diff --git "a/.github/ISSUE_TEMPLATE/\342\234\250-feature-request.md" "b/.github/ISSUE_TEMPLATE/\342\234\250-feature-request.md" deleted file mode 100644 index acb18d1..0000000 --- "a/.github/ISSUE_TEMPLATE/\342\234\250-feature-request.md" +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: "โœจ Feature request" -about: Suggest an idea for this project. -title: '' -labels: enhancement -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git "a/.github/ISSUE_TEMPLATE/\360\237\214\210-generic-ticket.md" "b/.github/ISSUE_TEMPLATE/\360\237\214\210-generic-ticket.md" deleted file mode 100644 index 968ffc5..0000000 --- "a/.github/ISSUE_TEMPLATE/\360\237\214\210-generic-ticket.md" +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: "\U0001F308 Generic Ticket" -about: Anything not being a bug report or a feature. -title: '' -labels: '' -assignees: '' - ---- - - diff --git "a/.github/ISSUE_TEMPLATE/\360\237\220\233-bug-report.md" "b/.github/ISSUE_TEMPLATE/\360\237\220\233-bug-report.md" deleted file mode 100644 index 209305f..0000000 --- "a/.github/ISSUE_TEMPLATE/\360\237\220\233-bug-report.md" +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: "\U0001F41B Bug report" -about: Create a report to help us fix a software bug. -title: '' -labels: bug -assignees: '' - ---- - -**๐Ÿ› Describe the bug** -A clear and concise description of what the bug is. - -**๐Ÿ”ข To Reproduce** -Steps to reproduce the behavior: - -1. Use file '...' -2. Run '...' -3. See error - -**๐Ÿ’˜ Expected behavior** -A clear and concise description of what you expected to happen. - -**๐Ÿ“ท Screenshots** -If applicable, add screenshots to help explain your problem. - -**๐Ÿ–ฅ๏ธ Setup** - - lasso-python version: [e.g. 1.5.1] - - OS: [e.g. iOS] - -**โ„น๏ธ Additional context** -Add any other context about the problem here. diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml deleted file mode 100644 index 76f86d6..0000000 --- a/.github/workflows/ci-cd.yml +++ /dev/null @@ -1,205 +0,0 @@ -name: Python Linting, Test and Upload - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - # JOB - # This job runs unit tests, linting and format checks - tests: - runs-on: ubuntu-latest - - strategy: - # If either the tests for 3.11 or 3.12 fail, all workflows - # are terminated to save computing resources. - fail-fast: true - # To safe runtime least and latest version supported are - # chosen. For more info see the pyproject.toml - matrix: - python-version: ["3.11", "3.12"] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Task - run: | - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d - - # Cache dependencies from poetry to speed things up - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ hashFiles('**/uv.lock') }} - - - name: Install and upgrade pip and uv - run: python -m pip install --upgrade pip uv - - - name: Install Dependencies - run: ./bin/task setup - - - name: Lint code - run: ./bin/task lint - - - name: Test code - run: ./bin/task test - - # JOB - # This job publishes the package to test-pipy. - test-publish: - # Will run after the job 'tests' - needs: [tests] - - if: > - startsWith(github.ref, 'refs/tags/') || - startsWith(github.ref, 'refs/heads/release/') - runs-on: ubuntu-latest - # Required for installation of the test package in the - # next job. - outputs: - version: ${{ steps.extract_version.outputs.version }} - - steps: - - uses: actions/checkout@v3 - - - name: Remember version - id: extract_version - run: | - VERSION=$(cat pyproject.toml | grep -oE -m 1 "version = \"(.*)\"" | cut -f2 -d '"') - echo "Version: ${VERSION}" - echo "version=${VERSION}" >> $GITHUB_OUTPUT - - # For publishing any version will do - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Install Task - run: | - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install Dependencies - run: | - python -m pip install --upgrade pip poetry - ./bin/task setup - - - name: Build packages for release - run: ./bin/task build - - - name: Publish distribution to Test PyPI - env: - TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} - run: poetry run twine upload --skip-existing --verbose 'dist/*' - - # JOB - # Test install from pypi to see if we have any installation bugs. - test-install: - needs: [test-publish] - if: > - startsWith(github.ref, 'refs/tags/') || - startsWith(github.ref, 'refs/heads/release/') - - runs-on: ubuntu-latest - - # Use the version from the previous job - env: - VERSION: ${{ needs.test-publish.outputs.version }} - - steps: - # Install python (be aware NO checkout action) - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - # Check if it installs without errors - - name: Install package - run: | - python -m pip install \ - --index-url https://test.pypi.org/simple/ \ - --extra-index-url https://pypi.org/simple \ - lasso-python=="${VERSION}" - - # We run the D3plot import here as it is the most delicate piece of the - # package for importing C-libraries. - - name: Test if the installed package works - run: python -c 'from lasso.dyna import D3plot' - - # JOB - # Finally publish the code to pypi - publish: - needs: [test-install] - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - # We need the entire git history for building the docs - with: - fetch-depth: 0 - - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Install Task - run: | - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v3 - with: - path: .venv - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - - - name: Install Dependencies - run: | - python -m pip install --upgrade poetry pip - ./bin/task setup - - - name: Build packages for release - run: ./bin/task build - - # Not required but this saves the distribution files - # with the package upload for debugging purposes. - - name: Save packages as artifacts - uses: actions/upload-artifact@v2 - with: - name: dist - path: dist - if-no-files-found: error - - - name: Publish distribution to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: poetry run twine upload --skip-existing --verbose 'dist/*' - - - name: Upload new docs - # We run a git pull first to ensure the runner has the latest pages - # branch. It did fail because of it in the past. - run: | - git pull origin gh-pages --rebase - ./bin/task docs:deploy diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0a4e587..0000000 --- a/.gitignore +++ /dev/null @@ -1,81 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# Distribution / packaging -.Python -./build/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Exclude femzip shared libraries -!**/lib/**/*.dll -!**/lib/**/*.so - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Sphinx documentation -docs/_build/ - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# mkdocs documentation -/site - -# Mac specific files -.DS_Store - -# Notepad++ backup file -.bak - -# Vscode configurations -.vscode - -# Ignore generated changelog -CHANGELOG.md - -# Custom test file -test/read_write_test.py diff --git a/.markdownlint.yml b/.markdownlint.yml deleted file mode 100644 index 2625aae..0000000 --- a/.markdownlint.yml +++ /dev/null @@ -1,5 +0,0 @@ -# There are different style types for markdown code blocks and strangely -# indentation is the default. We change it here to the more often used 'fenced' -# style denoted by ``` -MD046: - style: fenced diff --git a/src/lasso/dimred/svd/__init__.py b/.nojekyll similarity index 100% rename from src/lasso/dimred/svd/__init__.py rename to .nojekyll diff --git a/404.html b/404.html new file mode 100644 index 0000000..b7fbfe0 --- /dev/null +++ b/404.html @@ -0,0 +1,941 @@ + + + + + + + + + + + + + + + + LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 1c42eca..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,87 +0,0 @@ -# Open LASSO Python Contribution Guide - -## Roles - -There are roughly two roles in which you can contribute: - -- Contributors who just want to add changes from time to time -- Maintainers who oversee the repo, code themselves and review contribution - before they can be merged - -## Community - -The community can be found on [discord]. -Nothing beats a good discussion about existing features, new features or ideas -so jump right in. - -[discord]: https://discord.gg/jYUgTsEWtN - -## Spirit - -We are all learners, some in the early stage some in the later. -In a code review, we take the patience to imaginarily sit down together and -explain other people why something is recommended differently or how things are -usually done in software or python. -This often seems tedious at first but growing together is important for any kind -of project which wants to grow itself. -So no fear in case of lack of experience but bring your learning spirit. -Samewise to any experienced developer, have patience and explain things. -Take the opportunity to sit down together on discord. - -## How to make a Contribution - -Tl;dr; - -1. Fork the open lasso python repository -2. Clone the repo to your filesystem -3. Install [task][task_install] -4. Check out the `develop` branch -5. Set up the repo for development through `task setup` -6. Create a new branch from `develop` with the naming pattern `feature/...` -7. Make changes, commit and push them -8. Create a Pull Request in your for repo with target on the original repo -9. Add as reviewer `open-lasso-python/developers` -10. Wait for review patiently but you may nudge us a bit ๐Ÿซถ -11. Perform a Squash Merge and give a reasonable commit message as - `: ` where `branch_type` is one of the categories - below. - -[task_install]:https://taskfile.dev/installation/ - -You can fork the repo (1) by clicking on for in the top-right of the original -repo. -Cloning the repo (2) is traditionally done with git then of course. -Task is required (3) since it is used to store complex commands such as testing, -linting, build docs, etc. -(4) All development activities originate from the `develop` branch in which all -Pull Requests are finally merged again. -To create a branch choose a respective naming pattern following the angular -scheme: `/-`. -Typical branch types are: - -- `feature` for new features or if you got no clue what it is -- `bugfix` for ๐Ÿ›-fixes -- `ci` for changes on the Continuous Integration pipeline -- `docs` for documentation related works -- `refactor` if the PR just does cleanup ๐Ÿงน and improves the code -- `test` for solely test-related work - -Don't take these too seriously but they ought to provide rough categories. -**They are also used in the commit message when you squash merge a PR where it -is important!** -Install all dependencies otherwise obviously you can't code (5). -After making changes and pushing your branch to your forked repo (7 & 8), open a -Pull Request but make the target not `develop` in your fork but `develop` in the -original repo (7). -If not done automatically, add the maintainer group as reviewers (9). -Enjoy a healthy code review but be a bit patient with time as people contribute -voluntarily and may privately be occupied (10). -After approval, perform a Squash Merge (11). -A Squash Merge tosses away all the little, dirty commits we all do during -development. -What stays is the **final merge commit message and please pay attention here** -to format it right. -Why is this important? -This is needed to automatically generate a reasonable changelog during releases. -Thanks for contributing at this point. -Go wild and have fun ๐Ÿฅณ diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index a45ee60..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2022 lasso-open-source - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.rst b/README.rst deleted file mode 100644 index ec10843..0000000 --- a/README.rst +++ /dev/null @@ -1,79 +0,0 @@ - -|LASSO| Python Library -====================== - -|test-main| |test-dev| - -.. |test-main| image:: https://github.com/open-lasso-python/lasso-python/actions/workflows/ci-cd.yml/badge.svg?branch=main - :target: https://github.com/open-lasso-python/lasso-python/actions/workflows/test-runner.yml - -.. |test-dev| image:: https://github.com/open-lasso-python/lasso-python/actions/workflows/ci-cd.yml/badge.svg?branch=develop - :target: https://github.com/open-lasso-python/lasso-python/actions/workflows/test-runner.yml - -This python library is designed for general purpose usage in the field of -Computer Aided Engineering (CAE). -It's name originates from the original initiator and donator of the project -`LASSO GmbH`_. -The library is now maintained by an open-source community. - -Module Overview: - - `lasso.dyna`_ - - `lasso.dimred`_ - - `lasso.femzip`_ - - `lasso.diffcrash`_ - -For further infos please read the Documentation: - - |DOCS| `Documentation`_ - -.. _LASSO GmbH: https://www.lasso.de/en -.. _Documentation: https://open-lasso-python.github.io/lasso-python/ -.. _lasso.dyna: https://open-lasso-python.github.io/lasso-python/dyna/ -.. _lasso.dimred: https://open-lasso-python.github.io/lasso-python/dimred/ -.. _lasso.femzip: https://open-lasso-python.github.io/lasso-python/femzip/ -.. _lasso.diffcrash: https://open-lasso-python.github.io/lasso-python/diffcrash/ - - -Installation ------------- - -.. code-block:: bash - - python -m pip install lasso-python - - -Community ---------- - -Join our open-source community on: - - |DISCORD| `Discord`_ - -.. _Discord: https://discord.gg/jYUgTsEWtN - -.. |LASSO| image:: ./docs/lasso-logo.png - :target: https://open-lasso-python.github.io/lasso-python/build/html/index.html -.. |DOCS| image:: ./docs/icon-home.png - :target: https://open-lasso-python.github.io/lasso-python/build/html/index.html -.. |DISCORD| image:: ./docs/icon-discord.png - :target: https://discord.gg/GeHu79b - - -Development ------------ - -For development install `poetry`_ and `task`_: - -.. code-block:: bash - - python -m pip install poetry - sh -c "$(curl --location https://taskfile.dev/install.sh)" \ - -- -d -b ~/.local/bin - -Then by simply running the command ``task`` you can find a variety of available -commands such as ``task setup`` to install all dependencies or ``task test`` to -run the test suite. -Happy Coding ๐Ÿฅณ๐ŸŽ‰ - -.. _poetry: https://python-poetry.org/ -.. _task: https://taskfile.dev/ diff --git a/Taskfile.yml b/Taskfile.yml deleted file mode 100644 index 29eecbd..0000000 --- a/Taskfile.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: "3" - -tasks: - setup: - desc: Setup the development environment. - cmds: - - uv sync - - lint: - desc: Lints the code and reports on issues. - cmds: - - uv run ruff check . - # - uv run ruff format . --check - - build: - desc: Builds the python package - cmds: - - uv build - - test: - desc: Runs tests on the code - cmds: - - > - uv run pytest test - --cov=lasso - --cov-report=html - - docs:serve: - desc: Serve the documentation locally for development and testing - deps: - - test - - docs:changelog - cmds: - - uv run mkdocs serve - - docs:build: - desc: Build the documentation - deps: - - test - - docs:changelog - cmds: - - uv run mkdocs build - - docs:deploy: - desc: Deploys the docs to GitHub (be careful!) - deps: - - test - - docs:changelog - cmds: - - uv run mkdocs gh-deploy - - docs:changelog: - desc: Generates the changelog - cmds: - - > - uv run git-changelog . - --output CHANGELOG.md - --style angular - --template angular diff --git a/assets/_mkdocstrings.css b/assets/_mkdocstrings.css new file mode 100644 index 0000000..a65078d --- /dev/null +++ b/assets/_mkdocstrings.css @@ -0,0 +1,36 @@ + +/* Don't capitalize names. */ +h5.doc-heading { + text-transform: none !important; +} + +/* Avoid breaking parameters name, etc. in table cells. */ +.doc-contents td code { + word-break: normal !important; +} + +/* For pieces of Markdown rendered in table cells. */ +.doc-contents td p { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +/* Max width for docstring sections tables. */ +.doc .md-typeset__table, +.doc .md-typeset__table table { + display: table !important; + width: 100%; +} +.doc .md-typeset__table tr { + display: table-row; +} + +/* Avoid line breaks in rendered fields. */ +.field-body p { + display: inline; +} + +/* Defaults in Spacy table style. */ +.doc-param-default { + float: right; +} diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 0000000..1cf13b9 Binary files /dev/null and b/assets/images/favicon.png differ diff --git a/assets/javascripts/bundle.5a2dcb6a.min.js b/assets/javascripts/bundle.5a2dcb6a.min.js new file mode 100644 index 0000000..6f9720b --- /dev/null +++ b/assets/javascripts/bundle.5a2dcb6a.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var aa=Object.create;var wr=Object.defineProperty;var sa=Object.getOwnPropertyDescriptor;var ca=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,fa=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,fn=Object.prototype.propertyIsEnumerable;var cn=(e,t,r)=>t in e?wr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H=(e,t)=>{for(var r in t||(t={}))Er.call(t,r)&&cn(e,r,t[r]);if(kt)for(var r of kt(t))fn.call(t,r)&&cn(e,r,t[r]);return e};var un=(e,t)=>{var r={};for(var n in e)Er.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kt)for(var n of kt(e))t.indexOf(n)<0&&fn.call(e,n)&&(r[n]=e[n]);return r};var yt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ua=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ca(t))!Er.call(e,o)&&o!==r&&wr(e,o,{get:()=>t[o],enumerable:!(n=sa(t,o))||n.enumerable});return e};var Ye=(e,t,r)=>(r=e!=null?aa(fa(e)):{},ua(t||!e||!e.__esModule?wr(r,"default",{value:e,enumerable:!0}):r,e));var ln=yt((Sr,pn)=>{(function(e,t){typeof Sr=="object"&&typeof pn!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Sr,function(){"use strict";function e(r){var n=!0,o=!1,i=null,s={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function a(_){return!!(_&&_!==document&&_.nodeName!=="HTML"&&_.nodeName!=="BODY"&&"classList"in _&&"contains"in _.classList)}function c(_){var We=_.type,Fe=_.tagName;return!!(Fe==="INPUT"&&s[We]&&!_.readOnly||Fe==="TEXTAREA"&&!_.readOnly||_.isContentEditable)}function f(_){_.classList.contains("focus-visible")||(_.classList.add("focus-visible"),_.setAttribute("data-focus-visible-added",""))}function u(_){!_.hasAttribute("data-focus-visible-added")||(_.classList.remove("focus-visible"),_.removeAttribute("data-focus-visible-added"))}function p(_){_.metaKey||_.altKey||_.ctrlKey||(a(r.activeElement)&&f(r.activeElement),n=!0)}function l(_){n=!1}function d(_){!a(_.target)||(n||c(_.target))&&f(_.target)}function h(_){!a(_.target)||(_.target.classList.contains("focus-visible")||_.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),u(_.target))}function b(_){document.visibilityState==="hidden"&&(o&&(n=!0),U())}function U(){document.addEventListener("mousemove",W),document.addEventListener("mousedown",W),document.addEventListener("mouseup",W),document.addEventListener("pointermove",W),document.addEventListener("pointerdown",W),document.addEventListener("pointerup",W),document.addEventListener("touchmove",W),document.addEventListener("touchstart",W),document.addEventListener("touchend",W)}function G(){document.removeEventListener("mousemove",W),document.removeEventListener("mousedown",W),document.removeEventListener("mouseup",W),document.removeEventListener("pointermove",W),document.removeEventListener("pointerdown",W),document.removeEventListener("pointerup",W),document.removeEventListener("touchmove",W),document.removeEventListener("touchstart",W),document.removeEventListener("touchend",W)}function W(_){_.target.nodeName&&_.target.nodeName.toLowerCase()==="html"||(n=!1,G())}document.addEventListener("keydown",p,!0),document.addEventListener("mousedown",l,!0),document.addEventListener("pointerdown",l,!0),document.addEventListener("touchstart",l,!0),document.addEventListener("visibilitychange",b,!0),U(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var mn=yt(Or=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(f){return!1}},r=t(),n=function(f){var u={next:function(){var p=f.shift();return{done:p===void 0,value:p}}};return r&&(u[Symbol.iterator]=function(){return u}),u},o=function(f){return encodeURIComponent(f).replace(/%20/g,"+")},i=function(f){return decodeURIComponent(String(f).replace(/\+/g," "))},s=function(){var f=function(p){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var l=typeof p;if(l!=="undefined")if(l==="string")p!==""&&this._fromString(p);else if(p instanceof f){var d=this;p.forEach(function(G,W){d.append(W,G)})}else if(p!==null&&l==="object")if(Object.prototype.toString.call(p)==="[object Array]")for(var h=0;hd[0]?1:0}),f._entries&&(f._entries={});for(var p=0;p1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Or);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(c,f){typeof c!="string"&&(c=String(c)),f&&typeof f!="string"&&(f=String(f));var u=document,p;if(f&&(e.location===void 0||f!==e.location.href)){f=f.toLowerCase(),u=document.implementation.createHTMLDocument(""),p=u.createElement("base"),p.href=f,u.head.appendChild(p);try{if(p.href.indexOf(f)!==0)throw new Error(p.href)}catch(_){throw new Error("URL unable to set base "+f+" due to "+_)}}var l=u.createElement("a");l.href=c,p&&(u.body.appendChild(l),l.href=l.href);var d=u.createElement("input");if(d.type="url",d.value=c,l.protocol===":"||!/:/.test(l.href)||!d.checkValidity()&&!f)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:l});var h=new e.URLSearchParams(this.search),b=!0,U=!0,G=this;["append","delete","set"].forEach(function(_){var We=h[_];h[_]=function(){We.apply(h,arguments),b&&(U=!1,G.search=h.toString(),U=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var W=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==W&&(W=this.search,U&&(b=!1,this.searchParams._fromString(this.search),b=!0))}})},s=i.prototype,a=function(c){Object.defineProperty(s,c,{get:function(){return this._anchorElement[c]},set:function(f){this._anchorElement[c]=f},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(c){a(c)}),Object.defineProperty(s,"search",{get:function(){return this._anchorElement.search},set:function(c){this._anchorElement.search=c,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(s,{toString:{get:function(){var c=this;return function(){return c.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(c){this._anchorElement.href=c,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(c){this._anchorElement.pathname=c},enumerable:!0},origin:{get:function(){var c={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],f=this._anchorElement.port!=c&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(f?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(c){},enumerable:!0},username:{get:function(){return""},set:function(c){},enumerable:!0}}),i.createObjectURL=function(c){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(c){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Or)});var Pn=yt((Ks,$t)=>{/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var dn,hn,bn,vn,gn,yn,xn,wn,En,Ht,_r,Sn,On,_n,rt,Tn,Mn,Ln,An,Cn,Rn,kn,Hn,Pt;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof $t=="object"&&typeof $t.exports=="object"?e(r(t,r($t.exports))):e(r(t));function r(n,o){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,s){return n[i]=o?o(i,s):s}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};dn=function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(n,o);function i(){this.constructor=n}n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},hn=Object.assign||function(n){for(var o,i=1,s=arguments.length;i=0;u--)(f=n[u])&&(c=(a<3?f(c):a>3?f(o,i,c):f(o,i))||c);return a>3&&c&&Object.defineProperty(o,i,c),c},gn=function(n,o){return function(i,s){o(i,s,n)}},yn=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},xn=function(n,o,i,s){function a(c){return c instanceof i?c:new i(function(f){f(c)})}return new(i||(i=Promise))(function(c,f){function u(d){try{l(s.next(d))}catch(h){f(h)}}function p(d){try{l(s.throw(d))}catch(h){f(h)}}function l(d){d.done?c(d.value):a(d.value).then(u,p)}l((s=s.apply(n,o||[])).next())})},wn=function(n,o){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},s,a,c,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(l){return function(d){return p([l,d])}}function p(l){if(s)throw new TypeError("Generator is already executing.");for(;i;)try{if(s=1,a&&(c=l[0]&2?a.return:l[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,l[1])).done)return c;switch(a=0,c&&(l=[l[0]&2,c.value]),l[0]){case 0:case 1:c=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,a=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!c||l[1]>c[0]&&l[1]=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},_r=function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var s=i.call(n),a,c=[],f;try{for(;(o===void 0||o-- >0)&&!(a=s.next()).done;)c.push(a.value)}catch(u){f={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(f)throw f.error}}return c},Sn=function(){for(var n=[],o=0;o1||u(b,U)})})}function u(b,U){try{p(s[b](U))}catch(G){h(c[0][3],G)}}function p(b){b.value instanceof rt?Promise.resolve(b.value.v).then(l,d):h(c[0][2],b)}function l(b){u("next",b)}function d(b){u("throw",b)}function h(b,U){b(U),c.shift(),c.length&&u(c[0][0],c[0][1])}},Mn=function(n){var o,i;return o={},s("next"),s("throw",function(a){throw a}),s("return"),o[Symbol.iterator]=function(){return this},o;function s(a,c){o[a]=n[a]?function(f){return(i=!i)?{value:rt(n[a](f)),done:a==="return"}:c?c(f):f}:c}},Ln=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof Ht=="function"?Ht(n):n[Symbol.iterator](),i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i);function s(c){i[c]=n[c]&&function(f){return new Promise(function(u,p){f=n[c](f),a(u,p,f.done,f.value)})}}function a(c,f,u,p){Promise.resolve(p).then(function(l){c({value:l,done:u})},f)}},An=function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n};var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Cn=function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Pt(o,n,i);return r(o,n),o},Rn=function(n){return n&&n.__esModule?n:{default:n}},kn=function(n,o,i,s){if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(n):s?s.value:o.get(n)},Hn=function(n,o,i,s,a){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!a:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?a.call(n,i):a?a.value=i:o.set(n,i),i},e("__extends",dn),e("__assign",hn),e("__rest",bn),e("__decorate",vn),e("__param",gn),e("__metadata",yn),e("__awaiter",xn),e("__generator",wn),e("__exportStar",En),e("__createBinding",Pt),e("__values",Ht),e("__read",_r),e("__spread",Sn),e("__spreadArrays",On),e("__spreadArray",_n),e("__await",rt),e("__asyncGenerator",Tn),e("__asyncDelegator",Mn),e("__asyncValues",Ln),e("__makeTemplateObject",An),e("__importStar",Cn),e("__importDefault",Rn),e("__classPrivateFieldGet",kn),e("__classPrivateFieldSet",Hn)})});var Br=yt((At,Yr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT ยฉ Zeno Rocha + */(function(t,r){typeof At=="object"&&typeof Yr=="object"?Yr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof At=="object"?At.ClipboardJS=r():t.ClipboardJS=r()})(At,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return ia}});var s=i(279),a=i.n(s),c=i(370),f=i.n(c),u=i(817),p=i.n(u);function l(j){try{return document.execCommand(j)}catch(T){return!1}}var d=function(T){var O=p()(T);return l("cut"),O},h=d;function b(j){var T=document.documentElement.getAttribute("dir")==="rtl",O=document.createElement("textarea");O.style.fontSize="12pt",O.style.border="0",O.style.padding="0",O.style.margin="0",O.style.position="absolute",O.style[T?"right":"left"]="-9999px";var k=window.pageYOffset||document.documentElement.scrollTop;return O.style.top="".concat(k,"px"),O.setAttribute("readonly",""),O.value=j,O}var U=function(T,O){var k=b(T);O.container.appendChild(k);var $=p()(k);return l("copy"),k.remove(),$},G=function(T){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},k="";return typeof T=="string"?k=U(T,O):T instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(T==null?void 0:T.type)?k=U(T.value,O):(k=p()(T),l("copy")),k},W=G;function _(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(O){return typeof O}:_=function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},_(j)}var We=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},O=T.action,k=O===void 0?"copy":O,$=T.container,q=T.target,Te=T.text;if(k!=="copy"&&k!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(q!==void 0)if(q&&_(q)==="object"&&q.nodeType===1){if(k==="copy"&&q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(k==="cut"&&(q.hasAttribute("readonly")||q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Te)return W(Te,{container:$});if(q)return k==="cut"?h(q):W(q,{container:$})},Fe=We;function Pe(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pe=function(O){return typeof O}:Pe=function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},Pe(j)}function Ji(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function sn(j,T){for(var O=0;O0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof $.action=="function"?$.action:this.defaultAction,this.target=typeof $.target=="function"?$.target:this.defaultTarget,this.text=typeof $.text=="function"?$.text:this.defaultText,this.container=Pe($.container)==="object"?$.container:document.body}},{key:"listenClick",value:function($){var q=this;this.listener=f()($,"click",function(Te){return q.onClick(Te)})}},{key:"onClick",value:function($){var q=$.delegateTarget||$.currentTarget,Te=this.action(q)||"copy",Rt=Fe({action:Te,container:this.container,target:this.target(q),text:this.text(q)});this.emit(Rt?"success":"error",{action:Te,text:Rt,trigger:q,clearSelection:function(){q&&q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function($){return xr("action",$)}},{key:"defaultTarget",value:function($){var q=xr("target",$);if(q)return document.querySelector(q)}},{key:"defaultText",value:function($){return xr("text",$)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function($){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return W($,q)}},{key:"cut",value:function($){return h($)}},{key:"isSupported",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],q=typeof $=="string"?[$]:$,Te=!!document.queryCommandSupported;return q.forEach(function(Rt){Te=Te&&!!document.queryCommandSupported(Rt)}),Te}}]),O}(a()),ia=oa},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function s(a,c){for(;a&&a.nodeType!==o;){if(typeof a.matches=="function"&&a.matches(c))return a;a=a.parentNode}}n.exports=s},438:function(n,o,i){var s=i(828);function a(u,p,l,d,h){var b=f.apply(this,arguments);return u.addEventListener(l,b,h),{destroy:function(){u.removeEventListener(l,b,h)}}}function c(u,p,l,d,h){return typeof u.addEventListener=="function"?a.apply(null,arguments):typeof l=="function"?a.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(b){return a(b,p,l,d,h)}))}function f(u,p,l,d){return function(h){h.delegateTarget=s(h.target,p),h.delegateTarget&&d.call(u,h)}}n.exports=c},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var s=Object.prototype.toString.call(i);return i!==void 0&&(s==="[object NodeList]"||s==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var s=Object.prototype.toString.call(i);return s==="[object Function]"}},370:function(n,o,i){var s=i(879),a=i(438);function c(l,d,h){if(!l&&!d&&!h)throw new Error("Missing required arguments");if(!s.string(d))throw new TypeError("Second argument must be a String");if(!s.fn(h))throw new TypeError("Third argument must be a Function");if(s.node(l))return f(l,d,h);if(s.nodeList(l))return u(l,d,h);if(s.string(l))return p(l,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function f(l,d,h){return l.addEventListener(d,h),{destroy:function(){l.removeEventListener(d,h)}}}function u(l,d,h){return Array.prototype.forEach.call(l,function(b){b.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(l,function(b){b.removeEventListener(d,h)})}}}function p(l,d,h){return a(document.body,l,d,h)}n.exports=c},817:function(n){function o(i){var s;if(i.nodeName==="SELECT")i.focus(),s=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var a=i.hasAttribute("readonly");a||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),a||i.removeAttribute("readonly"),s=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),f=document.createRange();f.selectNodeContents(i),c.removeAllRanges(),c.addRange(f),s=c.toString()}return s}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,s,a){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:s,ctx:a}),this},once:function(i,s,a){var c=this;function f(){c.off(i,f),s.apply(a,arguments)}return f._=s,this.on(i,f,a)},emit:function(i){var s=[].slice.call(arguments,1),a=((this.e||(this.e={}))[i]||[]).slice(),c=0,f=a.length;for(c;c{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var Ms=/["'&<>]/;Si.exports=Ls;function Ls(e){var t=""+e,r=Ms.exec(t);if(!r)return t;var n,o="",i=0,s=0;for(i=r.index;i0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?Tr:(this.currentObservers=null,a.push(r),new $e(function(){n.currentObservers=null,Ue(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?r.error(i):s&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,n){return new Qn(r,n)},t}(F);var Qn=function(e){ne(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Tr},t}(E);var wt={now:function(){return(wt.delegate||Date).now()},delegate:void 0};var Et=function(e){ne(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=wt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;o||(i.push(r),!s&&i.push(a.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),c=0;c0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=at.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var s=r.actions;n!=null&&((i=s[s.length-1])===null||i===void 0?void 0:i.id)!==n&&(at.cancelAnimationFrame(n),r._scheduled=void 0)},t}(zt);var Gn=function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t}(Nt);var xe=new Gn(Bn);var R=new F(function(e){return e.complete()});function qt(e){return e&&L(e.schedule)}function Hr(e){return e[e.length-1]}function Ve(e){return L(Hr(e))?e.pop():void 0}function Ee(e){return qt(Hr(e))?e.pop():void 0}function Kt(e,t){return typeof Hr(e)=="number"?e.pop():t}var st=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Qt(e){return L(e==null?void 0:e.then)}function Yt(e){return L(e[it])}function Bt(e){return Symbol.asyncIterator&&L(e==null?void 0:e[Symbol.asyncIterator])}function Gt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ya(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Jt=ya();function Xt(e){return L(e==null?void 0:e[Jt])}function Zt(e){return jn(this,arguments,function(){var r,n,o,i;return It(this,function(s){switch(s.label){case 0:r=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,jt(r.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,jt(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,jt(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function er(e){return L(e==null?void 0:e.getReader)}function z(e){if(e instanceof F)return e;if(e!=null){if(Yt(e))return xa(e);if(st(e))return wa(e);if(Qt(e))return Ea(e);if(Bt(e))return Jn(e);if(Xt(e))return Sa(e);if(er(e))return Oa(e)}throw Gt(e)}function xa(e){return new F(function(t){var r=e[it]();if(L(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function wa(e){return new F(function(t){for(var r=0;r=2,!0))}function ie(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new E}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,s=i===void 0?!0:i,a=e.resetOnRefCountZero,c=a===void 0?!0:a;return function(f){var u,p,l,d=0,h=!1,b=!1,U=function(){p==null||p.unsubscribe(),p=void 0},G=function(){U(),u=l=void 0,h=b=!1},W=function(){var _=u;G(),_==null||_.unsubscribe()};return g(function(_,We){d++,!b&&!h&&U();var Fe=l=l!=null?l:r();We.add(function(){d--,d===0&&!b&&!h&&(p=Dr(W,c))}),Fe.subscribe(We),!u&&d>0&&(u=new Ge({next:function(Pe){return Fe.next(Pe)},error:function(Pe){b=!0,U(),p=Dr(G,o,Pe),Fe.error(Pe)},complete:function(){h=!0,U(),p=Dr(G,s),Fe.complete()}}),z(_).subscribe(u))})(f)}}function Dr(e,t){for(var r=[],n=2;ne.next(document)),e}function Q(e,t=document){return Array.from(t.querySelectorAll(e))}function K(e,t=document){let r=pe(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function pe(e,t=document){return t.querySelector(e)||void 0}function Ie(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}function nr(e){return A(v(document.body,"focusin"),v(document.body,"focusout")).pipe(Re(1),m(()=>{let t=Ie();return typeof t!="undefined"?e.contains(t):!1}),N(e===Ie()),B())}function qe(e){return{x:e.offsetLeft,y:e.offsetTop}}function yo(e){return A(v(window,"load"),v(window,"resize")).pipe(Ae(0,xe),m(()=>qe(e)),N(qe(e)))}function or(e){return{x:e.scrollLeft,y:e.scrollTop}}function pt(e){return A(v(e,"scroll"),v(window,"resize")).pipe(Ae(0,xe),m(()=>or(e)),N(or(e)))}var wo=function(){if(typeof Map!="undefined")return Map;function e(t,r){var n=-1;return t.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!qr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ka?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!qr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=qa.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Eo=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),Oo=typeof WeakMap!="undefined"?new WeakMap:new wo,_o=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Qa.getInstance(),n=new ns(t,r,this);Oo.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){_o.prototype[e]=function(){var t;return(t=Oo.get(this))[e].apply(t,arguments)}});var os=function(){return typeof ir.ResizeObserver!="undefined"?ir.ResizeObserver:_o}(),To=os;var Mo=new E,is=P(()=>I(new To(e=>{for(let t of e)Mo.next(t)}))).pipe(S(e=>A(Se,I(e)).pipe(C(()=>e.disconnect()))),X(1));function he(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ve(e){return is.pipe(w(t=>t.observe(e)),S(t=>Mo.pipe(x(({target:r})=>r===e),C(()=>t.unobserve(e)),m(()=>he(e)))),N(he(e)))}function mt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function cr(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}var Lo=new E,as=P(()=>I(new IntersectionObserver(e=>{for(let t of e)Lo.next(t)},{threshold:0}))).pipe(S(e=>A(Se,I(e)).pipe(C(()=>e.disconnect()))),X(1));function fr(e){return as.pipe(w(t=>t.observe(e)),S(t=>Lo.pipe(x(({target:r})=>r===e),C(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function Ao(e,t=16){return pt(e).pipe(m(({y:r})=>{let n=he(e),o=mt(e);return r>=o.height-n.height-t}),B())}var ur={drawer:K("[data-md-toggle=drawer]"),search:K("[data-md-toggle=search]")};function Co(e){return ur[e].checked}function Ke(e,t){ur[e].checked!==t&&ur[e].click()}function dt(e){let t=ur[e];return v(t,"change").pipe(m(()=>t.checked),N(t.checked))}function ss(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ro(){return v(window,"keydown").pipe(x(e=>!(e.metaKey||e.ctrlKey)),m(e=>({mode:Co("search")?"search":"global",type:e.key,claim(){e.preventDefault(),e.stopPropagation()}})),x(({mode:e,type:t})=>{if(e==="global"){let r=Ie();if(typeof r!="undefined")return!ss(r,t)}return!0}),ie())}function Oe(){return new URL(location.href)}function pr(e){location.href=e.href}function ko(){return new E}function Ho(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Ho(e,r)}function M(e,t,...r){let n=document.createElement(e);if(t)for(let o of Object.keys(t))typeof t[o]!="undefined"&&(typeof t[o]!="boolean"?n.setAttribute(o,t[o]):n.setAttribute(o,""));for(let o of r)Ho(n,o);return n}function Po(e,t){let r=t;if(e.length>r){for(;e[r]!==" "&&--r>0;);return`${e.substring(0,r)}...`}return e}function lr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function $o(){return location.hash.substring(1)}function Io(e){let t=M("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function cs(){return v(window,"hashchange").pipe(m($o),N($o()),x(e=>e.length>0),X(1))}function jo(){return cs().pipe(m(e=>pe(`[id="${e}"]`)),x(e=>typeof e!="undefined"))}function Kr(e){let t=matchMedia(e);return rr(r=>t.addListener(()=>r(t.matches))).pipe(N(t.matches))}function Fo(){let e=matchMedia("print");return A(v(window,"beforeprint").pipe(m(()=>!0)),v(window,"afterprint").pipe(m(()=>!1))).pipe(N(e.matches))}function Qr(e,t){return e.pipe(S(r=>r?t():R))}function mr(e,t={credentials:"same-origin"}){return ue(fetch(`${e}`,t)).pipe(ce(()=>R),S(r=>r.status!==200?Ot(()=>new Error(r.statusText)):I(r)))}function je(e,t){return mr(e,t).pipe(S(r=>r.json()),X(1))}function Uo(e,t){let r=new DOMParser;return mr(e,t).pipe(S(n=>n.text()),m(n=>r.parseFromString(n,"text/xml")),X(1))}function Do(e){let t=M("script",{src:e});return P(()=>(document.head.appendChild(t),A(v(t,"load"),v(t,"error").pipe(S(()=>Ot(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),C(()=>document.head.removeChild(t)),oe(1))))}function Wo(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function Vo(){return A(v(window,"scroll",{passive:!0}),v(window,"resize",{passive:!0})).pipe(m(Wo),N(Wo()))}function zo(){return{width:innerWidth,height:innerHeight}}function No(){return v(window,"resize",{passive:!0}).pipe(m(zo),N(zo()))}function qo(){return Y([Vo(),No()]).pipe(m(([e,t])=>({offset:e,size:t})),X(1))}function dr(e,{viewport$:t,header$:r}){let n=t.pipe(J("size")),o=Y([n,r]).pipe(m(()=>qe(e)));return Y([r,t,o]).pipe(m(([{height:i},{offset:s,size:a},{x:c,y:f}])=>({offset:{x:s.x-c,y:s.y-f+i},size:a})))}function Ko(e,{tx$:t}){let r=v(e,"message").pipe(m(({data:n})=>n));return t.pipe(Lt(()=>r,{leading:!0,trailing:!0}),w(n=>e.postMessage(n)),S(()=>r),ie())}var fs=K("#__config"),ht=JSON.parse(fs.textContent);ht.base=`${new URL(ht.base,Oe())}`;function le(){return ht}function Z(e){return ht.features.includes(e)}function re(e,t){return typeof t!="undefined"?ht.translations[e].replace("#",t.toString()):ht.translations[e]}function _e(e,t=document){return K(`[data-md-component=${e}]`,t)}function te(e,t=document){return Q(`[data-md-component=${e}]`,t)}function us(e){let t=K(".md-typeset > :first-child",e);return v(t,"click",{once:!0}).pipe(m(()=>K(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function Qo(e){return!Z("announce.dismiss")||!e.childElementCount?R:P(()=>{let t=new E;return t.pipe(N({hash:__md_get("__announce")})).subscribe(({hash:r})=>{var n;r&&r===((n=__md_get("__announce"))!=null?n:r)&&(e.hidden=!0,__md_set("__announce",r))}),us(e).pipe(w(r=>t.next(r)),C(()=>t.complete()),m(r=>H({ref:e},r)))})}function ps(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function Yo(e,t){let r=new E;return r.subscribe(({hidden:n})=>{e.hidden=n}),ps(e,t).pipe(w(n=>r.next(n)),C(()=>r.complete()),m(n=>H({ref:e},n)))}var ii=Ye(Br());function Gr(e){return M("div",{class:"md-tooltip",id:e},M("div",{class:"md-tooltip__inner md-typeset"}))}function Bo(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return M("aside",{class:"md-annotation",tabIndex:0},Gr(t),M("a",{href:r,class:"md-annotation__index",tabIndex:-1},M("span",{"data-md-annotation-id":e})))}else return M("aside",{class:"md-annotation",tabIndex:0},Gr(t),M("span",{class:"md-annotation__index",tabIndex:-1},M("span",{"data-md-annotation-id":e})))}function Go(e){return M("button",{class:"md-clipboard md-icon",title:re("clipboard.copy"),"data-clipboard-target":`#${e} > code`})}function Jr(e,t){let r=t&2,n=t&1,o=Object.keys(e.terms).filter(a=>!e.terms[a]).reduce((a,c)=>[...a,M("del",null,c)," "],[]).slice(0,-1),i=new URL(e.location);Z("search.highlight")&&i.searchParams.set("h",Object.entries(e.terms).filter(([,a])=>a).reduce((a,[c])=>`${a} ${c}`.trim(),""));let{tags:s}=le();return M("a",{href:`${i}`,class:"md-search-result__link",tabIndex:-1},M("article",{class:["md-search-result__article",...r?["md-search-result__article--document"]:[]].join(" "),"data-md-score":e.score.toFixed(2)},r>0&&M("div",{class:"md-search-result__icon md-icon"}),M("h1",{class:"md-search-result__title"},e.title),n>0&&e.text.length>0&&M("p",{class:"md-search-result__teaser"},Po(e.text,320)),e.tags&&M("div",{class:"md-typeset"},e.tags.map(a=>{let c=a.replace(/<[^>]+>/g,""),f=s?c in s?`md-tag-icon md-tag-icon--${s[c]}`:"md-tag-icon":"";return M("span",{class:`md-tag ${f}`},a)})),n>0&&o.length>0&&M("p",{class:"md-search-result__terms"},re("search.result.term.missing"),": ",...o)))}function Jo(e){let t=e[0].score,r=[...e],n=r.findIndex(f=>!f.location.includes("#")),[o]=r.splice(n,1),i=r.findIndex(f=>f.scoreJr(f,1)),...a.length?[M("details",{class:"md-search-result__more"},M("summary",{tabIndex:-1},a.length>0&&a.length===1?re("search.result.more.one"):re("search.result.more.other",a.length)),...a.map(f=>Jr(f,1)))]:[]];return M("li",{class:"md-search-result__item"},c)}function Xo(e){return M("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>M("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?lr(r):r)))}function Xr(e){let t=`tabbed-control tabbed-control--${e}`;return M("div",{class:t,hidden:!0},M("button",{class:"tabbed-button",tabIndex:-1}))}function Zo(e){return M("div",{class:"md-typeset__scrollwrap"},M("div",{class:"md-typeset__table"},e))}function ls(e){let t=le(),r=new URL(`../${e.version}/`,t.base);return M("li",{class:"md-version__item"},M("a",{href:`${r}`,class:"md-version__link"},e.title))}function ei(e,t){return M("div",{class:"md-version"},M("button",{class:"md-version__current","aria-label":re("select.version.title")},t.title),M("ul",{class:"md-version__list"},e.map(ls)))}function ms(e,t){let r=P(()=>Y([yo(e),pt(t)])).pipe(m(([{x:n,y:o},i])=>{let{width:s,height:a}=he(e);return{x:n-i.x+s/2,y:o-i.y+a/2}}));return nr(e).pipe(S(n=>r.pipe(m(o=>({active:n,offset:o})),oe(+!n||1/0))))}function ti(e,t,{target$:r}){let[n,o]=Array.from(e.children);return P(()=>{let i=new E,s=i.pipe(de(1));return i.subscribe({next({offset:a}){e.style.setProperty("--md-tooltip-x",`${a.x}px`),e.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),fr(e).pipe(ee(s)).subscribe(a=>{e.toggleAttribute("data-md-visible",a)}),A(i.pipe(x(({active:a})=>a)),i.pipe(Re(250),x(({active:a})=>!a))).subscribe({next({active:a}){a?e.prepend(n):n.remove()},complete(){e.prepend(n)}}),i.pipe(Ae(16,xe)).subscribe(({active:a})=>{n.classList.toggle("md-tooltip--active",a)}),i.pipe(zr(125,xe),x(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?e.style.setProperty("--md-tooltip-0",`${-a}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),v(o,"click").pipe(ee(s),x(a=>!(a.metaKey||a.ctrlKey))).subscribe(a=>a.preventDefault()),v(o,"mousedown").pipe(ee(s),ae(i)).subscribe(([a,{active:c}])=>{var f;if(a.button!==0||a.metaKey||a.ctrlKey)a.preventDefault();else if(c){a.preventDefault();let u=e.parentElement.closest(".md-annotation");u instanceof HTMLElement?u.focus():(f=Ie())==null||f.blur()}}),r.pipe(ee(s),x(a=>a===n),ke(125)).subscribe(()=>e.focus()),ms(e,t).pipe(w(a=>i.next(a)),C(()=>i.complete()),m(a=>H({ref:e},a)))})}function ds(e){let t=[];for(let r of Q(".c, .c1, .cm",e)){let n=[],o=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=o.nextNode();i;i=o.nextNode())n.push(i);for(let i of n){let s;for(;s=/(\(\d+\))(!)?/.exec(i.textContent);){let[,a,c]=s;if(typeof c=="undefined"){let f=i.splitText(s.index);i=f.splitText(a.length),t.push(f)}else{i.textContent=a,t.push(i);break}}}}return t}function ri(e,t){t.append(...Array.from(e.childNodes))}function ni(e,t,{target$:r,print$:n}){let o=t.closest("[id]"),i=o==null?void 0:o.id,s=new Map;for(let a of ds(t)){let[,c]=a.textContent.match(/\((\d+)\)/);pe(`li:nth-child(${c})`,e)&&(s.set(c,Bo(c,i)),a.replaceWith(s.get(c)))}return s.size===0?R:P(()=>{let a=new E,c=[];for(let[f,u]of s)c.push([K(".md-typeset",u),K(`li:nth-child(${f})`,e)]);return n.pipe(ee(a.pipe(de(1)))).subscribe(f=>{e.hidden=!f;for(let[u,p]of c)f?ri(u,p):ri(p,u)}),A(...[...s].map(([,f])=>ti(f,t,{target$:r}))).pipe(C(()=>a.complete()),ie())})}var hs=0;function ai(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return ai(t)}}function oi(e){return ve(e).pipe(m(({width:t})=>({scrollable:mt(e).width>t})),J("scrollable"))}function si(e,t){let{matches:r}=matchMedia("(hover)"),n=P(()=>{let o=new E;if(o.subscribe(({scrollable:s})=>{s&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}),ii.default.isSupported()){let s=e.closest("pre");s.id=`__code_${++hs}`,s.insertBefore(Go(s.id),e)}let i=e.closest(".highlight");if(i instanceof HTMLElement){let s=ai(i);if(typeof s!="undefined"&&(i.classList.contains("annotate")||Z("content.code.annotate"))){let a=ni(s,e,t);return oi(e).pipe(w(c=>o.next(c)),C(()=>o.complete()),m(c=>H({ref:e},c)),et(ve(i).pipe(m(({width:c,height:f})=>c&&f),B(),S(c=>c?a:R))))}}return oi(e).pipe(w(s=>o.next(s)),C(()=>o.complete()),m(s=>H({ref:e},s)))});return Z("content.lazy")?fr(e).pipe(x(o=>o),oe(1),S(()=>n)):n}var ci=".node circle,.node ellipse,.node path,.node polygon,.node rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}marker{fill:var(--md-mermaid-edge-color)!important}.edgeLabel .label rect{fill:#0000}.label{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.label foreignObject{line-height:normal;overflow:visible}.label div .edgeLabel{color:var(--md-mermaid-label-fg-color)}.edgeLabel,.edgeLabel rect,.label div .edgeLabel{background-color:var(--md-mermaid-label-bg-color)}.edgeLabel,.edgeLabel rect{fill:var(--md-mermaid-label-bg-color);color:var(--md-mermaid-edge-color)}.edgePath .path,.flowchart-link{stroke:var(--md-mermaid-edge-color)}.edgePath .arrowheadPath{fill:var(--md-mermaid-edge-color);stroke:none}.cluster rect{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}.cluster span{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}defs #flowchart-circleEnd,defs #flowchart-circleStart,defs #flowchart-crossEnd,defs #flowchart-crossStart,defs #flowchart-pointEnd,defs #flowchart-pointStart{stroke:none}g.classGroup line,g.classGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.classGroup text{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.classLabel .box{fill:var(--md-mermaid-label-bg-color);background-color:var(--md-mermaid-label-bg-color);opacity:1}.classLabel .label{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node .divider{stroke:var(--md-mermaid-node-fg-color)}.relation{stroke:var(--md-mermaid-edge-color)}.cardinality{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.cardinality text{fill:inherit!important}defs #classDiagram-compositionEnd,defs #classDiagram-compositionStart,defs #classDiagram-dependencyEnd,defs #classDiagram-dependencyStart,defs #classDiagram-extensionEnd,defs #classDiagram-extensionStart{fill:var(--md-mermaid-edge-color)!important;stroke:var(--md-mermaid-edge-color)!important}defs #classDiagram-aggregationEnd,defs #classDiagram-aggregationStart{fill:var(--md-mermaid-label-bg-color)!important;stroke:var(--md-mermaid-edge-color)!important}g.stateGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.stateGroup .state-title{fill:var(--md-mermaid-label-fg-color)!important;font-family:var(--md-mermaid-font-family)}g.stateGroup .composit{fill:var(--md-mermaid-label-bg-color)}.nodeLabel{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node circle.state-end,.node circle.state-start,.start-state{fill:var(--md-mermaid-edge-color);stroke:none}.end-state-inner,.end-state-outer{fill:var(--md-mermaid-edge-color)}.end-state-inner,.node circle.state-end{stroke:var(--md-mermaid-label-bg-color)}.transition{stroke:var(--md-mermaid-edge-color)}[id^=state-fork] rect,[id^=state-join] rect{fill:var(--md-mermaid-edge-color)!important;stroke:none!important}.statediagram-cluster.statediagram-cluster .inner{fill:var(--md-default-bg-color)}.statediagram-cluster rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.statediagram-state rect.divider{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}defs #statediagram-barbEnd{stroke:var(--md-mermaid-edge-color)}.entityBox{fill:var(--md-mermaid-label-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityLabel{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.relationshipLabelBox{fill:var(--md-mermaid-label-bg-color);fill-opacity:1;background-color:var(--md-mermaid-label-bg-color);opacity:1}.relationshipLabel{fill:var(--md-mermaid-label-fg-color)}.relationshipLine{stroke:var(--md-mermaid-edge-color)}defs #ONE_OR_MORE_END *,defs #ONE_OR_MORE_START *,defs #ONLY_ONE_END *,defs #ONLY_ONE_START *,defs #ZERO_OR_MORE_END *,defs #ZERO_OR_MORE_START *,defs #ZERO_OR_ONE_END *,defs #ZERO_OR_ONE_START *{stroke:var(--md-mermaid-edge-color)!important}.actor,defs #ZERO_OR_MORE_END circle,defs #ZERO_OR_MORE_START circle{fill:var(--md-mermaid-label-bg-color)}.actor{stroke:var(--md-mermaid-node-fg-color)}text.actor>tspan{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}line{stroke:var(--md-default-fg-color--lighter)}.messageLine0,.messageLine1{stroke:var(--md-mermaid-edge-color)}.loopText>tspan,.messageText,.noteText>tspan{fill:var(--md-mermaid-edge-color);stroke:none;font-family:var(--md-mermaid-font-family)!important}.noteText>tspan{fill:#000}#arrowhead path{fill:var(--md-mermaid-edge-color);stroke:none}.loopLine{stroke:var(--md-mermaid-node-fg-color)}.labelBox,.loopLine{fill:var(--md-mermaid-node-bg-color)}.labelBox{stroke:none}.labelText,.labelText>span{fill:var(--md-mermaid-node-fg-color);font-family:var(--md-mermaid-font-family)}";var Zr,vs=0;function gs(){return typeof mermaid=="undefined"||mermaid instanceof Element?Do("https://unpkg.com/mermaid@9.1.7/dist/mermaid.min.js"):I(void 0)}function fi(e){return e.classList.remove("mermaid"),Zr||(Zr=gs().pipe(w(()=>mermaid.initialize({startOnLoad:!1,themeCSS:ci,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),X(1))),Zr.subscribe(()=>{e.classList.add("mermaid");let t=`__mermaid_${vs++}`,r=M("div",{class:"mermaid"});mermaid.mermaidAPI.render(t,e.textContent,n=>{let o=r.attachShadow({mode:"closed"});o.innerHTML=n,e.replaceWith(r)})}),Zr.pipe(m(()=>({ref:e})))}function ys(e,{target$:t,print$:r}){let n=!0;return A(t.pipe(m(o=>o.closest("details:not([open])")),x(o=>e===o),m(()=>({action:"open",reveal:!0}))),r.pipe(x(o=>o||!n),w(()=>n=e.open),m(o=>({action:o?"open":"close"}))))}function ui(e,t){return P(()=>{let r=new E;return r.subscribe(({action:n,reveal:o})=>{e.toggleAttribute("open",n==="open"),o&&e.scrollIntoView()}),ys(e,t).pipe(w(n=>r.next(n)),C(()=>r.complete()),m(n=>H({ref:e},n)))})}var pi=M("table");function li(e){return e.replaceWith(pi),pi.replaceWith(Zo(e)),I({ref:e})}function xs(e){let t=Q(":scope > input",e),r=t.find(n=>n.checked)||t[0];return A(...t.map(n=>v(n,"change").pipe(m(()=>K(`label[for="${n.id}"]`))))).pipe(N(K(`label[for="${r.id}"]`)),m(n=>({active:n})))}function mi(e,{viewport$:t}){let r=Xr("prev");e.append(r);let n=Xr("next");e.append(n);let o=K(".tabbed-labels",e);return P(()=>{let i=new E,s=i.pipe(de(1));return Y([i,ve(e)]).pipe(Ae(1,xe),ee(s)).subscribe({next([{active:a},c]){let f=qe(a),{width:u}=he(a);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let p=or(o);(f.xp.x+c.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),Y([pt(o),ve(o)]).pipe(ee(s)).subscribe(([a,c])=>{let f=mt(o);r.hidden=a.x<16,n.hidden=a.x>f.width-c.width-16}),A(v(r,"click").pipe(m(()=>-1)),v(n,"click").pipe(m(()=>1))).pipe(ee(s)).subscribe(a=>{let{width:c}=he(o);o.scrollBy({left:c*a,behavior:"smooth"})}),Z("content.tabs.link")&&i.pipe(He(1),ae(t)).subscribe(([{active:a},{offset:c}])=>{let f=a.innerText.trim();if(a.hasAttribute("data-md-switching"))a.removeAttribute("data-md-switching");else{let u=e.offsetTop-c.y;for(let l of Q("[data-tabs]"))for(let d of Q(":scope > input",l)){let h=K(`label[for="${d.id}"]`);if(h!==a&&h.innerText.trim()===f){h.setAttribute("data-md-switching",""),d.click();break}}window.scrollTo({top:e.offsetTop-u});let p=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...p])])}}),xs(e).pipe(w(a=>i.next(a)),C(()=>i.complete()),m(a=>H({ref:e},a)))}).pipe(Je(fe))}function di(e,{viewport$:t,target$:r,print$:n}){return A(...Q("pre:not(.mermaid) > code",e).map(o=>si(o,{target$:r,print$:n})),...Q("pre.mermaid",e).map(o=>fi(o)),...Q("table:not([class])",e).map(o=>li(o)),...Q("details",e).map(o=>ui(o,{target$:r,print$:n})),...Q("[data-tabs]",e).map(o=>mi(o,{viewport$:t})))}function ws(e,{alert$:t}){return t.pipe(S(r=>A(I(!0),I(!1).pipe(ke(2e3))).pipe(m(n=>({message:r,active:n})))))}function hi(e,t){let r=K(".md-typeset",e);return P(()=>{let n=new E;return n.subscribe(({message:o,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=o}),ws(e,t).pipe(w(o=>n.next(o)),C(()=>n.complete()),m(o=>H({ref:e},o)))})}function Es({viewport$:e}){if(!Z("header.autohide"))return I(!1);let t=e.pipe(m(({offset:{y:o}})=>o),Ce(2,1),m(([o,i])=>[oMath.abs(i-o.y)>100),m(([,[o]])=>o),B()),n=dt("search");return Y([e,n]).pipe(m(([{offset:o},i])=>o.y>400&&!i),B(),S(o=>o?r:I(!1)),N(!1))}function bi(e,t){return P(()=>Y([ve(e),Es(t)])).pipe(m(([{height:r},n])=>({height:r,hidden:n})),B((r,n)=>r.height===n.height&&r.hidden===n.hidden),X(1))}function vi(e,{header$:t,main$:r}){return P(()=>{let n=new E,o=n.pipe(de(1));return n.pipe(J("active"),Ze(t)).subscribe(([{active:i},{hidden:s}])=>{e.classList.toggle("md-header--shadow",i&&!s),e.hidden=s}),r.subscribe(n),t.pipe(ee(o),m(i=>H({ref:e},i)))})}function Ss(e,{viewport$:t,header$:r}){return dr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:n}})=>{let{height:o}=he(e);return{active:n>=o}}),J("active"))}function gi(e,t){return P(()=>{let r=new E;r.subscribe(({active:o})=>{e.classList.toggle("md-header__title--active",o)});let n=pe("article h1");return typeof n=="undefined"?R:Ss(n,t).pipe(w(o=>r.next(o)),C(()=>r.complete()),m(o=>H({ref:e},o)))})}function yi(e,{viewport$:t,header$:r}){let n=r.pipe(m(({height:i})=>i),B()),o=n.pipe(S(()=>ve(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),J("bottom"))));return Y([n,o,t]).pipe(m(([i,{top:s,bottom:a},{offset:{y:c},size:{height:f}}])=>(f=Math.max(0,f-Math.max(0,s-c,i)-Math.max(0,f+c-a)),{offset:s-i,height:f,active:s-i<=c})),B((i,s)=>i.offset===s.offset&&i.height===s.height&&i.active===s.active))}function Os(e){let t=__md_get("__palette")||{index:e.findIndex(r=>matchMedia(r.getAttribute("data-md-color-media")).matches)};return I(...e).pipe(se(r=>v(r,"change").pipe(m(()=>r))),N(e[Math.max(0,t.index)]),m(r=>({index:e.indexOf(r),color:{scheme:r.getAttribute("data-md-color-scheme"),primary:r.getAttribute("data-md-color-primary"),accent:r.getAttribute("data-md-color-accent")}})),X(1))}function xi(e){return P(()=>{let t=new E;t.subscribe(n=>{document.body.setAttribute("data-md-color-switching","");for(let[o,i]of Object.entries(n.color))document.body.setAttribute(`data-md-color-${o}`,i);for(let o=0;o{document.body.removeAttribute("data-md-color-switching")});let r=Q("input",e);return Os(r).pipe(w(n=>t.next(n)),C(()=>t.complete()),m(n=>H({ref:e},n)))})}var en=Ye(Br());function _s(e){e.setAttribute("data-md-copying","");let t=e.innerText;return e.removeAttribute("data-md-copying"),t}function wi({alert$:e}){en.default.isSupported()&&new F(t=>{new en.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||_s(K(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(w(t=>{t.trigger.focus()}),m(()=>re("clipboard.copied"))).subscribe(e)}function Ts(e){if(e.length<2)return[""];let[t,r]=[...e].sort((o,i)=>o.length-i.length).map(o=>o.replace(/[^/]+$/,"")),n=0;if(t===r)n=t.length;else for(;t.charCodeAt(n)===r.charCodeAt(n);)n++;return e.map(o=>o.replace(t.slice(0,n),""))}function hr(e){let t=__md_get("__sitemap",sessionStorage,e);if(t)return I(t);{let r=le();return Uo(new URL("sitemap.xml",e||r.base)).pipe(m(n=>Ts(Q("loc",n).map(o=>o.textContent))),ce(()=>R),De([]),w(n=>__md_set("__sitemap",n,sessionStorage,e)))}}function Ei({document$:e,location$:t,viewport$:r}){let n=le();if(location.protocol==="file:")return;"scrollRestoration"in history&&(history.scrollRestoration="manual",v(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}));let o=pe("link[rel=icon]");typeof o!="undefined"&&(o.href=o.href);let i=hr().pipe(m(f=>f.map(u=>`${new URL(u,n.base)}`)),S(f=>v(document.body,"click").pipe(x(u=>!u.metaKey&&!u.ctrlKey),S(u=>{if(u.target instanceof Element){let p=u.target.closest("a");if(p&&!p.target){let l=new URL(p.href);if(l.search="",l.hash="",l.pathname!==location.pathname&&f.includes(l.toString()))return u.preventDefault(),I({url:new URL(p.href)})}}return Se}))),ie()),s=v(window,"popstate").pipe(x(f=>f.state!==null),m(f=>({url:new URL(location.href),offset:f.state})),ie());A(i,s).pipe(B((f,u)=>f.url.href===u.url.href),m(({url:f})=>f)).subscribe(t);let a=t.pipe(J("pathname"),S(f=>mr(f.href).pipe(ce(()=>(pr(f),Se)))),ie());i.pipe(ut(a)).subscribe(({url:f})=>{history.pushState({},"",`${f}`)});let c=new DOMParser;a.pipe(S(f=>f.text()),m(f=>c.parseFromString(f,"text/html"))).subscribe(e),e.pipe(He(1)).subscribe(f=>{for(let u of["title","link[rel=canonical]","meta[name=author]","meta[name=description]","[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...Z("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let p=pe(u),l=pe(u,f);typeof p!="undefined"&&typeof l!="undefined"&&p.replaceWith(l)}}),e.pipe(He(1),m(()=>_e("container")),S(f=>Q("script",f)),Ir(f=>{let u=M("script");if(f.src){for(let p of f.getAttributeNames())u.setAttribute(p,f.getAttribute(p));return f.replaceWith(u),new F(p=>{u.onload=()=>p.complete()})}else return u.textContent=f.textContent,f.replaceWith(u),R})).subscribe(),A(i,s).pipe(ut(e)).subscribe(({url:f,offset:u})=>{f.hash&&!u?Io(f.hash):window.scrollTo(0,(u==null?void 0:u.y)||0)}),r.pipe(Mt(i),Re(250),J("offset")).subscribe(({offset:f})=>{history.replaceState(f,"")}),A(i,s).pipe(Ce(2,1),x(([f,u])=>f.url.pathname===u.url.pathname),m(([,f])=>f)).subscribe(({offset:f})=>{window.scrollTo(0,(f==null?void 0:f.y)||0)})}var As=Ye(tn());var Oi=Ye(tn());function rn(e,t){let r=new RegExp(e.separator,"img"),n=(o,i,s)=>`${i}${s}`;return o=>{o=o.replace(/[\s*+\-:~^]+/g," ").trim();let i=new RegExp(`(^|${e.separator})(${o.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return s=>(t?(0,Oi.default)(s):s).replace(i,n).replace(/<\/mark>(\s+)]*>/img,"$1")}}function _i(e){return e.split(/"([^"]+)"/g).map((t,r)=>r&1?t.replace(/^\b|^(?![^\x00-\x7F]|$)|\s+/g," +"):t).join("").replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g,"").trim()}function bt(e){return e.type===1}function Ti(e){return e.type===2}function vt(e){return e.type===3}function Rs({config:e,docs:t}){e.lang.length===1&&e.lang[0]==="en"&&(e.lang=[re("search.config.lang")]),e.separator==="[\\s\\-]+"&&(e.separator=re("search.config.separator"));let n={pipeline:re("search.config.pipeline").split(/\s*,\s*/).filter(Boolean),suggestions:Z("search.suggest")};return{config:e,docs:t,options:n}}function Mi(e,t){let r=le(),n=new Worker(e),o=new E,i=Ko(n,{tx$:o}).pipe(m(s=>{if(vt(s))for(let a of s.data.items)for(let c of a)c.location=`${new URL(c.location,r.base)}`;return s}),ie());return ue(t).pipe(m(s=>({type:0,data:Rs(s)}))).subscribe(o.next.bind(o)),{tx$:o,rx$:i}}function Li({document$:e}){let t=le(),r=je(new URL("../versions.json",t.base)).pipe(ce(()=>R)),n=r.pipe(m(o=>{let[,i]=t.base.match(/([^/]+)\/?$/);return o.find(({version:s,aliases:a})=>s===i||a.includes(i))||o[0]}));r.pipe(m(o=>new Map(o.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),S(o=>v(document.body,"click").pipe(x(i=>!i.metaKey&&!i.ctrlKey),ae(n),S(([i,s])=>{if(i.target instanceof Element){let a=i.target.closest("a");if(a&&!a.target&&o.has(a.href)){let c=a.href;return!i.target.closest(".md-version")&&o.get(c)===s?R:(i.preventDefault(),I(c))}}return R}),S(i=>{let{version:s}=o.get(i);return hr(new URL(i)).pipe(m(a=>{let f=Oe().href.replace(t.base,"");return a.includes(f.split("#")[0])?new URL(`../${s}/${f}`,t.base):new URL(i)}))})))).subscribe(o=>pr(o)),Y([r,n]).subscribe(([o,i])=>{K(".md-header__topic").appendChild(ei(o,i))}),e.pipe(S(()=>n)).subscribe(o=>{var s;let i=__md_get("__outdated",sessionStorage);if(i===null){let a=((s=t.version)==null?void 0:s.default)||"latest";i=!o.aliases.includes(a),__md_set("__outdated",i,sessionStorage)}if(i)for(let a of te("outdated"))a.hidden=!1})}function ks(e,{rx$:t}){let r=(__search==null?void 0:__search.transform)||_i,{searchParams:n}=Oe();n.has("q")&&Ke("search",!0);let o=t.pipe(x(bt),oe(1),m(()=>n.get("q")||""));dt("search").pipe(x(a=>!a),oe(1)).subscribe(()=>{let a=new URL(location.href);a.searchParams.delete("q"),history.replaceState({},"",`${a}`)}),o.subscribe(a=>{a&&(e.value=a,e.focus())});let i=nr(e),s=A(v(e,"keyup"),v(e,"focus").pipe(ke(1)),o).pipe(m(()=>r(e.value)),N(""),B());return Y([s,i]).pipe(m(([a,c])=>({value:a,focus:c})),X(1))}function Ai(e,{tx$:t,rx$:r}){let n=new E,o=n.pipe(de(1));return n.pipe(J("value"),m(({value:i})=>({type:2,data:i}))).subscribe(t.next.bind(t)),n.pipe(J("focus")).subscribe(({focus:i})=>{i?(Ke("search",i),e.placeholder=""):e.placeholder=re("search.placeholder")}),v(e.form,"reset").pipe(ee(o)).subscribe(()=>e.focus()),ks(e,{tx$:t,rx$:r}).pipe(w(i=>n.next(i)),C(()=>n.complete()),m(i=>H({ref:e},i)),ie())}function Ci(e,{rx$:t},{query$:r}){let n=new E,o=Ao(e.parentElement).pipe(x(Boolean)),i=K(":scope > :first-child",e),s=K(":scope > :last-child",e),a=t.pipe(x(bt),oe(1));return n.pipe(ae(r),Mt(a)).subscribe(([{items:f},{value:u}])=>{if(u)switch(f.length){case 0:i.textContent=re("search.result.none");break;case 1:i.textContent=re("search.result.one");break;default:i.textContent=re("search.result.other",lr(f.length))}else i.textContent=re("search.result.placeholder")}),n.pipe(w(()=>s.innerHTML=""),S(({items:f})=>A(I(...f.slice(0,10)),I(...f.slice(10)).pipe(Ce(4),Nr(o),S(([u])=>u))))).subscribe(f=>s.appendChild(Jo(f))),t.pipe(x(vt),m(({data:f})=>f)).pipe(w(f=>n.next(f)),C(()=>n.complete()),m(f=>H({ref:e},f)))}function Hs(e,{query$:t}){return t.pipe(m(({value:r})=>{let n=Oe();return n.hash="",n.searchParams.delete("h"),n.searchParams.set("q",r),{url:n}}))}function Ri(e,t){let r=new E;return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),v(e,"click").subscribe(n=>n.preventDefault()),Hs(e,t).pipe(w(n=>r.next(n)),C(()=>r.complete()),m(n=>H({ref:e},n)))}function ki(e,{rx$:t},{keyboard$:r}){let n=new E,o=_e("search-query"),i=A(v(o,"keydown"),v(o,"focus")).pipe(Le(fe),m(()=>o.value),B());return n.pipe(Ze(i),m(([{suggestions:a},c])=>{let f=c.split(/([\s-]+)/);if((a==null?void 0:a.length)&&f[f.length-1]){let u=a[a.length-1];u.startsWith(f[f.length-1])&&(f[f.length-1]=u)}else f.length=0;return f})).subscribe(a=>e.innerHTML=a.join("").replace(/\s/g," ")),r.pipe(x(({mode:a})=>a==="search")).subscribe(a=>{switch(a.type){case"ArrowRight":e.innerText.length&&o.selectionStart===o.value.length&&(o.value=e.innerText);break}}),t.pipe(x(vt),m(({data:a})=>a)).pipe(w(a=>n.next(a)),C(()=>n.complete()),m(()=>({ref:e})))}function Hi(e,{index$:t,keyboard$:r}){let n=le();try{let o=(__search==null?void 0:__search.worker)||n.search,i=Mi(o,t),s=_e("search-query",e),a=_e("search-result",e),{tx$:c,rx$:f}=i;c.pipe(x(Ti),ut(f.pipe(x(bt))),oe(1)).subscribe(c.next.bind(c)),r.pipe(x(({mode:l})=>l==="search")).subscribe(l=>{let d=Ie();switch(l.type){case"Enter":if(d===s){let h=new Map;for(let b of Q(":first-child [href]",a)){let U=b.firstElementChild;h.set(b,parseFloat(U.getAttribute("data-md-score")))}if(h.size){let[[b]]=[...h].sort(([,U],[,G])=>G-U);b.click()}l.claim()}break;case"Escape":case"Tab":Ke("search",!1),s.blur();break;case"ArrowUp":case"ArrowDown":if(typeof d=="undefined")s.focus();else{let h=[s,...Q(":not(details) > [href], summary, details[open] [href]",a)],b=Math.max(0,(Math.max(0,h.indexOf(d))+h.length+(l.type==="ArrowUp"?-1:1))%h.length);h[b].focus()}l.claim();break;default:s!==Ie()&&s.focus()}}),r.pipe(x(({mode:l})=>l==="global")).subscribe(l=>{switch(l.type){case"f":case"s":case"/":s.focus(),s.select(),l.claim();break}});let u=Ai(s,i),p=Ci(a,i,{query$:u});return A(u,p).pipe(et(...te("search-share",e).map(l=>Ri(l,{query$:u})),...te("search-suggest",e).map(l=>ki(l,i,{keyboard$:r}))))}catch(o){return e.hidden=!0,Se}}function Pi(e,{index$:t,location$:r}){return Y([t,r.pipe(N(Oe()),x(n=>!!n.searchParams.get("h")))]).pipe(m(([n,o])=>rn(n.config,!0)(o.searchParams.get("h"))),m(n=>{var s;let o=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a;a=i.nextNode())if((s=a.parentElement)!=null&&s.offsetHeight){let c=a.textContent,f=n(c);f.length>c.length&&o.set(a,f)}for(let[a,c]of o){let{childNodes:f}=M("span",null,c);a.replaceWith(...Array.from(f))}return{ref:e,nodes:o}}))}function Ps(e,{viewport$:t,main$:r}){let n=e.parentElement,o=n.offsetTop-n.parentElement.offsetTop;return Y([r,t]).pipe(m(([{offset:i,height:s},{offset:{y:a}}])=>(s=s+Math.min(o,Math.max(0,a-i))-o,{height:s,locked:a>=i+o})),B((i,s)=>i.height===s.height&&i.locked===s.locked))}function nn(e,n){var o=n,{header$:t}=o,r=un(o,["header$"]);let i=K(".md-sidebar__scrollwrap",e),{y:s}=qe(i);return P(()=>{let a=new E;return a.pipe(Ae(0,xe),ae(t)).subscribe({next([{height:c},{height:f}]){i.style.height=`${c-2*s}px`,e.style.top=`${f}px`},complete(){i.style.height="",e.style.top=""}}),a.pipe(Le(xe),oe(1)).subscribe(()=>{for(let c of Q(".md-nav__link--active[href]",e)){let f=cr(c);if(typeof f!="undefined"){let u=c.offsetTop-f.offsetTop,{height:p}=he(f);f.scrollTo({top:u-p/2})}}}),Ps(e,r).pipe(w(c=>a.next(c)),C(()=>a.complete()),m(c=>H({ref:e},c)))})}function $i(e,t){if(typeof t!="undefined"){let r=`https://api.github.com/repos/${e}/${t}`;return _t(je(`${r}/releases/latest`).pipe(ce(()=>R),m(n=>({version:n.tag_name})),De({})),je(r).pipe(ce(()=>R),m(n=>({stars:n.stargazers_count,forks:n.forks_count})),De({}))).pipe(m(([n,o])=>H(H({},n),o)))}else{let r=`https://api.github.com/users/${e}`;return je(r).pipe(m(n=>({repositories:n.public_repos})),De({}))}}function Ii(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return je(r).pipe(ce(()=>R),m(({star_count:n,forks_count:o})=>({stars:n,forks:o})),De({}))}function ji(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,n]=t;return $i(r,n)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,n]=t;return Ii(r,n)}return R}var $s;function Is(e){return $s||($s=P(()=>{let t=__md_get("__source",sessionStorage);if(t)return I(t);if(te("consent").length){let n=__md_get("__consent");if(!(n&&n.github))return R}return ji(e.href).pipe(w(n=>__md_set("__source",n,sessionStorage)))}).pipe(ce(()=>R),x(t=>Object.keys(t).length>0),m(t=>({facts:t})),X(1)))}function Fi(e){let t=K(":scope > :last-child",e);return P(()=>{let r=new E;return r.subscribe(({facts:n})=>{t.appendChild(Xo(n)),t.classList.add("md-source__repository--active")}),Is(e).pipe(w(n=>r.next(n)),C(()=>r.complete()),m(n=>H({ref:e},n)))})}function js(e,{viewport$:t,header$:r}){return ve(document.body).pipe(S(()=>dr(e,{header$:r,viewport$:t})),m(({offset:{y:n}})=>({hidden:n>=10})),J("hidden"))}function Ui(e,t){return P(()=>{let r=new E;return r.subscribe({next({hidden:n}){e.hidden=n},complete(){e.hidden=!1}}),(Z("navigation.tabs.sticky")?I({hidden:!1}):js(e,t)).pipe(w(n=>r.next(n)),C(()=>r.complete()),m(n=>H({ref:e},n)))})}function Fs(e,{viewport$:t,header$:r}){let n=new Map,o=Q("[href^=\\#]",e);for(let a of o){let c=decodeURIComponent(a.hash.substring(1)),f=pe(`[id="${c}"]`);typeof f!="undefined"&&n.set(a,f)}let i=r.pipe(J("height"),m(({height:a})=>{let c=_e("main"),f=K(":scope > :first-child",c);return a+.8*(f.offsetTop-c.offsetTop)}),ie());return ve(document.body).pipe(J("height"),S(a=>P(()=>{let c=[];return I([...n].reduce((f,[u,p])=>{for(;c.length&&n.get(c[c.length-1]).tagName>=p.tagName;)c.pop();let l=p.offsetTop;for(;!l&&p.parentElement;)p=p.parentElement,l=p.offsetTop;return f.set([...c=[...c,u]].reverse(),l)},new Map))}).pipe(m(c=>new Map([...c].sort(([,f],[,u])=>f-u))),Ze(i),S(([c,f])=>t.pipe(Ur(([u,p],{offset:{y:l},size:d})=>{let h=l+d.height>=Math.floor(a.height);for(;p.length;){let[,b]=p[0];if(b-f=l&&!h)p=[u.pop(),...p];else break}return[u,p]},[[],[...c]]),B((u,p)=>u[0]===p[0]&&u[1]===p[1])))))).pipe(m(([a,c])=>({prev:a.map(([f])=>f),next:c.map(([f])=>f)})),N({prev:[],next:[]}),Ce(2,1),m(([a,c])=>a.prev.length{let o=new E,i=o.pipe(de(1));if(o.subscribe(({prev:s,next:a})=>{for(let[c]of a)c.classList.remove("md-nav__link--passed"),c.classList.remove("md-nav__link--active");for(let[c,[f]]of s.entries())f.classList.add("md-nav__link--passed"),f.classList.toggle("md-nav__link--active",c===s.length-1)}),Z("toc.follow")){let s=A(t.pipe(Re(1),m(()=>{})),t.pipe(Re(250),m(()=>"smooth")));o.pipe(x(({prev:a})=>a.length>0),ae(s)).subscribe(([{prev:a},c])=>{let[f]=a[a.length-1];if(f.offsetHeight){let u=cr(f);if(typeof u!="undefined"){let p=f.offsetTop-u.offsetTop,{height:l}=he(u);u.scrollTo({top:p-l/2,behavior:c})}}})}return Z("navigation.tracking")&&t.pipe(ee(i),J("offset"),Re(250),He(1),ee(n.pipe(He(1))),Tt({delay:250}),ae(o)).subscribe(([,{prev:s}])=>{let a=Oe(),c=s[s.length-1];if(c&&c.length){let[f]=c,{hash:u}=new URL(f.href);a.hash!==u&&(a.hash=u,history.replaceState({},"",`${a}`))}else a.hash="",history.replaceState({},"",`${a}`)}),Fs(e,{viewport$:t,header$:r}).pipe(w(s=>o.next(s)),C(()=>o.complete()),m(s=>H({ref:e},s)))})}function Us(e,{viewport$:t,main$:r,target$:n}){let o=t.pipe(m(({offset:{y:s}})=>s),Ce(2,1),m(([s,a])=>s>a&&a>0),B()),i=r.pipe(m(({active:s})=>s));return Y([i,o]).pipe(m(([s,a])=>!(s&&a)),B(),ee(n.pipe(He(1))),Fr(!0),Tt({delay:250}),m(s=>({hidden:s})))}function Wi(e,{viewport$:t,header$:r,main$:n,target$:o}){let i=new E,s=i.pipe(de(1));return i.subscribe({next({hidden:a}){e.hidden=a,a?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(ee(s),J("height")).subscribe(({height:a})=>{e.style.top=`${a+16}px`}),Us(e,{viewport$:t,main$:n,target$:o}).pipe(w(a=>i.next(a)),C(()=>i.complete()),m(a=>H({ref:e},a)))}function Vi({document$:e,tablet$:t}){e.pipe(S(()=>Q(".md-toggle--indeterminate, [data-md-state=indeterminate]")),w(r=>{r.indeterminate=!0,r.checked=!1}),se(r=>v(r,"change").pipe(Wr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ae(t)).subscribe(([r,n])=>{r.classList.remove("md-toggle--indeterminate"),n&&(r.checked=!1)})}function Ds(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function zi({document$:e}){e.pipe(S(()=>Q("[data-md-scrollfix]")),w(t=>t.removeAttribute("data-md-scrollfix")),x(Ds),se(t=>v(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function Ni({viewport$:e,tablet$:t}){Y([dt("search"),t]).pipe(m(([r,n])=>r&&!n),S(r=>I(r).pipe(ke(r?400:100))),ae(e)).subscribe(([r,{offset:{y:n}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${n}px`;else{let o=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",o&&window.scrollTo(0,o)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let n=e[r];typeof n=="string"?n=document.createTextNode(n):n.parentNode&&n.parentNode.removeChild(n),r?t.insertBefore(this.previousSibling,n):t.replaceChild(n,this)}}}));document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var tt=go(),vr=ko(),gt=jo(),on=Ro(),we=qo(),gr=Kr("(min-width: 960px)"),Ki=Kr("(min-width: 1220px)"),Qi=Fo(),Yi=le(),Bi=document.forms.namedItem("search")?(__search==null?void 0:__search.index)||je(new URL("search/search_index.json",Yi.base)):Se,an=new E;wi({alert$:an});Z("navigation.instant")&&Ei({document$:tt,location$:vr,viewport$:we});var qi;((qi=Yi.version)==null?void 0:qi.provider)==="mike"&&Li({document$:tt});A(vr,gt).pipe(ke(125)).subscribe(()=>{Ke("drawer",!1),Ke("search",!1)});on.pipe(x(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=pe("[href][rel=prev]");typeof t!="undefined"&&t.click();break;case"n":case".":let r=pe("[href][rel=next]");typeof r!="undefined"&&r.click();break}});Vi({document$:tt,tablet$:gr});zi({document$:tt});Ni({viewport$:we,tablet$:gr});var Qe=bi(_e("header"),{viewport$:we}),br=tt.pipe(m(()=>_e("main")),S(e=>yi(e,{viewport$:we,header$:Qe})),X(1)),Ws=A(...te("consent").map(e=>Yo(e,{target$:gt})),...te("dialog").map(e=>hi(e,{alert$:an})),...te("header").map(e=>vi(e,{viewport$:we,header$:Qe,main$:br})),...te("palette").map(e=>xi(e)),...te("search").map(e=>Hi(e,{index$:Bi,keyboard$:on})),...te("source").map(e=>Fi(e))),Vs=P(()=>A(...te("announce").map(e=>Qo(e)),...te("content").map(e=>di(e,{viewport$:we,target$:gt,print$:Qi})),...te("content").map(e=>Z("search.highlight")?Pi(e,{index$:Bi,location$:vr}):R),...te("header-title").map(e=>gi(e,{viewport$:we,header$:Qe})),...te("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Qr(Ki,()=>nn(e,{viewport$:we,header$:Qe,main$:br})):Qr(gr,()=>nn(e,{viewport$:we,header$:Qe,main$:br}))),...te("tabs").map(e=>Ui(e,{viewport$:we,header$:Qe})),...te("toc").map(e=>Di(e,{viewport$:we,header$:Qe,target$:gt})),...te("top").map(e=>Wi(e,{viewport$:we,header$:Qe,main$:br,target$:gt})))),Gi=tt.pipe(S(()=>Vs),et(Ws),X(1));Gi.subscribe();window.document$=tt;window.location$=vr;window.target$=gt;window.keyboard$=on;window.viewport$=we;window.tablet$=gr;window.screen$=Ki;window.print$=Qi;window.alert$=an;window.component$=Gi;})(); +//# sourceMappingURL=bundle.5a2dcb6a.min.js.map + diff --git a/assets/javascripts/bundle.5a2dcb6a.min.js.map b/assets/javascripts/bundle.5a2dcb6a.min.js.map new file mode 100644 index 0000000..34e26a3 --- /dev/null +++ b/assets/javascripts/bundle.5a2dcb6a.min.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "sources": ["node_modules/focus-visible/dist/focus-visible.js", "node_modules/url-polyfill/url-polyfill.js", "node_modules/rxjs/node_modules/tslib/tslib.js", "node_modules/clipboard/dist/clipboard.js", "node_modules/escape-html/index.js", "node_modules/array-flat-polyfill/index.mjs", "src/assets/javascripts/bundle.ts", "node_modules/unfetch/polyfill/index.js", "node_modules/rxjs/node_modules/tslib/modules/index.js", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subscription.ts", "node_modules/rxjs/src/internal/config.ts", "node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "node_modules/rxjs/src/internal/util/noop.ts", "node_modules/rxjs/src/internal/NotificationFactories.ts", "node_modules/rxjs/src/internal/util/errorContext.ts", "node_modules/rxjs/src/internal/Subscriber.ts", "node_modules/rxjs/src/internal/symbol/observable.ts", "node_modules/rxjs/src/internal/util/identity.ts", "node_modules/rxjs/src/internal/util/pipe.ts", "node_modules/rxjs/src/internal/Observable.ts", "node_modules/rxjs/src/internal/util/lift.ts", "node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "node_modules/rxjs/src/internal/scheduler/animationFrameProvider.ts", "node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "node_modules/rxjs/src/internal/Subject.ts", "node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "node_modules/rxjs/src/internal/ReplaySubject.ts", "node_modules/rxjs/src/internal/scheduler/Action.ts", "node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "node_modules/rxjs/src/internal/Scheduler.ts", "node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "node_modules/rxjs/src/internal/scheduler/async.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts", "node_modules/rxjs/src/internal/scheduler/animationFrame.ts", "node_modules/rxjs/src/internal/observable/empty.ts", "node_modules/rxjs/src/internal/util/isScheduler.ts", "node_modules/rxjs/src/internal/util/args.ts", "node_modules/rxjs/src/internal/util/isArrayLike.ts", "node_modules/rxjs/src/internal/util/isPromise.ts", "node_modules/rxjs/src/internal/util/isInteropObservable.ts", "node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "node_modules/rxjs/src/internal/symbol/iterator.ts", "node_modules/rxjs/src/internal/util/isIterable.ts", "node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "node_modules/rxjs/src/internal/observable/innerFrom.ts", "node_modules/rxjs/src/internal/util/executeSchedule.ts", "node_modules/rxjs/src/internal/operators/observeOn.ts", "node_modules/rxjs/src/internal/operators/subscribeOn.ts", "node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "node_modules/rxjs/src/internal/scheduled/scheduled.ts", "node_modules/rxjs/src/internal/observable/from.ts", "node_modules/rxjs/src/internal/observable/of.ts", "node_modules/rxjs/src/internal/observable/throwError.ts", "node_modules/rxjs/src/internal/util/isDate.ts", "node_modules/rxjs/src/internal/operators/map.ts", "node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts", "node_modules/rxjs/src/internal/util/createObject.ts", "node_modules/rxjs/src/internal/observable/combineLatest.ts", "node_modules/rxjs/src/internal/operators/mergeInternals.ts", "node_modules/rxjs/src/internal/operators/mergeMap.ts", "node_modules/rxjs/src/internal/operators/mergeAll.ts", "node_modules/rxjs/src/internal/operators/concatAll.ts", "node_modules/rxjs/src/internal/observable/concat.ts", "node_modules/rxjs/src/internal/observable/defer.ts", "node_modules/rxjs/src/internal/observable/fromEvent.ts", "node_modules/rxjs/src/internal/observable/fromEventPattern.ts", "node_modules/rxjs/src/internal/observable/timer.ts", "node_modules/rxjs/src/internal/observable/merge.ts", "node_modules/rxjs/src/internal/observable/never.ts", "node_modules/rxjs/src/internal/util/argsOrArgArray.ts", "node_modules/rxjs/src/internal/operators/filter.ts", "node_modules/rxjs/src/internal/observable/zip.ts", "node_modules/rxjs/src/internal/operators/audit.ts", "node_modules/rxjs/src/internal/operators/auditTime.ts", "node_modules/rxjs/src/internal/operators/bufferCount.ts", "node_modules/rxjs/src/internal/operators/catchError.ts", "node_modules/rxjs/src/internal/operators/scanInternals.ts", "node_modules/rxjs/src/internal/operators/combineLatest.ts", "node_modules/rxjs/src/internal/operators/combineLatestWith.ts", "node_modules/rxjs/src/internal/operators/concatMap.ts", "node_modules/rxjs/src/internal/operators/debounceTime.ts", "node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts", "node_modules/rxjs/src/internal/operators/take.ts", "node_modules/rxjs/src/internal/operators/ignoreElements.ts", "node_modules/rxjs/src/internal/operators/mapTo.ts", "node_modules/rxjs/src/internal/operators/delayWhen.ts", "node_modules/rxjs/src/internal/operators/delay.ts", "node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts", "node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts", "node_modules/rxjs/src/internal/operators/endWith.ts", "node_modules/rxjs/src/internal/operators/finalize.ts", "node_modules/rxjs/src/internal/operators/takeLast.ts", "node_modules/rxjs/src/internal/operators/merge.ts", "node_modules/rxjs/src/internal/operators/mergeWith.ts", "node_modules/rxjs/src/internal/operators/repeat.ts", "node_modules/rxjs/src/internal/operators/sample.ts", "node_modules/rxjs/src/internal/operators/scan.ts", "node_modules/rxjs/src/internal/operators/share.ts", "node_modules/rxjs/src/internal/operators/shareReplay.ts", "node_modules/rxjs/src/internal/operators/skip.ts", "node_modules/rxjs/src/internal/operators/skipUntil.ts", "node_modules/rxjs/src/internal/operators/startWith.ts", "node_modules/rxjs/src/internal/operators/switchMap.ts", "node_modules/rxjs/src/internal/operators/takeUntil.ts", "node_modules/rxjs/src/internal/operators/takeWhile.ts", "node_modules/rxjs/src/internal/operators/tap.ts", "node_modules/rxjs/src/internal/operators/throttle.ts", "node_modules/rxjs/src/internal/operators/throttleTime.ts", "node_modules/rxjs/src/internal/operators/withLatestFrom.ts", "node_modules/rxjs/src/internal/operators/zip.ts", "node_modules/rxjs/src/internal/operators/zipWith.ts", "src/assets/javascripts/browser/document/index.ts", "src/assets/javascripts/browser/element/_/index.ts", "src/assets/javascripts/browser/element/focus/index.ts", "src/assets/javascripts/browser/element/offset/_/index.ts", "src/assets/javascripts/browser/element/offset/content/index.ts", "node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js", "src/assets/javascripts/browser/element/size/_/index.ts", "src/assets/javascripts/browser/element/size/content/index.ts", "src/assets/javascripts/browser/element/visibility/index.ts", "src/assets/javascripts/browser/toggle/index.ts", "src/assets/javascripts/browser/keyboard/index.ts", "src/assets/javascripts/browser/location/_/index.ts", "src/assets/javascripts/utilities/h/index.ts", "src/assets/javascripts/utilities/string/index.ts", "src/assets/javascripts/browser/location/hash/index.ts", "src/assets/javascripts/browser/media/index.ts", "src/assets/javascripts/browser/request/index.ts", "src/assets/javascripts/browser/script/index.ts", "src/assets/javascripts/browser/viewport/offset/index.ts", "src/assets/javascripts/browser/viewport/size/index.ts", "src/assets/javascripts/browser/viewport/_/index.ts", "src/assets/javascripts/browser/viewport/at/index.ts", "src/assets/javascripts/browser/worker/index.ts", "src/assets/javascripts/_/index.ts", "src/assets/javascripts/components/_/index.ts", "src/assets/javascripts/components/announce/index.ts", "src/assets/javascripts/components/consent/index.ts", "src/assets/javascripts/components/content/code/_/index.ts", "src/assets/javascripts/templates/tooltip/index.tsx", "src/assets/javascripts/templates/annotation/index.tsx", "src/assets/javascripts/templates/clipboard/index.tsx", "src/assets/javascripts/templates/search/index.tsx", "src/assets/javascripts/templates/source/index.tsx", "src/assets/javascripts/templates/tabbed/index.tsx", "src/assets/javascripts/templates/table/index.tsx", "src/assets/javascripts/templates/version/index.tsx", "src/assets/javascripts/components/content/annotation/_/index.ts", "src/assets/javascripts/components/content/annotation/list/index.ts", "src/assets/javascripts/components/content/code/mermaid/index.ts", "src/assets/javascripts/components/content/details/index.ts", "src/assets/javascripts/components/content/table/index.ts", "src/assets/javascripts/components/content/tabs/index.ts", "src/assets/javascripts/components/content/_/index.ts", "src/assets/javascripts/components/dialog/index.ts", "src/assets/javascripts/components/header/_/index.ts", "src/assets/javascripts/components/header/title/index.ts", "src/assets/javascripts/components/main/index.ts", "src/assets/javascripts/components/palette/index.ts", "src/assets/javascripts/integrations/clipboard/index.ts", "src/assets/javascripts/integrations/sitemap/index.ts", "src/assets/javascripts/integrations/instant/index.ts", "src/assets/javascripts/integrations/search/document/index.ts", "src/assets/javascripts/integrations/search/highlighter/index.ts", "src/assets/javascripts/integrations/search/query/transform/index.ts", "src/assets/javascripts/integrations/search/worker/message/index.ts", "src/assets/javascripts/integrations/search/worker/_/index.ts", "src/assets/javascripts/integrations/version/index.ts", "src/assets/javascripts/components/search/query/index.ts", "src/assets/javascripts/components/search/result/index.ts", "src/assets/javascripts/components/search/share/index.ts", "src/assets/javascripts/components/search/suggest/index.ts", "src/assets/javascripts/components/search/_/index.ts", "src/assets/javascripts/components/search/highlight/index.ts", "src/assets/javascripts/components/sidebar/index.ts", "src/assets/javascripts/components/source/facts/github/index.ts", "src/assets/javascripts/components/source/facts/gitlab/index.ts", "src/assets/javascripts/components/source/facts/_/index.ts", "src/assets/javascripts/components/source/_/index.ts", "src/assets/javascripts/components/tabs/index.ts", "src/assets/javascripts/components/toc/index.ts", "src/assets/javascripts/components/top/index.ts", "src/assets/javascripts/patches/indeterminate/index.ts", "src/assets/javascripts/patches/scrollfix/index.ts", "src/assets/javascripts/patches/scrolllock/index.ts", "src/assets/javascripts/polyfills/index.ts"], + "sourceRoot": "../../../..", + "sourcesContent": ["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. \u00AF\\_(\u30C4)_/\u00AF\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n", "(function(global) {\r\n /**\r\n * Polyfill URLSearchParams\r\n *\r\n * Inspired from : https://github.com/WebReflection/url-search-params/blob/master/src/url-search-params.js\r\n */\r\n\r\n var checkIfIteratorIsSupported = function() {\r\n try {\r\n return !!Symbol.iterator;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n\r\n\r\n var iteratorSupported = checkIfIteratorIsSupported();\r\n\r\n var createIterator = function(items) {\r\n var iterator = {\r\n next: function() {\r\n var value = items.shift();\r\n return { done: value === void 0, value: value };\r\n }\r\n };\r\n\r\n if (iteratorSupported) {\r\n iterator[Symbol.iterator] = function() {\r\n return iterator;\r\n };\r\n }\r\n\r\n return iterator;\r\n };\r\n\r\n /**\r\n * Search param name and values should be encoded according to https://url.spec.whatwg.org/#urlencoded-serializing\r\n * encodeURIComponent() produces the same result except encoding spaces as `%20` instead of `+`.\r\n */\r\n var serializeParam = function(value) {\r\n return encodeURIComponent(value).replace(/%20/g, '+');\r\n };\r\n\r\n var deserializeParam = function(value) {\r\n return decodeURIComponent(String(value).replace(/\\+/g, ' '));\r\n };\r\n\r\n var polyfillURLSearchParams = function() {\r\n\r\n var URLSearchParams = function(searchString) {\r\n Object.defineProperty(this, '_entries', { writable: true, value: {} });\r\n var typeofSearchString = typeof searchString;\r\n\r\n if (typeofSearchString === 'undefined') {\r\n // do nothing\r\n } else if (typeofSearchString === 'string') {\r\n if (searchString !== '') {\r\n this._fromString(searchString);\r\n }\r\n } else if (searchString instanceof URLSearchParams) {\r\n var _this = this;\r\n searchString.forEach(function(value, name) {\r\n _this.append(name, value);\r\n });\r\n } else if ((searchString !== null) && (typeofSearchString === 'object')) {\r\n if (Object.prototype.toString.call(searchString) === '[object Array]') {\r\n for (var i = 0; i < searchString.length; i++) {\r\n var entry = searchString[i];\r\n if ((Object.prototype.toString.call(entry) === '[object Array]') || (entry.length !== 2)) {\r\n this.append(entry[0], entry[1]);\r\n } else {\r\n throw new TypeError('Expected [string, any] as entry at index ' + i + ' of URLSearchParams\\'s input');\r\n }\r\n }\r\n } else {\r\n for (var key in searchString) {\r\n if (searchString.hasOwnProperty(key)) {\r\n this.append(key, searchString[key]);\r\n }\r\n }\r\n }\r\n } else {\r\n throw new TypeError('Unsupported input\\'s type for URLSearchParams');\r\n }\r\n };\r\n\r\n var proto = URLSearchParams.prototype;\r\n\r\n proto.append = function(name, value) {\r\n if (name in this._entries) {\r\n this._entries[name].push(String(value));\r\n } else {\r\n this._entries[name] = [String(value)];\r\n }\r\n };\r\n\r\n proto.delete = function(name) {\r\n delete this._entries[name];\r\n };\r\n\r\n proto.get = function(name) {\r\n return (name in this._entries) ? this._entries[name][0] : null;\r\n };\r\n\r\n proto.getAll = function(name) {\r\n return (name in this._entries) ? this._entries[name].slice(0) : [];\r\n };\r\n\r\n proto.has = function(name) {\r\n return (name in this._entries);\r\n };\r\n\r\n proto.set = function(name, value) {\r\n this._entries[name] = [String(value)];\r\n };\r\n\r\n proto.forEach = function(callback, thisArg) {\r\n var entries;\r\n for (var name in this._entries) {\r\n if (this._entries.hasOwnProperty(name)) {\r\n entries = this._entries[name];\r\n for (var i = 0; i < entries.length; i++) {\r\n callback.call(thisArg, entries[i], name, this);\r\n }\r\n }\r\n }\r\n };\r\n\r\n proto.keys = function() {\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push(name);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n proto.values = function() {\r\n var items = [];\r\n this.forEach(function(value) {\r\n items.push(value);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n proto.entries = function() {\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push([name, value]);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n if (iteratorSupported) {\r\n proto[Symbol.iterator] = proto.entries;\r\n }\r\n\r\n proto.toString = function() {\r\n var searchArray = [];\r\n this.forEach(function(value, name) {\r\n searchArray.push(serializeParam(name) + '=' + serializeParam(value));\r\n });\r\n return searchArray.join('&');\r\n };\r\n\r\n\r\n global.URLSearchParams = URLSearchParams;\r\n };\r\n\r\n var checkIfURLSearchParamsSupported = function() {\r\n try {\r\n var URLSearchParams = global.URLSearchParams;\r\n\r\n return (\r\n (new URLSearchParams('?a=1').toString() === 'a=1') &&\r\n (typeof URLSearchParams.prototype.set === 'function') &&\r\n (typeof URLSearchParams.prototype.entries === 'function')\r\n );\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n if (!checkIfURLSearchParamsSupported()) {\r\n polyfillURLSearchParams();\r\n }\r\n\r\n var proto = global.URLSearchParams.prototype;\r\n\r\n if (typeof proto.sort !== 'function') {\r\n proto.sort = function() {\r\n var _this = this;\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push([name, value]);\r\n if (!_this._entries) {\r\n _this.delete(name);\r\n }\r\n });\r\n items.sort(function(a, b) {\r\n if (a[0] < b[0]) {\r\n return -1;\r\n } else if (a[0] > b[0]) {\r\n return +1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n if (_this._entries) { // force reset because IE keeps keys index\r\n _this._entries = {};\r\n }\r\n for (var i = 0; i < items.length; i++) {\r\n this.append(items[i][0], items[i][1]);\r\n }\r\n };\r\n }\r\n\r\n if (typeof proto._fromString !== 'function') {\r\n Object.defineProperty(proto, '_fromString', {\r\n enumerable: false,\r\n configurable: false,\r\n writable: false,\r\n value: function(searchString) {\r\n if (this._entries) {\r\n this._entries = {};\r\n } else {\r\n var keys = [];\r\n this.forEach(function(value, name) {\r\n keys.push(name);\r\n });\r\n for (var i = 0; i < keys.length; i++) {\r\n this.delete(keys[i]);\r\n }\r\n }\r\n\r\n searchString = searchString.replace(/^\\?/, '');\r\n var attributes = searchString.split('&');\r\n var attribute;\r\n for (var i = 0; i < attributes.length; i++) {\r\n attribute = attributes[i].split('=');\r\n this.append(\r\n deserializeParam(attribute[0]),\r\n (attribute.length > 1) ? deserializeParam(attribute[1]) : ''\r\n );\r\n }\r\n }\r\n });\r\n }\r\n\r\n // HTMLAnchorElement\r\n\r\n})(\r\n (typeof global !== 'undefined') ? global\r\n : ((typeof window !== 'undefined') ? window\r\n : ((typeof self !== 'undefined') ? self : this))\r\n);\r\n\r\n(function(global) {\r\n /**\r\n * Polyfill URL\r\n *\r\n * Inspired from : https://github.com/arv/DOM-URL-Polyfill/blob/master/src/url.js\r\n */\r\n\r\n var checkIfURLIsSupported = function() {\r\n try {\r\n var u = new global.URL('b', 'http://a');\r\n u.pathname = 'c d';\r\n return (u.href === 'http://a/c%20d') && u.searchParams;\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n\r\n var polyfillURL = function() {\r\n var _URL = global.URL;\r\n\r\n var URL = function(url, base) {\r\n if (typeof url !== 'string') url = String(url);\r\n if (base && typeof base !== 'string') base = String(base);\r\n\r\n // Only create another document if the base is different from current location.\r\n var doc = document, baseElement;\r\n if (base && (global.location === void 0 || base !== global.location.href)) {\r\n base = base.toLowerCase();\r\n doc = document.implementation.createHTMLDocument('');\r\n baseElement = doc.createElement('base');\r\n baseElement.href = base;\r\n doc.head.appendChild(baseElement);\r\n try {\r\n if (baseElement.href.indexOf(base) !== 0) throw new Error(baseElement.href);\r\n } catch (err) {\r\n throw new Error('URL unable to set base ' + base + ' due to ' + err);\r\n }\r\n }\r\n\r\n var anchorElement = doc.createElement('a');\r\n anchorElement.href = url;\r\n if (baseElement) {\r\n doc.body.appendChild(anchorElement);\r\n anchorElement.href = anchorElement.href; // force href to refresh\r\n }\r\n\r\n var inputElement = doc.createElement('input');\r\n inputElement.type = 'url';\r\n inputElement.value = url;\r\n\r\n if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href) || (!inputElement.checkValidity() && !base)) {\r\n throw new TypeError('Invalid URL');\r\n }\r\n\r\n Object.defineProperty(this, '_anchorElement', {\r\n value: anchorElement\r\n });\r\n\r\n\r\n // create a linked searchParams which reflect its changes on URL\r\n var searchParams = new global.URLSearchParams(this.search);\r\n var enableSearchUpdate = true;\r\n var enableSearchParamsUpdate = true;\r\n var _this = this;\r\n ['append', 'delete', 'set'].forEach(function(methodName) {\r\n var method = searchParams[methodName];\r\n searchParams[methodName] = function() {\r\n method.apply(searchParams, arguments);\r\n if (enableSearchUpdate) {\r\n enableSearchParamsUpdate = false;\r\n _this.search = searchParams.toString();\r\n enableSearchParamsUpdate = true;\r\n }\r\n };\r\n });\r\n\r\n Object.defineProperty(this, 'searchParams', {\r\n value: searchParams,\r\n enumerable: true\r\n });\r\n\r\n var search = void 0;\r\n Object.defineProperty(this, '_updateSearchParams', {\r\n enumerable: false,\r\n configurable: false,\r\n writable: false,\r\n value: function() {\r\n if (this.search !== search) {\r\n search = this.search;\r\n if (enableSearchParamsUpdate) {\r\n enableSearchUpdate = false;\r\n this.searchParams._fromString(this.search);\r\n enableSearchUpdate = true;\r\n }\r\n }\r\n }\r\n });\r\n };\r\n\r\n var proto = URL.prototype;\r\n\r\n var linkURLWithAnchorAttribute = function(attributeName) {\r\n Object.defineProperty(proto, attributeName, {\r\n get: function() {\r\n return this._anchorElement[attributeName];\r\n },\r\n set: function(value) {\r\n this._anchorElement[attributeName] = value;\r\n },\r\n enumerable: true\r\n });\r\n };\r\n\r\n ['hash', 'host', 'hostname', 'port', 'protocol']\r\n .forEach(function(attributeName) {\r\n linkURLWithAnchorAttribute(attributeName);\r\n });\r\n\r\n Object.defineProperty(proto, 'search', {\r\n get: function() {\r\n return this._anchorElement['search'];\r\n },\r\n set: function(value) {\r\n this._anchorElement['search'] = value;\r\n this._updateSearchParams();\r\n },\r\n enumerable: true\r\n });\r\n\r\n Object.defineProperties(proto, {\r\n\r\n 'toString': {\r\n get: function() {\r\n var _this = this;\r\n return function() {\r\n return _this.href;\r\n };\r\n }\r\n },\r\n\r\n 'href': {\r\n get: function() {\r\n return this._anchorElement.href.replace(/\\?$/, '');\r\n },\r\n set: function(value) {\r\n this._anchorElement.href = value;\r\n this._updateSearchParams();\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'pathname': {\r\n get: function() {\r\n return this._anchorElement.pathname.replace(/(^\\/?)/, '/');\r\n },\r\n set: function(value) {\r\n this._anchorElement.pathname = value;\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'origin': {\r\n get: function() {\r\n // get expected port from protocol\r\n var expectedPort = { 'http:': 80, 'https:': 443, 'ftp:': 21 }[this._anchorElement.protocol];\r\n // add port to origin if, expected port is different than actual port\r\n // and it is not empty f.e http://foo:8080\r\n // 8080 != 80 && 8080 != ''\r\n var addPortToOrigin = this._anchorElement.port != expectedPort &&\r\n this._anchorElement.port !== '';\r\n\r\n return this._anchorElement.protocol +\r\n '//' +\r\n this._anchorElement.hostname +\r\n (addPortToOrigin ? (':' + this._anchorElement.port) : '');\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'password': { // TODO\r\n get: function() {\r\n return '';\r\n },\r\n set: function(value) {\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'username': { // TODO\r\n get: function() {\r\n return '';\r\n },\r\n set: function(value) {\r\n },\r\n enumerable: true\r\n },\r\n });\r\n\r\n URL.createObjectURL = function(blob) {\r\n return _URL.createObjectURL.apply(_URL, arguments);\r\n };\r\n\r\n URL.revokeObjectURL = function(url) {\r\n return _URL.revokeObjectURL.apply(_URL, arguments);\r\n };\r\n\r\n global.URL = URL;\r\n\r\n };\r\n\r\n if (!checkIfURLIsSupported()) {\r\n polyfillURL();\r\n }\r\n\r\n if ((global.location !== void 0) && !('origin' in global.location)) {\r\n var getOrigin = function() {\r\n return global.location.protocol + '//' + global.location.hostname + (global.location.port ? (':' + global.location.port) : '');\r\n };\r\n\r\n try {\r\n Object.defineProperty(global.location, 'origin', {\r\n get: getOrigin,\r\n enumerable: true\r\n });\r\n } catch (e) {\r\n setInterval(function() {\r\n global.location.origin = getOrigin();\r\n }, 100);\r\n }\r\n }\r\n\r\n})(\r\n (typeof global !== 'undefined') ? global\r\n : ((typeof window !== 'undefined') ? window\r\n : ((typeof self !== 'undefined') ? self : this))\r\n);\r\n", "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n", "/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT \u00A9 Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "Array.prototype.flat||Object.defineProperty(Array.prototype,\"flat\",{configurable:!0,value:function r(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(a,e){return Array.isArray(e)?a.push.apply(a,r.call(e,t-1)):a.push(e),a},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,\"flatMap\",{configurable:!0,value:function(r){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport \"array-flat-polyfill\"\nimport \"focus-visible\"\nimport \"unfetch/polyfill\"\nimport \"url-polyfill\"\n\nimport {\n EMPTY,\n NEVER,\n Subject,\n defer,\n delay,\n filter,\n map,\n merge,\n mergeWith,\n shareReplay,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"./_\"\nimport {\n at,\n getOptionalElement,\n requestJSON,\n setToggle,\n watchDocument,\n watchKeyboard,\n watchLocation,\n watchLocationTarget,\n watchMedia,\n watchPrint,\n watchViewport\n} from \"./browser\"\nimport {\n getComponentElement,\n getComponentElements,\n mountAnnounce,\n mountBackToTop,\n mountConsent,\n mountContent,\n mountDialog,\n mountHeader,\n mountHeaderTitle,\n mountPalette,\n mountSearch,\n mountSearchHiglight,\n mountSidebar,\n mountSource,\n mountTableOfContents,\n mountTabs,\n watchHeader,\n watchMain\n} from \"./components\"\nimport {\n SearchIndex,\n setupClipboardJS,\n setupInstantLoading,\n setupVersionSelector\n} from \"./integrations\"\nimport {\n patchIndeterminate,\n patchScrollfix,\n patchScrolllock\n} from \"./patches\"\nimport \"./polyfills\"\n\n/* ----------------------------------------------------------------------------\n * Application\n * ------------------------------------------------------------------------- */\n\n/* Yay, JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Set up navigation observables and subjects */\nconst document$ = watchDocument()\nconst location$ = watchLocation()\nconst target$ = watchLocationTarget()\nconst keyboard$ = watchKeyboard()\n\n/* Set up media observables */\nconst viewport$ = watchViewport()\nconst tablet$ = watchMedia(\"(min-width: 960px)\")\nconst screen$ = watchMedia(\"(min-width: 1220px)\")\nconst print$ = watchPrint()\n\n/* Retrieve search index, if search is enabled */\nconst config = configuration()\nconst index$ = document.forms.namedItem(\"search\")\n ? __search?.index || requestJSON(\n new URL(\"search/search_index.json\", config.base)\n )\n : NEVER\n\n/* Set up Clipboard.js integration */\nconst alert$ = new Subject()\nsetupClipboardJS({ alert$ })\n\n/* Set up instant loading, if enabled */\nif (feature(\"navigation.instant\"))\n setupInstantLoading({ document$, location$, viewport$ })\n\n/* Set up version selector */\nif (config.version?.provider === \"mike\")\n setupVersionSelector({ document$ })\n\n/* Always close drawer and search on navigation */\nmerge(location$, target$)\n .pipe(\n delay(125)\n )\n .subscribe(() => {\n setToggle(\"drawer\", false)\n setToggle(\"search\", false)\n })\n\n/* Set up global keyboard handlers */\nkeyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Go to previous page */\n case \"p\":\n case \",\":\n const prev = getOptionalElement(\"[href][rel=prev]\")\n if (typeof prev !== \"undefined\")\n prev.click()\n break\n\n /* Go to next page */\n case \"n\":\n case \".\":\n const next = getOptionalElement(\"[href][rel=next]\")\n if (typeof next !== \"undefined\")\n next.click()\n break\n }\n })\n\n/* Set up patches */\npatchIndeterminate({ document$, tablet$ })\npatchScrollfix({ document$ })\npatchScrolllock({ viewport$, tablet$ })\n\n/* Set up header and main area observable */\nconst header$ = watchHeader(getComponentElement(\"header\"), { viewport$ })\nconst main$ = document$\n .pipe(\n map(() => getComponentElement(\"main\")),\n switchMap(el => watchMain(el, { viewport$, header$ })),\n shareReplay(1)\n )\n\n/* Set up control component observables */\nconst control$ = merge(\n\n /* Consent */\n ...getComponentElements(\"consent\")\n .map(el => mountConsent(el, { target$ })),\n\n /* Dialog */\n ...getComponentElements(\"dialog\")\n .map(el => mountDialog(el, { alert$ })),\n\n /* Header */\n ...getComponentElements(\"header\")\n .map(el => mountHeader(el, { viewport$, header$, main$ })),\n\n /* Color palette */\n ...getComponentElements(\"palette\")\n .map(el => mountPalette(el)),\n\n /* Search */\n ...getComponentElements(\"search\")\n .map(el => mountSearch(el, { index$, keyboard$ })),\n\n /* Repository information */\n ...getComponentElements(\"source\")\n .map(el => mountSource(el))\n)\n\n/* Set up content component observables */\nconst content$ = defer(() => merge(\n\n /* Announcement bar */\n ...getComponentElements(\"announce\")\n .map(el => mountAnnounce(el)),\n\n /* Content */\n ...getComponentElements(\"content\")\n .map(el => mountContent(el, { viewport$, target$, print$ })),\n\n /* Search highlighting */\n ...getComponentElements(\"content\")\n .map(el => feature(\"search.highlight\")\n ? mountSearchHiglight(el, { index$, location$ })\n : EMPTY\n ),\n\n /* Header title */\n ...getComponentElements(\"header-title\")\n .map(el => mountHeaderTitle(el, { viewport$, header$ })),\n\n /* Sidebar */\n ...getComponentElements(\"sidebar\")\n .map(el => el.getAttribute(\"data-md-type\") === \"navigation\"\n ? at(screen$, () => mountSidebar(el, { viewport$, header$, main$ }))\n : at(tablet$, () => mountSidebar(el, { viewport$, header$, main$ }))\n ),\n\n /* Navigation tabs */\n ...getComponentElements(\"tabs\")\n .map(el => mountTabs(el, { viewport$, header$ })),\n\n /* Table of contents */\n ...getComponentElements(\"toc\")\n .map(el => mountTableOfContents(el, { viewport$, header$, target$ })),\n\n /* Back-to-top button */\n ...getComponentElements(\"top\")\n .map(el => mountBackToTop(el, { viewport$, header$, main$, target$ }))\n))\n\n/* Set up component observables */\nconst component$ = document$\n .pipe(\n switchMap(() => content$),\n mergeWith(control$),\n shareReplay(1)\n )\n\n/* Subscribe to all components */\ncomponent$.subscribe()\n\n/* ----------------------------------------------------------------------------\n * Exports\n * ------------------------------------------------------------------------- */\n\nwindow.document$ = document$ /* Document observable */\nwindow.location$ = location$ /* Location subject */\nwindow.target$ = target$ /* Location target observable */\nwindow.keyboard$ = keyboard$ /* Keyboard observable */\nwindow.viewport$ = viewport$ /* Viewport observable */\nwindow.tablet$ = tablet$ /* Media tablet observable */\nwindow.screen$ = screen$ /* Media screen observable */\nwindow.print$ = print$ /* Media print observable */\nwindow.alert$ = alert$ /* Alert subject */\nwindow.component$ = component$ /* Component observable */\n", "self.fetch||(self.fetch=function(e,n){return n=n||{},new Promise(function(t,s){var r=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var c in r.open(n.method||\"get\",e,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+\",\"+t:t}),t(a())},r.onerror=s,r.withCredentials=\"include\"==n.credentials,n.headers)r.setRequestHeader(c,n.headers[c]);r.send(n.body||null)})});\n", "import tslib from '../tslib.js';\r\nconst {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n} = tslib;\r\nexport {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n};\r\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n ReplaySubject,\n Subject,\n fromEvent\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch document\n *\n * Documents are implemented as subjects, so all downstream observables are\n * automatically updated when a new document is emitted.\n *\n * @returns Document subject\n */\nexport function watchDocument(): Subject {\n const document$ = new ReplaySubject(1)\n fromEvent(document, \"DOMContentLoaded\", { once: true })\n .subscribe(() => document$.next(document))\n\n /* Return document */\n return document$\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Elements\n */\nexport function getElements(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T][]\n\nexport function getElements(\n selector: string, node?: ParentNode\n): T[]\n\nexport function getElements(\n selector: string, node: ParentNode = document\n): T[] {\n return Array.from(node.querySelectorAll(selector))\n}\n\n/**\n * Retrieve an element matching a query selector or throw a reference error\n *\n * Note that this function assumes that the element is present. If unsure if an\n * element is existent, use the `getOptionalElement` function instead.\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element\n */\nexport function getElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T]\n\nexport function getElement(\n selector: string, node?: ParentNode\n): T\n\nexport function getElement(\n selector: string, node: ParentNode = document\n): T {\n const el = getOptionalElement(selector, node)\n if (typeof el === \"undefined\")\n throw new ReferenceError(\n `Missing element: expected \"${selector}\" to be present`\n )\n\n /* Return element */\n return el\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an optional element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element or nothing\n */\nexport function getOptionalElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T] | undefined\n\nexport function getOptionalElement(\n selector: string, node?: ParentNode\n): T | undefined\n\nexport function getOptionalElement(\n selector: string, node: ParentNode = document\n): T | undefined {\n return node.querySelector(selector) || undefined\n}\n\n/**\n * Retrieve the currently active element\n *\n * @returns Element or nothing\n */\nexport function getActiveElement(): HTMLElement | undefined {\n return document.activeElement instanceof HTMLElement\n ? document.activeElement || undefined\n : undefined\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n debounceTime,\n distinctUntilChanged,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\nimport { getActiveElement } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch element focus\n *\n * Previously, this function used `focus` and `blur` events to determine whether\n * an element is focused, but this doesn't work if there are focusable elements\n * within the elements itself. A better solutions are `focusin` and `focusout`\n * events, which bubble up the tree and allow for more fine-grained control.\n *\n * `debounceTime` is necessary, because when a focus change happens inside an\n * element, the observable would first emit `false` and then `true` again.\n *\n * @param el - Element\n *\n * @returns Element focus observable\n */\nexport function watchElementFocus(\n el: HTMLElement\n): Observable {\n return merge(\n fromEvent(document.body, \"focusin\"),\n fromEvent(document.body, \"focusout\")\n )\n .pipe(\n debounceTime(1),\n map(() => {\n const active = getActiveElement()\n return typeof active !== \"undefined\"\n ? el.contains(active)\n : false\n }),\n startWith(el === getActiveElement()),\n distinctUntilChanged()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n animationFrameScheduler,\n auditTime,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element offset\n *\n * @param el - Element\n *\n * @returns Element offset\n */\nexport function getElementOffset(\n el: HTMLElement\n): ElementOffset {\n return {\n x: el.offsetLeft,\n y: el.offsetTop\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element offset\n *\n * @param el - Element\n *\n * @returns Element offset observable\n */\nexport function watchElementOffset(\n el: HTMLElement\n): Observable {\n return merge(\n fromEvent(window, \"load\"),\n fromEvent(window, \"resize\")\n )\n .pipe(\n auditTime(0, animationFrameScheduler),\n map(() => getElementOffset(el)),\n startWith(getElementOffset(el))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n animationFrameScheduler,\n auditTime,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\nimport { ElementOffset } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element content offset (= scroll offset)\n *\n * @param el - Element\n *\n * @returns Element content offset\n */\nexport function getElementContentOffset(\n el: HTMLElement\n): ElementOffset {\n return {\n x: el.scrollLeft,\n y: el.scrollTop\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element content offset\n *\n * @param el - Element\n *\n * @returns Element content offset observable\n */\nexport function watchElementContentOffset(\n el: HTMLElement\n): Observable {\n return merge(\n fromEvent(el, \"scroll\"),\n fromEvent(window, \"resize\")\n )\n .pipe(\n auditTime(0, animationFrameScheduler),\n map(() => getElementContentOffset(el)),\n startWith(getElementContentOffset(el))\n )\n}\n", "/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ResizeObserver from \"resize-observer-polyfill\"\nimport {\n NEVER,\n Observable,\n Subject,\n defer,\n filter,\n finalize,\n map,\n merge,\n of,\n shareReplay,\n startWith,\n switchMap,\n tap\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementSize {\n width: number /* Element width */\n height: number /* Element height */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Resize observer entry subject\n */\nconst entry$ = new Subject()\n\n/**\n * Resize observer observable\n *\n * This observable will create a `ResizeObserver` on the first subscription\n * and will automatically terminate it when there are no more subscribers.\n * It's quite important to centralize observation in a single `ResizeObserver`,\n * as the performance difference can be quite dramatic, as the link shows.\n *\n * @see https://bit.ly/3iIYfEm - Google Groups on performance\n */\nconst observer$ = defer(() => of(\n new ResizeObserver(entries => {\n for (const entry of entries)\n entry$.next(entry)\n })\n))\n .pipe(\n switchMap(observer => merge(NEVER, of(observer))\n .pipe(\n finalize(() => observer.disconnect())\n )\n ),\n shareReplay(1)\n )\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element size\n *\n * @param el - Element\n *\n * @returns Element size\n */\nexport function getElementSize(\n el: HTMLElement\n): ElementSize {\n return {\n width: el.offsetWidth,\n height: el.offsetHeight\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element size\n *\n * This function returns an observable that subscribes to a single internal\n * instance of `ResizeObserver` upon subscription, and emit resize events until\n * termination. Note that this function should not be called with the same\n * element twice, as the first unsubscription will terminate observation.\n *\n * Sadly, we can't use the `DOMRect` objects returned by the observer, because\n * we need the emitted values to be consistent with `getElementSize`, which will\n * return the used values (rounded) and not actual values (unrounded). Thus, we\n * use the `offset*` properties. See the linked GitHub issue.\n *\n * @see https://bit.ly/3m0k3he - GitHub issue\n *\n * @param el - Element\n *\n * @returns Element size observable\n */\nexport function watchElementSize(\n el: HTMLElement\n): Observable {\n return observer$\n .pipe(\n tap(observer => observer.observe(el)),\n switchMap(observer => entry$\n .pipe(\n filter(({ target }) => target === el),\n finalize(() => observer.unobserve(el)),\n map(() => getElementSize(el))\n )\n ),\n startWith(getElementSize(el))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ElementSize } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element content size (= scroll width and height)\n *\n * @param el - Element\n *\n * @returns Element content size\n */\nexport function getElementContentSize(\n el: HTMLElement\n): ElementSize {\n return {\n width: el.scrollWidth,\n height: el.scrollHeight\n }\n}\n\n/**\n * Retrieve the overflowing container of an element, if any\n *\n * @param el - Element\n *\n * @returns Overflowing container or nothing\n */\nexport function getElementContainer(\n el: HTMLElement\n): HTMLElement | undefined {\n let parent = el.parentElement\n while (parent)\n if (\n el.scrollWidth <= parent.scrollWidth &&\n el.scrollHeight <= parent.scrollHeight\n )\n parent = (el = parent).parentElement\n else\n break\n\n /* Return overflowing container */\n return parent ? el : undefined\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n NEVER,\n Observable,\n Subject,\n defer,\n distinctUntilChanged,\n filter,\n finalize,\n map,\n merge,\n of,\n shareReplay,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport {\n getElementContentSize,\n getElementSize,\n watchElementContentOffset\n} from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Intersection observer entry subject\n */\nconst entry$ = new Subject()\n\n/**\n * Intersection observer observable\n *\n * This observable will create an `IntersectionObserver` on first subscription\n * and will automatically terminate it when there are no more subscribers.\n *\n * @see https://bit.ly/3iIYfEm - Google Groups on performance\n */\nconst observer$ = defer(() => of(\n new IntersectionObserver(entries => {\n for (const entry of entries)\n entry$.next(entry)\n }, {\n threshold: 0\n })\n))\n .pipe(\n switchMap(observer => merge(NEVER, of(observer))\n .pipe(\n finalize(() => observer.disconnect())\n )\n ),\n shareReplay(1)\n )\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch element visibility\n *\n * @param el - Element\n *\n * @returns Element visibility observable\n */\nexport function watchElementVisibility(\n el: HTMLElement\n): Observable {\n return observer$\n .pipe(\n tap(observer => observer.observe(el)),\n switchMap(observer => entry$\n .pipe(\n filter(({ target }) => target === el),\n finalize(() => observer.unobserve(el)),\n map(({ isIntersecting }) => isIntersecting)\n )\n )\n )\n}\n\n/**\n * Watch element boundary\n *\n * This function returns an observable which emits whether the bottom content\n * boundary (= scroll offset) of an element is within a certain threshold.\n *\n * @param el - Element\n * @param threshold - Threshold\n *\n * @returns Element boundary observable\n */\nexport function watchElementBoundary(\n el: HTMLElement, threshold = 16\n): Observable {\n return watchElementContentOffset(el)\n .pipe(\n map(({ y }) => {\n const visible = getElementSize(el)\n const content = getElementContentSize(el)\n return y >= (\n content.height - visible.height - threshold\n )\n }),\n distinctUntilChanged()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n startWith\n} from \"rxjs\"\n\nimport { getElement } from \"../element\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle\n */\nexport type Toggle =\n | \"drawer\" /* Toggle for drawer */\n | \"search\" /* Toggle for search */\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle map\n */\nconst toggles: Record = {\n drawer: getElement(\"[data-md-toggle=drawer]\"),\n search: getElement(\"[data-md-toggle=search]\")\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve the value of a toggle\n *\n * @param name - Toggle\n *\n * @returns Toggle value\n */\nexport function getToggle(name: Toggle): boolean {\n return toggles[name].checked\n}\n\n/**\n * Set toggle\n *\n * Simulating a click event seems to be the most cross-browser compatible way\n * of changing the value while also emitting a `change` event. Before, Material\n * used `CustomEvent` to programmatically change the value of a toggle, but this\n * is a much simpler and cleaner solution which doesn't require a polyfill.\n *\n * @param name - Toggle\n * @param value - Toggle value\n */\nexport function setToggle(name: Toggle, value: boolean): void {\n if (toggles[name].checked !== value)\n toggles[name].click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch toggle\n *\n * @param name - Toggle\n *\n * @returns Toggle value observable\n */\nexport function watchToggle(name: Toggle): Observable {\n const el = toggles[name]\n return fromEvent(el, \"change\")\n .pipe(\n map(() => el.checked),\n startWith(el.checked)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n filter,\n fromEvent,\n map,\n share\n} from \"rxjs\"\n\nimport { getActiveElement } from \"../element\"\nimport { getToggle } from \"../toggle\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Keyboard mode\n */\nexport type KeyboardMode =\n | \"global\" /* Global */\n | \"search\" /* Search is open */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Keyboard\n */\nexport interface Keyboard {\n mode: KeyboardMode /* Keyboard mode */\n type: string /* Key type */\n claim(): void /* Key claim */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether an element may receive keyboard input\n *\n * @param el - Element\n * @param type - Key type\n *\n * @returns Test result\n */\nfunction isSusceptibleToKeyboard(\n el: HTMLElement, type: string\n): boolean {\n switch (el.constructor) {\n\n /* Input elements */\n case HTMLInputElement:\n /* @ts-expect-error - omit unnecessary type cast */\n if (el.type === \"radio\")\n return /^Arrow/.test(type)\n else\n return true\n\n /* Select element and textarea */\n case HTMLSelectElement:\n case HTMLTextAreaElement:\n return true\n\n /* Everything else */\n default:\n return el.isContentEditable\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch keyboard\n *\n * @returns Keyboard observable\n */\nexport function watchKeyboard(): Observable {\n return fromEvent(window, \"keydown\")\n .pipe(\n filter(ev => !(ev.metaKey || ev.ctrlKey)),\n map(ev => ({\n mode: getToggle(\"search\") ? \"search\" : \"global\",\n type: ev.key,\n claim() {\n ev.preventDefault()\n ev.stopPropagation()\n }\n } as Keyboard)),\n filter(({ mode, type }) => {\n if (mode === \"global\") {\n const active = getActiveElement()\n if (typeof active !== \"undefined\")\n return !isSusceptibleToKeyboard(active, type)\n }\n return true\n }),\n share()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Subject } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location\n *\n * This function returns a `URL` object (and not `Location`) to normalize the\n * typings across the application. Furthermore, locations need to be tracked\n * without setting them and `Location` is a singleton which represents the\n * current location.\n *\n * @returns URL\n */\nexport function getLocation(): URL {\n return new URL(location.href)\n}\n\n/**\n * Set location\n *\n * @param url - URL to change to\n */\nexport function setLocation(url: URL): void {\n location.href = url.href\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location\n *\n * @returns Location subject\n */\nexport function watchLocation(): Subject {\n return new Subject()\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { JSX as JSXInternal } from \"preact\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * HTML attributes\n */\ntype Attributes =\n & JSXInternal.HTMLAttributes\n & JSXInternal.SVGAttributes\n & Record\n\n/**\n * Child element\n */\ntype Child =\n | HTMLElement\n | Text\n | string\n | number\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Append a child node to an element\n *\n * @param el - Element\n * @param child - Child node(s)\n */\nfunction appendChild(el: HTMLElement, child: Child | Child[]): void {\n\n /* Handle primitive types (including raw HTML) */\n if (typeof child === \"string\" || typeof child === \"number\") {\n el.innerHTML += child.toString()\n\n /* Handle nodes */\n } else if (child instanceof Node) {\n el.appendChild(child)\n\n /* Handle nested children */\n } else if (Array.isArray(child)) {\n for (const node of child)\n appendChild(el, node)\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * JSX factory\n *\n * @template T - Element type\n *\n * @param tag - HTML tag\n * @param attributes - HTML attributes\n * @param children - Child elements\n *\n * @returns Element\n */\nexport function h(\n tag: T, attributes?: Attributes | null, ...children: Child[]\n): HTMLElementTagNameMap[T]\n\nexport function h(\n tag: string, attributes?: Attributes | null, ...children: Child[]\n): T\n\nexport function h(\n tag: string, attributes?: Attributes | null, ...children: Child[]\n): T {\n const el = document.createElement(tag)\n\n /* Set attributes, if any */\n if (attributes)\n for (const attr of Object.keys(attributes)) {\n if (typeof attributes[attr] === \"undefined\")\n continue\n\n /* Set default attribute or boolean */\n if (typeof attributes[attr] !== \"boolean\")\n el.setAttribute(attr, attributes[attr])\n else\n el.setAttribute(attr, \"\")\n }\n\n /* Append child nodes */\n for (const child of children)\n appendChild(el, child)\n\n /* Return element */\n return el as T\n}\n\n/* ----------------------------------------------------------------------------\n * Namespace\n * ------------------------------------------------------------------------- */\n\nexport declare namespace h {\n namespace JSX {\n type Element = HTMLElement\n type IntrinsicElements = JSXInternal.IntrinsicElements\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Truncate a string after the given number of characters\n *\n * This is not a very reasonable approach, since the summaries kind of suck.\n * It would be better to create something more intelligent, highlighting the\n * search occurrences and making a better summary out of it, but this note was\n * written three years ago, so who knows if we'll ever fix it.\n *\n * @param value - Value to be truncated\n * @param n - Number of characters\n *\n * @returns Truncated value\n */\nexport function truncate(value: string, n: number): string {\n let i = n\n if (value.length > i) {\n while (value[i] !== \" \" && --i > 0) { /* keep eating */ }\n return `${value.substring(0, i)}...`\n }\n return value\n}\n\n/**\n * Round a number for display with repository facts\n *\n * This is a reverse-engineered version of GitHub's weird rounding algorithm\n * for stars, forks and all other numbers. While all numbers below `1,000` are\n * returned as-is, bigger numbers are converted to fixed numbers:\n *\n * - `1,049` => `1k`\n * - `1,050` => `1.1k`\n * - `1,949` => `1.9k`\n * - `1,950` => `2k`\n *\n * @param value - Original value\n *\n * @returns Rounded value\n */\nexport function round(value: number): string {\n if (value > 999) {\n const digits = +((value - 950) % 1000 > 99)\n return `${((value + 0.000001) / 1000).toFixed(digits)}k`\n } else {\n return value.toString()\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n filter,\n fromEvent,\n map,\n shareReplay,\n startWith\n} from \"rxjs\"\n\nimport { getOptionalElement } from \"~/browser\"\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location hash\n *\n * @returns Location hash\n */\nexport function getLocationHash(): string {\n return location.hash.substring(1)\n}\n\n/**\n * Set location hash\n *\n * Setting a new fragment identifier via `location.hash` will have no effect\n * if the value doesn't change. When a new fragment identifier is set, we want\n * the browser to target the respective element at all times, which is why we\n * use this dirty little trick.\n *\n * @param hash - Location hash\n */\nexport function setLocationHash(hash: string): void {\n const el = h(\"a\", { href: hash })\n el.addEventListener(\"click\", ev => ev.stopPropagation())\n el.click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location hash\n *\n * @returns Location hash observable\n */\nexport function watchLocationHash(): Observable {\n return fromEvent(window, \"hashchange\")\n .pipe(\n map(getLocationHash),\n startWith(getLocationHash()),\n filter(hash => hash.length > 0),\n shareReplay(1)\n )\n}\n\n/**\n * Watch location target\n *\n * @returns Location target observable\n */\nexport function watchLocationTarget(): Observable {\n return watchLocationHash()\n .pipe(\n map(id => getOptionalElement(`[id=\"${id}\"]`)!),\n filter(el => typeof el !== \"undefined\")\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n fromEvent,\n fromEventPattern,\n map,\n merge,\n startWith,\n switchMap\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch media query\n *\n * Note that although `MediaQueryList.addListener` is deprecated we have to\n * use it, because it's the only way to ensure proper downward compatibility.\n *\n * @see https://bit.ly/3dUBH2m - GitHub issue\n *\n * @param query - Media query\n *\n * @returns Media observable\n */\nexport function watchMedia(query: string): Observable {\n const media = matchMedia(query)\n return fromEventPattern(next => (\n media.addListener(() => next(media.matches))\n ))\n .pipe(\n startWith(media.matches)\n )\n}\n\n/**\n * Watch print mode\n *\n * @returns Print observable\n */\nexport function watchPrint(): Observable {\n const media = matchMedia(\"print\")\n return merge(\n fromEvent(window, \"beforeprint\").pipe(map(() => true)),\n fromEvent(window, \"afterprint\").pipe(map(() => false))\n )\n .pipe(\n startWith(media.matches)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Toggle an observable with a media observable\n *\n * @template T - Data type\n *\n * @param query$ - Media observable\n * @param factory - Observable factory\n *\n * @returns Toggled observable\n */\nexport function at(\n query$: Observable, factory: () => Observable\n): Observable {\n return query$\n .pipe(\n switchMap(active => active ? factory() : EMPTY)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n catchError,\n from,\n map,\n of,\n shareReplay,\n switchMap,\n throwError\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch the given URL\n *\n * If the request fails (e.g. when dispatched from `file://` locations), the\n * observable will complete without emitting a value.\n *\n * @param url - Request URL\n * @param options - Options\n *\n * @returns Response observable\n */\nexport function request(\n url: URL | string, options: RequestInit = { credentials: \"same-origin\" }\n): Observable {\n return from(fetch(`${url}`, options))\n .pipe(\n catchError(() => EMPTY),\n switchMap(res => res.status !== 200\n ? throwError(() => new Error(res.statusText))\n : of(res)\n )\n )\n}\n\n/**\n * Fetch JSON from the given URL\n *\n * @template T - Data type\n *\n * @param url - Request URL\n * @param options - Options\n *\n * @returns Data observable\n */\nexport function requestJSON(\n url: URL | string, options?: RequestInit\n): Observable {\n return request(url, options)\n .pipe(\n switchMap(res => res.json()),\n shareReplay(1)\n )\n}\n\n/**\n * Fetch XML from the given URL\n *\n * @param url - Request URL\n * @param options - Options\n *\n * @returns Data observable\n */\nexport function requestXML(\n url: URL | string, options?: RequestInit\n): Observable {\n const dom = new DOMParser()\n return request(url, options)\n .pipe(\n switchMap(res => res.text()),\n map(res => dom.parseFromString(res, \"text/xml\")),\n shareReplay(1)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n defer,\n finalize,\n fromEvent,\n map,\n merge,\n switchMap,\n take,\n throwError\n} from \"rxjs\"\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create and load a `script` element\n *\n * This function returns an observable that will emit when the script was\n * successfully loaded, or throw an error if it didn't.\n *\n * @param src - Script URL\n *\n * @returns Script observable\n */\nexport function watchScript(src: string): Observable {\n const script = h(\"script\", { src })\n return defer(() => {\n document.head.appendChild(script)\n return merge(\n fromEvent(script, \"load\"),\n fromEvent(script, \"error\")\n .pipe(\n switchMap(() => (\n throwError(() => new ReferenceError(`Invalid script: ${src}`))\n ))\n )\n )\n .pipe(\n map(() => undefined),\n finalize(() => document.head.removeChild(script)),\n take(1)\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport offset\n */\nexport interface ViewportOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport offset\n *\n * On iOS Safari, viewport offset can be negative due to overflow scrolling.\n * As this may induce strange behaviors downstream, we'll just limit it to 0.\n *\n * @returns Viewport offset\n */\nexport function getViewportOffset(): ViewportOffset {\n return {\n x: Math.max(0, scrollX),\n y: Math.max(0, scrollY)\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset\n *\n * @returns Viewport offset observable\n */\nexport function watchViewportOffset(): Observable {\n return merge(\n fromEvent(window, \"scroll\", { passive: true }),\n fromEvent(window, \"resize\", { passive: true })\n )\n .pipe(\n map(getViewportOffset),\n startWith(getViewportOffset())\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n startWith\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport size\n */\nexport interface ViewportSize {\n width: number /* Viewport width */\n height: number /* Viewport height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport size\n *\n * @returns Viewport size\n */\nexport function getViewportSize(): ViewportSize {\n return {\n width: innerWidth,\n height: innerHeight\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport size\n *\n * @returns Viewport size observable\n */\nexport function watchViewportSize(): Observable {\n return fromEvent(window, \"resize\", { passive: true })\n .pipe(\n map(getViewportSize),\n startWith(getViewportSize())\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n map,\n shareReplay\n} from \"rxjs\"\n\nimport {\n ViewportOffset,\n watchViewportOffset\n} from \"../offset\"\nimport {\n ViewportSize,\n watchViewportSize\n} from \"../size\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport\n */\nexport interface Viewport {\n offset: ViewportOffset /* Viewport offset */\n size: ViewportSize /* Viewport size */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport\n *\n * @returns Viewport observable\n */\nexport function watchViewport(): Observable {\n return combineLatest([\n watchViewportOffset(),\n watchViewportSize()\n ])\n .pipe(\n map(([offset, size]) => ({ offset, size })),\n shareReplay(1)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n distinctUntilKeyChanged,\n map\n} from \"rxjs\"\n\nimport { Header } from \"~/components\"\n\nimport { getElementOffset } from \"../../element\"\nimport { Viewport } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
/* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport relative to element\n *\n * @param el - Element\n * @param options - Options\n *\n * @returns Viewport observable\n */\nexport function watchViewportAt(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n const size$ = viewport$\n .pipe(\n distinctUntilKeyChanged(\"size\")\n )\n\n /* Compute element offset */\n const offset$ = combineLatest([size$, header$])\n .pipe(\n map(() => getElementOffset(el))\n )\n\n /* Compute relative viewport, return hot observable */\n return combineLatest([header$, viewport$, offset$])\n .pipe(\n map(([{ height }, { offset, size }, { x, y }]) => ({\n offset: {\n x: offset.x - x,\n y: offset.y - y + height\n },\n size\n }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n fromEvent,\n map,\n share,\n switchMap,\n tap,\n throttle\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Worker message\n */\nexport interface WorkerMessage {\n type: unknown /* Message type */\n data?: unknown /* Message data */\n}\n\n/**\n * Worker handler\n *\n * @template T - Message type\n */\nexport interface WorkerHandler<\n T extends WorkerMessage\n> {\n tx$: Subject /* Message transmission subject */\n rx$: Observable /* Message receive observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n *\n * @template T - Worker message type\n */\ninterface WatchOptions {\n tx$: Observable /* Message transmission observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch a web worker\n *\n * This function returns an observable that sends all values emitted by the\n * message observable to the web worker. Web worker communication is expected\n * to be bidirectional (request-response) and synchronous. Messages that are\n * emitted during a pending request are throttled, the last one is emitted.\n *\n * @param worker - Web worker\n * @param options - Options\n *\n * @returns Worker message observable\n */\nexport function watchWorker(\n worker: Worker, { tx$ }: WatchOptions\n): Observable {\n\n /* Intercept messages from worker-like objects */\n const rx$ = fromEvent(worker, \"message\")\n .pipe(\n map(({ data }) => data as T)\n )\n\n /* Send and receive messages, return hot observable */\n return tx$\n .pipe(\n throttle(() => rx$, { leading: true, trailing: true }),\n tap(message => worker.postMessage(message)),\n switchMap(() => rx$),\n share()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElement, getLocation } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Feature flag\n */\nexport type Flag =\n | \"announce.dismiss\" /* Dismissable announcement bar */\n | \"content.code.annotate\" /* Code annotations */\n | \"content.lazy\" /* Lazy content elements */\n | \"content.tabs.link\" /* Link content tabs */\n | \"header.autohide\" /* Hide header */\n | \"navigation.expand\" /* Automatic expansion */\n | \"navigation.indexes\" /* Section pages */\n | \"navigation.instant\" /* Instant loading */\n | \"navigation.sections\" /* Section navigation */\n | \"navigation.tabs\" /* Tabs navigation */\n | \"navigation.tabs.sticky\" /* Tabs navigation (sticky) */\n | \"navigation.top\" /* Back-to-top button */\n | \"navigation.tracking\" /* Anchor tracking */\n | \"search.highlight\" /* Search highlighting */\n | \"search.share\" /* Search sharing */\n | \"search.suggest\" /* Search suggestions */\n | \"toc.follow\" /* Following table of contents */\n | \"toc.integrate\" /* Integrated table of contents */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Translation\n */\nexport type Translation =\n | \"clipboard.copy\" /* Copy to clipboard */\n | \"clipboard.copied\" /* Copied to clipboard */\n | \"search.config.lang\" /* Search language */\n | \"search.config.pipeline\" /* Search pipeline */\n | \"search.config.separator\" /* Search separator */\n | \"search.placeholder\" /* Search */\n | \"search.result.placeholder\" /* Type to start searching */\n | \"search.result.none\" /* No matching documents */\n | \"search.result.one\" /* 1 matching document */\n | \"search.result.other\" /* # matching documents */\n | \"search.result.more.one\" /* 1 more on this page */\n | \"search.result.more.other\" /* # more on this page */\n | \"search.result.term.missing\" /* Missing */\n | \"select.version.title\" /* Version selector */\n\n/**\n * Translations\n */\nexport type Translations = Record\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Versioning\n */\nexport interface Versioning {\n provider: \"mike\" /* Version provider */\n default?: string /* Default version */\n}\n\n/**\n * Configuration\n */\nexport interface Config {\n base: string /* Base URL */\n features: Flag[] /* Feature flags */\n translations: Translations /* Translations */\n search: string /* Search worker URL */\n tags?: Record /* Tags mapping */\n version?: Versioning /* Versioning */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve global configuration and make base URL absolute\n */\nconst script = getElement(\"#__config\")\nconst config: Config = JSON.parse(script.textContent!)\nconfig.base = `${new URL(config.base, getLocation())}`\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve global configuration\n *\n * @returns Global configuration\n */\nexport function configuration(): Config {\n return config\n}\n\n/**\n * Check whether a feature flag is enabled\n *\n * @param flag - Feature flag\n *\n * @returns Test result\n */\nexport function feature(flag: Flag): boolean {\n return config.features.includes(flag)\n}\n\n/**\n * Retrieve the translation for the given key\n *\n * @param key - Key to be translated\n * @param value - Positional value, if any\n *\n * @returns Translation\n */\nexport function translation(\n key: Translation, value?: string | number\n): string {\n return typeof value !== \"undefined\"\n ? config.translations[key].replace(\"#\", value.toString())\n : config.translations[key]\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElement, getElements } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component type\n */\nexport type ComponentType =\n | \"announce\" /* Announcement bar */\n | \"container\" /* Container */\n | \"consent\" /* Consent */\n | \"content\" /* Content */\n | \"dialog\" /* Dialog */\n | \"header\" /* Header */\n | \"header-title\" /* Header title */\n | \"header-topic\" /* Header topic */\n | \"main\" /* Main area */\n | \"outdated\" /* Version warning */\n | \"palette\" /* Color palette */\n | \"search\" /* Search */\n | \"search-query\" /* Search input */\n | \"search-result\" /* Search results */\n | \"search-share\" /* Search sharing */\n | \"search-suggest\" /* Search suggestions */\n | \"sidebar\" /* Sidebar */\n | \"skip\" /* Skip link */\n | \"source\" /* Repository information */\n | \"tabs\" /* Navigation tabs */\n | \"toc\" /* Table of contents */\n | \"top\" /* Back-to-top button */\n\n/**\n * Component\n *\n * @template T - Component type\n * @template U - Reference type\n */\nexport type Component<\n T extends {} = {},\n U extends HTMLElement = HTMLElement\n> =\n T & {\n ref: U /* Component reference */\n }\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component type map\n */\ninterface ComponentTypeMap {\n \"announce\": HTMLElement /* Announcement bar */\n \"container\": HTMLElement /* Container */\n \"consent\": HTMLElement /* Consent */\n \"content\": HTMLElement /* Content */\n \"dialog\": HTMLElement /* Dialog */\n \"header\": HTMLElement /* Header */\n \"header-title\": HTMLElement /* Header title */\n \"header-topic\": HTMLElement /* Header topic */\n \"main\": HTMLElement /* Main area */\n \"outdated\": HTMLElement /* Version warning */\n \"palette\": HTMLElement /* Color palette */\n \"search\": HTMLElement /* Search */\n \"search-query\": HTMLInputElement /* Search input */\n \"search-result\": HTMLElement /* Search results */\n \"search-share\": HTMLAnchorElement /* Search sharing */\n \"search-suggest\": HTMLElement /* Search suggestions */\n \"sidebar\": HTMLElement /* Sidebar */\n \"skip\": HTMLAnchorElement /* Skip link */\n \"source\": HTMLAnchorElement /* Repository information */\n \"tabs\": HTMLElement /* Navigation tabs */\n \"toc\": HTMLElement /* Table of contents */\n \"top\": HTMLAnchorElement /* Back-to-top button */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve the element for a given component or throw a reference error\n *\n * @template T - Component type\n *\n * @param type - Component type\n * @param node - Node of reference\n *\n * @returns Element\n */\nexport function getComponentElement(\n type: T, node: ParentNode = document\n): ComponentTypeMap[T] {\n return getElement(`[data-md-component=${type}]`, node)\n}\n\n/**\n * Retrieve all elements for a given component\n *\n * @template T - Component type\n *\n * @param type - Component type\n * @param node - Node of reference\n *\n * @returns Elements\n */\nexport function getComponentElements(\n type: T, node: ParentNode = document\n): ComponentTypeMap[T][] {\n return getElements(`[data-md-component=${type}]`, node)\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n defer,\n finalize,\n fromEvent,\n map,\n startWith,\n tap\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport { getElement } from \"~/browser\"\n\nimport { Component } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Announcement bar\n */\nexport interface Announce {\n hash: number /* Content hash */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch announcement bar\n *\n * @param el - Announcement bar element\n *\n * @returns Announcement bar observable\n */\nexport function watchAnnounce(\n el: HTMLElement\n): Observable {\n const button = getElement(\".md-typeset > :first-child\", el)\n return fromEvent(button, \"click\", { once: true })\n .pipe(\n map(() => getElement(\".md-typeset\", el)),\n map(content => ({ hash: __md_hash(content.innerHTML) }))\n )\n}\n\n/**\n * Mount announcement bar\n *\n * @param el - Announcement bar element\n *\n * @returns Announcement bar component observable\n */\nexport function mountAnnounce(\n el: HTMLElement\n): Observable> {\n if (!feature(\"announce.dismiss\") || !el.childElementCount)\n return EMPTY\n\n /* Mount component on subscription */\n return defer(() => {\n const push$ = new Subject()\n push$\n .pipe(\n startWith({ hash: __md_get(\"__announce\") })\n )\n .subscribe(({ hash }) => {\n if (hash && hash === (__md_get(\"__announce\") ?? hash)) {\n el.hidden = true\n\n /* Persist preference in local storage */\n __md_set(\"__announce\", hash)\n }\n })\n\n /* Create and return component */\n return watchAnnounce(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n finalize,\n map,\n tap\n} from \"rxjs\"\n\nimport { Component } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Consent\n */\nexport interface Consent {\n hidden: boolean /* Consent is hidden */\n}\n\n/**\n * Consent defaults\n */\nexport interface ConsentDefaults {\n analytics?: boolean /* Consent for Analytics */\n github?: boolean /* Consent for GitHub */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n target$: Observable /* Target observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n target$: Observable /* Target observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch consent\n *\n * @param el - Consent element\n * @param options - Options\n *\n * @returns Consent observable\n */\nexport function watchConsent(\n el: HTMLElement, { target$ }: WatchOptions\n): Observable {\n return target$\n .pipe(\n map(target => ({ hidden: target !== el }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount consent\n *\n * @param el - Consent element\n * @param options - Options\n *\n * @returns Consent component observable\n */\nexport function mountConsent(\n el: HTMLElement, options: MountOptions\n): Observable> {\n const internal$ = new Subject()\n internal$.subscribe(({ hidden }) => {\n el.hidden = hidden\n })\n\n /* Create and return component */\n return watchConsent(el, options)\n .pipe(\n tap(state => internal$.next(state)),\n finalize(() => internal$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ClipboardJS from \"clipboard\"\nimport {\n EMPTY,\n Observable,\n Subject,\n defer,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n finalize,\n map,\n mergeWith,\n switchMap,\n take,\n tap\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n getElementContentSize,\n watchElementSize,\n watchElementVisibility\n} from \"~/browser\"\nimport { renderClipboardButton } from \"~/templates\"\n\nimport { Component } from \"../../../_\"\nimport {\n Annotation,\n mountAnnotationList\n} from \"../../annotation\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Code block\n */\nexport interface CodeBlock {\n scrollable: boolean /* Code block overflows */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Global sequence number for code blocks\n */\nlet sequence = 0\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Find candidate list element directly following a code block\n *\n * @param el - Code block element\n *\n * @returns List element or nothing\n */\nfunction findCandidateList(el: HTMLElement): HTMLElement | undefined {\n if (el.nextElementSibling) {\n const sibling = el.nextElementSibling as HTMLElement\n if (sibling.tagName === \"OL\")\n return sibling\n\n /* Skip empty paragraphs - see https://bit.ly/3r4ZJ2O */\n else if (sibling.tagName === \"P\" && !sibling.children.length)\n return findCandidateList(sibling)\n }\n\n /* Everything else */\n return undefined\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch code block\n *\n * This function monitors size changes of the viewport, as well as switches of\n * content tabs with embedded code blocks, as both may trigger overflow.\n *\n * @param el - Code block element\n *\n * @returns Code block observable\n */\nexport function watchCodeBlock(\n el: HTMLElement\n): Observable {\n return watchElementSize(el)\n .pipe(\n map(({ width }) => {\n const content = getElementContentSize(el)\n return {\n scrollable: content.width > width\n }\n }),\n distinctUntilKeyChanged(\"scrollable\")\n )\n}\n\n/**\n * Mount code block\n *\n * This function ensures that an overflowing code block is focusable through\n * keyboard, so it can be scrolled without a mouse to improve on accessibility.\n * Furthermore, if code annotations are enabled, they are mounted if and only\n * if the code block is currently visible, e.g., not in a hidden content tab.\n *\n * Note that code blocks may be mounted eagerly or lazily. If they're mounted\n * lazily (on first visibility), code annotation anchor links will not work,\n * as they are evaluated on initial page load, and code annotations in general\n * might feel a little bumpier.\n *\n * @param el - Code block element\n * @param options - Options\n *\n * @returns Code block and annotation component observable\n */\nexport function mountCodeBlock(\n el: HTMLElement, options: MountOptions\n): Observable> {\n const { matches: hover } = matchMedia(\"(hover)\")\n\n /* Defer mounting of code block - see https://bit.ly/3vHVoVD */\n const factory$ = defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ scrollable }) => {\n if (scrollable && hover)\n el.setAttribute(\"tabindex\", \"0\")\n else\n el.removeAttribute(\"tabindex\")\n })\n\n /* Render button for Clipboard.js integration */\n if (ClipboardJS.isSupported()) {\n const parent = el.closest(\"pre\")!\n parent.id = `__code_${++sequence}`\n parent.insertBefore(\n renderClipboardButton(parent.id),\n el\n )\n }\n\n /* Handle code annotations */\n const container = el.closest(\".highlight\")\n if (container instanceof HTMLElement) {\n const list = findCandidateList(container)\n\n /* Mount code annotations, if enabled */\n if (typeof list !== \"undefined\" && (\n container.classList.contains(\"annotate\") ||\n feature(\"content.code.annotate\")\n )) {\n const annotations$ = mountAnnotationList(list, el, options)\n\n /* Create and return component */\n return watchCodeBlock(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state })),\n mergeWith(\n watchElementSize(container)\n .pipe(\n map(({ width, height }) => width && height),\n distinctUntilChanged(),\n switchMap(active => active ? annotations$ : EMPTY)\n )\n )\n )\n }\n }\n\n /* Create and return component */\n return watchCodeBlock(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n\n /* Mount code block lazily */\n if (feature(\"content.lazy\"))\n return watchElementVisibility(el)\n .pipe(\n filter(visible => visible),\n take(1),\n switchMap(() => factory$)\n )\n\n /* Mount code block */\n return factory$\n}\n", "/*\n * Copyright (c) 2016-2021 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a tooltip\n *\n * @param id - Tooltip identifier\n *\n * @returns Element\n */\nexport function renderTooltip(id?: string): HTMLElement {\n return (\n
\n
\n
\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"~/utilities\"\n\nimport { renderTooltip } from \"../tooltip\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render an annotation\n *\n * @param id - Annotation identifier\n * @param prefix - Tooltip identifier prefix\n *\n * @returns Element\n */\nexport function renderAnnotation(\n id: string | number, prefix?: string\n): HTMLElement {\n prefix = prefix ? `${prefix}_annotation_${id}` : undefined\n\n /* Render tooltip with anchor, if given */\n if (prefix) {\n const anchor = prefix ? `#${prefix}` : undefined\n return (\n \n )\n } else {\n return (\n \n )\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { translation } from \"~/_\"\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a 'copy-to-clipboard' button\n *\n * @param id - Unique identifier\n *\n * @returns Element\n */\nexport function renderClipboardButton(id: string): HTMLElement {\n return (\n code`}\n >\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ComponentChild } from \"preact\"\n\nimport { configuration, feature, translation } from \"~/_\"\nimport {\n SearchDocument,\n SearchMetadata,\n SearchResultItem\n} from \"~/integrations/search\"\nimport { h, truncate } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Render flag\n */\nconst enum Flag {\n TEASER = 1, /* Render teaser */\n PARENT = 2 /* Render as parent */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper function\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search document\n *\n * @param document - Search document\n * @param flag - Render flags\n *\n * @returns Element\n */\nfunction renderSearchDocument(\n document: SearchDocument & SearchMetadata, flag: Flag\n): HTMLElement {\n const parent = flag & Flag.PARENT\n const teaser = flag & Flag.TEASER\n\n /* Render missing query terms */\n const missing = Object.keys(document.terms)\n .filter(key => !document.terms[key])\n .reduce((list, key) => [\n ...list, {key}, \" \"\n ], [])\n .slice(0, -1)\n\n /* Assemble query string for highlighting */\n const url = new URL(document.location)\n if (feature(\"search.highlight\"))\n url.searchParams.set(\"h\", Object.entries(document.terms)\n .filter(([, match]) => match)\n .reduce((highlight, [value]) => `${highlight} ${value}`.trim(), \"\")\n )\n\n /* Render article or section, depending on flags */\n const { tags } = configuration()\n return (\n \n \n {parent > 0 &&
}\n

{document.title}

\n {teaser > 0 && document.text.length > 0 &&\n

\n {truncate(document.text, 320)}\n

\n }\n {document.tags && (\n
\n {document.tags.map(tag => {\n const id = tag.replace(/<[^>]+>/g, \"\")\n const type = tags\n ? id in tags\n ? `md-tag-icon md-tag-icon--${tags[id]}`\n : \"md-tag-icon\"\n : \"\"\n return (\n {tag}\n )\n })}\n
\n )}\n {teaser > 0 && missing.length > 0 &&\n

\n {translation(\"search.result.term.missing\")}: {...missing}\n

\n }\n \n
\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search result\n *\n * @param result - Search result\n *\n * @returns Element\n */\nexport function renderSearchResultItem(\n result: SearchResultItem\n): HTMLElement {\n const threshold = result[0].score\n const docs = [...result]\n\n /* Find and extract parent article */\n const parent = docs.findIndex(doc => !doc.location.includes(\"#\"))\n const [article] = docs.splice(parent, 1)\n\n /* Determine last index above threshold */\n let index = docs.findIndex(doc => doc.score < threshold)\n if (index === -1)\n index = docs.length\n\n /* Partition sections */\n const best = docs.slice(0, index)\n const more = docs.slice(index)\n\n /* Render children */\n const children = [\n renderSearchDocument(article, Flag.PARENT | +(!parent && index === 0)),\n ...best.map(section => renderSearchDocument(section, Flag.TEASER)),\n ...more.length ? [\n
\n \n {more.length > 0 && more.length === 1\n ? translation(\"search.result.more.one\")\n : translation(\"search.result.more.other\", more.length)\n }\n \n {...more.map(section => renderSearchDocument(section, Flag.TEASER))}\n
\n ] : []\n ]\n\n /* Render search result */\n return (\n
  • \n {children}\n
  • \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SourceFacts } from \"~/components\"\nimport { h, round } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render repository facts\n *\n * @param facts - Repository facts\n *\n * @returns Element\n */\nexport function renderSourceFacts(facts: SourceFacts): HTMLElement {\n return (\n
      \n {Object.entries(facts).map(([key, value]) => (\n
    • \n {typeof value === \"number\" ? round(value) : value}\n
    • \n ))}\n
    \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Tabbed control type\n */\ntype TabbedControlType =\n | \"prev\"\n | \"next\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render control for content tabs\n *\n * @param type - Control type\n *\n * @returns Element\n */\nexport function renderTabbedControl(\n type: TabbedControlType\n): HTMLElement {\n const classes = `tabbed-control tabbed-control--${type}`\n return (\n \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a table inside a wrapper to improve scrolling on mobile\n *\n * @param table - Table element\n *\n * @returns Element\n */\nexport function renderTable(table: HTMLElement): HTMLElement {\n return (\n
    \n
    \n {table}\n
    \n
    \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { configuration, translation } from \"~/_\"\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Version\n */\nexport interface Version {\n version: string /* Version identifier */\n title: string /* Version title */\n aliases: string[] /* Version aliases */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a version\n *\n * @param version - Version\n *\n * @returns Element\n */\nfunction renderVersion(version: Version): HTMLElement {\n const config = configuration()\n\n /* Ensure trailing slash - see https://bit.ly/3rL5u3f */\n const url = new URL(`../${version.version}/`, config.base)\n return (\n
  • \n \n {version.title}\n \n
  • \n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a version selector\n *\n * @param versions - Versions\n * @param active - Active version\n *\n * @returns Element\n */\nexport function renderVersionSelector(\n versions: Version[], active: Version\n): HTMLElement {\n return (\n
    \n \n {active.title}\n \n
      \n {versions.map(renderVersion)}\n
    \n
    \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n animationFrameScheduler,\n auditTime,\n combineLatest,\n debounceTime,\n defer,\n delay,\n filter,\n finalize,\n fromEvent,\n map,\n merge,\n switchMap,\n take,\n takeLast,\n takeUntil,\n tap,\n throttleTime,\n withLatestFrom\n} from \"rxjs\"\n\nimport {\n ElementOffset,\n getActiveElement,\n getElementSize,\n watchElementContentOffset,\n watchElementFocus,\n watchElementOffset,\n watchElementVisibility\n} from \"~/browser\"\n\nimport { Component } from \"../../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Annotation\n */\nexport interface Annotation {\n active: boolean /* Annotation is active */\n offset: ElementOffset /* Annotation offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n target$: Observable /* Location target observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch annotation\n *\n * @param el - Annotation element\n * @param container - Containing element\n *\n * @returns Annotation observable\n */\nexport function watchAnnotation(\n el: HTMLElement, container: HTMLElement\n): Observable {\n const offset$ = defer(() => combineLatest([\n watchElementOffset(el),\n watchElementContentOffset(container)\n ]))\n .pipe(\n map(([{ x, y }, scroll]): ElementOffset => {\n const { width, height } = getElementSize(el)\n return ({\n x: x - scroll.x + width / 2,\n y: y - scroll.y + height / 2\n })\n })\n )\n\n /* Actively watch annotation on focus */\n return watchElementFocus(el)\n .pipe(\n switchMap(active => offset$\n .pipe(\n map(offset => ({ active, offset })),\n take(+!active || Infinity)\n )\n )\n )\n}\n\n/**\n * Mount annotation\n *\n * @param el - Annotation element\n * @param container - Containing element\n * @param options - Options\n *\n * @returns Annotation component observable\n */\nexport function mountAnnotation(\n el: HTMLElement, container: HTMLElement, { target$ }: MountOptions\n): Observable> {\n const [tooltip, index] = Array.from(el.children)\n\n /* Mount component on subscription */\n return defer(() => {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n push$.subscribe({\n\n /* Handle emission */\n next({ offset }) {\n el.style.setProperty(\"--md-tooltip-x\", `${offset.x}px`)\n el.style.setProperty(\"--md-tooltip-y\", `${offset.y}px`)\n },\n\n /* Handle complete */\n complete() {\n el.style.removeProperty(\"--md-tooltip-x\")\n el.style.removeProperty(\"--md-tooltip-y\")\n }\n })\n\n /* Start animation only when annotation is visible */\n watchElementVisibility(el)\n .pipe(\n takeUntil(done$)\n )\n .subscribe(visible => {\n el.toggleAttribute(\"data-md-visible\", visible)\n })\n\n /* Toggle tooltip presence to mitigate empty lines when copying */\n merge(\n push$.pipe(filter(({ active }) => active)),\n push$.pipe(debounceTime(250), filter(({ active }) => !active))\n )\n .subscribe({\n\n /* Handle emission */\n next({ active }) {\n if (active)\n el.prepend(tooltip)\n else\n tooltip.remove()\n },\n\n /* Handle complete */\n complete() {\n el.prepend(tooltip)\n }\n })\n\n /* Toggle tooltip visibility */\n push$\n .pipe(\n auditTime(16, animationFrameScheduler)\n )\n .subscribe(({ active }) => {\n tooltip.classList.toggle(\"md-tooltip--active\", active)\n })\n\n /* Track relative origin of tooltip */\n push$\n .pipe(\n throttleTime(125, animationFrameScheduler),\n filter(() => !!el.offsetParent),\n map(() => el.offsetParent!.getBoundingClientRect()),\n map(({ x }) => x)\n )\n .subscribe({\n\n /* Handle emission */\n next(origin) {\n if (origin)\n el.style.setProperty(\"--md-tooltip-0\", `${-origin}px`)\n else\n el.style.removeProperty(\"--md-tooltip-0\")\n },\n\n /* Handle complete */\n complete() {\n el.style.removeProperty(\"--md-tooltip-0\")\n }\n })\n\n /* Allow to copy link without scrolling to anchor */\n fromEvent(index, \"click\")\n .pipe(\n takeUntil(done$),\n filter(ev => !(ev.metaKey || ev.ctrlKey))\n )\n .subscribe(ev => ev.preventDefault())\n\n /* Allow to open link in new tab or blur on close */\n fromEvent(index, \"mousedown\")\n .pipe(\n takeUntil(done$),\n withLatestFrom(push$)\n )\n .subscribe(([ev, { active }]) => {\n\n /* Open in new tab */\n if (ev.button !== 0 || ev.metaKey || ev.ctrlKey) {\n ev.preventDefault()\n\n /* Close annotation */\n } else if (active) {\n ev.preventDefault()\n\n /* Focus parent annotation, if any */\n const parent = el.parentElement!.closest(\".md-annotation\")\n if (parent instanceof HTMLElement)\n parent.focus()\n else\n getActiveElement()?.blur()\n }\n })\n\n /* Open and focus annotation on location target */\n target$\n .pipe(\n takeUntil(done$),\n filter(target => target === tooltip),\n delay(125)\n )\n .subscribe(() => el.focus())\n\n /* Create and return component */\n return watchAnnotation(el, container)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n defer,\n finalize,\n merge,\n share,\n takeLast,\n takeUntil\n} from \"rxjs\"\n\nimport {\n getElement,\n getElements,\n getOptionalElement\n} from \"~/browser\"\nimport { renderAnnotation } from \"~/templates\"\n\nimport { Component } from \"../../../_\"\nimport {\n Annotation,\n mountAnnotation\n} from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Find all annotation markers in the given code block\n *\n * @param container - Containing element\n *\n * @returns Annotation markers\n */\nfunction findAnnotationMarkers(container: HTMLElement): Text[] {\n const markers: Text[] = []\n for (const el of getElements(\".c, .c1, .cm\", container)) {\n const nodes: Text[] = []\n\n /* Find all text nodes in current element */\n const it = document.createNodeIterator(el, NodeFilter.SHOW_TEXT)\n for (let node = it.nextNode(); node; node = it.nextNode())\n nodes.push(node as Text)\n\n /* Find all markers in each text node */\n for (let text of nodes) {\n let match: RegExpExecArray | null\n\n /* Split text at marker and add to list */\n while ((match = /(\\(\\d+\\))(!)?/.exec(text.textContent!))) {\n const [, id, force] = match\n if (typeof force === \"undefined\") {\n const marker = text.splitText(match.index)\n text = marker.splitText(id.length)\n markers.push(marker)\n\n /* Replace entire text with marker */\n } else {\n text.textContent = id\n markers.push(text)\n break\n }\n }\n }\n }\n return markers\n}\n\n/**\n * Swap the child nodes of two elements\n *\n * @param source - Source element\n * @param target - Target element\n */\nfunction swap(source: HTMLElement, target: HTMLElement): void {\n target.append(...Array.from(source.childNodes))\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount annotation list\n *\n * This function analyzes the containing code block and checks for markers\n * referring to elements in the given annotation list. If no markers are found,\n * the list is left untouched. Otherwise, list elements are rendered as\n * annotations inside the code block.\n *\n * @param el - Annotation list element\n * @param container - Containing element\n * @param options - Options\n *\n * @returns Annotation component observable\n */\nexport function mountAnnotationList(\n el: HTMLElement, container: HTMLElement, { target$, print$ }: MountOptions\n): Observable> {\n\n /* Compute prefix for tooltip anchors */\n const parent = container.closest(\"[id]\")\n const prefix = parent?.id\n\n /* Find and replace all markers with empty annotations */\n const annotations = new Map()\n for (const marker of findAnnotationMarkers(container)) {\n const [, id] = marker.textContent!.match(/\\((\\d+)\\)/)!\n if (getOptionalElement(`li:nth-child(${id})`, el)) {\n annotations.set(id, renderAnnotation(id, prefix))\n marker.replaceWith(annotations.get(id)!)\n }\n }\n\n /* Keep list if there are no annotations to render */\n if (annotations.size === 0)\n return EMPTY\n\n /* Mount component on subscription */\n return defer(() => {\n const done$ = new Subject()\n\n /* Retrieve container pairs for swapping */\n const pairs: [HTMLElement, HTMLElement][] = []\n for (const [id, annotation] of annotations)\n pairs.push([\n getElement(\".md-typeset\", annotation),\n getElement(`li:nth-child(${id})`, el)\n ])\n\n /* Handle print mode - see https://bit.ly/3rgPdpt */\n print$\n .pipe(\n takeUntil(done$.pipe(takeLast(1)))\n )\n .subscribe(active => {\n el.hidden = !active\n\n /* Show annotations in code block or list (print) */\n for (const [inner, child] of pairs)\n if (!active)\n swap(child, inner)\n else\n swap(inner, child)\n })\n\n /* Create and return component */\n return merge(...[...annotations]\n .map(([, annotation]) => (\n mountAnnotation(annotation, container, { target$ })\n ))\n )\n .pipe(\n finalize(() => done$.complete()),\n share()\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n map,\n of,\n shareReplay,\n tap\n} from \"rxjs\"\n\nimport { watchScript } from \"~/browser\"\nimport { h } from \"~/utilities\"\n\nimport { Component } from \"../../../_\"\n\nimport themeCSS from \"./index.css\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mermaid diagram\n */\nexport interface Mermaid {}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Mermaid instance observable\n */\nlet mermaid$: Observable\n\n/**\n * Global sequence number for diagrams\n */\nlet sequence = 0\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch Mermaid script\n *\n * @returns Mermaid scripts observable\n */\nfunction fetchScripts(): Observable {\n return typeof mermaid === \"undefined\" || mermaid instanceof Element\n ? watchScript(\"https://unpkg.com/mermaid@9.1.7/dist/mermaid.min.js\")\n : of(undefined)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount Mermaid diagram\n *\n * @param el - Code block element\n *\n * @returns Mermaid diagram component observable\n */\nexport function mountMermaid(\n el: HTMLElement\n): Observable> {\n el.classList.remove(\"mermaid\") // Hack: mitigate https://bit.ly/3CiN6Du\n mermaid$ ||= fetchScripts()\n .pipe(\n tap(() => mermaid.initialize({\n startOnLoad: false,\n themeCSS,\n sequence: {\n actorFontSize: \"16px\", // Hack: mitigate https://bit.ly/3y0NEi3\n messageFontSize: \"16px\",\n noteFontSize: \"16px\"\n }\n })),\n map(() => undefined),\n shareReplay(1)\n )\n\n /* Render diagram */\n mermaid$.subscribe(() => {\n el.classList.add(\"mermaid\") // Hack: mitigate https://bit.ly/3CiN6Du\n const id = `__mermaid_${sequence++}`\n const host = h(\"div\", { class: \"mermaid\" })\n mermaid.mermaidAPI.render(id, el.textContent, (svg: string) => {\n\n /* Create a shadow root and inject diagram */\n const shadow = host.attachShadow({ mode: \"closed\" })\n shadow.innerHTML = svg\n\n /* Replace code block with diagram */\n el.replaceWith(host)\n })\n })\n\n /* Create and return component */\n return mermaid$\n .pipe(\n map(() => ({ ref: el }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n defer,\n filter,\n finalize,\n map,\n merge,\n tap\n} from \"rxjs\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Details\n */\nexport interface Details {\n action: \"open\" | \"close\" /* Details state */\n reveal?: boolean /* Details is revealed */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch details\n *\n * @param el - Details element\n * @param options - Options\n *\n * @returns Details observable\n */\nexport function watchDetails(\n el: HTMLDetailsElement, { target$, print$ }: WatchOptions\n): Observable
    {\n let open = true\n return merge(\n\n /* Open and focus details on location target */\n target$\n .pipe(\n map(target => target.closest(\"details:not([open])\")!),\n filter(details => el === details),\n map(() => ({\n action: \"open\", reveal: true\n }) as Details)\n ),\n\n /* Open details on print and close afterwards */\n print$\n .pipe(\n filter(active => active || !open),\n tap(() => open = el.open),\n map(active => ({\n action: active ? \"open\" : \"close\"\n }) as Details)\n )\n )\n}\n\n/**\n * Mount details\n *\n * This function ensures that `details` tags are opened on anchor jumps and\n * prior to printing, so the whole content of the page is visible.\n *\n * @param el - Details element\n * @param options - Options\n *\n * @returns Details component observable\n */\nexport function mountDetails(\n el: HTMLDetailsElement, options: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject
    ()\n push$.subscribe(({ action, reveal }) => {\n el.toggleAttribute(\"open\", action === \"open\")\n if (reveal)\n el.scrollIntoView()\n })\n\n /* Create and return component */\n return watchDetails(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, of } from \"rxjs\"\n\nimport { renderTable } from \"~/templates\"\nimport { h } from \"~/utilities\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Data table\n */\nexport interface DataTable {}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Sentinel for replacement\n */\nconst sentinel = h(\"table\")\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount data table\n *\n * This function wraps a data table in another scrollable container, so it can\n * be smoothly scrolled on smaller screen sizes and won't break the layout.\n *\n * @param el - Data table element\n *\n * @returns Data table component observable\n */\nexport function mountDataTable(\n el: HTMLElement\n): Observable> {\n el.replaceWith(sentinel)\n sentinel.replaceWith(renderTable(el))\n\n /* Create and return component */\n return of({ ref: el })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n animationFrameScheduler,\n asyncScheduler,\n auditTime,\n combineLatest,\n defer,\n finalize,\n fromEvent,\n map,\n merge,\n skip,\n startWith,\n subscribeOn,\n takeLast,\n takeUntil,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n Viewport,\n getElement,\n getElementContentOffset,\n getElementContentSize,\n getElementOffset,\n getElementSize,\n getElements,\n watchElementContentOffset,\n watchElementSize\n} from \"~/browser\"\nimport { renderTabbedControl } from \"~/templates\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Content tabs\n */\nexport interface ContentTabs {\n active: HTMLLabelElement /* Active tab label */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch content tabs\n *\n * @param el - Content tabs element\n *\n * @returns Content tabs observable\n */\nexport function watchContentTabs(\n el: HTMLElement\n): Observable {\n const inputs = getElements(\":scope > input\", el)\n const initial = inputs.find(input => input.checked) || inputs[0]\n return merge(...inputs.map(input => fromEvent(input, \"change\")\n .pipe(\n map(() => getElement(`label[for=\"${input.id}\"]`))\n )\n ))\n .pipe(\n startWith(getElement(`label[for=\"${initial.id}\"]`)),\n map(active => ({ active }))\n )\n}\n\n/**\n * Mount content tabs\n *\n * This function scrolls the active tab into view. While this functionality is\n * provided by browsers as part of `scrollInfoView`, browsers will always also\n * scroll the vertical axis, which we do not want. Thus, we decided to provide\n * this functionality ourselves.\n *\n * @param el - Content tabs element\n * @param options - Options\n *\n * @returns Content tabs component observable\n */\nexport function mountContentTabs(\n el: HTMLElement, { viewport$ }: MountOptions\n): Observable> {\n\n /* Render content tab previous button for pagination */\n const prev = renderTabbedControl(\"prev\")\n el.append(prev)\n\n /* Render content tab next button for pagination */\n const next = renderTabbedControl(\"next\")\n el.append(next)\n\n /* Mount component on subscription */\n const container = getElement(\".tabbed-labels\", el)\n return defer(() => {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n combineLatest([push$, watchElementSize(el)])\n .pipe(\n auditTime(1, animationFrameScheduler),\n takeUntil(done$)\n )\n .subscribe({\n\n /* Handle emission */\n next([{ active }, size]) {\n const offset = getElementOffset(active)\n const { width } = getElementSize(active)\n\n /* Set tab indicator offset and width */\n el.style.setProperty(\"--md-indicator-x\", `${offset.x}px`)\n el.style.setProperty(\"--md-indicator-width\", `${width}px`)\n\n /* Scroll container to active content tab */\n const content = getElementContentOffset(container)\n if (\n offset.x < content.x ||\n offset.x + width > content.x + size.width\n )\n container.scrollTo({\n left: Math.max(0, offset.x - 16),\n behavior: \"smooth\"\n })\n },\n\n /* Handle complete */\n complete() {\n el.style.removeProperty(\"--md-indicator-x\")\n el.style.removeProperty(\"--md-indicator-width\")\n }\n })\n\n /* Hide content tab buttons on borders */\n combineLatest([\n watchElementContentOffset(container),\n watchElementSize(container)\n ])\n .pipe(\n takeUntil(done$)\n )\n .subscribe(([offset, size]) => {\n const content = getElementContentSize(container)\n prev.hidden = offset.x < 16\n next.hidden = offset.x > content.width - size.width - 16\n })\n\n /* Paginate content tab container on click */\n merge(\n fromEvent(prev, \"click\").pipe(map(() => -1)),\n fromEvent(next, \"click\").pipe(map(() => +1))\n )\n .pipe(\n takeUntil(done$)\n )\n .subscribe(direction => {\n const { width } = getElementSize(container)\n container.scrollBy({\n left: width * direction,\n behavior: \"smooth\"\n })\n })\n\n /* Set up linking of content tabs, if enabled */\n if (feature(\"content.tabs.link\"))\n push$.pipe(\n skip(1),\n withLatestFrom(viewport$)\n )\n .subscribe(([{ active }, { offset }]) => {\n const tab = active.innerText.trim()\n if (active.hasAttribute(\"data-md-switching\")) {\n active.removeAttribute(\"data-md-switching\")\n\n /* Determine viewport offset of active tab */\n } else {\n const y = el.offsetTop - offset.y\n\n /* Passively activate other tabs */\n for (const set of getElements(\"[data-tabs]\"))\n for (const input of getElements(\n \":scope > input\", set\n )) {\n const label = getElement(`label[for=\"${input.id}\"]`)\n if (\n label !== active &&\n label.innerText.trim() === tab\n ) {\n label.setAttribute(\"data-md-switching\", \"\")\n input.click()\n break\n }\n }\n\n /* Bring active tab into view */\n window.scrollTo({\n top: el.offsetTop - y\n })\n\n /* Persist active tabs in local storage */\n const tabs = __md_get(\"__tabs\") || []\n __md_set(\"__tabs\", [...new Set([tab, ...tabs])])\n }\n })\n\n /* Create and return component */\n return watchContentTabs(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n .pipe(\n subscribeOn(asyncScheduler)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, merge } from \"rxjs\"\n\nimport { Viewport, getElements } from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { Annotation } from \"../annotation\"\nimport {\n CodeBlock,\n Mermaid,\n mountCodeBlock,\n mountMermaid\n} from \"../code\"\nimport {\n Details,\n mountDetails\n} from \"../details\"\nimport {\n DataTable,\n mountDataTable\n} from \"../table\"\nimport {\n ContentTabs,\n mountContentTabs\n} from \"../tabs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Content\n */\nexport type Content =\n | Annotation\n | ContentTabs\n | CodeBlock\n | Mermaid\n | DataTable\n | Details\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount content\n *\n * This function mounts all components that are found in the content of the\n * actual article, including code blocks, data tables and details.\n *\n * @param el - Content element\n * @param options - Options\n *\n * @returns Content component observable\n */\nexport function mountContent(\n el: HTMLElement, { viewport$, target$, print$ }: MountOptions\n): Observable> {\n return merge(\n\n /* Code blocks */\n ...getElements(\"pre:not(.mermaid) > code\", el)\n .map(child => mountCodeBlock(child, { target$, print$ })),\n\n /* Mermaid diagrams */\n ...getElements(\"pre.mermaid\", el)\n .map(child => mountMermaid(child)),\n\n /* Data tables */\n ...getElements(\"table:not([class])\", el)\n .map(child => mountDataTable(child)),\n\n /* Details */\n ...getElements(\"details\", el)\n .map(child => mountDetails(child, { target$, print$ })),\n\n /* Content tabs */\n ...getElements(\"[data-tabs]\", el)\n .map(child => mountContentTabs(child, { viewport$ }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n defer,\n delay,\n finalize,\n map,\n merge,\n of,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport { getElement } from \"~/browser\"\n\nimport { Component } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Dialog\n */\nexport interface Dialog {\n message: string /* Dialog message */\n active: boolean /* Dialog is active */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n alert$: Subject /* Alert subject */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n alert$: Subject /* Alert subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch dialog\n *\n * @param _el - Dialog element\n * @param options - Options\n *\n * @returns Dialog observable\n */\nexport function watchDialog(\n _el: HTMLElement, { alert$ }: WatchOptions\n): Observable {\n return alert$\n .pipe(\n switchMap(message => merge(\n of(true),\n of(false).pipe(delay(2000))\n )\n .pipe(\n map(active => ({ message, active }))\n )\n )\n )\n}\n\n/**\n * Mount dialog\n *\n * This function reveals the dialog in the right corner when a new alert is\n * emitted through the subject that is passed as part of the options.\n *\n * @param el - Dialog element\n * @param options - Options\n *\n * @returns Dialog component observable\n */\nexport function mountDialog(\n el: HTMLElement, options: MountOptions\n): Observable> {\n const inner = getElement(\".md-typeset\", el)\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ message, active }) => {\n el.classList.toggle(\"md-dialog--active\", active)\n inner.textContent = message\n })\n\n /* Create and return component */\n return watchDialog(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n combineLatest,\n combineLatestWith,\n defer,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n takeLast,\n takeUntil\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n Viewport,\n watchElementSize,\n watchToggle\n} from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { Main } from \"../../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header\n */\nexport interface Header {\n height: number /* Header visible height */\n hidden: boolean /* Header is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n main$: Observable
    /* Main area observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Compute whether the header is hidden\n *\n * If the user scrolls past a certain threshold, the header can be hidden when\n * scrolling down, and shown when scrolling up.\n *\n * @param options - Options\n *\n * @returns Toggle observable\n */\nfunction isHidden({ viewport$ }: WatchOptions): Observable {\n if (!feature(\"header.autohide\"))\n return of(false)\n\n /* Compute direction and turning point */\n const direction$ = viewport$\n .pipe(\n map(({ offset: { y } }) => y),\n bufferCount(2, 1),\n map(([a, b]) => [a < b, b] as const),\n distinctUntilKeyChanged(0)\n )\n\n /* Compute whether header should be hidden */\n const hidden$ = combineLatest([viewport$, direction$])\n .pipe(\n filter(([{ offset }, [, y]]) => Math.abs(y - offset.y) > 100),\n map(([, [direction]]) => direction),\n distinctUntilChanged()\n )\n\n /* Compute threshold for hiding */\n const search$ = watchToggle(\"search\")\n return combineLatest([viewport$, search$])\n .pipe(\n map(([{ offset }, search]) => offset.y > 400 && !search),\n distinctUntilChanged(),\n switchMap(active => active ? hidden$ : of(false)),\n startWith(false)\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header\n *\n * @param el - Header element\n * @param options - Options\n *\n * @returns Header observable\n */\nexport function watchHeader(\n el: HTMLElement, options: WatchOptions\n): Observable
    {\n return defer(() => combineLatest([\n watchElementSize(el),\n isHidden(options)\n ]))\n .pipe(\n map(([{ height }, hidden]) => ({\n height,\n hidden\n })),\n distinctUntilChanged((a, b) => (\n a.height === b.height &&\n a.hidden === b.hidden\n )),\n shareReplay(1)\n )\n}\n\n/**\n * Mount header\n *\n * This function manages the different states of the header, i.e. whether it's\n * hidden or rendered with a shadow. This depends heavily on the main area.\n *\n * @param el - Header element\n * @param options - Options\n *\n * @returns Header component observable\n */\nexport function mountHeader(\n el: HTMLElement, { header$, main$ }: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject
    ()\n const done$ = push$.pipe(takeLast(1))\n push$\n .pipe(\n distinctUntilKeyChanged(\"active\"),\n combineLatestWith(header$)\n )\n .subscribe(([{ active }, { hidden }]) => {\n el.classList.toggle(\"md-header--shadow\", active && !hidden)\n el.hidden = hidden\n })\n\n /* Link to main area */\n main$.subscribe(push$)\n\n /* Create and return component */\n return header$\n .pipe(\n takeUntil(done$),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n defer,\n distinctUntilKeyChanged,\n finalize,\n map,\n tap\n} from \"rxjs\"\n\nimport {\n Viewport,\n getElementSize,\n getOptionalElement,\n watchViewportAt\n} from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { Header } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header\n */\nexport interface HeaderTitle {\n active: boolean /* Header title is active */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header title\n *\n * @param el - Heading element\n * @param options - Options\n *\n * @returns Header title observable\n */\nexport function watchHeaderTitle(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n return watchViewportAt(el, { viewport$, header$ })\n .pipe(\n map(({ offset: { y } }) => {\n const { height } = getElementSize(el)\n return {\n active: y >= height\n }\n }),\n distinctUntilKeyChanged(\"active\")\n )\n}\n\n/**\n * Mount header title\n *\n * This function swaps the header title from the site title to the title of the\n * current page when the user scrolls past the first headline.\n *\n * @param el - Header title element\n * @param options - Options\n *\n * @returns Header title component observable\n */\nexport function mountHeaderTitle(\n el: HTMLElement, options: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ active }) => {\n el.classList.toggle(\"md-header__title--active\", active)\n })\n\n /* Obtain headline, if any */\n const heading = getOptionalElement(\"article h1\")\n if (typeof heading === \"undefined\")\n return EMPTY\n\n /* Create and return component */\n return watchHeaderTitle(heading, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n map,\n switchMap\n} from \"rxjs\"\n\nimport {\n Viewport,\n watchElementSize\n} from \"~/browser\"\n\nimport { Header } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Main area\n */\nexport interface Main {\n offset: number /* Main area top offset */\n height: number /* Main area visible height */\n active: boolean /* Main area is active */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch main area\n *\n * This function returns an observable that computes the visual parameters of\n * the main area which depends on the viewport vertical offset and height, as\n * well as the height of the header element, if the header is fixed.\n *\n * @param el - Main area element\n * @param options - Options\n *\n * @returns Main area observable\n */\nexport function watchMain(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable
    {\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n map(({ height }) => height),\n distinctUntilChanged()\n )\n\n /* Compute the main area's top and bottom borders */\n const border$ = adjust$\n .pipe(\n switchMap(() => watchElementSize(el)\n .pipe(\n map(({ height }) => ({\n top: el.offsetTop,\n bottom: el.offsetTop + height\n })),\n distinctUntilKeyChanged(\"bottom\")\n )\n )\n )\n\n /* Compute the main area's offset, visible height and if we scrolled past */\n return combineLatest([adjust$, border$, viewport$])\n .pipe(\n map(([header, { top, bottom }, { offset: { y }, size: { height } }]) => {\n height = Math.max(0, height\n - Math.max(0, top - y, header)\n - Math.max(0, height + y - bottom)\n )\n return {\n offset: top - header,\n height,\n active: top - header <= y\n }\n }),\n distinctUntilChanged((a, b) => (\n a.offset === b.offset &&\n a.height === b.height &&\n a.active === b.active\n ))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n asyncScheduler,\n defer,\n finalize,\n fromEvent,\n map,\n mergeMap,\n observeOn,\n of,\n shareReplay,\n startWith,\n tap\n} from \"rxjs\"\n\nimport { getElements } from \"~/browser\"\n\nimport { Component } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Palette colors\n */\nexport interface PaletteColor {\n scheme?: string /* Color scheme */\n primary?: string /* Primary color */\n accent?: string /* Accent color */\n}\n\n/**\n * Palette\n */\nexport interface Palette {\n index: number /* Palette index */\n color: PaletteColor /* Palette colors */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch color palette\n *\n * @param inputs - Color palette element\n *\n * @returns Color palette observable\n */\nexport function watchPalette(\n inputs: HTMLInputElement[]\n): Observable {\n const current = __md_get(\"__palette\") || {\n index: inputs.findIndex(input => matchMedia(\n input.getAttribute(\"data-md-color-media\")!\n ).matches)\n }\n\n /* Emit changes in color palette */\n return of(...inputs)\n .pipe(\n mergeMap(input => fromEvent(input, \"change\")\n .pipe(\n map(() => input)\n )\n ),\n startWith(inputs[Math.max(0, current.index)]),\n map(input => ({\n index: inputs.indexOf(input),\n color: {\n scheme: input.getAttribute(\"data-md-color-scheme\"),\n primary: input.getAttribute(\"data-md-color-primary\"),\n accent: input.getAttribute(\"data-md-color-accent\")\n }\n } as Palette)),\n shareReplay(1)\n )\n}\n\n/**\n * Mount color palette\n *\n * @param el - Color palette element\n *\n * @returns Color palette component observable\n */\nexport function mountPalette(\n el: HTMLElement\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(palette => {\n document.body.setAttribute(\"data-md-color-switching\", \"\")\n\n /* Set color palette */\n for (const [key, value] of Object.entries(palette.color))\n document.body.setAttribute(`data-md-color-${key}`, value)\n\n /* Toggle visibility */\n for (let index = 0; index < inputs.length; index++) {\n const label = inputs[index].nextElementSibling\n if (label instanceof HTMLElement)\n label.hidden = palette.index !== index\n }\n\n /* Persist preference in local storage */\n __md_set(\"__palette\", palette)\n })\n\n /* Revert transition durations after color switch */\n push$.pipe(observeOn(asyncScheduler))\n .subscribe(() => {\n document.body.removeAttribute(\"data-md-color-switching\")\n })\n\n /* Create and return component */\n const inputs = getElements(\"input\", el)\n return watchPalette(inputs)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ClipboardJS from \"clipboard\"\nimport {\n Observable,\n Subject,\n map,\n tap\n} from \"rxjs\"\n\nimport { translation } from \"~/_\"\nimport { getElement } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n alert$: Subject /* Alert subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Extract text to copy\n *\n * @param el - HTML element\n *\n * @returns Extracted text\n */\nfunction extract(el: HTMLElement): string {\n el.setAttribute(\"data-md-copying\", \"\")\n const text = el.innerText\n el.removeAttribute(\"data-md-copying\")\n return text\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up Clipboard.js integration\n *\n * @param options - Options\n */\nexport function setupClipboardJS(\n { alert$ }: SetupOptions\n): void {\n if (ClipboardJS.isSupported()) {\n new Observable(subscriber => {\n new ClipboardJS(\"[data-clipboard-target], [data-clipboard-text]\", {\n text: el => (\n el.getAttribute(\"data-clipboard-text\")! ||\n extract(getElement(\n el.getAttribute(\"data-clipboard-target\")!\n ))\n )\n })\n .on(\"success\", ev => subscriber.next(ev))\n })\n .pipe(\n tap(ev => {\n const trigger = ev.trigger as HTMLElement\n trigger.focus()\n }),\n map(() => translation(\"clipboard.copied\"))\n )\n .subscribe(alert$)\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n catchError,\n defaultIfEmpty,\n map,\n of,\n tap\n} from \"rxjs\"\n\nimport { configuration } from \"~/_\"\nimport { getElements, requestXML } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Sitemap, i.e. a list of URLs\n */\nexport type Sitemap = string[]\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Preprocess a list of URLs\n *\n * This function replaces the `site_url` in the sitemap with the actual base\n * URL, to allow instant loading to work in occasions like Netlify previews.\n *\n * @param urls - URLs\n *\n * @returns URL path parts\n */\nfunction preprocess(urls: Sitemap): Sitemap {\n if (urls.length < 2)\n return [\"\"]\n\n /* Take the first two URLs and remove everything after the last slash */\n const [root, next] = [...urls]\n .sort((a, b) => a.length - b.length)\n .map(url => url.replace(/[^/]+$/, \"\"))\n\n /* Compute common prefix */\n let index = 0\n if (root === next)\n index = root.length\n else\n while (root.charCodeAt(index) === next.charCodeAt(index))\n index++\n\n /* Remove common prefix and return in original order */\n return urls.map(url => url.replace(root.slice(0, index), \"\"))\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch the sitemap for the given base URL\n *\n * @param base - Base URL\n *\n * @returns Sitemap observable\n */\nexport function fetchSitemap(base?: URL): Observable {\n const cached = __md_get(\"__sitemap\", sessionStorage, base)\n if (cached) {\n return of(cached)\n } else {\n const config = configuration()\n return requestXML(new URL(\"sitemap.xml\", base || config.base))\n .pipe(\n map(sitemap => preprocess(getElements(\"loc\", sitemap)\n .map(node => node.textContent!)\n )),\n catchError(() => EMPTY), // @todo refactor instant loading\n defaultIfEmpty([]),\n tap(sitemap => __md_set(\"__sitemap\", sitemap, sessionStorage, base))\n )\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n NEVER,\n Observable,\n Subject,\n bufferCount,\n catchError,\n concatMap,\n debounceTime,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n fromEvent,\n map,\n merge,\n of,\n sample,\n share,\n skip,\n skipUntil,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"~/_\"\nimport {\n Viewport,\n ViewportOffset,\n getElements,\n getOptionalElement,\n request,\n setLocation,\n setLocationHash\n} from \"~/browser\"\nimport { getComponentElement } from \"~/components\"\nimport { h } from \"~/utilities\"\n\nimport { fetchSitemap } from \"../sitemap\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * History state\n */\nexport interface HistoryState {\n url: URL /* State URL */\n offset?: ViewportOffset /* State viewport offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n document$: Subject /* Document subject */\n location$: Subject /* Location subject */\n viewport$: Observable /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up instant loading\n *\n * When fetching, theoretically, we could use `responseType: \"document\"`, but\n * since all MkDocs links are relative, we need to make sure that the current\n * location matches the document we just loaded. Otherwise any relative links\n * in the document could use the old location.\n *\n * This is the reason why we need to synchronize history events and the process\n * of fetching the document for navigation changes (except `popstate` events):\n *\n * 1. Fetch document via `XMLHTTPRequest`\n * 2. Set new location via `history.pushState`\n * 3. Parse and emit fetched document\n *\n * For `popstate` events, we must not use `history.pushState`, or the forward\n * history will be irreversibly overwritten. In case the request fails, the\n * location change is dispatched regularly.\n *\n * @param options - Options\n */\nexport function setupInstantLoading(\n { document$, location$, viewport$ }: SetupOptions\n): void {\n const config = configuration()\n if (location.protocol === \"file:\")\n return\n\n /* Disable automatic scroll restoration */\n if (\"scrollRestoration\" in history) {\n history.scrollRestoration = \"manual\"\n\n /* Hack: ensure that reloads restore viewport offset */\n fromEvent(window, \"beforeunload\")\n .subscribe(() => {\n history.scrollRestoration = \"auto\"\n })\n }\n\n /* Hack: ensure absolute favicon link to omit 404s when switching */\n const favicon = getOptionalElement(\"link[rel=icon]\")\n if (typeof favicon !== \"undefined\")\n favicon.href = favicon.href\n\n /* Intercept internal navigation */\n const push$ = fetchSitemap()\n .pipe(\n map(paths => paths.map(path => `${new URL(path, config.base)}`)),\n switchMap(urls => fromEvent(document.body, \"click\")\n .pipe(\n filter(ev => !ev.metaKey && !ev.ctrlKey),\n switchMap(ev => {\n if (ev.target instanceof Element) {\n const el = ev.target.closest(\"a\")\n if (el && !el.target) {\n const url = new URL(el.href)\n\n /* Canonicalize URL */\n url.search = \"\"\n url.hash = \"\"\n\n /* Check if URL should be intercepted */\n if (\n url.pathname !== location.pathname &&\n urls.includes(url.toString())\n ) {\n ev.preventDefault()\n return of({\n url: new URL(el.href)\n })\n }\n }\n }\n return NEVER\n })\n )\n ),\n share()\n )\n\n /* Intercept history back and forward */\n const pop$ = fromEvent(window, \"popstate\")\n .pipe(\n filter(ev => ev.state !== null),\n map(ev => ({\n url: new URL(location.href),\n offset: ev.state\n })),\n share()\n )\n\n /* Emit location change */\n merge(push$, pop$)\n .pipe(\n distinctUntilChanged((a, b) => a.url.href === b.url.href),\n map(({ url }) => url)\n )\n .subscribe(location$)\n\n /* Fetch document via `XMLHTTPRequest` */\n const response$ = location$\n .pipe(\n distinctUntilKeyChanged(\"pathname\"),\n switchMap(url => request(url.href)\n .pipe(\n catchError(() => {\n setLocation(url)\n return NEVER\n })\n )\n ),\n share()\n )\n\n /* Set new location via `history.pushState` */\n push$\n .pipe(\n sample(response$)\n )\n .subscribe(({ url }) => {\n history.pushState({}, \"\", `${url}`)\n })\n\n /* Parse and emit fetched document */\n const dom = new DOMParser()\n response$\n .pipe(\n switchMap(res => res.text()),\n map(res => dom.parseFromString(res, \"text/html\"))\n )\n .subscribe(document$)\n\n /* Replace meta tags and components */\n document$\n .pipe(\n skip(1)\n )\n .subscribe(replacement => {\n for (const selector of [\n\n /* Meta tags */\n \"title\",\n \"link[rel=canonical]\",\n \"meta[name=author]\",\n \"meta[name=description]\",\n\n /* Components */\n \"[data-md-component=announce]\",\n \"[data-md-component=container]\",\n \"[data-md-component=header-topic]\",\n \"[data-md-component=outdated]\",\n \"[data-md-component=logo]\",\n \"[data-md-component=skip]\",\n ...feature(\"navigation.tabs.sticky\")\n ? [\"[data-md-component=tabs]\"]\n : []\n ]) {\n const source = getOptionalElement(selector)\n const target = getOptionalElement(selector, replacement)\n if (\n typeof source !== \"undefined\" &&\n typeof target !== \"undefined\"\n ) {\n source.replaceWith(target)\n }\n }\n })\n\n /* Re-evaluate scripts */\n document$\n .pipe(\n skip(1),\n map(() => getComponentElement(\"container\")),\n switchMap(el => getElements(\"script\", el)),\n concatMap(el => {\n const script = h(\"script\")\n if (el.src) {\n for (const name of el.getAttributeNames())\n script.setAttribute(name, el.getAttribute(name)!)\n el.replaceWith(script)\n\n /* Complete when script is loaded */\n return new Observable(observer => {\n script.onload = () => observer.complete()\n })\n\n /* Complete immediately */\n } else {\n script.textContent = el.textContent\n el.replaceWith(script)\n return EMPTY\n }\n })\n )\n .subscribe()\n\n /* Emit history state change */\n merge(push$, pop$)\n .pipe(\n sample(document$)\n )\n .subscribe(({ url, offset }) => {\n if (url.hash && !offset) {\n setLocationHash(url.hash)\n } else {\n window.scrollTo(0, offset?.y || 0)\n }\n })\n\n /* Debounce update of viewport offset */\n viewport$\n .pipe(\n skipUntil(push$),\n debounceTime(250),\n distinctUntilKeyChanged(\"offset\")\n )\n .subscribe(({ offset }) => {\n history.replaceState(offset, \"\")\n })\n\n /* Set viewport offset from history */\n merge(push$, pop$)\n .pipe(\n bufferCount(2, 1),\n filter(([a, b]) => a.url.pathname === b.url.pathname),\n map(([, state]) => state)\n )\n .subscribe(({ offset }) => {\n window.scrollTo(0, offset?.y || 0)\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexDocument } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search document\n */\nexport interface SearchDocument extends SearchIndexDocument {\n parent?: SearchIndexDocument /* Parent article */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search document mapping\n */\nexport type SearchDocumentMap = Map\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document mapping\n *\n * @param docs - Search index documents\n *\n * @returns Search document map\n */\nexport function setupSearchDocumentMap(\n docs: SearchIndexDocument[]\n): SearchDocumentMap {\n const documents = new Map()\n const parents = new Set()\n for (const doc of docs) {\n const [path, hash] = doc.location.split(\"#\")\n\n /* Extract location, title and tags */\n const location = doc.location\n const title = doc.title\n const tags = doc.tags\n\n /* Escape and cleanup text */\n const text = escapeHTML(doc.text)\n .replace(/\\s+(?=[,.:;!?])/g, \"\")\n .replace(/\\s+/g, \" \")\n\n /* Handle section */\n if (hash) {\n const parent = documents.get(path)!\n\n /* Ignore first section, override article */\n if (!parents.has(parent)) {\n parent.title = doc.title\n parent.text = text\n\n /* Remember that we processed the article */\n parents.add(parent)\n\n /* Add subsequent section */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n parent\n })\n }\n\n /* Add article */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n ...tags && { tags }\n })\n }\n }\n return documents\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexConfig } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlight function\n *\n * @param value - Value\n *\n * @returns Highlighted value\n */\nexport type SearchHighlightFn = (value: string) => string\n\n/**\n * Search highlight factory function\n *\n * @param query - Query value\n *\n * @returns Search highlight function\n */\nexport type SearchHighlightFactoryFn = (query: string) => SearchHighlightFn\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search highlighter\n *\n * @param config - Search index configuration\n * @param escape - Whether to escape HTML\n *\n * @returns Search highlight factory function\n */\nexport function setupSearchHighlighter(\n config: SearchIndexConfig, escape: boolean\n): SearchHighlightFactoryFn {\n const separator = new RegExp(config.separator, \"img\")\n const highlight = (_: unknown, data: string, term: string) => {\n return `${data}${term}`\n }\n\n /* Return factory function */\n return (query: string) => {\n query = query\n .replace(/[\\s*+\\-:~^]+/g, \" \")\n .trim()\n\n /* Create search term match expression */\n const match = new RegExp(`(^|${config.separator})(${\n query\n .replace(/[|\\\\{}()[\\]^$+*?.-]/g, \"\\\\$&\")\n .replace(separator, \"|\")\n })`, \"img\")\n\n /* Highlight string value */\n return value => (\n escape\n ? escapeHTML(value)\n : value\n )\n .replace(match, highlight)\n .replace(/<\\/mark>(\\s+)]*>/img, \"$1\")\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search transformation function\n *\n * @param value - Query value\n *\n * @returns Transformed query value\n */\nexport type SearchTransformFn = (value: string) => string\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Default transformation function\n *\n * 1. Search for terms in quotation marks and prepend a `+` modifier to denote\n * that the resulting document must contain all terms, converting the query\n * to an `AND` query (as opposed to the default `OR` behavior). While users\n * may expect terms enclosed in quotation marks to map to span queries, i.e.\n * for which order is important, Lunr.js doesn't support them, so the best\n * we can do is to convert the terms to an `AND` query.\n *\n * 2. Replace control characters which are not located at the beginning of the\n * query or preceded by white space, or are not followed by a non-whitespace\n * character or are at the end of the query string. Furthermore, filter\n * unmatched quotation marks.\n *\n * 3. Trim excess whitespace from left and right.\n *\n * @param query - Query value\n *\n * @returns Transformed query value\n */\nexport function defaultTransform(query: string): string {\n return query\n .split(/\"([^\"]+)\"/g) /* => 1 */\n .map((terms, index) => index & 1\n ? terms.replace(/^\\b|^(?![^\\x00-\\x7F]|$)|\\s+/g, \" +\")\n : terms\n )\n .join(\"\")\n .replace(/\"|(?:^|\\s+)[*+\\-:^~]+(?=\\s+|$)/g, \"\") /* => 2 */\n .trim() /* => 3 */\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndex, SearchResult } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search message type\n */\nexport const enum SearchMessageType {\n SETUP, /* Search index setup */\n READY, /* Search index ready */\n QUERY, /* Search query */\n RESULT /* Search results */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Message containing the data necessary to setup the search index\n */\nexport interface SearchSetupMessage {\n type: SearchMessageType.SETUP /* Message type */\n data: SearchIndex /* Message data */\n}\n\n/**\n * Message indicating the search index is ready\n */\nexport interface SearchReadyMessage {\n type: SearchMessageType.READY /* Message type */\n}\n\n/**\n * Message containing a search query\n */\nexport interface SearchQueryMessage {\n type: SearchMessageType.QUERY /* Message type */\n data: string /* Message data */\n}\n\n/**\n * Message containing results for a search query\n */\nexport interface SearchResultMessage {\n type: SearchMessageType.RESULT /* Message type */\n data: SearchResult /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Message exchanged with the search worker\n */\nexport type SearchMessage =\n | SearchSetupMessage\n | SearchReadyMessage\n | SearchQueryMessage\n | SearchResultMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for search setup messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchSetupMessage(\n message: SearchMessage\n): message is SearchSetupMessage {\n return message.type === SearchMessageType.SETUP\n}\n\n/**\n * Type guard for search ready messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchReadyMessage(\n message: SearchMessage\n): message is SearchReadyMessage {\n return message.type === SearchMessageType.READY\n}\n\n/**\n * Type guard for search query messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchQueryMessage(\n message: SearchMessage\n): message is SearchQueryMessage {\n return message.type === SearchMessageType.QUERY\n}\n\n/**\n * Type guard for search result messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchResultMessage(\n message: SearchMessage\n): message is SearchResultMessage {\n return message.type === SearchMessageType.RESULT\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n ObservableInput,\n Subject,\n from,\n map,\n share\n} from \"rxjs\"\n\nimport { configuration, feature, translation } from \"~/_\"\nimport { WorkerHandler, watchWorker } from \"~/browser\"\n\nimport { SearchIndex } from \"../../_\"\nimport {\n SearchOptions,\n SearchPipeline\n} from \"../../options\"\nimport {\n SearchMessage,\n SearchMessageType,\n SearchSetupMessage,\n isSearchResultMessage\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search worker\n */\nexport type SearchWorker = WorkerHandler\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search index\n *\n * @param data - Search index\n *\n * @returns Search index\n */\nfunction setupSearchIndex({ config, docs }: SearchIndex): SearchIndex {\n\n /* Override default language with value from translation */\n if (config.lang.length === 1 && config.lang[0] === \"en\")\n config.lang = [\n translation(\"search.config.lang\")\n ]\n\n /* Override default separator with value from translation */\n if (config.separator === \"[\\\\s\\\\-]+\")\n config.separator = translation(\"search.config.separator\")\n\n /* Set pipeline from translation */\n const pipeline = translation(\"search.config.pipeline\")\n .split(/\\s*,\\s*/)\n .filter(Boolean) as SearchPipeline\n\n /* Determine search options */\n const options: SearchOptions = {\n pipeline,\n suggestions: feature(\"search.suggest\")\n }\n\n /* Return search index after defaulting */\n return { config, docs, options }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search worker\n *\n * This function creates a web worker to set up and query the search index,\n * which is done using Lunr.js. The index must be passed as an observable to\n * enable hacks like _localsearch_ via search index embedding as JSON.\n *\n * @param url - Worker URL\n * @param index - Search index observable input\n *\n * @returns Search worker\n */\nexport function setupSearchWorker(\n url: string, index: ObservableInput\n): SearchWorker {\n const config = configuration()\n const worker = new Worker(url)\n\n /* Create communication channels and resolve relative links */\n const tx$ = new Subject()\n const rx$ = watchWorker(worker, { tx$ })\n .pipe(\n map(message => {\n if (isSearchResultMessage(message)) {\n for (const result of message.data.items)\n for (const document of result)\n document.location = `${new URL(document.location, config.base)}`\n }\n return message\n }),\n share()\n )\n\n /* Set up search index */\n from(index)\n .pipe(\n map(data => ({\n type: SearchMessageType.SETUP,\n data: setupSearchIndex(data)\n } as SearchSetupMessage))\n )\n .subscribe(tx$.next.bind(tx$))\n\n /* Return search worker */\n return { tx$, rx$ }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Subject,\n catchError,\n combineLatest,\n filter,\n fromEvent,\n map,\n of,\n switchMap,\n withLatestFrom\n} from \"rxjs\"\n\nimport { configuration } from \"~/_\"\nimport {\n getElement,\n getLocation,\n requestJSON,\n setLocation\n} from \"~/browser\"\nimport { getComponentElements } from \"~/components\"\nimport {\n Version,\n renderVersionSelector\n} from \"~/templates\"\n\nimport { fetchSitemap } from \"../sitemap\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n document$: Subject /* Document subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up version selector\n *\n * @param options - Options\n */\nexport function setupVersionSelector(\n { document$ }: SetupOptions\n): void {\n const config = configuration()\n const versions$ = requestJSON(\n new URL(\"../versions.json\", config.base)\n )\n .pipe(\n catchError(() => EMPTY) // @todo refactor instant loading\n )\n\n /* Determine current version */\n const current$ = versions$\n .pipe(\n map(versions => {\n const [, current] = config.base.match(/([^/]+)\\/?$/)!\n return versions.find(({ version, aliases }) => (\n version === current || aliases.includes(current)\n )) || versions[0]\n })\n )\n\n /* Intercept inter-version navigation */\n versions$\n .pipe(\n map(versions => new Map(versions.map(version => [\n `${new URL(`../${version.version}/`, config.base)}`,\n version\n ]))),\n switchMap(urls => fromEvent(document.body, \"click\")\n .pipe(\n filter(ev => !ev.metaKey && !ev.ctrlKey),\n withLatestFrom(current$),\n switchMap(([ev, current]) => {\n if (ev.target instanceof Element) {\n const el = ev.target.closest(\"a\")\n if (el && !el.target && urls.has(el.href)) {\n const url = el.href\n // This is a temporary hack to detect if a version inside the\n // version selector or on another part of the site was clicked.\n // If we're inside the version selector, we definitely want to\n // find the same page, as we might have different deployments\n // due to aliases. However, if we're outside the version\n // selector, we must abort here, because we might otherwise\n // interfere with instant loading. We need to refactor this\n // at some point together with instant loading.\n //\n // See https://github.com/squidfunk/mkdocs-material/issues/4012\n if (!ev.target.closest(\".md-version\")) {\n const version = urls.get(url)!\n if (version === current)\n return EMPTY\n }\n ev.preventDefault()\n return of(url)\n }\n }\n return EMPTY\n }),\n switchMap(url => {\n const { version } = urls.get(url)!\n return fetchSitemap(new URL(url))\n .pipe(\n map(sitemap => {\n const location = getLocation()\n const path = location.href.replace(config.base, \"\")\n return sitemap.includes(path.split(\"#\")[0])\n ? new URL(`../${version}/${path}`, config.base)\n : new URL(url)\n })\n )\n })\n )\n )\n )\n .subscribe(url => setLocation(url))\n\n /* Render version selector and warning */\n combineLatest([versions$, current$])\n .subscribe(([versions, current]) => {\n const topic = getElement(\".md-header__topic\")\n topic.appendChild(renderVersionSelector(versions, current))\n })\n\n /* Integrate outdated version banner with instant loading */\n document$.pipe(switchMap(() => current$))\n .subscribe(current => {\n\n /* Check if version state was already determined */\n let outdated = __md_get(\"__outdated\", sessionStorage)\n if (outdated === null) {\n const latest = config.version?.default || \"latest\"\n outdated = !current.aliases.includes(latest)\n\n /* Persist version state in session storage */\n __md_set(\"__outdated\", outdated, sessionStorage)\n }\n\n /* Unhide outdated version banner */\n if (outdated)\n for (const warning of getComponentElements(\"outdated\"))\n warning.hidden = false\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n combineLatest,\n delay,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n finalize,\n fromEvent,\n map,\n merge,\n share,\n shareReplay,\n startWith,\n take,\n takeLast,\n takeUntil,\n tap\n} from \"rxjs\"\n\nimport { translation } from \"~/_\"\nimport {\n getLocation,\n setToggle,\n watchElementFocus,\n watchToggle\n} from \"~/browser\"\nimport {\n SearchMessageType,\n SearchQueryMessage,\n SearchWorker,\n defaultTransform,\n isSearchReadyMessage\n} from \"~/integrations\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query\n */\nexport interface SearchQuery {\n value: string /* Query value */\n focus: boolean /* Query focus */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search query\n *\n * Note that the focus event which triggers re-reading the current query value\n * is delayed by `1ms` so the input's empty state is allowed to propagate.\n *\n * @param el - Search query element\n * @param worker - Search worker\n *\n * @returns Search query observable\n */\nexport function watchSearchQuery(\n el: HTMLInputElement, { rx$ }: SearchWorker\n): Observable {\n const fn = __search?.transform || defaultTransform\n\n /* Immediately show search dialog */\n const { searchParams } = getLocation()\n if (searchParams.has(\"q\"))\n setToggle(\"search\", true)\n\n /* Intercept query parameter (deep link) */\n const param$ = rx$\n .pipe(\n filter(isSearchReadyMessage),\n take(1),\n map(() => searchParams.get(\"q\") || \"\")\n )\n\n /* Remove query parameter when search is closed */\n watchToggle(\"search\")\n .pipe(\n filter(active => !active),\n take(1)\n )\n .subscribe(() => {\n const url = new URL(location.href)\n url.searchParams.delete(\"q\")\n history.replaceState({}, \"\", `${url}`)\n })\n\n /* Set query from parameter */\n param$.subscribe(value => { // TODO: not ideal - find a better way\n if (value) {\n el.value = value\n el.focus()\n }\n })\n\n /* Intercept focus and input events */\n const focus$ = watchElementFocus(el)\n const value$ = merge(\n fromEvent(el, \"keyup\"),\n fromEvent(el, \"focus\").pipe(delay(1)),\n param$\n )\n .pipe(\n map(() => fn(el.value)),\n startWith(\"\"),\n distinctUntilChanged(),\n )\n\n /* Combine into single observable */\n return combineLatest([value$, focus$])\n .pipe(\n map(([value, focus]) => ({ value, focus })),\n shareReplay(1)\n )\n}\n\n/**\n * Mount search query\n *\n * @param el - Search query element\n * @param worker - Search worker\n *\n * @returns Search query component observable\n */\nexport function mountSearchQuery(\n el: HTMLInputElement, { tx$, rx$ }: SearchWorker\n): Observable> {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n\n /* Handle value changes */\n push$\n .pipe(\n distinctUntilKeyChanged(\"value\"),\n map(({ value }): SearchQueryMessage => ({\n type: SearchMessageType.QUERY,\n data: value\n }))\n )\n .subscribe(tx$.next.bind(tx$))\n\n /* Handle focus changes */\n push$\n .pipe(\n distinctUntilKeyChanged(\"focus\")\n )\n .subscribe(({ focus }) => {\n if (focus) {\n setToggle(\"search\", focus)\n el.placeholder = \"\"\n } else {\n el.placeholder = translation(\"search.placeholder\")\n }\n })\n\n /* Handle reset */\n fromEvent(el.form!, \"reset\")\n .pipe(\n takeUntil(done$)\n )\n .subscribe(() => el.focus())\n\n /* Create and return component */\n return watchSearchQuery(el, { tx$, rx$ })\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state })),\n share()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n filter,\n finalize,\n map,\n merge,\n of,\n skipUntil,\n switchMap,\n take,\n tap,\n withLatestFrom,\n zipWith\n} from \"rxjs\"\n\nimport { translation } from \"~/_\"\nimport {\n getElement,\n watchElementBoundary\n} from \"~/browser\"\nimport {\n SearchResult,\n SearchWorker,\n isSearchReadyMessage,\n isSearchResultMessage\n} from \"~/integrations\"\nimport { renderSearchResultItem } from \"~/templates\"\nimport { round } from \"~/utilities\"\n\nimport { Component } from \"../../_\"\nimport { SearchQuery } from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search result list\n *\n * This function performs a lazy rendering of the search results, depending on\n * the vertical offset of the search result container.\n *\n * @param el - Search result list element\n * @param worker - Search worker\n * @param options - Options\n *\n * @returns Search result list component observable\n */\nexport function mountSearchResult(\n el: HTMLElement, { rx$ }: SearchWorker, { query$ }: MountOptions\n): Observable> {\n const push$ = new Subject()\n const boundary$ = watchElementBoundary(el.parentElement!)\n .pipe(\n filter(Boolean)\n )\n\n /* Retrieve nested components */\n const meta = getElement(\":scope > :first-child\", el)\n const list = getElement(\":scope > :last-child\", el)\n\n /* Wait until search is ready */\n const ready$ = rx$\n .pipe(\n filter(isSearchReadyMessage),\n take(1)\n )\n\n /* Update search result metadata */\n push$\n .pipe(\n withLatestFrom(query$),\n skipUntil(ready$)\n )\n .subscribe(([{ items }, { value }]) => {\n if (value) {\n switch (items.length) {\n\n /* No results */\n case 0:\n meta.textContent = translation(\"search.result.none\")\n break\n\n /* One result */\n case 1:\n meta.textContent = translation(\"search.result.one\")\n break\n\n /* Multiple result */\n default:\n meta.textContent = translation(\n \"search.result.other\",\n round(items.length)\n )\n }\n } else {\n meta.textContent = translation(\"search.result.placeholder\")\n }\n })\n\n /* Update search result list */\n push$\n .pipe(\n tap(() => list.innerHTML = \"\"),\n switchMap(({ items }) => merge(\n of(...items.slice(0, 10)),\n of(...items.slice(10))\n .pipe(\n bufferCount(4),\n zipWith(boundary$),\n switchMap(([chunk]) => chunk)\n )\n ))\n )\n .subscribe(result => list.appendChild(\n renderSearchResultItem(result)\n ))\n\n /* Filter search result message */\n const result$ = rx$\n .pipe(\n filter(isSearchResultMessage),\n map(({ data }) => data)\n )\n\n /* Create and return component */\n return result$\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n finalize,\n fromEvent,\n map,\n tap\n} from \"rxjs\"\n\nimport { getLocation } from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { SearchQuery } from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search sharing\n */\nexport interface SearchShare {\n url: URL /* Deep link for sharing */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n query$: Observable /* Search query observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search sharing\n *\n * @param _el - Search sharing element\n * @param options - Options\n *\n * @returns Search sharing observable\n */\nexport function watchSearchShare(\n _el: HTMLElement, { query$ }: WatchOptions\n): Observable {\n return query$\n .pipe(\n map(({ value }) => {\n const url = getLocation()\n url.hash = \"\"\n url.searchParams.delete(\"h\")\n url.searchParams.set(\"q\", value)\n return { url }\n })\n )\n}\n\n/**\n * Mount search sharing\n *\n * @param el - Search sharing element\n * @param options - Options\n *\n * @returns Search sharing component observable\n */\nexport function mountSearchShare(\n el: HTMLAnchorElement, options: MountOptions\n): Observable> {\n const push$ = new Subject()\n push$.subscribe(({ url }) => {\n el.setAttribute(\"data-clipboard-text\", el.href)\n el.href = `${url}`\n })\n\n /* Prevent following of link */\n fromEvent(el, \"click\")\n .subscribe(ev => ev.preventDefault())\n\n /* Create and return component */\n return watchSearchShare(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n asyncScheduler,\n combineLatestWith,\n distinctUntilChanged,\n filter,\n finalize,\n fromEvent,\n map,\n merge,\n observeOn,\n tap\n} from \"rxjs\"\n\nimport { Keyboard } from \"~/browser\"\nimport {\n SearchResult,\n SearchWorker,\n isSearchResultMessage\n} from \"~/integrations\"\n\nimport { Component, getComponentElement } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search suggestions\n */\nexport interface SearchSuggest {}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n keyboard$: Observable /* Keyboard observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search suggestions\n *\n * This function will perform a lazy rendering of the search results, depending\n * on the vertical offset of the search result container.\n *\n * @param el - Search result list element\n * @param worker - Search worker\n * @param options - Options\n *\n * @returns Search result list component observable\n */\nexport function mountSearchSuggest(\n el: HTMLElement, { rx$ }: SearchWorker, { keyboard$ }: MountOptions\n): Observable> {\n const push$ = new Subject()\n\n /* Retrieve query component and track all changes */\n const query = getComponentElement(\"search-query\")\n const query$ = merge(\n fromEvent(query, \"keydown\"),\n fromEvent(query, \"focus\")\n )\n .pipe(\n observeOn(asyncScheduler),\n map(() => query.value),\n distinctUntilChanged(),\n )\n\n /* Update search suggestions */\n push$\n .pipe(\n combineLatestWith(query$),\n map(([{ suggestions }, value]) => {\n const words = value.split(/([\\s-]+)/)\n if (suggestions?.length && words[words.length - 1]) {\n const last = suggestions[suggestions.length - 1]\n if (last.startsWith(words[words.length - 1]))\n words[words.length - 1] = last\n } else {\n words.length = 0\n }\n return words\n })\n )\n .subscribe(words => el.innerHTML = words\n .join(\"\")\n .replace(/\\s/g, \" \")\n )\n\n /* Set up search keyboard handlers */\n keyboard$\n .pipe(\n filter(({ mode }) => mode === \"search\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Right arrow: accept current suggestion */\n case \"ArrowRight\":\n if (\n el.innerText.length &&\n query.selectionStart === query.value.length\n )\n query.value = el.innerText\n break\n }\n })\n\n /* Filter search result message */\n const result$ = rx$\n .pipe(\n filter(isSearchResultMessage),\n map(({ data }) => data)\n )\n\n /* Create and return component */\n return result$\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(() => ({ ref: el }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n NEVER,\n Observable,\n ObservableInput,\n filter,\n merge,\n mergeWith,\n sample,\n take\n} from \"rxjs\"\n\nimport { configuration } from \"~/_\"\nimport {\n Keyboard,\n getActiveElement,\n getElements,\n setToggle\n} from \"~/browser\"\nimport {\n SearchIndex,\n SearchResult,\n isSearchQueryMessage,\n isSearchReadyMessage,\n setupSearchWorker\n} from \"~/integrations\"\n\nimport {\n Component,\n getComponentElement,\n getComponentElements\n} from \"../../_\"\nimport {\n SearchQuery,\n mountSearchQuery\n} from \"../query\"\nimport { mountSearchResult } from \"../result\"\nimport {\n SearchShare,\n mountSearchShare\n} from \"../share\"\nimport {\n SearchSuggest,\n mountSearchSuggest\n} from \"../suggest\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search\n */\nexport type Search =\n | SearchQuery\n | SearchResult\n | SearchShare\n | SearchSuggest\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n index$: ObservableInput /* Search index observable */\n keyboard$: Observable /* Keyboard observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search\n *\n * This function sets up the search functionality, including the underlying\n * web worker and all keyboard bindings.\n *\n * @param el - Search element\n * @param options - Options\n *\n * @returns Search component observable\n */\nexport function mountSearch(\n el: HTMLElement, { index$, keyboard$ }: MountOptions\n): Observable> {\n const config = configuration()\n try {\n const url = __search?.worker || config.search\n const worker = setupSearchWorker(url, index$)\n\n /* Retrieve query and result components */\n const query = getComponentElement(\"search-query\", el)\n const result = getComponentElement(\"search-result\", el)\n\n /* Re-emit query when search is ready */\n const { tx$, rx$ } = worker\n tx$\n .pipe(\n filter(isSearchQueryMessage),\n sample(rx$.pipe(filter(isSearchReadyMessage))),\n take(1)\n )\n .subscribe(tx$.next.bind(tx$))\n\n /* Set up search keyboard handlers */\n keyboard$\n .pipe(\n filter(({ mode }) => mode === \"search\")\n )\n .subscribe(key => {\n const active = getActiveElement()\n switch (key.type) {\n\n /* Enter: go to first (best) result */\n case \"Enter\":\n if (active === query) {\n const anchors = new Map()\n for (const anchor of getElements(\n \":first-child [href]\", result\n )) {\n const article = anchor.firstElementChild!\n anchors.set(anchor, parseFloat(\n article.getAttribute(\"data-md-score\")!\n ))\n }\n\n /* Go to result with highest score, if any */\n if (anchors.size) {\n const [[best]] = [...anchors].sort(([, a], [, b]) => b - a)\n best.click()\n }\n\n /* Otherwise omit form submission */\n key.claim()\n }\n break\n\n /* Escape or Tab: close search */\n case \"Escape\":\n case \"Tab\":\n setToggle(\"search\", false)\n query.blur()\n break\n\n /* Vertical arrows: select previous or next search result */\n case \"ArrowUp\":\n case \"ArrowDown\":\n if (typeof active === \"undefined\") {\n query.focus()\n } else {\n const els = [query, ...getElements(\n \":not(details) > [href], summary, details[open] [href]\",\n result\n )]\n const i = Math.max(0, (\n Math.max(0, els.indexOf(active)) + els.length + (\n key.type === \"ArrowUp\" ? -1 : +1\n )\n ) % els.length)\n els[i].focus()\n }\n\n /* Prevent scrolling of page */\n key.claim()\n break\n\n /* All other keys: hand to search query */\n default:\n if (query !== getActiveElement())\n query.focus()\n }\n })\n\n /* Set up global keyboard handlers */\n keyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\"),\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Open search and select query */\n case \"f\":\n case \"s\":\n case \"/\":\n query.focus()\n query.select()\n\n /* Prevent scrolling of page */\n key.claim()\n break\n }\n })\n\n /* Create and return component */\n const query$ = mountSearchQuery(query, worker)\n const result$ = mountSearchResult(result, worker, { query$ })\n return merge(query$, result$)\n .pipe(\n mergeWith(\n\n /* Search sharing */\n ...getComponentElements(\"search-share\", el)\n .map(child => mountSearchShare(child, { query$ })),\n\n /* Search suggestions */\n ...getComponentElements(\"search-suggest\", el)\n .map(child => mountSearchSuggest(child, worker, { keyboard$ }))\n )\n )\n\n /* Gracefully handle broken search */\n } catch (err) {\n el.hidden = true\n return NEVER\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n ObservableInput,\n combineLatest,\n filter,\n map,\n startWith\n} from \"rxjs\"\n\nimport { getLocation } from \"~/browser\"\nimport {\n SearchIndex,\n setupSearchHighlighter\n} from \"~/integrations\"\nimport { h } from \"~/utilities\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlighting\n */\nexport interface SearchHighlight {\n nodes: Map /* Map of replacements */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n index$: ObservableInput /* Search index observable */\n location$: Observable /* Location observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search highlighting\n *\n * @param el - Content element\n * @param options - Options\n *\n * @returns Search highlighting component observable\n */\nexport function mountSearchHiglight(\n el: HTMLElement, { index$, location$ }: MountOptions\n): Observable> {\n return combineLatest([\n index$,\n location$\n .pipe(\n startWith(getLocation()),\n filter(url => !!url.searchParams.get(\"h\"))\n )\n ])\n .pipe(\n map(([index, url]) => setupSearchHighlighter(index.config, true)(\n url.searchParams.get(\"h\")!\n )),\n map(fn => {\n const nodes = new Map()\n\n /* Traverse text nodes and collect matches */\n const it = document.createNodeIterator(el, NodeFilter.SHOW_TEXT)\n for (let node = it.nextNode(); node; node = it.nextNode()) {\n if (node.parentElement?.offsetHeight) {\n const original = node.textContent!\n const replaced = fn(original)\n if (replaced.length > original.length)\n nodes.set(node as ChildNode, replaced)\n }\n }\n\n /* Replace original nodes with matches */\n for (const [node, text] of nodes) {\n const { childNodes } = h(\"span\", null, text)\n node.replaceWith(...Array.from(childNodes))\n }\n\n /* Return component */\n return { ref: el, nodes }\n })\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n animationFrameScheduler,\n auditTime,\n combineLatest,\n defer,\n distinctUntilChanged,\n finalize,\n map,\n observeOn,\n take,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\nimport {\n Viewport,\n getElement,\n getElementContainer,\n getElementOffset,\n getElementSize,\n getElements\n} from \"~/browser\"\n\nimport { Component } from \"../_\"\nimport { Header } from \"../header\"\nimport { Main } from \"../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Sidebar\n */\nexport interface Sidebar {\n height: number /* Sidebar height */\n locked: boolean /* Sidebar is locked */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n main$: Observable
    /* Main area observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n main$: Observable
    /* Main area observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch sidebar\n *\n * This function returns an observable that computes the visual parameters of\n * the sidebar which depends on the vertical viewport offset, as well as the\n * height of the main area. When the page is scrolled beyond the header, the\n * sidebar is locked and fills the remaining space.\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @returns Sidebar observable\n */\nexport function watchSidebar(\n el: HTMLElement, { viewport$, main$ }: WatchOptions\n): Observable {\n const parent = el.parentElement!\n const adjust =\n parent.offsetTop -\n parent.parentElement!.offsetTop\n\n /* Compute the sidebar's available height and if it should be locked */\n return combineLatest([main$, viewport$])\n .pipe(\n map(([{ offset, height }, { offset: { y } }]) => {\n height = height\n + Math.min(adjust, Math.max(0, y - offset))\n - adjust\n return {\n height,\n locked: y >= offset + adjust\n }\n }),\n distinctUntilChanged((a, b) => (\n a.height === b.height &&\n a.locked === b.locked\n ))\n )\n}\n\n/**\n * Mount sidebar\n *\n * This function doesn't set the height of the actual sidebar, but of its first\n * child \u2013 the `.md-sidebar__scrollwrap` element in order to mitigiate jittery\n * sidebars when the footer is scrolled into view. At some point we switched\n * from `absolute` / `fixed` positioning to `sticky` positioning, significantly\n * reducing jitter in some browsers (respectively Firefox and Safari) when\n * scrolling from the top. However, top-aligned sticky positioning means that\n * the sidebar snaps to the bottom when the end of the container is reached.\n * This is what leads to the mentioned jitter, as the sidebar's height may be\n * updated too slowly.\n *\n * This behaviour can be mitigiated by setting the height of the sidebar to `0`\n * while preserving the padding, and the height on its first element.\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @returns Sidebar component observable\n */\nexport function mountSidebar(\n el: HTMLElement, { header$, ...options }: MountOptions\n): Observable> {\n const inner = getElement(\".md-sidebar__scrollwrap\", el)\n const { y } = getElementOffset(inner)\n return defer(() => {\n const push$ = new Subject()\n push$\n .pipe(\n auditTime(0, animationFrameScheduler),\n withLatestFrom(header$)\n )\n .subscribe({\n\n /* Handle emission */\n next([{ height }, { height: offset }]) {\n inner.style.height = `${height - 2 * y}px`\n el.style.top = `${offset}px`\n },\n\n /* Handle complete */\n complete() {\n inner.style.height = \"\"\n el.style.top = \"\"\n }\n })\n\n /* Bring active item into view on initial load */\n push$\n .pipe(\n observeOn(animationFrameScheduler),\n take(1)\n )\n .subscribe(() => {\n for (const item of getElements(\".md-nav__link--active[href]\", el)) {\n const container = getElementContainer(item)\n if (typeof container !== \"undefined\") {\n const offset = item.offsetTop - container.offsetTop\n const { height } = getElementSize(container)\n container.scrollTo({\n top: offset - height / 2\n })\n }\n }\n })\n\n /* Create and return component */\n return watchSidebar(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Repo, User } from \"github-types\"\nimport {\n EMPTY,\n Observable,\n catchError,\n defaultIfEmpty,\n map,\n zip\n} from \"rxjs\"\n\nimport { requestJSON } from \"~/browser\"\n\nimport { SourceFacts } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * GitHub release (partial)\n */\ninterface Release {\n tag_name: string /* Tag name */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitHub repository facts\n *\n * @param user - GitHub user or organization\n * @param repo - GitHub repository\n *\n * @returns Repository facts observable\n */\nexport function fetchSourceFactsFromGitHub(\n user: string, repo?: string\n): Observable {\n if (typeof repo !== \"undefined\") {\n const url = `https://api.github.com/repos/${user}/${repo}`\n return zip(\n\n /* Fetch version */\n requestJSON(`${url}/releases/latest`)\n .pipe(\n catchError(() => EMPTY), // @todo refactor instant loading\n map(release => ({\n version: release.tag_name\n })),\n defaultIfEmpty({})\n ),\n\n /* Fetch stars and forks */\n requestJSON(url)\n .pipe(\n catchError(() => EMPTY), // @todo refactor instant loading\n map(info => ({\n stars: info.stargazers_count,\n forks: info.forks_count\n })),\n defaultIfEmpty({})\n )\n )\n .pipe(\n map(([release, info]) => ({ ...release, ...info }))\n )\n\n /* User or organization */\n } else {\n const url = `https://api.github.com/users/${user}`\n return requestJSON(url)\n .pipe(\n map(info => ({\n repositories: info.public_repos\n })),\n defaultIfEmpty({})\n )\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ProjectSchema } from \"gitlab\"\nimport {\n EMPTY,\n Observable,\n catchError,\n defaultIfEmpty,\n map\n} from \"rxjs\"\n\nimport { requestJSON } from \"~/browser\"\n\nimport { SourceFacts } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitLab repository facts\n *\n * @param base - GitLab base\n * @param project - GitLab project\n *\n * @returns Repository facts observable\n */\nexport function fetchSourceFactsFromGitLab(\n base: string, project: string\n): Observable {\n const url = `https://${base}/api/v4/projects/${encodeURIComponent(project)}`\n return requestJSON(url)\n .pipe(\n catchError(() => EMPTY), // @todo refactor instant loading\n map(({ star_count, forks_count }) => ({\n stars: star_count,\n forks: forks_count\n })),\n defaultIfEmpty({})\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { EMPTY, Observable } from \"rxjs\"\n\nimport { fetchSourceFactsFromGitHub } from \"../github\"\nimport { fetchSourceFactsFromGitLab } from \"../gitlab\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Repository facts for repositories\n */\nexport interface RepositoryFacts {\n stars?: number /* Number of stars */\n forks?: number /* Number of forks */\n version?: string /* Latest version */\n}\n\n/**\n * Repository facts for organizations\n */\nexport interface OrganizationFacts {\n repositories?: number /* Number of repositories */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Repository facts\n */\nexport type SourceFacts =\n | RepositoryFacts\n | OrganizationFacts\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch repository facts\n *\n * @param url - Repository URL\n *\n * @returns Repository facts observable\n */\nexport function fetchSourceFacts(\n url: string\n): Observable {\n\n /* Try to match GitHub repository */\n let match = url.match(/^.+github\\.com\\/([^/]+)\\/?([^/]+)?/i)\n if (match) {\n const [, user, repo] = match\n return fetchSourceFactsFromGitHub(user, repo)\n }\n\n /* Try to match GitLab repository */\n match = url.match(/^.+?([^/]*gitlab[^/]+)\\/(.+?)\\/?$/i)\n if (match) {\n const [, base, slug] = match\n return fetchSourceFactsFromGitLab(base, slug)\n }\n\n /* Fallback */\n return EMPTY\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n catchError,\n defer,\n filter,\n finalize,\n map,\n of,\n shareReplay,\n tap\n} from \"rxjs\"\n\nimport { getElement } from \"~/browser\"\nimport { ConsentDefaults } from \"~/components/consent\"\nimport { renderSourceFacts } from \"~/templates\"\n\nimport {\n Component,\n getComponentElements\n} from \"../../_\"\nimport {\n SourceFacts,\n fetchSourceFacts\n} from \"../facts\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Repository information\n */\nexport interface Source {\n facts: SourceFacts /* Repository facts */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Repository information observable\n */\nlet fetch$: Observable\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch repository information\n *\n * This function tries to read the repository facts from session storage, and\n * if unsuccessful, fetches them from the underlying provider.\n *\n * @param el - Repository information element\n *\n * @returns Repository information observable\n */\nexport function watchSource(\n el: HTMLAnchorElement\n): Observable {\n return fetch$ ||= defer(() => {\n const cached = __md_get(\"__source\", sessionStorage)\n if (cached) {\n return of(cached)\n } else {\n\n /* Check if consent is configured and was given */\n const els = getComponentElements(\"consent\")\n if (els.length) {\n const consent = __md_get(\"__consent\")\n if (!(consent && consent.github))\n return EMPTY\n }\n\n /* Fetch repository facts */\n return fetchSourceFacts(el.href)\n .pipe(\n tap(facts => __md_set(\"__source\", facts, sessionStorage))\n )\n }\n })\n .pipe(\n catchError(() => EMPTY),\n filter(facts => Object.keys(facts).length > 0),\n map(facts => ({ facts })),\n shareReplay(1)\n )\n}\n\n/**\n * Mount repository information\n *\n * @param el - Repository information element\n *\n * @returns Repository information component observable\n */\nexport function mountSource(\n el: HTMLAnchorElement\n): Observable> {\n const inner = getElement(\":scope > :last-child\", el)\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ facts }) => {\n inner.appendChild(renderSourceFacts(facts))\n inner.classList.add(\"md-source__repository--active\")\n })\n\n /* Create and return component */\n return watchSource(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n defer,\n distinctUntilKeyChanged,\n finalize,\n map,\n of,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n Viewport,\n watchElementSize,\n watchViewportAt\n} from \"~/browser\"\n\nimport { Component } from \"../_\"\nimport { Header } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Navigation tabs\n */\nexport interface Tabs {\n hidden: boolean /* Navigation tabs are hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch navigation tabs\n *\n * @param el - Navigation tabs element\n * @param options - Options\n *\n * @returns Navigation tabs observable\n */\nexport function watchTabs(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n return watchElementSize(document.body)\n .pipe(\n switchMap(() => watchViewportAt(el, { header$, viewport$ })),\n map(({ offset: { y } }) => {\n return {\n hidden: y >= 10\n }\n }),\n distinctUntilKeyChanged(\"hidden\")\n )\n}\n\n/**\n * Mount navigation tabs\n *\n * This function hides the navigation tabs when scrolling past the threshold\n * and makes them reappear in a nice CSS animation when scrolling back up.\n *\n * @param el - Navigation tabs element\n * @param options - Options\n *\n * @returns Navigation tabs component observable\n */\nexport function mountTabs(\n el: HTMLElement, options: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe({\n\n /* Handle emission */\n next({ hidden }) {\n el.hidden = hidden\n },\n\n /* Handle complete */\n complete() {\n el.hidden = false\n }\n })\n\n /* Create and return component */\n return (\n feature(\"navigation.tabs.sticky\")\n ? of({ hidden: false })\n : watchTabs(el, options)\n )\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n combineLatestWith,\n debounceTime,\n defer,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n finalize,\n map,\n merge,\n of,\n repeat,\n scan,\n share,\n skip,\n startWith,\n switchMap,\n takeLast,\n takeUntil,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n Viewport,\n getElement,\n getElementContainer,\n getElementSize,\n getElements,\n getLocation,\n getOptionalElement,\n watchElementSize\n} from \"~/browser\"\n\nimport {\n Component,\n getComponentElement\n} from \"../_\"\nimport { Header } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Table of contents\n */\nexport interface TableOfContents {\n prev: HTMLAnchorElement[][] /* Anchors (previous) */\n next: HTMLAnchorElement[][] /* Anchors (next) */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n target$: Observable /* Location target observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch table of contents\n *\n * This is effectively a scroll spy implementation which will account for the\n * fixed header and automatically re-calculate anchor offsets when the viewport\n * is resized. The returned observable will only emit if the table of contents\n * needs to be repainted.\n *\n * This implementation tracks an anchor element's entire path starting from its\n * level up to the top-most anchor element, e.g. `[h3, h2, h1]`. Although the\n * Material theme currently doesn't make use of this information, it enables\n * the styling of the entire hierarchy through customization.\n *\n * Note that the current anchor is the last item of the `prev` anchor list.\n *\n * @param el - Table of contents element\n * @param options - Options\n *\n * @returns Table of contents observable\n */\nexport function watchTableOfContents(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n const table = new Map()\n\n /* Compute anchor-to-target mapping */\n const anchors = getElements(\"[href^=\\\\#]\", el)\n for (const anchor of anchors) {\n const id = decodeURIComponent(anchor.hash.substring(1))\n const target = getOptionalElement(`[id=\"${id}\"]`)\n if (typeof target !== \"undefined\")\n table.set(anchor, target)\n }\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n distinctUntilKeyChanged(\"height\"),\n map(({ height }) => {\n const main = getComponentElement(\"main\")\n const grid = getElement(\":scope > :first-child\", main)\n return height + 0.8 * (\n grid.offsetTop -\n main.offsetTop\n )\n }),\n share()\n )\n\n /* Compute partition of previous and next anchors */\n const partition$ = watchElementSize(document.body)\n .pipe(\n distinctUntilKeyChanged(\"height\"),\n\n /* Build index to map anchor paths to vertical offsets */\n switchMap(body => defer(() => {\n let path: HTMLAnchorElement[] = []\n return of([...table].reduce((index, [anchor, target]) => {\n while (path.length) {\n const last = table.get(path[path.length - 1])!\n if (last.tagName >= target.tagName) {\n path.pop()\n } else {\n break\n }\n }\n\n /* If the current anchor is hidden, continue with its parent */\n let offset = target.offsetTop\n while (!offset && target.parentElement) {\n target = target.parentElement\n offset = target.offsetTop\n }\n\n /* Map reversed anchor path to vertical offset */\n return index.set(\n [...path = [...path, anchor]].reverse(),\n offset\n )\n }, new Map()))\n })\n .pipe(\n\n /* Sort index by vertical offset (see https://bit.ly/30z6QSO) */\n map(index => new Map([...index].sort(([, a], [, b]) => a - b))),\n combineLatestWith(adjust$),\n\n /* Re-compute partition when viewport offset changes */\n switchMap(([index, adjust]) => viewport$\n .pipe(\n scan(([prev, next], { offset: { y }, size }) => {\n const last = y + size.height >= Math.floor(body.height)\n\n /* Look forward */\n while (next.length) {\n const [, offset] = next[0]\n if (offset - adjust < y || last) {\n prev = [...prev, next.shift()!]\n } else {\n break\n }\n }\n\n /* Look backward */\n while (prev.length) {\n const [, offset] = prev[prev.length - 1]\n if (offset - adjust >= y && !last) {\n next = [prev.pop()!, ...next]\n } else {\n break\n }\n }\n\n /* Return partition */\n return [prev, next]\n }, [[], [...index]]),\n distinctUntilChanged((a, b) => (\n a[0] === b[0] &&\n a[1] === b[1]\n ))\n )\n )\n )\n )\n )\n\n /* Compute and return anchor list migrations */\n return partition$\n .pipe(\n map(([prev, next]) => ({\n prev: prev.map(([path]) => path),\n next: next.map(([path]) => path)\n })),\n\n /* Extract anchor list migrations */\n startWith({ prev: [], next: [] }),\n bufferCount(2, 1),\n map(([a, b]) => {\n\n /* Moving down */\n if (a.prev.length < b.prev.length) {\n return {\n prev: b.prev.slice(Math.max(0, a.prev.length - 1), b.prev.length),\n next: []\n }\n\n /* Moving up */\n } else {\n return {\n prev: b.prev.slice(-1),\n next: b.next.slice(0, b.next.length - a.next.length)\n }\n }\n })\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount table of contents\n *\n * @param el - Table of contents element\n * @param options - Options\n *\n * @returns Table of contents component observable\n */\nexport function mountTableOfContents(\n el: HTMLElement, { viewport$, header$, target$ }: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n push$.subscribe(({ prev, next }) => {\n\n /* Look forward */\n for (const [anchor] of next) {\n anchor.classList.remove(\"md-nav__link--passed\")\n anchor.classList.remove(\"md-nav__link--active\")\n }\n\n /* Look backward */\n for (const [index, [anchor]] of prev.entries()) {\n anchor.classList.add(\"md-nav__link--passed\")\n anchor.classList.toggle(\n \"md-nav__link--active\",\n index === prev.length - 1\n )\n }\n })\n\n /* Set up following, if enabled */\n if (feature(\"toc.follow\")) {\n\n /* Toggle smooth scrolling only for anchor clicks */\n const smooth$ = merge(\n viewport$.pipe(debounceTime(1), map(() => undefined)),\n viewport$.pipe(debounceTime(250), map(() => \"smooth\" as const))\n )\n\n /* Bring active anchor into view */\n push$\n .pipe(\n filter(({ prev }) => prev.length > 0),\n withLatestFrom(smooth$)\n )\n .subscribe(([{ prev }, behavior]) => {\n const [anchor] = prev[prev.length - 1]\n if (anchor.offsetHeight) {\n\n /* Retrieve overflowing container and scroll */\n const container = getElementContainer(anchor)\n if (typeof container !== \"undefined\") {\n const offset = anchor.offsetTop - container.offsetTop\n const { height } = getElementSize(container)\n container.scrollTo({\n top: offset - height / 2,\n behavior\n })\n }\n }\n })\n }\n\n /* Set up anchor tracking, if enabled */\n if (feature(\"navigation.tracking\"))\n viewport$\n .pipe(\n takeUntil(done$),\n distinctUntilKeyChanged(\"offset\"),\n debounceTime(250),\n skip(1),\n takeUntil(target$.pipe(skip(1))),\n repeat({ delay: 250 }),\n withLatestFrom(push$)\n )\n .subscribe(([, { prev }]) => {\n const url = getLocation()\n\n /* Set hash fragment to active anchor */\n const anchor = prev[prev.length - 1]\n if (anchor && anchor.length) {\n const [active] = anchor\n const { hash } = new URL(active.href)\n if (url.hash !== hash) {\n url.hash = hash\n history.replaceState({}, \"\", `${url}`)\n }\n\n /* Reset anchor when at the top */\n } else {\n url.hash = \"\"\n history.replaceState({}, \"\", `${url}`)\n }\n })\n\n /* Create and return component */\n return watchTableOfContents(el, { viewport$, header$ })\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n combineLatest,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n endWith,\n finalize,\n map,\n repeat,\n skip,\n takeLast,\n takeUntil,\n tap\n} from \"rxjs\"\n\nimport { Viewport } from \"~/browser\"\n\nimport { Component } from \"../_\"\nimport { Header } from \"../header\"\nimport { Main } from \"../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Back-to-top button\n */\nexport interface BackToTop {\n hidden: boolean /* Back-to-top button is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n main$: Observable
    /* Main area observable */\n target$: Observable /* Location target observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n main$: Observable
    /* Main area observable */\n target$: Observable /* Location target observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch back-to-top\n *\n * @param _el - Back-to-top element\n * @param options - Options\n *\n * @returns Back-to-top observable\n */\nexport function watchBackToTop(\n _el: HTMLElement, { viewport$, main$, target$ }: WatchOptions\n): Observable {\n\n /* Compute direction */\n const direction$ = viewport$\n .pipe(\n map(({ offset: { y } }) => y),\n bufferCount(2, 1),\n map(([a, b]) => a > b && b > 0),\n distinctUntilChanged()\n )\n\n /* Compute whether main area is active */\n const active$ = main$\n .pipe(\n map(({ active }) => active)\n )\n\n /* Compute threshold for hiding */\n return combineLatest([active$, direction$])\n .pipe(\n map(([active, direction]) => !(active && direction)),\n distinctUntilChanged(),\n takeUntil(target$.pipe(skip(1))),\n endWith(true),\n repeat({ delay: 250 }),\n map(hidden => ({ hidden }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount back-to-top\n *\n * @param el - Back-to-top element\n * @param options - Options\n *\n * @returns Back-to-top component observable\n */\nexport function mountBackToTop(\n el: HTMLElement, { viewport$, header$, main$, target$ }: MountOptions\n): Observable> {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n push$.subscribe({\n\n /* Handle emission */\n next({ hidden }) {\n el.hidden = hidden\n if (hidden) {\n el.setAttribute(\"tabindex\", \"-1\")\n el.blur()\n } else {\n el.removeAttribute(\"tabindex\")\n }\n },\n\n /* Handle complete */\n complete() {\n el.style.top = \"\"\n el.hidden = true\n el.removeAttribute(\"tabindex\")\n }\n })\n\n /* Watch header height */\n header$\n .pipe(\n takeUntil(done$),\n distinctUntilKeyChanged(\"height\")\n )\n .subscribe(({ height }) => {\n el.style.top = `${height + 16}px`\n })\n\n /* Create and return component */\n return watchBackToTop(el, { viewport$, main$, target$ })\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n mergeMap,\n switchMap,\n takeWhile,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\nimport { getElements } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n document$: Observable /* Document observable */\n tablet$: Observable /* Media tablet observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch indeterminate checkboxes\n *\n * This function replaces the indeterminate \"pseudo state\" with the actual\n * indeterminate state, which is used to keep navigation always expanded.\n *\n * @param options - Options\n */\nexport function patchIndeterminate(\n { document$, tablet$ }: PatchOptions\n): void {\n document$\n .pipe(\n switchMap(() => getElements(\n // @todo `data-md-state` is deprecated and removed in v9\n \".md-toggle--indeterminate, [data-md-state=indeterminate]\"\n )),\n tap(el => {\n el.indeterminate = true\n el.checked = false\n }),\n mergeMap(el => fromEvent(el, \"change\")\n .pipe(\n takeWhile(() => el.classList.contains(\"md-toggle--indeterminate\")),\n map(() => el)\n )\n ),\n withLatestFrom(tablet$)\n )\n .subscribe(([el, tablet]) => {\n el.classList.remove(\"md-toggle--indeterminate\")\n if (tablet)\n el.checked = false\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n filter,\n fromEvent,\n map,\n mergeMap,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport { getElements } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n document$: Observable /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether the given device is an Apple device\n *\n * @returns Test result\n */\nfunction isAppleDevice(): boolean {\n return /(iPad|iPhone|iPod)/.test(navigator.userAgent)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all elements with `data-md-scrollfix` attributes\n *\n * This is a year-old patch which ensures that overflow scrolling works at the\n * top and bottom of containers on iOS by ensuring a `1px` scroll offset upon\n * the start of a touch event.\n *\n * @see https://bit.ly/2SCtAOO - Original source\n *\n * @param options - Options\n */\nexport function patchScrollfix(\n { document$ }: PatchOptions\n): void {\n document$\n .pipe(\n switchMap(() => getElements(\"[data-md-scrollfix]\")),\n tap(el => el.removeAttribute(\"data-md-scrollfix\")),\n filter(isAppleDevice),\n mergeMap(el => fromEvent(el, \"touchstart\")\n .pipe(\n map(() => el)\n )\n )\n )\n .subscribe(el => {\n const top = el.scrollTop\n\n /* We're at the top of the container */\n if (top === 0) {\n el.scrollTop = 1\n\n /* We're at the bottom of the container */\n } else if (top + el.offsetHeight === el.scrollHeight) {\n el.scrollTop = top - 1\n }\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n delay,\n map,\n of,\n switchMap,\n withLatestFrom\n} from \"rxjs\"\n\nimport {\n Viewport,\n watchToggle\n} from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n viewport$: Observable /* Viewport observable */\n tablet$: Observable /* Media tablet observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch the document body to lock when search is open\n *\n * For mobile and tablet viewports, the search is rendered full screen, which\n * leads to scroll leaking when at the top or bottom of the search result. This\n * function locks the body when the search is in full screen mode, and restores\n * the scroll position when leaving.\n *\n * @param options - Options\n */\nexport function patchScrolllock(\n { viewport$, tablet$ }: PatchOptions\n): void {\n combineLatest([watchToggle(\"search\"), tablet$])\n .pipe(\n map(([active, tablet]) => active && !tablet),\n switchMap(active => of(active)\n .pipe(\n delay(active ? 400 : 100)\n )\n ),\n withLatestFrom(viewport$)\n )\n .subscribe(([active, { offset: { y }}]) => {\n if (active) {\n document.body.setAttribute(\"data-md-scrolllock\", \"\")\n document.body.style.top = `-${y}px`\n } else {\n const value = -1 * parseInt(document.body.style.top, 10)\n document.body.removeAttribute(\"data-md-scrolllock\")\n document.body.style.top = \"\"\n if (value)\n window.scrollTo(0, value)\n }\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Polyfills\n * ------------------------------------------------------------------------- */\n\n/* Polyfill `Object.entries` */\nif (!Object.entries)\n Object.entries = function (obj: object) {\n const data: [string, string][] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push([key, obj[key]])\n\n /* Return entries */\n return data\n }\n\n/* Polyfill `Object.values` */\nif (!Object.values)\n Object.values = function (obj: object) {\n const data: string[] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push(obj[key])\n\n /* Return values */\n return data\n }\n\n/* ------------------------------------------------------------------------- */\n\n/* Polyfills for `Element` */\nif (typeof Element !== \"undefined\") {\n\n /* Polyfill `Element.scrollTo` */\n if (!Element.prototype.scrollTo)\n Element.prototype.scrollTo = function (\n x?: ScrollToOptions | number, y?: number\n ): void {\n if (typeof x === \"object\") {\n this.scrollLeft = x.left!\n this.scrollTop = x.top!\n } else {\n this.scrollLeft = x!\n this.scrollTop = y!\n }\n }\n\n /* Polyfill `Element.replaceWith` */\n if (!Element.prototype.replaceWith)\n Element.prototype.replaceWith = function (\n ...nodes: Array\n ): void {\n const parent = this.parentNode\n if (parent) {\n if (nodes.length === 0)\n parent.removeChild(this)\n\n /* Replace children and create text nodes */\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i]\n if (typeof node === \"string\")\n node = document.createTextNode(node)\n else if (node.parentNode)\n node.parentNode.removeChild(node)\n\n /* Replace child or insert before previous sibling */\n if (!i)\n parent.replaceChild(node, this)\n else\n parent.insertBefore(this.previousSibling!, node)\n }\n }\n }\n}\n"], + "mappings": "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", + "names": ["require_focus_visible", "__commonJSMin", "exports", "module", "global", "factory", "applyFocusVisiblePolyfill", "scope", "hadKeyboardEvent", "hadFocusVisibleRecently", "hadFocusVisibleRecentlyTimeout", "inputTypesAllowlist", "isValidFocusTarget", "el", "focusTriggersKeyboardModality", "type", "tagName", "addFocusVisibleClass", "removeFocusVisibleClass", "onKeyDown", "e", "onPointerDown", "onFocus", "onBlur", "onVisibilityChange", "addInitialPointerMoveListeners", "onInitialPointerMove", "removeInitialPointerMoveListeners", "event", "error", "require_url_polyfill", "__commonJSMin", "exports", "global", "checkIfIteratorIsSupported", "error", "iteratorSupported", "createIterator", "items", "iterator", "value", "serializeParam", "deserializeParam", "polyfillURLSearchParams", "URLSearchParams", "searchString", "typeofSearchString", "_this", "name", "i", "entry", "key", "proto", "callback", "thisArg", "entries", "searchArray", "checkIfURLSearchParamsSupported", "e", "a", "b", "keys", "attributes", "attribute", "checkIfURLIsSupported", "u", "polyfillURL", "_URL", "URL", "url", "base", "doc", "baseElement", "err", "anchorElement", "inputElement", "searchParams", "enableSearchUpdate", "enableSearchParamsUpdate", "methodName", "method", "search", "linkURLWithAnchorAttribute", "attributeName", "expectedPort", "addPortToOrigin", "blob", "getOrigin", "require_tslib", "__commonJSMin", "exports", "module", "__extends", "__assign", "__rest", "__decorate", "__param", "__metadata", "__awaiter", "__generator", "__exportStar", "__values", "__read", "__spread", "__spreadArrays", "__spreadArray", "__await", "__asyncGenerator", "__asyncDelegator", "__asyncValues", "__makeTemplateObject", "__importStar", "__importDefault", "__classPrivateFieldGet", "__classPrivateFieldSet", "__createBinding", "factory", "root", "createExporter", "previous", "id", "v", "exporter", "extendStatics", "d", "b", "p", "__", "t", "s", "n", "e", "i", "decorators", "target", "key", "desc", "c", "r", "paramIndex", "decorator", "metadataKey", "metadataValue", "thisArg", "_arguments", "P", "generator", "adopt", "value", "resolve", "reject", "fulfilled", "step", "rejected", "result", "body", "_", "f", "y", "g", "verb", "op", "m", "o", "k", "k2", "ar", "error", "il", "a", "j", "jl", "to", "from", "pack", "l", "q", "resume", "settle", "fulfill", "cooked", "raw", "__setModuleDefault", "mod", "receiver", "state", "kind", "require_clipboard", "__commonJSMin", "exports", "module", "root", "factory", "__webpack_modules__", "__unused_webpack_module", "__webpack_exports__", "__webpack_require__", "clipboard", "tiny_emitter", "tiny_emitter_default", "listen", "listen_default", "src_select", "select_default", "command", "type", "err", "ClipboardActionCut", "target", "selectedText", "actions_cut", "createFakeElement", "value", "isRTL", "fakeElement", "yPosition", "fakeCopyAction", "options", "ClipboardActionCopy", "actions_copy", "_typeof", "obj", "ClipboardActionDefault", "_options$action", "action", "container", "text", "actions_default", "clipboard_typeof", "_classCallCheck", "instance", "Constructor", "_defineProperties", "props", "i", "descriptor", "_createClass", "protoProps", "staticProps", "_inherits", "subClass", "superClass", "_setPrototypeOf", "o", "p", "_createSuper", "Derived", "hasNativeReflectConstruct", "_isNativeReflectConstruct", "Super", "_getPrototypeOf", "result", "NewTarget", "_possibleConstructorReturn", "self", "call", "_assertThisInitialized", "e", "getAttributeValue", "suffix", "element", "attribute", "Clipboard", "_Emitter", "_super", "trigger", "_this", "_this2", "selector", "actions", "support", "DOCUMENT_NODE_TYPE", "proto", "closest", "__unused_webpack_exports", "_delegate", "callback", "useCapture", "listenerFn", "listener", "delegate", "elements", "is", "listenNode", "listenNodeList", "listenSelector", "node", "nodeList", "select", "isReadOnly", "selection", "range", "E", "name", "ctx", "data", "evtArr", "len", "evts", "liveEvents", "__webpack_module_cache__", "moduleId", "getter", "definition", "key", "prop", "require_escape_html", "__commonJSMin", "exports", "module", "matchHtmlRegExp", "escapeHtml", "string", "str", "match", "escape", "html", "index", "lastIndex", "r", "a", "e", "import_focus_visible", "n", "t", "s", "r", "o", "u", "i", "a", "e", "c", "import_url_polyfill", "import_tslib", "__extends", "__assign", "__rest", "__decorate", "__param", "__metadata", "__awaiter", "__generator", "__exportStar", "__createBinding", "__values", "__read", "__spread", "__spreadArrays", "__spreadArray", "__await", "__asyncGenerator", "__asyncDelegator", "__asyncValues", "__makeTemplateObject", "__importStar", "__importDefault", "__classPrivateFieldGet", "__classPrivateFieldSet", "tslib", "isFunction", "value", "createErrorClass", "createImpl", "_super", "instance", "ctorFunc", "UnsubscriptionError", "createErrorClass", "_super", "errors", "err", "i", "arrRemove", "arr", "item", "index", "Subscription", "initialTeardown", "errors", "_parentage", "_parentage_1", "__values", "_parentage_1_1", "parent_1", "initialFinalizer", "isFunction", "e", "UnsubscriptionError", "_finalizers", "_finalizers_1", "_finalizers_1_1", "finalizer", "execFinalizer", "err", "__spreadArray", "__read", "teardown", "_a", "parent", "arrRemove", "empty", "EMPTY_SUBSCRIPTION", "Subscription", "isSubscription", "value", "isFunction", "execFinalizer", "finalizer", "config", "timeoutProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "reportUnhandledError", "err", "timeoutProvider", "onUnhandledError", "config", "noop", "COMPLETE_NOTIFICATION", "createNotification", "errorNotification", "error", "nextNotification", "value", "kind", "context", "errorContext", "cb", "config", "isRoot", "_a", "errorThrown", "error", "captureError", "err", "Subscriber", "_super", "__extends", "destination", "_this", "isSubscription", "EMPTY_OBSERVER", "next", "error", "complete", "SafeSubscriber", "value", "handleStoppedNotification", "nextNotification", "err", "errorNotification", "COMPLETE_NOTIFICATION", "Subscription", "_bind", "bind", "fn", "thisArg", "ConsumerObserver", "partialObserver", "value", "error", "handleUnhandledError", "err", "SafeSubscriber", "_super", "__extends", "observerOrNext", "complete", "_this", "isFunction", "context_1", "config", "Subscriber", "handleUnhandledError", "error", "config", "captureError", "reportUnhandledError", "defaultErrorHandler", "err", "handleStoppedNotification", "notification", "subscriber", "onStoppedNotification", "timeoutProvider", "EMPTY_OBSERVER", "noop", "observable", "identity", "x", "pipe", "fns", "_i", "pipeFromArray", "identity", "input", "prev", "fn", "Observable", "subscribe", "operator", "observable", "observerOrNext", "error", "complete", "_this", "subscriber", "isSubscriber", "SafeSubscriber", "errorContext", "_a", "source", "sink", "err", "next", "promiseCtor", "getPromiseCtor", "resolve", "reject", "value", "operations", "_i", "pipeFromArray", "x", "getPromiseCtor", "promiseCtor", "_a", "config", "isObserver", "value", "isFunction", "isSubscriber", "Subscriber", "isSubscription", "hasLift", "source", "isFunction", "operate", "init", "liftedSource", "err", "createOperatorSubscriber", "destination", "onNext", "onComplete", "onError", "onFinalize", "OperatorSubscriber", "_super", "__extends", "shouldUnsubscribe", "_this", "value", "err", "closed_1", "_a", "Subscriber", "animationFrameProvider", "callback", "request", "cancel", "delegate", "handle", "timestamp", "Subscription", "args", "_i", "__spreadArray", "__read", "ObjectUnsubscribedError", "createErrorClass", "_super", "Subject", "_super", "__extends", "_this", "operator", "subject", "AnonymousSubject", "ObjectUnsubscribedError", "value", "errorContext", "_b", "__values", "_c", "observer", "err", "observers", "_a", "subscriber", "hasError", "isStopped", "EMPTY_SUBSCRIPTION", "Subscription", "arrRemove", "thrownError", "observable", "Observable", "destination", "source", "AnonymousSubject", "_super", "__extends", "destination", "source", "_this", "value", "_b", "_a", "err", "subscriber", "EMPTY_SUBSCRIPTION", "Subject", "dateTimestampProvider", "ReplaySubject", "_super", "__extends", "_bufferSize", "_windowTime", "_timestampProvider", "dateTimestampProvider", "_this", "value", "_a", "isStopped", "_buffer", "_infiniteTimeWindow", "subscriber", "subscription", "copy", "i", "adjustedBufferSize", "now", "last", "Subject", "Action", "_super", "__extends", "scheduler", "work", "state", "delay", "Subscription", "intervalProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "AsyncAction", "_super", "__extends", "scheduler", "work", "_this", "state", "delay", "id", "_a", "_id", "intervalProvider", "_scheduler", "error", "_delay", "errored", "errorValue", "e", "actions", "arrRemove", "Action", "Scheduler", "schedulerActionCtor", "now", "work", "delay", "state", "dateTimestampProvider", "AsyncScheduler", "_super", "__extends", "SchedulerAction", "now", "Scheduler", "_this", "action", "actions", "error", "asyncScheduler", "AsyncScheduler", "AsyncAction", "async", "AnimationFrameAction", "_super", "__extends", "scheduler", "work", "_this", "id", "delay", "animationFrameProvider", "actions", "_a", "AsyncAction", "AnimationFrameScheduler", "_super", "__extends", "action", "flushId", "actions", "error", "AsyncScheduler", "animationFrameScheduler", "AnimationFrameScheduler", "AnimationFrameAction", "EMPTY", "Observable", "subscriber", "isScheduler", "value", "isFunction", "last", "arr", "popResultSelector", "args", "isFunction", "popScheduler", "isScheduler", "popNumber", "defaultValue", "isArrayLike", "x", "isPromise", "value", "isFunction", "isInteropObservable", "input", "isFunction", "observable", "isAsyncIterable", "obj", "isFunction", "createInvalidObservableTypeError", "input", "getSymbolIterator", "iterator", "isIterable", "input", "isFunction", "iterator", "readableStreamLikeToAsyncGenerator", "readableStream", "reader", "__await", "_a", "_b", "value", "done", "isReadableStreamLike", "obj", "isFunction", "innerFrom", "input", "Observable", "isInteropObservable", "fromInteropObservable", "isArrayLike", "fromArrayLike", "isPromise", "fromPromise", "isAsyncIterable", "fromAsyncIterable", "isIterable", "fromIterable", "isReadableStreamLike", "fromReadableStreamLike", "createInvalidObservableTypeError", "obj", "subscriber", "obs", "observable", "isFunction", "array", "i", "promise", "value", "err", "reportUnhandledError", "iterable", "iterable_1", "__values", "iterable_1_1", "asyncIterable", "process", "readableStream", "readableStreamLikeToAsyncGenerator", "asyncIterable_1", "__asyncValues", "asyncIterable_1_1", "executeSchedule", "parentSubscription", "scheduler", "work", "delay", "repeat", "scheduleSubscription", "observeOn", "scheduler", "delay", "operate", "source", "subscriber", "createOperatorSubscriber", "value", "executeSchedule", "err", "subscribeOn", "scheduler", "delay", "operate", "source", "subscriber", "scheduleObservable", "input", "scheduler", "innerFrom", "subscribeOn", "observeOn", "schedulePromise", "input", "scheduler", "innerFrom", "subscribeOn", "observeOn", "scheduleArray", "input", "scheduler", "Observable", "subscriber", "i", "scheduleIterable", "input", "scheduler", "Observable", "subscriber", "iterator", "executeSchedule", "value", "done", "_a", "err", "isFunction", "scheduleAsyncIterable", "input", "scheduler", "Observable", "subscriber", "executeSchedule", "iterator", "result", "scheduleReadableStreamLike", "input", "scheduler", "scheduleAsyncIterable", "readableStreamLikeToAsyncGenerator", "scheduled", "input", "scheduler", "isInteropObservable", "scheduleObservable", "isArrayLike", "scheduleArray", "isPromise", "schedulePromise", "isAsyncIterable", "scheduleAsyncIterable", "isIterable", "scheduleIterable", "isReadableStreamLike", "scheduleReadableStreamLike", "createInvalidObservableTypeError", "from", "input", "scheduler", "scheduled", "innerFrom", "of", "args", "_i", "scheduler", "popScheduler", "from", "throwError", "errorOrErrorFactory", "scheduler", "errorFactory", "isFunction", "init", "subscriber", "Observable", "isValidDate", "value", "map", "project", "thisArg", "operate", "source", "subscriber", "index", "createOperatorSubscriber", "value", "isArray", "callOrApply", "fn", "args", "__spreadArray", "__read", "mapOneOrManyArgs", "map", "isArray", "getPrototypeOf", "objectProto", "getKeys", "argsArgArrayOrObject", "args", "first_1", "isPOJO", "keys", "key", "obj", "createObject", "keys", "values", "result", "key", "i", "combineLatest", "args", "_i", "scheduler", "popScheduler", "resultSelector", "popResultSelector", "_a", "argsArgArrayOrObject", "observables", "keys", "from", "result", "Observable", "combineLatestInit", "values", "createObject", "identity", "mapOneOrManyArgs", "valueTransform", "subscriber", "maybeSchedule", "length", "active", "remainingFirstValues", "i", "source", "hasFirstValue", "createOperatorSubscriber", "value", "execute", "subscription", "executeSchedule", "mergeInternals", "source", "subscriber", "project", "concurrent", "onBeforeNext", "expand", "innerSubScheduler", "additionalFinalizer", "buffer", "active", "index", "isComplete", "checkComplete", "outerNext", "value", "doInnerSub", "innerComplete", "innerFrom", "createOperatorSubscriber", "innerValue", "bufferedValue", "executeSchedule", "err", "mergeMap", "project", "resultSelector", "concurrent", "isFunction", "a", "i", "map", "b", "ii", "innerFrom", "operate", "source", "subscriber", "mergeInternals", "mergeAll", "concurrent", "mergeMap", "identity", "concatAll", "mergeAll", "concat", "args", "_i", "concatAll", "from", "popScheduler", "defer", "observableFactory", "Observable", "subscriber", "innerFrom", "nodeEventEmitterMethods", "eventTargetMethods", "jqueryMethods", "fromEvent", "target", "eventName", "options", "resultSelector", "isFunction", "mapOneOrManyArgs", "_a", "__read", "isEventTarget", "methodName", "handler", "isNodeStyleEventEmitter", "toCommonHandlerRegistry", "isJQueryStyleEventEmitter", "add", "remove", "isArrayLike", "mergeMap", "subTarget", "innerFrom", "Observable", "subscriber", "args", "_i", "fromEventPattern", "addHandler", "removeHandler", "resultSelector", "mapOneOrManyArgs", "Observable", "subscriber", "handler", "e", "_i", "retValue", "isFunction", "timer", "dueTime", "intervalOrScheduler", "scheduler", "async", "intervalDuration", "isScheduler", "Observable", "subscriber", "due", "isValidDate", "n", "merge", "args", "_i", "scheduler", "popScheduler", "concurrent", "popNumber", "sources", "innerFrom", "mergeAll", "from", "EMPTY", "NEVER", "Observable", "noop", "isArray", "argsOrArgArray", "args", "filter", "predicate", "thisArg", "operate", "source", "subscriber", "index", "createOperatorSubscriber", "value", "zip", "args", "_i", "resultSelector", "popResultSelector", "sources", "argsOrArgArray", "Observable", "subscriber", "buffers", "completed", "sourceIndex", "innerFrom", "createOperatorSubscriber", "value", "buffer", "result", "__spreadArray", "__read", "i", "EMPTY", "audit", "durationSelector", "operate", "source", "subscriber", "hasValue", "lastValue", "durationSubscriber", "isComplete", "endDuration", "value", "cleanupDuration", "createOperatorSubscriber", "innerFrom", "auditTime", "duration", "scheduler", "asyncScheduler", "audit", "timer", "bufferCount", "bufferSize", "startBufferEvery", "operate", "source", "subscriber", "buffers", "count", "createOperatorSubscriber", "value", "toEmit", "buffers_1", "__values", "buffers_1_1", "buffer", "toEmit_1", "toEmit_1_1", "arrRemove", "buffers_2", "buffers_2_1", "catchError", "selector", "operate", "source", "subscriber", "innerSub", "syncUnsub", "handledResult", "createOperatorSubscriber", "err", "innerFrom", "scanInternals", "accumulator", "seed", "hasSeed", "emitOnNext", "emitBeforeComplete", "source", "subscriber", "hasState", "state", "index", "createOperatorSubscriber", "value", "i", "combineLatest", "args", "_i", "resultSelector", "popResultSelector", "pipe", "__spreadArray", "__read", "mapOneOrManyArgs", "operate", "source", "subscriber", "combineLatestInit", "argsOrArgArray", "combineLatestWith", "otherSources", "_i", "combineLatest", "__spreadArray", "__read", "concatMap", "project", "resultSelector", "isFunction", "mergeMap", "debounceTime", "dueTime", "scheduler", "asyncScheduler", "operate", "source", "subscriber", "activeTask", "lastValue", "lastTime", "emit", "value", "emitWhenIdle", "targetTime", "now", "createOperatorSubscriber", "defaultIfEmpty", "defaultValue", "operate", "source", "subscriber", "hasValue", "createOperatorSubscriber", "value", "take", "count", "EMPTY", "operate", "source", "subscriber", "seen", "createOperatorSubscriber", "value", "ignoreElements", "operate", "source", "subscriber", "createOperatorSubscriber", "noop", "mapTo", "value", "map", "delayWhen", "delayDurationSelector", "subscriptionDelay", "source", "concat", "take", "ignoreElements", "mergeMap", "value", "index", "mapTo", "delay", "due", "scheduler", "asyncScheduler", "duration", "timer", "delayWhen", "distinctUntilChanged", "comparator", "keySelector", "identity", "defaultCompare", "operate", "source", "subscriber", "previousKey", "first", "createOperatorSubscriber", "value", "currentKey", "a", "b", "distinctUntilKeyChanged", "key", "compare", "distinctUntilChanged", "x", "y", "endWith", "values", "_i", "source", "concat", "of", "__spreadArray", "__read", "finalize", "callback", "operate", "source", "subscriber", "takeLast", "count", "EMPTY", "operate", "source", "subscriber", "buffer", "createOperatorSubscriber", "value", "buffer_1", "__values", "buffer_1_1", "merge", "args", "_i", "scheduler", "popScheduler", "concurrent", "popNumber", "argsOrArgArray", "operate", "source", "subscriber", "mergeAll", "from", "__spreadArray", "__read", "mergeWith", "otherSources", "_i", "merge", "__spreadArray", "__read", "repeat", "countOrConfig", "count", "delay", "_a", "EMPTY", "operate", "source", "subscriber", "soFar", "sourceSub", "resubscribe", "notifier", "timer", "innerFrom", "notifierSubscriber_1", "createOperatorSubscriber", "subscribeToSource", "syncUnsub", "sample", "notifier", "operate", "source", "subscriber", "hasValue", "lastValue", "createOperatorSubscriber", "value", "noop", "scan", "accumulator", "seed", "operate", "scanInternals", "share", "options", "_a", "connector", "Subject", "_b", "resetOnError", "_c", "resetOnComplete", "_d", "resetOnRefCountZero", "wrapperSource", "connection", "resetConnection", "subject", "refCount", "hasCompleted", "hasErrored", "cancelReset", "reset", "resetAndUnsubscribe", "conn", "operate", "source", "subscriber", "dest", "handleReset", "SafeSubscriber", "value", "err", "innerFrom", "on", "args", "_i", "onSubscriber", "__spreadArray", "__read", "shareReplay", "configOrBufferSize", "windowTime", "scheduler", "bufferSize", "refCount", "_a", "_b", "_c", "share", "ReplaySubject", "skip", "count", "filter", "_", "index", "skipUntil", "notifier", "operate", "source", "subscriber", "taking", "skipSubscriber", "createOperatorSubscriber", "noop", "innerFrom", "value", "startWith", "values", "_i", "scheduler", "popScheduler", "operate", "source", "subscriber", "concat", "switchMap", "project", "resultSelector", "operate", "source", "subscriber", "innerSubscriber", "index", "isComplete", "checkComplete", "createOperatorSubscriber", "value", "innerIndex", "outerIndex", "innerFrom", "innerValue", "takeUntil", "notifier", "operate", "source", "subscriber", "innerFrom", "createOperatorSubscriber", "noop", "takeWhile", "predicate", "inclusive", "operate", "source", "subscriber", "index", "createOperatorSubscriber", "value", "result", "tap", "observerOrNext", "error", "complete", "tapObserver", "isFunction", "operate", "source", "subscriber", "_a", "isUnsub", "createOperatorSubscriber", "value", "err", "_b", "identity", "defaultThrottleConfig", "throttle", "durationSelector", "config", "operate", "source", "subscriber", "leading", "trailing", "hasValue", "sendValue", "throttled", "isComplete", "endThrottling", "send", "cleanupThrottling", "startThrottle", "value", "innerFrom", "createOperatorSubscriber", "throttleTime", "duration", "scheduler", "config", "asyncScheduler", "defaultThrottleConfig", "duration$", "timer", "throttle", "withLatestFrom", "inputs", "_i", "project", "popResultSelector", "operate", "source", "subscriber", "len", "otherValues", "hasValue", "ready", "i", "innerFrom", "createOperatorSubscriber", "value", "identity", "noop", "values", "__spreadArray", "__read", "zip", "sources", "_i", "operate", "source", "subscriber", "__spreadArray", "__read", "zipWith", "otherInputs", "_i", "zip", "__spreadArray", "__read", "watchDocument", "document$", "ReplaySubject", "fromEvent", "getElements", "selector", "node", "getElement", "el", "getOptionalElement", "getActiveElement", "watchElementFocus", "el", "merge", "fromEvent", "debounceTime", "map", "active", "getActiveElement", "startWith", "distinctUntilChanged", "getElementOffset", "el", "watchElementOffset", "merge", "fromEvent", "auditTime", "animationFrameScheduler", "map", "startWith", "getElementContentOffset", "el", "watchElementContentOffset", "merge", "fromEvent", "auditTime", "animationFrameScheduler", "map", "startWith", "MapShim", "getIndex", "arr", "key", "result", "entry", "index", "class_1", "value", "entries", "callback", "ctx", "_i", "_a", "isBrowser", "global$1", "requestAnimationFrame$1", "trailingTimeout", "throttle", "delay", "leadingCall", "trailingCall", "lastCallTime", "resolvePending", "proxy", "timeoutCallback", "timeStamp", "REFRESH_DELAY", "transitionKeys", "mutationObserverSupported", "ResizeObserverController", "observer", "observers", "changesDetected", "activeObservers", "_b", "propertyName", "isReflowProperty", "defineConfigurable", "target", "props", "getWindowOf", "ownerGlobal", "emptyRect", "createRectInit", "toFloat", "getBordersSize", "styles", "positions", "size", "position", "getPaddings", "paddings", "positions_1", "getSVGContentRect", "bbox", "getHTMLElementContentRect", "clientWidth", "clientHeight", "horizPad", "vertPad", "width", "height", "isDocumentElement", "vertScrollbar", "horizScrollbar", "isSVGGraphicsElement", "getContentRect", "createReadOnlyRect", "x", "y", "Constr", "rect", "ResizeObservation", "ResizeObserverEntry", "rectInit", "contentRect", "ResizeObserverSPI", "controller", "callbackCtx", "observations", "_this", "observation", "ResizeObserver", "method", "ResizeObserver_es_default", "entry$", "Subject", "observer$", "defer", "of", "ResizeObserver_es_default", "entries", "entry", "switchMap", "observer", "merge", "NEVER", "finalize", "shareReplay", "getElementSize", "el", "watchElementSize", "tap", "filter", "target", "map", "startWith", "getElementContentSize", "el", "getElementContainer", "parent", "entry$", "Subject", "observer$", "defer", "of", "entries", "entry", "switchMap", "observer", "merge", "NEVER", "finalize", "shareReplay", "watchElementVisibility", "el", "tap", "filter", "target", "map", "isIntersecting", "watchElementBoundary", "threshold", "watchElementContentOffset", "y", "visible", "getElementSize", "content", "getElementContentSize", "distinctUntilChanged", "toggles", "getElement", "getToggle", "name", "setToggle", "value", "watchToggle", "el", "fromEvent", "map", "startWith", "isSusceptibleToKeyboard", "el", "type", "watchKeyboard", "fromEvent", "filter", "ev", "map", "getToggle", "mode", "active", "getActiveElement", "share", "getLocation", "setLocation", "url", "watchLocation", "Subject", "appendChild", "el", "child", "node", "h", "tag", "attributes", "children", "attr", "truncate", "value", "n", "i", "round", "digits", "getLocationHash", "setLocationHash", "hash", "el", "h", "ev", "watchLocationHash", "fromEvent", "map", "startWith", "filter", "shareReplay", "watchLocationTarget", "id", "getOptionalElement", "watchMedia", "query", "media", "fromEventPattern", "next", "startWith", "watchPrint", "merge", "fromEvent", "map", "at", "query$", "factory", "switchMap", "active", "EMPTY", "request", "url", "options", "from", "catchError", "EMPTY", "switchMap", "res", "throwError", "of", "requestJSON", "shareReplay", "requestXML", "dom", "map", "watchScript", "src", "script", "h", "defer", "merge", "fromEvent", "switchMap", "throwError", "map", "finalize", "take", "getViewportOffset", "watchViewportOffset", "merge", "fromEvent", "map", "startWith", "getViewportSize", "watchViewportSize", "fromEvent", "map", "startWith", "watchViewport", "combineLatest", "watchViewportOffset", "watchViewportSize", "map", "offset", "size", "shareReplay", "watchViewportAt", "el", "viewport$", "header$", "size$", "distinctUntilKeyChanged", "offset$", "combineLatest", "map", "getElementOffset", "height", "offset", "size", "x", "y", "watchWorker", "worker", "tx$", "rx$", "fromEvent", "map", "data", "throttle", "tap", "message", "switchMap", "share", "script", "getElement", "config", "getLocation", "configuration", "feature", "flag", "translation", "key", "value", "getComponentElement", "type", "node", "getElement", "getComponentElements", "getElements", "watchAnnounce", "el", "button", "getElement", "fromEvent", "map", "content", "mountAnnounce", "feature", "EMPTY", "defer", "push$", "Subject", "startWith", "hash", "_a", "tap", "state", "finalize", "__spreadValues", "watchConsent", "el", "target$", "map", "target", "mountConsent", "options", "internal$", "Subject", "hidden", "tap", "state", "finalize", "__spreadValues", "import_clipboard", "renderTooltip", "id", "h", "renderAnnotation", "id", "prefix", "anchor", "h", "renderTooltip", "renderClipboardButton", "id", "h", "translation", "renderSearchDocument", "document", "flag", "parent", "teaser", "missing", "key", "list", "h", "url", "feature", "match", "highlight", "value", "tags", "configuration", "truncate", "tag", "id", "type", "translation", "renderSearchResultItem", "result", "threshold", "docs", "doc", "article", "index", "best", "more", "children", "section", "renderSourceFacts", "facts", "h", "key", "value", "round", "renderTabbedControl", "type", "classes", "h", "renderTable", "table", "h", "renderVersion", "version", "config", "configuration", "url", "h", "renderVersionSelector", "versions", "active", "translation", "watchAnnotation", "el", "container", "offset$", "defer", "combineLatest", "watchElementOffset", "watchElementContentOffset", "map", "x", "y", "scroll", "width", "height", "getElementSize", "watchElementFocus", "switchMap", "active", "offset", "take", "mountAnnotation", "target$", "tooltip", "index", "push$", "Subject", "done$", "takeLast", "watchElementVisibility", "takeUntil", "visible", "merge", "filter", "debounceTime", "auditTime", "animationFrameScheduler", "throttleTime", "origin", "fromEvent", "ev", "withLatestFrom", "_a", "parent", "getActiveElement", "target", "delay", "tap", "state", "finalize", "__spreadValues", "findAnnotationMarkers", "container", "markers", "el", "getElements", "nodes", "it", "node", "text", "match", "id", "force", "marker", "swap", "source", "target", "mountAnnotationList", "target$", "print$", "parent", "prefix", "annotations", "getOptionalElement", "renderAnnotation", "EMPTY", "defer", "done$", "Subject", "pairs", "annotation", "getElement", "takeUntil", "takeLast", "active", "inner", "child", "merge", "mountAnnotation", "finalize", "share", "sequence", "findCandidateList", "el", "sibling", "watchCodeBlock", "watchElementSize", "map", "width", "getElementContentSize", "distinctUntilKeyChanged", "mountCodeBlock", "options", "hover", "factory$", "defer", "push$", "Subject", "scrollable", "ClipboardJS", "parent", "renderClipboardButton", "container", "list", "feature", "annotations$", "mountAnnotationList", "tap", "state", "finalize", "__spreadValues", "mergeWith", "height", "distinctUntilChanged", "switchMap", "active", "EMPTY", "watchElementVisibility", "filter", "visible", "take", "mermaid$", "sequence", "fetchScripts", "watchScript", "of", "mountMermaid", "el", "tap", "mermaid_default", "map", "shareReplay", "id", "host", "h", "svg", "shadow", "watchDetails", "el", "target$", "print$", "open", "merge", "map", "target", "filter", "details", "active", "tap", "mountDetails", "options", "defer", "push$", "Subject", "action", "reveal", "state", "finalize", "__spreadValues", "sentinel", "h", "mountDataTable", "el", "renderTable", "of", "watchContentTabs", "el", "inputs", "getElements", "initial", "input", "merge", "fromEvent", "map", "getElement", "startWith", "active", "mountContentTabs", "viewport$", "prev", "renderTabbedControl", "next", "container", "defer", "push$", "Subject", "done$", "takeLast", "combineLatest", "watchElementSize", "auditTime", "animationFrameScheduler", "takeUntil", "size", "offset", "getElementOffset", "width", "getElementSize", "content", "getElementContentOffset", "watchElementContentOffset", "getElementContentSize", "direction", "feature", "skip", "withLatestFrom", "tab", "y", "set", "label", "tabs", "tap", "state", "finalize", "__spreadValues", "subscribeOn", "asyncScheduler", "mountContent", "el", "viewport$", "target$", "print$", "merge", "getElements", "child", "mountCodeBlock", "mountMermaid", "mountDataTable", "mountDetails", "mountContentTabs", "watchDialog", "_el", "alert$", "switchMap", "message", "merge", "of", "delay", "map", "active", "mountDialog", "el", "options", "inner", "getElement", "defer", "push$", "Subject", "tap", "state", "finalize", "__spreadValues", "isHidden", "viewport$", "feature", "of", "direction$", "map", "y", "bufferCount", "a", "b", "distinctUntilKeyChanged", "hidden$", "combineLatest", "filter", "offset", "direction", "distinctUntilChanged", "search$", "watchToggle", "search", "switchMap", "active", "startWith", "watchHeader", "el", "options", "defer", "watchElementSize", "height", "hidden", "shareReplay", "mountHeader", "header$", "main$", "push$", "Subject", "done$", "takeLast", "combineLatestWith", "takeUntil", "state", "__spreadValues", "watchHeaderTitle", "el", "viewport$", "header$", "watchViewportAt", "map", "y", "height", "getElementSize", "distinctUntilKeyChanged", "mountHeaderTitle", "options", "defer", "push$", "Subject", "active", "heading", "getOptionalElement", "EMPTY", "tap", "state", "finalize", "__spreadValues", "watchMain", "el", "viewport$", "header$", "adjust$", "map", "height", "distinctUntilChanged", "border$", "switchMap", "watchElementSize", "distinctUntilKeyChanged", "combineLatest", "header", "top", "bottom", "y", "a", "b", "watchPalette", "inputs", "current", "input", "of", "mergeMap", "fromEvent", "map", "startWith", "shareReplay", "mountPalette", "el", "defer", "push$", "Subject", "palette", "key", "value", "index", "label", "observeOn", "asyncScheduler", "getElements", "tap", "state", "finalize", "__spreadValues", "import_clipboard", "extract", "el", "text", "setupClipboardJS", "alert$", "ClipboardJS", "Observable", "subscriber", "getElement", "ev", "tap", "map", "translation", "preprocess", "urls", "root", "next", "a", "b", "url", "index", "fetchSitemap", "base", "cached", "of", "config", "configuration", "requestXML", "map", "sitemap", "getElements", "node", "catchError", "EMPTY", "defaultIfEmpty", "tap", "setupInstantLoading", "document$", "location$", "viewport$", "config", "configuration", "fromEvent", "favicon", "getOptionalElement", "push$", "fetchSitemap", "map", "paths", "path", "switchMap", "urls", "filter", "ev", "el", "url", "of", "NEVER", "share", "pop$", "merge", "distinctUntilChanged", "a", "b", "response$", "distinctUntilKeyChanged", "request", "catchError", "setLocation", "sample", "dom", "res", "skip", "replacement", "selector", "feature", "source", "target", "getComponentElement", "getElements", "concatMap", "script", "h", "name", "Observable", "observer", "EMPTY", "offset", "setLocationHash", "skipUntil", "debounceTime", "bufferCount", "state", "import_escape_html", "import_escape_html", "setupSearchHighlighter", "config", "escape", "separator", "highlight", "_", "data", "term", "query", "match", "value", "escapeHTML", "defaultTransform", "query", "terms", "index", "isSearchReadyMessage", "message", "isSearchQueryMessage", "isSearchResultMessage", "setupSearchIndex", "config", "docs", "translation", "options", "feature", "setupSearchWorker", "url", "index", "configuration", "worker", "tx$", "Subject", "rx$", "watchWorker", "map", "message", "isSearchResultMessage", "result", "document", "share", "from", "data", "setupVersionSelector", "document$", "config", "configuration", "versions$", "requestJSON", "catchError", "EMPTY", "current$", "map", "versions", "current", "version", "aliases", "switchMap", "urls", "fromEvent", "filter", "ev", "withLatestFrom", "el", "url", "of", "fetchSitemap", "sitemap", "path", "getLocation", "setLocation", "combineLatest", "getElement", "renderVersionSelector", "_a", "outdated", "latest", "warning", "getComponentElements", "watchSearchQuery", "el", "rx$", "fn", "defaultTransform", "searchParams", "getLocation", "setToggle", "param$", "filter", "isSearchReadyMessage", "take", "map", "watchToggle", "active", "url", "value", "focus$", "watchElementFocus", "value$", "merge", "fromEvent", "delay", "startWith", "distinctUntilChanged", "combineLatest", "focus", "shareReplay", "mountSearchQuery", "tx$", "push$", "Subject", "done$", "takeLast", "distinctUntilKeyChanged", "translation", "takeUntil", "tap", "state", "finalize", "__spreadValues", "share", "mountSearchResult", "el", "rx$", "query$", "push$", "Subject", "boundary$", "watchElementBoundary", "filter", "meta", "getElement", "list", "ready$", "isSearchReadyMessage", "take", "withLatestFrom", "skipUntil", "items", "value", "translation", "round", "tap", "switchMap", "merge", "of", "bufferCount", "zipWith", "chunk", "result", "renderSearchResultItem", "isSearchResultMessage", "map", "data", "state", "finalize", "__spreadValues", "watchSearchShare", "_el", "query$", "map", "value", "url", "getLocation", "mountSearchShare", "el", "options", "push$", "Subject", "fromEvent", "ev", "tap", "state", "finalize", "__spreadValues", "mountSearchSuggest", "el", "rx$", "keyboard$", "push$", "Subject", "query", "getComponentElement", "query$", "merge", "fromEvent", "observeOn", "asyncScheduler", "map", "distinctUntilChanged", "combineLatestWith", "suggestions", "value", "words", "last", "filter", "mode", "key", "isSearchResultMessage", "data", "tap", "state", "finalize", "mountSearch", "el", "index$", "keyboard$", "config", "configuration", "url", "worker", "setupSearchWorker", "query", "getComponentElement", "result", "tx$", "rx$", "filter", "isSearchQueryMessage", "sample", "isSearchReadyMessage", "take", "mode", "key", "active", "getActiveElement", "anchors", "anchor", "getElements", "article", "best", "a", "b", "setToggle", "els", "i", "query$", "mountSearchQuery", "result$", "mountSearchResult", "merge", "mergeWith", "getComponentElements", "child", "mountSearchShare", "mountSearchSuggest", "err", "NEVER", "mountSearchHiglight", "el", "index$", "location$", "combineLatest", "startWith", "getLocation", "filter", "url", "map", "index", "setupSearchHighlighter", "fn", "_a", "nodes", "it", "node", "original", "replaced", "text", "childNodes", "h", "watchSidebar", "el", "viewport$", "main$", "parent", "adjust", "combineLatest", "map", "offset", "height", "y", "distinctUntilChanged", "a", "b", "mountSidebar", "_a", "_b", "header$", "options", "__objRest", "inner", "getElement", "getElementOffset", "defer", "push$", "Subject", "auditTime", "animationFrameScheduler", "withLatestFrom", "observeOn", "take", "item", "getElements", "container", "getElementContainer", "getElementSize", "tap", "state", "finalize", "__spreadValues", "fetchSourceFactsFromGitHub", "user", "repo", "url", "zip", "requestJSON", "catchError", "EMPTY", "map", "release", "defaultIfEmpty", "info", "__spreadValues", "fetchSourceFactsFromGitLab", "base", "project", "url", "requestJSON", "catchError", "EMPTY", "map", "star_count", "forks_count", "defaultIfEmpty", "fetchSourceFacts", "url", "match", "user", "repo", "fetchSourceFactsFromGitHub", "base", "slug", "fetchSourceFactsFromGitLab", "EMPTY", "fetch$", "watchSource", "el", "defer", "cached", "of", "getComponentElements", "consent", "EMPTY", "fetchSourceFacts", "tap", "facts", "catchError", "filter", "map", "shareReplay", "mountSource", "inner", "getElement", "push$", "Subject", "renderSourceFacts", "state", "finalize", "__spreadValues", "watchTabs", "el", "viewport$", "header$", "watchElementSize", "switchMap", "watchViewportAt", "map", "y", "distinctUntilKeyChanged", "mountTabs", "options", "defer", "push$", "Subject", "hidden", "feature", "of", "tap", "state", "finalize", "__spreadValues", "watchTableOfContents", "el", "viewport$", "header$", "table", "anchors", "getElements", "anchor", "id", "target", "getOptionalElement", "adjust$", "distinctUntilKeyChanged", "map", "height", "main", "getComponentElement", "grid", "getElement", "share", "watchElementSize", "switchMap", "body", "defer", "path", "of", "index", "offset", "a", "b", "combineLatestWith", "adjust", "scan", "prev", "next", "y", "size", "last", "distinctUntilChanged", "startWith", "bufferCount", "mountTableOfContents", "target$", "push$", "Subject", "done$", "takeLast", "feature", "smooth$", "merge", "debounceTime", "filter", "withLatestFrom", "behavior", "container", "getElementContainer", "getElementSize", "takeUntil", "skip", "repeat", "url", "getLocation", "active", "hash", "tap", "state", "finalize", "__spreadValues", "watchBackToTop", "_el", "viewport$", "main$", "target$", "direction$", "map", "y", "bufferCount", "a", "b", "distinctUntilChanged", "active$", "active", "combineLatest", "direction", "takeUntil", "skip", "endWith", "repeat", "hidden", "mountBackToTop", "el", "header$", "push$", "Subject", "done$", "takeLast", "distinctUntilKeyChanged", "height", "tap", "state", "finalize", "__spreadValues", "patchIndeterminate", "document$", "tablet$", "switchMap", "getElements", "tap", "el", "mergeMap", "fromEvent", "takeWhile", "map", "withLatestFrom", "tablet", "isAppleDevice", "patchScrollfix", "document$", "switchMap", "getElements", "tap", "el", "filter", "mergeMap", "fromEvent", "map", "top", "patchScrolllock", "viewport$", "tablet$", "combineLatest", "watchToggle", "map", "active", "tablet", "switchMap", "of", "delay", "withLatestFrom", "y", "value", "obj", "data", "key", "x", "y", "nodes", "parent", "i", "node", "document$", "watchDocument", "location$", "watchLocation", "target$", "watchLocationTarget", "keyboard$", "watchKeyboard", "viewport$", "watchViewport", "tablet$", "watchMedia", "screen$", "print$", "watchPrint", "config", "configuration", "index$", "requestJSON", "NEVER", "alert$", "Subject", "setupClipboardJS", "feature", "setupInstantLoading", "_a", "setupVersionSelector", "merge", "delay", "setToggle", "filter", "mode", "key", "prev", "getOptionalElement", "next", "patchIndeterminate", "patchScrollfix", "patchScrolllock", "header$", "watchHeader", "getComponentElement", "main$", "map", "switchMap", "el", "watchMain", "shareReplay", "control$", "getComponentElements", "mountConsent", "mountDialog", "mountHeader", "mountPalette", "mountSearch", "mountSource", "content$", "defer", "mountAnnounce", "mountContent", "mountSearchHiglight", "EMPTY", "mountHeaderTitle", "at", "mountSidebar", "mountTabs", "mountTableOfContents", "mountBackToTop", "component$", "mergeWith"] +} diff --git a/assets/javascripts/extra/bundle.5f09fbc3.min.js b/assets/javascripts/extra/bundle.5f09fbc3.min.js new file mode 100644 index 0000000..48b752c --- /dev/null +++ b/assets/javascripts/extra/bundle.5f09fbc3.min.js @@ -0,0 +1,18 @@ +"use strict";(()=>{var Je=Object.create;var qr=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var rt=(r,o)=>()=>(o||r((o={exports:{}}).exports,o),o.exports);var et=(r,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Qe(o))!Ze.call(r,n)&&n!==t&&qr(r,n,{get:()=>o[n],enumerable:!(e=$e(o,n))||e.enumerable});return r};var tt=(r,o,t)=>(t=r!=null?Je(Xe(r)):{},et(o||!r||!r.__esModule?qr(t,"default",{value:r,enumerable:!0}):t,r));var me=rt((Tt,er)=>{/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Hr,Kr,Jr,$r,Qr,Xr,Zr,re,ee,Z,Ar,te,oe,ne,k,ie,fe,ae,ue,ce,se,pe,le,rr;(function(r){var o=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(e){r(t(o,t(e)))}):typeof er=="object"&&typeof er.exports=="object"?r(t(o,t(er.exports))):r(t(o));function t(e,n){return e!==o&&(typeof Object.create=="function"?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(i,f){return e[i]=n?n(i,f):f}}})(function(r){var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])};Hr=function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");o(e,n);function i(){this.constructor=e}e.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},Kr=Object.assign||function(e){for(var n,i=1,f=arguments.length;i=0;s--)(c=e[s])&&(a=(u<3?c(a):u>3?c(n,i,a):c(n,i))||a);return u>3&&a&&Object.defineProperty(n,i,a),a},Qr=function(e,n){return function(i,f){n(i,f,e)}},Xr=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)},Zr=function(e,n,i,f){function u(a){return a instanceof i?a:new i(function(c){c(a)})}return new(i||(i=Promise))(function(a,c){function s(y){try{p(f.next(y))}catch(g){c(g)}}function d(y){try{p(f.throw(y))}catch(g){c(g)}}function p(y){y.done?a(y.value):u(y.value).then(s,d)}p((f=f.apply(e,n||[])).next())})},re=function(e,n){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},f,u,a,c;return c={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function s(p){return function(y){return d([p,y])}}function d(p){if(f)throw new TypeError("Generator is already executing.");for(;i;)try{if(f=1,u&&(a=p[0]&2?u.return:p[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,p[1])).done)return a;switch(u=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,u=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]=e.length&&(e=void 0),{value:e&&e[f++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Ar=function(e,n){var i=typeof Symbol=="function"&&e[Symbol.iterator];if(!i)return e;var f=i.call(e),u,a=[],c;try{for(;(n===void 0||n-- >0)&&!(u=f.next()).done;)a.push(u.value)}catch(s){c={error:s}}finally{try{u&&!u.done&&(i=f.return)&&i.call(f)}finally{if(c)throw c.error}}return a},te=function(){for(var e=[],n=0;n1||s(m,P)})})}function s(m,P){try{d(f[m](P))}catch(j){g(a[0][3],j)}}function d(m){m.value instanceof k?Promise.resolve(m.value.v).then(p,y):g(a[0][2],m)}function p(m){s("next",m)}function y(m){s("throw",m)}function g(m,P){m(P),a.shift(),a.length&&s(a[0][0],a[0][1])}},fe=function(e){var n,i;return n={},f("next"),f("throw",function(u){throw u}),f("return"),n[Symbol.iterator]=function(){return this},n;function f(u,a){n[u]=e[u]?function(c){return(i=!i)?{value:k(e[u](c)),done:u==="return"}:a?a(c):c}:a}},ae=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],i;return n?n.call(e):(e=typeof Z=="function"?Z(e):e[Symbol.iterator](),i={},f("next"),f("throw"),f("return"),i[Symbol.asyncIterator]=function(){return this},i);function f(a){i[a]=e[a]&&function(c){return new Promise(function(s,d){c=e[a](c),u(s,d,c.done,c.value)})}}function u(a,c,s,d){Promise.resolve(d).then(function(p){a({value:p,done:s})},c)}},ue=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e};var t=Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n};ce=function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&rr(n,e,i);return t(n,e),n},se=function(e){return e&&e.__esModule?e:{default:e}},pe=function(e,n,i,f){if(i==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!f:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?f:i==="a"?f.call(e):f?f.value:n.get(e)},le=function(e,n,i,f,u){if(f==="m")throw new TypeError("Private method is not writable");if(f==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!u:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return f==="a"?u.call(e,i):u?u.value=i:n.set(e,i),i},r("__extends",Hr),r("__assign",Kr),r("__rest",Jr),r("__decorate",$r),r("__param",Qr),r("__metadata",Xr),r("__awaiter",Zr),r("__generator",re),r("__exportStar",ee),r("__createBinding",rr),r("__values",Z),r("__read",Ar),r("__spread",te),r("__spreadArrays",oe),r("__spreadArray",ne),r("__await",k),r("__asyncGenerator",ie),r("__asyncDelegator",fe),r("__asyncValues",ae),r("__makeTemplateObject",ue),r("__importStar",ce),r("__importDefault",se),r("__classPrivateFieldGet",pe),r("__classPrivateFieldSet",le)})});var de=tt(me(),1),{__extends:_,__assign:Pt,__rest:jt,__decorate:Ft,__param:Mt,__metadata:Ct,__awaiter:he,__generator:tr,__exportStar:Lt,__createBinding:Rt,__values:M,__read:w,__spread:kt,__spreadArrays:Ut,__spreadArray:S,__await:or,__asyncGenerator:ve,__asyncDelegator:Wt,__asyncValues:be,__makeTemplateObject:Dt,__importStar:Vt,__importDefault:Bt,__classPrivateFieldGet:Gt,__classPrivateFieldSet:Nt}=de.default;function l(r){return typeof r=="function"}function nr(r){var o=function(e){Error.call(e),e.stack=new Error().stack},t=r(o);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ir=nr(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription: +`+t.map(function(e,n){return n+1+") "+e.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=t}});function C(r,o){if(r){var t=r.indexOf(o);0<=t&&r.splice(t,1)}}var F=function(){function r(o){this.initialTeardown=o,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var o,t,e,n,i;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var u=M(f),a=u.next();!a.done;a=u.next()){var c=a.value;c.remove(this)}}catch(m){o={error:m}}finally{try{a&&!a.done&&(t=u.return)&&t.call(u)}finally{if(o)throw o.error}}else f.remove(this);var s=this.initialTeardown;if(l(s))try{s()}catch(m){i=m instanceof ir?m.errors:[m]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=M(d),y=p.next();!y.done;y=p.next()){var g=y.value;try{ye(g)}catch(m){i=i!=null?i:[],m instanceof ir?i=S(S([],w(i)),w(m.errors)):i.push(m)}}}catch(m){e={error:m}}finally{try{y&&!y.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}}if(i)throw new ir(i)}},r.prototype.add=function(o){var t;if(o&&o!==this)if(this.closed)ye(o);else{if(o instanceof r){if(o.closed||o._hasParent(this))return;o._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(o)}},r.prototype._hasParent=function(o){var t=this._parentage;return t===o||Array.isArray(t)&&t.includes(o)},r.prototype._addParent=function(o){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(o),t):t?[t,o]:o},r.prototype._removeParent=function(o){var t=this._parentage;t===o?this._parentage=null:Array.isArray(t)&&C(t,o)},r.prototype.remove=function(o){var t=this._finalizers;t&&C(t,o),o instanceof r&&o._removeParent(this)},r.EMPTY=function(){var o=new r;return o.closed=!0,o}(),r}();var Ir=F.EMPTY;function fr(r){return r instanceof F||r&&"closed"in r&&l(r.remove)&&l(r.add)&&l(r.unsubscribe)}function ye(r){l(r)?r():r.unsubscribe()}var O={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var U={setTimeout:function(r,o){for(var t=[],e=2;e0},enumerable:!1,configurable:!0}),o.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},o.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},o.prototype._innerSubscribe=function(t){var e=this,n=this,i=n.hasError,f=n.isStopped,u=n.observers;return i||f?Ir:(this.currentObservers=null,u.push(t),new F(function(){e.currentObservers=null,C(u,t)}))},o.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,i=e.thrownError,f=e.isStopped;n?t.error(i):f&&t.complete()},o.prototype.asObservable=function(){var t=new b;return t.source=this,t},o.create=function(t,e){return new Ae(t,e)},o}(b);var Ae=function(r){_(o,r);function o(t,e){var n=r.call(this)||this;return n.destination=t,n.source=e,n}return o.prototype.next=function(t){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.next)===null||n===void 0||n.call(e,t)},o.prototype.error=function(t){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.error)===null||n===void 0||n.call(e,t)},o.prototype.complete=function(){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||e===void 0||e.call(t)},o.prototype._subscribe=function(t){var e,n;return(n=(e=this.source)===null||e===void 0?void 0:e.subscribe(t))!==null&&n!==void 0?n:Ir},o}(Fr);var J={now:function(){return(J.delegate||Date).now()},delegate:void 0};var Mr=function(r){_(o,r);function o(t,e,n){t===void 0&&(t=1/0),e===void 0&&(e=1/0),n===void 0&&(n=J);var i=r.call(this)||this;return i._bufferSize=t,i._windowTime=e,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=e===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,e),i}return o.prototype.next=function(t){var e=this,n=e.isStopped,i=e._buffer,f=e._infiniteTimeWindow,u=e._timestampProvider,a=e._windowTime;n||(i.push(t),!f&&i.push(u.now()+a)),this._trimBuffer(),r.prototype.next.call(this,t)},o.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this,i=n._infiniteTimeWindow,f=n._buffer,u=f.slice(),a=0;a{sessionStorage.setItem("\u1D34\u2092\u1D34\u2092\u1D34\u2092",`${t}`),r.hidden=!t}),o.next(JSON.parse(sessionStorage.getItem("\u1D34\u2092\u1D34\u2092\u1D34\u2092")||"true")),z(r,"click").pipe(zr(o)).subscribe(([,t])=>o.next(!t)),kr(250).pipe(gr(o.pipe(X(t=>!t))),H(75),Nr({delay:()=>o.pipe(X(t=>t))}),T(()=>{let t=document.createElement("div");return t.className="\u1D34\u2092\u1D34\u2092\u1D34\u2092",t.ariaHidden="true",Ke.appendChild(t),Ur(Wr,Rr(t)).pipe(Gr(()=>t.remove()),gr(o.pipe(X(e=>!e))),Yr(e=>z(e,"click").pipe(Er(()=>e.classList.add("\u1D34\u2092\u1D34\u2092\u1D34\u2092--\u1D4D\u2092\u1D57\uA700\u1D34\u2090")),Vr(1e3),Er(()=>e.classList.remove("\u1D34\u2092\u1D34\u2092\u1D34\u2092--\u1D4D\u2092\u1D57\uA700\u1D34\u2090")))))})).subscribe()}})(); +//# sourceMappingURL=bundle.5f09fbc3.min.js.map + diff --git a/assets/javascripts/extra/bundle.5f09fbc3.min.js.map b/assets/javascripts/extra/bundle.5f09fbc3.min.js.map new file mode 100644 index 0000000..24f3674 --- /dev/null +++ b/assets/javascripts/extra/bundle.5f09fbc3.min.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "sources": ["node_modules/rxjs/node_modules/tslib/tslib.js", "node_modules/rxjs/node_modules/tslib/modules/index.js", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subscription.ts", "node_modules/rxjs/src/internal/config.ts", "node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "node_modules/rxjs/src/internal/util/noop.ts", "node_modules/rxjs/src/internal/NotificationFactories.ts", "node_modules/rxjs/src/internal/util/errorContext.ts", "node_modules/rxjs/src/internal/Subscriber.ts", "node_modules/rxjs/src/internal/symbol/observable.ts", "node_modules/rxjs/src/internal/util/identity.ts", "node_modules/rxjs/src/internal/util/pipe.ts", "node_modules/rxjs/src/internal/Observable.ts", "node_modules/rxjs/src/internal/util/lift.ts", "node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "node_modules/rxjs/src/internal/Subject.ts", "node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "node_modules/rxjs/src/internal/ReplaySubject.ts", "node_modules/rxjs/src/internal/scheduler/Action.ts", "node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "node_modules/rxjs/src/internal/Scheduler.ts", "node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "node_modules/rxjs/src/internal/scheduler/async.ts", "node_modules/rxjs/src/internal/observable/empty.ts", "node_modules/rxjs/src/internal/util/isScheduler.ts", "node_modules/rxjs/src/internal/util/args.ts", "node_modules/rxjs/src/internal/util/isArrayLike.ts", "node_modules/rxjs/src/internal/util/isPromise.ts", "node_modules/rxjs/src/internal/util/isInteropObservable.ts", "node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "node_modules/rxjs/src/internal/symbol/iterator.ts", "node_modules/rxjs/src/internal/util/isIterable.ts", "node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "node_modules/rxjs/src/internal/observable/innerFrom.ts", "node_modules/rxjs/src/internal/util/executeSchedule.ts", "node_modules/rxjs/src/internal/operators/observeOn.ts", "node_modules/rxjs/src/internal/operators/subscribeOn.ts", "node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "node_modules/rxjs/src/internal/scheduled/scheduled.ts", "node_modules/rxjs/src/internal/observable/from.ts", "node_modules/rxjs/src/internal/observable/of.ts", "node_modules/rxjs/src/internal/util/isDate.ts", "node_modules/rxjs/src/internal/operators/map.ts", "node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "node_modules/rxjs/src/internal/operators/mergeInternals.ts", "node_modules/rxjs/src/internal/operators/mergeMap.ts", "node_modules/rxjs/src/internal/operators/mergeAll.ts", "node_modules/rxjs/src/internal/operators/concatAll.ts", "node_modules/rxjs/src/internal/observable/concat.ts", "node_modules/rxjs/src/internal/observable/fromEvent.ts", "node_modules/rxjs/src/internal/observable/timer.ts", "node_modules/rxjs/src/internal/observable/interval.ts", "node_modules/rxjs/src/internal/observable/merge.ts", "node_modules/rxjs/src/internal/observable/never.ts", "node_modules/rxjs/src/internal/operators/filter.ts", "node_modules/rxjs/src/internal/operators/take.ts", "node_modules/rxjs/src/internal/operators/ignoreElements.ts", "node_modules/rxjs/src/internal/operators/mapTo.ts", "node_modules/rxjs/src/internal/operators/delayWhen.ts", "node_modules/rxjs/src/internal/operators/delay.ts", "node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts", "node_modules/rxjs/src/internal/operators/finalize.ts", "node_modules/rxjs/src/internal/operators/repeat.ts", "node_modules/rxjs/src/internal/operators/switchMap.ts", "node_modules/rxjs/src/internal/operators/takeUntil.ts", "node_modules/rxjs/src/internal/operators/tap.ts", "node_modules/rxjs/src/internal/operators/withLatestFrom.ts", "src/assets/javascripts/extra/bundle.ts"], + "sourceRoot": "../../../..", + "sourcesContent": ["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n", "import tslib from '../tslib.js';\r\nconst {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n} = tslib;\r\nexport {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n};\r\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n NEVER,\n ReplaySubject,\n delay,\n distinctUntilChanged,\n filter,\n finalize,\n fromEvent,\n interval,\n merge,\n mergeMap,\n of,\n repeat,\n switchMap,\n take,\n takeUntil,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Script\n * ------------------------------------------------------------------------- */\n\n/* Append container for instances */\nconst container = document.createElement(\"div\")\ndocument.body.appendChild(container)\n\n/* Append button next to palette toggle */\nconst header = document.querySelector(\".md-header__option\")\nif (header) {\n const button = document.createElement(\"button\")\n button.className = \"md-header__button md-icon \u1D34\u2092\u1D34\u2092\u1D34\u2092__button\"\n if (header.parentElement)\n header.parentElement.insertBefore(button, header)\n\n /* Toggle animation */\n const on$ = new ReplaySubject(1)\n on$\n .pipe(\n distinctUntilChanged()\n )\n .subscribe(on => {\n sessionStorage.setItem(\"\u1D34\u2092\u1D34\u2092\u1D34\u2092\", `${on}`)\n button.hidden = !on\n })\n\n /* Load state from session storage */\n on$.next(JSON.parse(sessionStorage.getItem(\"\u1D34\u2092\u1D34\u2092\u1D34\u2092\") || \"true\"))\n fromEvent(button, \"click\")\n .pipe(\n withLatestFrom(on$)\n )\n .subscribe(([, on]) => on$.next(!on))\n\n /* Generate instances */\n interval(250)\n .pipe(\n takeUntil(on$.pipe(filter(on => !on))),\n take(75),\n repeat({ delay: () => on$.pipe(filter(on => on)) }),\n mergeMap(() => {\n const instance = document.createElement(\"div\")\n instance.className = \"\u1D34\u2092\u1D34\u2092\u1D34\u2092\"\n instance.ariaHidden = \"true\"\n container.appendChild(instance)\n return merge(NEVER, of(instance))\n .pipe(\n finalize(() => instance.remove()),\n takeUntil(on$.pipe(filter(on => !on))),\n switchMap(el => fromEvent(el, \"click\")\n .pipe(\n tap(() => el.classList.add(\"\u1D34\u2092\u1D34\u2092\u1D34\u2092--\u1D4D\u2092\u1D57\uA700\u1D34\u2090\")),\n delay(1000),\n tap(() => el.classList.remove(\"\u1D34\u2092\u1D34\u2092\u1D34\u2092--\u1D4D\u2092\u1D57\uA700\u1D34\u2090\"))\n )\n )\n )\n })\n )\n .subscribe()\n}\n"], + "mappings": "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", + "names": ["require_tslib", "__commonJSMin", "exports", "module", "__extends", "__assign", "__rest", "__decorate", "__param", "__metadata", "__awaiter", "__generator", "__exportStar", "__values", "__read", "__spread", "__spreadArrays", "__spreadArray", "__await", "__asyncGenerator", "__asyncDelegator", "__asyncValues", "__makeTemplateObject", "__importStar", "__importDefault", "__classPrivateFieldGet", "__classPrivateFieldSet", "__createBinding", "factory", "root", "createExporter", "previous", "id", "v", "exporter", "extendStatics", "d", "b", "p", "__", "t", "s", "n", "e", "i", "decorators", "target", "key", "desc", "c", "r", "paramIndex", "decorator", "metadataKey", "metadataValue", "thisArg", "_arguments", "P", "generator", "adopt", "value", "resolve", "reject", "fulfilled", "step", "rejected", "result", "body", "_", "y", "g", "verb", "op", "m", "o", "k", "k2", "ar", "error", "il", "j", "jl", "to", "from", "pack", "l", "q", "a", "resume", "settle", "fulfill", "f", "cooked", "raw", "__setModuleDefault", "mod", "receiver", "state", "kind", "import_tslib", "__extends", "__assign", "__rest", "__decorate", "__param", "__metadata", "__awaiter", "__generator", "__exportStar", "__createBinding", "__values", "__read", "__spread", "__spreadArrays", "__spreadArray", "__await", "__asyncGenerator", "__asyncDelegator", "__asyncValues", "__makeTemplateObject", "__importStar", "__importDefault", "__classPrivateFieldGet", "__classPrivateFieldSet", "tslib", "isFunction", "value", "createErrorClass", "createImpl", "_super", "instance", "ctorFunc", "UnsubscriptionError", "createErrorClass", "_super", "errors", "err", "i", "arrRemove", "arr", "item", "index", "Subscription", "initialTeardown", "errors", "_parentage", "_parentage_1", "__values", "_parentage_1_1", "parent_1", "initialFinalizer", "isFunction", "e", "UnsubscriptionError", "_finalizers", "_finalizers_1", "_finalizers_1_1", "finalizer", "execFinalizer", "err", "__spreadArray", "__read", "teardown", "_a", "parent", "arrRemove", "empty", "EMPTY_SUBSCRIPTION", "Subscription", "isSubscription", "value", "isFunction", "execFinalizer", "finalizer", "config", "timeoutProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "reportUnhandledError", "err", "timeoutProvider", "onUnhandledError", "config", "noop", "COMPLETE_NOTIFICATION", "createNotification", "errorNotification", "error", "nextNotification", "value", "kind", "context", "errorContext", "cb", "config", "isRoot", "_a", "errorThrown", "error", "captureError", "err", "Subscriber", "_super", "__extends", "destination", "_this", "isSubscription", "EMPTY_OBSERVER", "next", "error", "complete", "SafeSubscriber", "value", "handleStoppedNotification", "nextNotification", "err", "errorNotification", "COMPLETE_NOTIFICATION", "Subscription", "_bind", "bind", "fn", "thisArg", "ConsumerObserver", "partialObserver", "value", "error", "handleUnhandledError", "err", "SafeSubscriber", "_super", "__extends", "observerOrNext", "complete", "_this", "isFunction", "context_1", "config", "Subscriber", "handleUnhandledError", "error", "config", "captureError", "reportUnhandledError", "defaultErrorHandler", "err", "handleStoppedNotification", "notification", "subscriber", "onStoppedNotification", "timeoutProvider", "EMPTY_OBSERVER", "noop", "observable", "identity", "x", "pipeFromArray", "fns", "identity", "input", "prev", "fn", "Observable", "subscribe", "operator", "observable", "observerOrNext", "error", "complete", "_this", "subscriber", "isSubscriber", "SafeSubscriber", "errorContext", "_a", "source", "sink", "err", "next", "promiseCtor", "getPromiseCtor", "resolve", "reject", "value", "operations", "_i", "pipeFromArray", "x", "getPromiseCtor", "promiseCtor", "_a", "config", "isObserver", "value", "isFunction", "isSubscriber", "Subscriber", "isSubscription", "hasLift", "source", "isFunction", "operate", "init", "liftedSource", "err", "createOperatorSubscriber", "destination", "onNext", "onComplete", "onError", "onFinalize", "OperatorSubscriber", "_super", "__extends", "shouldUnsubscribe", "_this", "value", "err", "closed_1", "_a", "Subscriber", "ObjectUnsubscribedError", "createErrorClass", "_super", "Subject", "_super", "__extends", "_this", "operator", "subject", "AnonymousSubject", "ObjectUnsubscribedError", "value", "errorContext", "_b", "__values", "_c", "observer", "err", "observers", "_a", "subscriber", "hasError", "isStopped", "EMPTY_SUBSCRIPTION", "Subscription", "arrRemove", "thrownError", "observable", "Observable", "destination", "source", "AnonymousSubject", "_super", "__extends", "destination", "source", "_this", "value", "_b", "_a", "err", "subscriber", "EMPTY_SUBSCRIPTION", "Subject", "dateTimestampProvider", "ReplaySubject", "_super", "__extends", "_bufferSize", "_windowTime", "_timestampProvider", "dateTimestampProvider", "_this", "value", "_a", "isStopped", "_buffer", "_infiniteTimeWindow", "subscriber", "subscription", "copy", "i", "adjustedBufferSize", "now", "last", "Subject", "Action", "_super", "__extends", "scheduler", "work", "state", "delay", "Subscription", "intervalProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "AsyncAction", "_super", "__extends", "scheduler", "work", "_this", "state", "delay", "id", "_a", "_id", "intervalProvider", "_scheduler", "error", "_delay", "errored", "errorValue", "e", "actions", "arrRemove", "Action", "Scheduler", "schedulerActionCtor", "now", "work", "delay", "state", "dateTimestampProvider", "AsyncScheduler", "_super", "__extends", "SchedulerAction", "now", "Scheduler", "_this", "action", "actions", "error", "asyncScheduler", "AsyncScheduler", "AsyncAction", "async", "EMPTY", "Observable", "subscriber", "isScheduler", "value", "isFunction", "last", "arr", "popResultSelector", "args", "isFunction", "popScheduler", "isScheduler", "popNumber", "defaultValue", "isArrayLike", "x", "isPromise", "value", "isFunction", "isInteropObservable", "input", "isFunction", "observable", "isAsyncIterable", "obj", "isFunction", "createInvalidObservableTypeError", "input", "getSymbolIterator", "iterator", "isIterable", "input", "isFunction", "iterator", "readableStreamLikeToAsyncGenerator", "readableStream", "reader", "__await", "_a", "_b", "value", "done", "isReadableStreamLike", "obj", "isFunction", "innerFrom", "input", "Observable", "isInteropObservable", "fromInteropObservable", "isArrayLike", "fromArrayLike", "isPromise", "fromPromise", "isAsyncIterable", "fromAsyncIterable", "isIterable", "fromIterable", "isReadableStreamLike", "fromReadableStreamLike", "createInvalidObservableTypeError", "obj", "subscriber", "obs", "observable", "isFunction", "array", "i", "promise", "value", "err", "reportUnhandledError", "iterable", "iterable_1", "__values", "iterable_1_1", "asyncIterable", "process", "readableStream", "readableStreamLikeToAsyncGenerator", "asyncIterable_1", "__asyncValues", "asyncIterable_1_1", "executeSchedule", "parentSubscription", "scheduler", "work", "delay", "repeat", "scheduleSubscription", "observeOn", "scheduler", "delay", "operate", "source", "subscriber", "createOperatorSubscriber", "value", "executeSchedule", "err", "subscribeOn", "scheduler", "delay", "operate", "source", "subscriber", "scheduleObservable", "input", "scheduler", "innerFrom", "subscribeOn", "observeOn", "schedulePromise", "input", "scheduler", "innerFrom", "subscribeOn", "observeOn", "scheduleArray", "input", "scheduler", "Observable", "subscriber", "i", "scheduleIterable", "input", "scheduler", "Observable", "subscriber", "iterator", "executeSchedule", "value", "done", "_a", "err", "isFunction", "scheduleAsyncIterable", "input", "scheduler", "Observable", "subscriber", "executeSchedule", "iterator", "result", "scheduleReadableStreamLike", "input", "scheduler", "scheduleAsyncIterable", "readableStreamLikeToAsyncGenerator", "scheduled", "input", "scheduler", "isInteropObservable", "scheduleObservable", "isArrayLike", "scheduleArray", "isPromise", "schedulePromise", "isAsyncIterable", "scheduleAsyncIterable", "isIterable", "scheduleIterable", "isReadableStreamLike", "scheduleReadableStreamLike", "createInvalidObservableTypeError", "from", "input", "scheduler", "scheduled", "innerFrom", "of", "args", "_i", "scheduler", "popScheduler", "from", "isValidDate", "value", "map", "project", "thisArg", "operate", "source", "subscriber", "index", "createOperatorSubscriber", "value", "isArray", "callOrApply", "fn", "args", "__spreadArray", "__read", "mapOneOrManyArgs", "map", "mergeInternals", "source", "subscriber", "project", "concurrent", "onBeforeNext", "expand", "innerSubScheduler", "additionalFinalizer", "buffer", "active", "index", "isComplete", "checkComplete", "outerNext", "value", "doInnerSub", "innerComplete", "innerFrom", "createOperatorSubscriber", "innerValue", "bufferedValue", "executeSchedule", "err", "mergeMap", "project", "resultSelector", "concurrent", "isFunction", "a", "i", "map", "b", "ii", "innerFrom", "operate", "source", "subscriber", "mergeInternals", "mergeAll", "concurrent", "mergeMap", "identity", "concatAll", "mergeAll", "concat", "args", "_i", "concatAll", "from", "popScheduler", "nodeEventEmitterMethods", "eventTargetMethods", "jqueryMethods", "fromEvent", "target", "eventName", "options", "resultSelector", "isFunction", "mapOneOrManyArgs", "_a", "__read", "isEventTarget", "methodName", "handler", "isNodeStyleEventEmitter", "toCommonHandlerRegistry", "isJQueryStyleEventEmitter", "add", "remove", "isArrayLike", "mergeMap", "subTarget", "innerFrom", "Observable", "subscriber", "args", "_i", "timer", "dueTime", "intervalOrScheduler", "scheduler", "async", "intervalDuration", "isScheduler", "Observable", "subscriber", "due", "isValidDate", "n", "interval", "period", "scheduler", "asyncScheduler", "timer", "merge", "args", "_i", "scheduler", "popScheduler", "concurrent", "popNumber", "sources", "innerFrom", "mergeAll", "from", "EMPTY", "NEVER", "Observable", "noop", "filter", "predicate", "thisArg", "operate", "source", "subscriber", "index", "createOperatorSubscriber", "value", "take", "count", "EMPTY", "operate", "source", "subscriber", "seen", "createOperatorSubscriber", "value", "ignoreElements", "operate", "source", "subscriber", "createOperatorSubscriber", "noop", "mapTo", "value", "map", "delayWhen", "delayDurationSelector", "subscriptionDelay", "source", "concat", "take", "ignoreElements", "mergeMap", "value", "index", "mapTo", "delay", "due", "scheduler", "asyncScheduler", "duration", "timer", "delayWhen", "distinctUntilChanged", "comparator", "keySelector", "identity", "defaultCompare", "operate", "source", "subscriber", "previousKey", "first", "createOperatorSubscriber", "value", "currentKey", "a", "b", "finalize", "callback", "operate", "source", "subscriber", "repeat", "countOrConfig", "count", "delay", "_a", "EMPTY", "operate", "source", "subscriber", "soFar", "sourceSub", "resubscribe", "notifier", "timer", "innerFrom", "notifierSubscriber_1", "createOperatorSubscriber", "subscribeToSource", "syncUnsub", "switchMap", "project", "resultSelector", "operate", "source", "subscriber", "innerSubscriber", "index", "isComplete", "checkComplete", "createOperatorSubscriber", "value", "innerIndex", "outerIndex", "innerFrom", "innerValue", "takeUntil", "notifier", "operate", "source", "subscriber", "innerFrom", "createOperatorSubscriber", "noop", "tap", "observerOrNext", "error", "complete", "tapObserver", "isFunction", "operate", "source", "subscriber", "_a", "isUnsub", "createOperatorSubscriber", "value", "err", "_b", "identity", "withLatestFrom", "inputs", "_i", "project", "popResultSelector", "operate", "source", "subscriber", "len", "otherValues", "hasValue", "ready", "i", "innerFrom", "createOperatorSubscriber", "value", "identity", "noop", "values", "__spreadArray", "__read", "container", "header", "button", "on$", "ReplaySubject", "distinctUntilChanged", "on", "fromEvent", "withLatestFrom", "interval", "takeUntil", "filter", "take", "repeat", "mergeMap", "instance", "merge", "NEVER", "of", "finalize", "switchMap", "el", "tap", "delay"] +} diff --git a/assets/javascripts/lunr/min/lunr.ar.min.js b/assets/javascripts/lunr/min/lunr.ar.min.js new file mode 100644 index 0000000..9b06c26 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ar.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ar=function(){this.pipeline.reset(),this.pipeline.add(e.ar.trimmer,e.ar.stopWordFilter,e.ar.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ar.stemmer))},e.ar.wordCharacters="ุก-ู›ูฑู€",e.ar.trimmer=e.trimmerSupport.generateTrimmer(e.ar.wordCharacters),e.Pipeline.registerFunction(e.ar.trimmer,"trimmer-ar"),e.ar.stemmer=function(){var e=this;return e.result=!1,e.preRemoved=!1,e.sufRemoved=!1,e.pre={pre1:"ู ูƒ ุจ ูˆ ุณ ู„ ู† ุง ูŠ ุช",pre2:"ุงู„ ู„ู„",pre3:"ุจุงู„ ูˆุงู„ ูุงู„ ุชุงู„ ูƒุงู„ ูˆู„ู„",pre4:"ูุจุงู„ ูƒุจุงู„ ูˆุจุงู„ ูˆูƒุงู„"},e.suf={suf1:"ู‡ ูƒ ุช ู† ุง ูŠ",suf2:"ู†ูƒ ู†ู‡ ู‡ุง ูˆูƒ ูŠุง ุงู‡ ูˆู† ูŠู† ุชู† ุชู… ู†ุง ูˆุง ุงู† ูƒู… ูƒู† ู†ูŠ ู†ู† ู…ุง ู‡ู… ู‡ู† ุชูƒ ุชู‡ ุงุช ูŠู‡",suf3:"ุชูŠู† ูƒู‡ู… ู†ูŠู‡ ู†ู‡ู… ูˆู†ู‡ ูˆู‡ุง ูŠู‡ู… ูˆู†ุง ูˆู†ูƒ ูˆู†ูŠ ูˆู‡ู… ุชูƒู… ุชู†ุง ุชู‡ุง ุชู†ูŠ ุชู‡ู… ูƒู…ุง ูƒู‡ุง ู†ุงู‡ ู†ูƒู… ู‡ู†ุง ุชุงู† ูŠู‡ุง",suf4:"ูƒู…ูˆู‡ ู†ุงู‡ุง ูˆู†ู†ูŠ ูˆู†ู‡ู… ุชูƒู…ุง ุชู…ูˆู‡ ุชูƒุงู‡ ูƒู…ุงู‡ ู†ุงูƒู… ู†ุงู‡ู… ู†ูŠู‡ุง ูˆู†ู†ุง"},e.patterns=JSON.parse('{"pt43":[{"pt":[{"c":"ุง","l":1}]},{"pt":[{"c":"ุง,ุช,ู†,ูŠ","l":0}],"mPt":[{"c":"ู","l":0,"m":1},{"c":"ุน","l":1,"m":2},{"c":"ู„","l":2,"m":3}]},{"pt":[{"c":"ูˆ","l":2}],"mPt":[{"c":"ู","l":0,"m":0},{"c":"ุน","l":1,"m":1},{"c":"ู„","l":2,"m":3}]},{"pt":[{"c":"ุง","l":2}]},{"pt":[{"c":"ูŠ","l":2}],"mPt":[{"c":"ู","l":0,"m":0},{"c":"ุน","l":1,"m":1},{"c":"ุง","l":2},{"c":"ู„","l":3,"m":3}]},{"pt":[{"c":"ู…","l":0}]}],"pt53":[{"pt":[{"c":"ุช","l":0},{"c":"ุง","l":2}]},{"pt":[{"c":"ุง,ู†,ุช,ูŠ","l":0},{"c":"ุช","l":2}],"mPt":[{"c":"ุง","l":0},{"c":"ู","l":1,"m":1},{"c":"ุช","l":2},{"c":"ุน","l":3,"m":3},{"c":"ุง","l":4},{"c":"ู„","l":5,"m":4}]},{"pt":[{"c":"ุง","l":0},{"c":"ุง","l":2}],"mPt":[{"c":"ุง","l":0},{"c":"ู","l":1,"m":1},{"c":"ุน","l":2,"m":3},{"c":"ู„","l":3,"m":4},{"c":"ุง","l":4},{"c":"ู„","l":5,"m":4}]},{"pt":[{"c":"ุง","l":0},{"c":"ุง","l":3}],"mPt":[{"c":"ู","l":0,"m":1},{"c":"ุน","l":1,"m":2},{"c":"ู„","l":2,"m":4}]},{"pt":[{"c":"ุง","l":3},{"c":"ู†","l":4}]},{"pt":[{"c":"ุช","l":0},{"c":"ูŠ","l":3}]},{"pt":[{"c":"ู…","l":0},{"c":"ูˆ","l":3}]},{"pt":[{"c":"ุง","l":1},{"c":"ูˆ","l":3}]},{"pt":[{"c":"ูˆ","l":1},{"c":"ุง","l":2}]},{"pt":[{"c":"ู…","l":0},{"c":"ุง","l":3}]},{"pt":[{"c":"ู…","l":0},{"c":"ูŠ","l":3}]},{"pt":[{"c":"ุง","l":2},{"c":"ู†","l":3}]},{"pt":[{"c":"ู…","l":0},{"c":"ู†","l":1}],"mPt":[{"c":"ุง","l":0},{"c":"ู†","l":1},{"c":"ู","l":2,"m":2},{"c":"ุน","l":3,"m":3},{"c":"ุง","l":4},{"c":"ู„","l":5,"m":4}]},{"pt":[{"c":"ู…","l":0},{"c":"ุช","l":2}],"mPt":[{"c":"ุง","l":0},{"c":"ู","l":1,"m":1},{"c":"ุช","l":2},{"c":"ุน","l":3,"m":3},{"c":"ุง","l":4},{"c":"ู„","l":5,"m":4}]},{"pt":[{"c":"ู…","l":0},{"c":"ุง","l":2}]},{"pt":[{"c":"ู…","l":1},{"c":"ุง","l":3}]},{"pt":[{"c":"ูŠ,ุช,ุง,ู†","l":0},{"c":"ุช","l":1}],"mPt":[{"c":"ู","l":0,"m":2},{"c":"ุน","l":1,"m":3},{"c":"ุง","l":2},{"c":"ู„","l":3,"m":4}]},{"pt":[{"c":"ุช,ูŠ,ุง,ู†","l":0},{"c":"ุช","l":2}],"mPt":[{"c":"ุง","l":0},{"c":"ู","l":1,"m":1},{"c":"ุช","l":2},{"c":"ุน","l":3,"m":3},{"c":"ุง","l":4},{"c":"ู„","l":5,"m":4}]},{"pt":[{"c":"ุง","l":2},{"c":"ูŠ","l":3}]},{"pt":[{"c":"ุง,ูŠ,ุช,ู†","l":0},{"c":"ู†","l":1}],"mPt":[{"c":"ุง","l":0},{"c":"ู†","l":1},{"c":"ู","l":2,"m":2},{"c":"ุน","l":3,"m":3},{"c":"ุง","l":4},{"c":"ู„","l":5,"m":4}]},{"pt":[{"c":"ุง","l":3},{"c":"ุก","l":4}]}],"pt63":[{"pt":[{"c":"ุง","l":0},{"c":"ุช","l":2},{"c":"ุง","l":4}]},{"pt":[{"c":"ุง,ุช,ู†,ูŠ","l":0},{"c":"ุณ","l":1},{"c":"ุช","l":2}],"mPt":[{"c":"ุง","l":0},{"c":"ุณ","l":1},{"c":"ุช","l":2},{"c":"ู","l":3,"m":3},{"c":"ุน","l":4,"m":4},{"c":"ุง","l":5},{"c":"ู„","l":6,"m":5}]},{"pt":[{"c":"ุง,ู†,ุช,ูŠ","l":0},{"c":"ูˆ","l":3}]},{"pt":[{"c":"ู…","l":0},{"c":"ุณ","l":1},{"c":"ุช","l":2}],"mPt":[{"c":"ุง","l":0},{"c":"ุณ","l":1},{"c":"ุช","l":2},{"c":"ู","l":3,"m":3},{"c":"ุน","l":4,"m":4},{"c":"ุง","l":5},{"c":"ู„","l":6,"m":5}]},{"pt":[{"c":"ูŠ","l":1},{"c":"ูŠ","l":3},{"c":"ุง","l":4},{"c":"ุก","l":5}]},{"pt":[{"c":"ุง","l":0},{"c":"ู†","l":1},{"c":"ุง","l":4}]}],"pt54":[{"pt":[{"c":"ุช","l":0}]},{"pt":[{"c":"ุง,ูŠ,ุช,ู†","l":0}],"mPt":[{"c":"ุง","l":0},{"c":"ู","l":1,"m":1},{"c":"ุน","l":2,"m":2},{"c":"ู„","l":3,"m":3},{"c":"ุฑ","l":4,"m":4},{"c":"ุง","l":5},{"c":"ุฑ","l":6,"m":4}]},{"pt":[{"c":"ู…","l":0}],"mPt":[{"c":"ุง","l":0},{"c":"ู","l":1,"m":1},{"c":"ุน","l":2,"m":2},{"c":"ู„","l":3,"m":3},{"c":"ุฑ","l":4,"m":4},{"c":"ุง","l":5},{"c":"ุฑ","l":6,"m":4}]},{"pt":[{"c":"ุง","l":2}]},{"pt":[{"c":"ุง","l":0},{"c":"ู†","l":2}]}],"pt64":[{"pt":[{"c":"ุง","l":0},{"c":"ุง","l":4}]},{"pt":[{"c":"ู…","l":0},{"c":"ุช","l":1}]}],"pt73":[{"pt":[{"c":"ุง","l":0},{"c":"ุณ","l":1},{"c":"ุช","l":2},{"c":"ุง","l":5}]}],"pt75":[{"pt":[{"c":"ุง","l":0},{"c":"ุง","l":5}]}]}'),e.execArray=["cleanWord","removeDiacritics","cleanAlef","removeStopWords","normalizeHamzaAndAlef","removeStartWaw","removePre432","removeEndTaa","wordCheck"],e.stem=function(){var r=0;for(e.result=!1,e.preRemoved=!1,e.sufRemoved=!1;r=0)return!0},e.normalizeHamzaAndAlef=function(){return e.word=e.word.replace("ุค","ุก"),e.word=e.word.replace("ุฆ","ุก"),e.word=e.word.replace(/([\u0627])\1+/gi,"ุง"),!1},e.removeEndTaa=function(){return!(e.word.length>2)||(e.word=e.word.replace(/[\u0627]$/,""),e.word=e.word.replace("ุฉ",""),!1)},e.removeStartWaw=function(){return e.word.length>3&&"ูˆ"==e.word[0]&&"ูˆ"==e.word[1]&&(e.word=e.word.slice(1)),!1},e.removePre432=function(){var r=e.word;if(e.word.length>=7){var t=new RegExp("^("+e.pre.pre4.split(" ").join("|")+")");e.word=e.word.replace(t,"")}if(e.word==r&&e.word.length>=6){var c=new RegExp("^("+e.pre.pre3.split(" ").join("|")+")");e.word=e.word.replace(c,"")}if(e.word==r&&e.word.length>=5){var l=new RegExp("^("+e.pre.pre2.split(" ").join("|")+")");e.word=e.word.replace(l,"")}return r!=e.word&&(e.preRemoved=!0),!1},e.patternCheck=function(r){for(var t=0;t3){var t=new RegExp("^("+e.pre.pre1.split(" ").join("|")+")");e.word=e.word.replace(t,"")}return r!=e.word&&(e.preRemoved=!0),!1},e.removeSuf1=function(){var r=e.word;if(0==e.sufRemoved&&e.word.length>3){var t=new RegExp("("+e.suf.suf1.split(" ").join("|")+")$");e.word=e.word.replace(t,"")}return r!=e.word&&(e.sufRemoved=!0),!1},e.removeSuf432=function(){var r=e.word;if(e.word.length>=6){var t=new RegExp("("+e.suf.suf4.split(" ").join("|")+")$");e.word=e.word.replace(t,"")}if(e.word==r&&e.word.length>=5){var c=new RegExp("("+e.suf.suf3.split(" ").join("|")+")$");e.word=e.word.replace(c,"")}if(e.word==r&&e.word.length>=4){var l=new RegExp("("+e.suf.suf2.split(" ").join("|")+")$");e.word=e.word.replace(l,"")}return r!=e.word&&(e.sufRemoved=!0),!1},e.wordCheck=function(){for(var r=(e.word,[e.removeSuf432,e.removeSuf1,e.removePre1]),t=0,c=!1;e.word.length>=7&&!e.result&&t=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}d=f.cursor,d=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("lรธs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("lรธst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu nรฅr og ogsรฅ om op os over pรฅ selv sig sin sine sit skal skulle som sรฅdan thi til ud under var vi vil ville vor vรฆre vรฆret".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.de.min.js b/assets/javascripts/lunr/min/lunr.de.min.js new file mode 100644 index 0000000..f3b5c10 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.de.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `German` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.de=function(){this.pipeline.reset(),this.pipeline.add(e.de.trimmer,e.de.stopWordFilter,e.de.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.de.stemmer))},e.de.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.de.trimmer=e.trimmerSupport.generateTrimmer(e.de.wordCharacters),e.Pipeline.registerFunction(e.de.trimmer,"trimmer-de"),e.de.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!v.eq_s(1,e)||(v.ket=v.cursor,!v.in_grouping(p,97,252)))&&(v.slice_from(r),v.cursor=n,!0)}function i(){for(var r,n,i,s,t=v.cursor;;)if(r=v.cursor,v.bra=r,v.eq_s(1,"รŸ"))v.ket=v.cursor,v.slice_from("ss");else{if(r>=v.limit)break;v.cursor=r+1}for(v.cursor=t;;)for(n=v.cursor;;){if(i=v.cursor,v.in_grouping(p,97,252)){if(s=v.cursor,v.bra=s,e("u","U",i))break;if(v.cursor=s,e("y","Y",i))break}if(i>=v.limit)return void(v.cursor=n);v.cursor=i+1}}function s(){for(;!v.in_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}for(;!v.out_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}return!1}function t(){m=v.limit,l=m;var e=v.cursor+3;0<=e&&e<=v.limit&&(d=e,s()||(m=v.cursor,m=v.limit)return;v.cursor++}}}function c(){return m<=v.cursor}function u(){return l<=v.cursor}function a(){var e,r,n,i,s=v.limit-v.cursor;if(v.ket=v.cursor,(e=v.find_among_b(w,7))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:v.slice_del(),v.ket=v.cursor,v.eq_s_b(1,"s")&&(v.bra=v.cursor,v.eq_s_b(3,"nis")&&v.slice_del());break;case 3:v.in_grouping_b(g,98,116)&&v.slice_del()}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(f,4))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:if(v.in_grouping_b(k,98,116)){var t=v.cursor-3;v.limit_backward<=t&&t<=v.limit&&(v.cursor=t,v.slice_del())}}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(_,8))&&(v.bra=v.cursor,u()))switch(e){case 1:v.slice_del(),v.ket=v.cursor,v.eq_s_b(2,"ig")&&(v.bra=v.cursor,r=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-r,u()&&v.slice_del()));break;case 2:n=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-n,v.slice_del());break;case 3:if(v.slice_del(),v.ket=v.cursor,i=v.limit-v.cursor,!v.eq_s_b(2,"er")&&(v.cursor=v.limit-i,!v.eq_s_b(2,"en")))break;v.bra=v.cursor,c()&&v.slice_del();break;case 4:v.slice_del(),v.ket=v.cursor,e=v.find_among_b(b,2),e&&(v.bra=v.cursor,u()&&1==e&&v.slice_del())}}var d,l,m,h=[new r("",-1,6),new r("U",0,2),new r("Y",0,1),new r("รค",0,3),new r("รถ",0,4),new r("รผ",0,5)],w=[new r("e",-1,2),new r("em",-1,1),new r("en",-1,2),new r("ern",-1,1),new r("er",-1,1),new r("s",-1,3),new r("es",5,2)],f=[new r("en",-1,1),new r("er",-1,1),new r("st",-1,2),new r("est",2,1)],b=[new r("ig",-1,1),new r("lich",-1,1)],_=[new r("end",-1,1),new r("ig",-1,2),new r("ung",-1,1),new r("lich",-1,3),new r("isch",-1,2),new r("ik",-1,2),new r("heit",-1,3),new r("keit",-1,4)],p=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32,8],g=[117,30,5],k=[117,30,4],v=new n;this.setCurrent=function(e){v.setCurrent(e)},this.getCurrent=function(){return v.getCurrent()},this.stem=function(){var e=v.cursor;return i(),v.cursor=e,t(),v.limit_backward=e,v.cursor=v.limit,a(),v.cursor=v.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.de.stemmer,"stemmer-de"),e.de.stopWordFilter=e.generateStopWordFilter("aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daรŸ dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures fรผr gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines kรถnnen kรถnnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte wรคhrend wรผrde wรผrden zu zum zur zwar zwischen รผber".split(" ")),e.Pipeline.registerFunction(e.de.stopWordFilter,"stopWordFilter-de")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.du.min.js b/assets/javascripts/lunr/min/lunr.du.min.js new file mode 100644 index 0000000..49a0f3f --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.du.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Dutch` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");console.warn('[Lunr Languages] Please use the "nl" instead of the "du". The "nl" code is the standard code for Dutch language, and "du" will be removed in the next major versions.'),e.du=function(){this.pipeline.reset(),this.pipeline.add(e.du.trimmer,e.du.stopWordFilter,e.du.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.du.stemmer))},e.du.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.du.trimmer=e.trimmerSupport.generateTrimmer(e.du.wordCharacters),e.Pipeline.registerFunction(e.du.trimmer,"trimmer-du"),e.du.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e,r,i,o=C.cursor;;){if(C.bra=C.cursor,e=C.find_among(b,11))switch(C.ket=C.cursor,e){case 1:C.slice_from("a");continue;case 2:C.slice_from("e");continue;case 3:C.slice_from("i");continue;case 4:C.slice_from("o");continue;case 5:C.slice_from("u");continue;case 6:if(C.cursor>=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(r=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=r);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=r;else if(n(r))break}else if(n(r))break}function n(e){return C.cursor=e,e>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,f=_,t()||(_=C.cursor,_<3&&(_=3),t()||(f=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var e;;)if(C.bra=C.cursor,e=C.find_among(p,3))switch(C.ket=C.cursor,e){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return f<=C.cursor}function a(){var e=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-e,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var e;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.slice_del(),w=!0,a())))}function m(){var e;u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.eq_s_b(3,"gem")||(C.cursor=C.limit-e,C.slice_del(),a())))}function d(){var e,r,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,e=C.find_among_b(h,5))switch(C.bra=C.cursor,e){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(z,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(r=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-r,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,e=C.find_among_b(k,6))switch(C.bra=C.cursor,e){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(j,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var f,_,w,b=[new r("",-1,6),new r("รก",0,1),new r("รค",0,1),new r("รฉ",0,2),new r("รซ",0,2),new r("รญ",0,3),new r("รฏ",0,3),new r("รณ",0,4),new r("รถ",0,4),new r("รบ",0,5),new r("รผ",0,5)],p=[new r("",-1,3),new r("I",0,2),new r("Y",0,1)],g=[new r("dd",-1,-1),new r("kk",-1,-1),new r("tt",-1,-1)],h=[new r("ene",-1,2),new r("se",-1,3),new r("en",-1,2),new r("heden",2,1),new r("s",-1,3)],k=[new r("end",-1,1),new r("ig",-1,2),new r("ing",-1,1),new r("lijk",-1,3),new r("baar",-1,4),new r("bar",-1,5)],v=[new r("aa",-1,-1),new r("ee",-1,-1),new r("oo",-1,-1),new r("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(e){C.setCurrent(e)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var r=C.cursor;return e(),C.cursor=r,o(),C.limit_backward=r,C.cursor=C.limit,d(),C.cursor=C.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.du.stemmer,"stemmer-du"),e.du.stopWordFilter=e.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),e.Pipeline.registerFunction(e.du.stopWordFilter,"stopWordFilter-du")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.es.min.js b/assets/javascripts/lunr/min/lunr.es.min.js new file mode 100644 index 0000000..2989d34 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.es.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Spanish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,s){"function"==typeof define&&define.amd?define(s):"object"==typeof exports?module.exports=s():s()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.es=function(){this.pipeline.reset(),this.pipeline.add(e.es.trimmer,e.es.stopWordFilter,e.es.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.es.stemmer))},e.es.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.es.trimmer=e.trimmerSupport.generateTrimmer(e.es.wordCharacters),e.Pipeline.registerFunction(e.es.trimmer,"trimmer-es"),e.es.stemmer=function(){var s=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(){if(A.out_grouping(x,97,252)){for(;!A.in_grouping(x,97,252);){if(A.cursor>=A.limit)return!0;A.cursor++}return!1}return!0}function n(){if(A.in_grouping(x,97,252)){var s=A.cursor;if(e()){if(A.cursor=s,!A.in_grouping(x,97,252))return!0;for(;!A.out_grouping(x,97,252);){if(A.cursor>=A.limit)return!0;A.cursor++}}return!1}return!0}function i(){var s,r=A.cursor;if(n()){if(A.cursor=r,!A.out_grouping(x,97,252))return;if(s=A.cursor,e()){if(A.cursor=s,!A.in_grouping(x,97,252)||A.cursor>=A.limit)return;A.cursor++}}g=A.cursor}function a(){for(;!A.in_grouping(x,97,252);){if(A.cursor>=A.limit)return!1;A.cursor++}for(;!A.out_grouping(x,97,252);){if(A.cursor>=A.limit)return!1;A.cursor++}return!0}function t(){var e=A.cursor;g=A.limit,p=g,v=g,i(),A.cursor=e,a()&&(p=A.cursor,a()&&(v=A.cursor))}function o(){for(var e;;){if(A.bra=A.cursor,e=A.find_among(k,6))switch(A.ket=A.cursor,e){case 1:A.slice_from("a");continue;case 2:A.slice_from("e");continue;case 3:A.slice_from("i");continue;case 4:A.slice_from("o");continue;case 5:A.slice_from("u");continue;case 6:if(A.cursor>=A.limit)break;A.cursor++;continue}break}}function u(){return g<=A.cursor}function w(){return p<=A.cursor}function c(){return v<=A.cursor}function m(){var e;if(A.ket=A.cursor,A.find_among_b(y,13)&&(A.bra=A.cursor,(e=A.find_among_b(q,11))&&u()))switch(e){case 1:A.bra=A.cursor,A.slice_from("iendo");break;case 2:A.bra=A.cursor,A.slice_from("ando");break;case 3:A.bra=A.cursor,A.slice_from("ar");break;case 4:A.bra=A.cursor,A.slice_from("er");break;case 5:A.bra=A.cursor,A.slice_from("ir");break;case 6:A.slice_del();break;case 7:A.eq_s_b(1,"u")&&A.slice_del()}}function l(e,s){if(!c())return!0;A.slice_del(),A.ket=A.cursor;var r=A.find_among_b(e,s);return r&&(A.bra=A.cursor,1==r&&c()&&A.slice_del()),!1}function d(e){return!c()||(A.slice_del(),A.ket=A.cursor,A.eq_s_b(2,e)&&(A.bra=A.cursor,c()&&A.slice_del()),!1)}function b(){var e;if(A.ket=A.cursor,e=A.find_among_b(S,46)){switch(A.bra=A.cursor,e){case 1:if(!c())return!1;A.slice_del();break;case 2:if(d("ic"))return!1;break;case 3:if(!c())return!1;A.slice_from("log");break;case 4:if(!c())return!1;A.slice_from("u");break;case 5:if(!c())return!1;A.slice_from("ente");break;case 6:if(!w())return!1;A.slice_del(),A.ket=A.cursor,e=A.find_among_b(C,4),e&&(A.bra=A.cursor,c()&&(A.slice_del(),1==e&&(A.ket=A.cursor,A.eq_s_b(2,"at")&&(A.bra=A.cursor,c()&&A.slice_del()))));break;case 7:if(l(P,3))return!1;break;case 8:if(l(F,3))return!1;break;case 9:if(d("at"))return!1}return!0}return!1}function f(){var e,s;if(A.cursor>=g&&(s=A.limit_backward,A.limit_backward=g,A.ket=A.cursor,e=A.find_among_b(W,12),A.limit_backward=s,e)){if(A.bra=A.cursor,1==e){if(!A.eq_s_b(1,"u"))return!1;A.slice_del()}return!0}return!1}function _(){var e,s,r,n;if(A.cursor>=g&&(s=A.limit_backward,A.limit_backward=g,A.ket=A.cursor,e=A.find_among_b(L,96),A.limit_backward=s,e))switch(A.bra=A.cursor,e){case 1:r=A.limit-A.cursor,A.eq_s_b(1,"u")?(n=A.limit-A.cursor,A.eq_s_b(1,"g")?A.cursor=A.limit-n:A.cursor=A.limit-r):A.cursor=A.limit-r,A.bra=A.cursor;case 2:A.slice_del()}}function h(){var e,s;if(A.ket=A.cursor,e=A.find_among_b(z,8))switch(A.bra=A.cursor,e){case 1:u()&&A.slice_del();break;case 2:u()&&(A.slice_del(),A.ket=A.cursor,A.eq_s_b(1,"u")&&(A.bra=A.cursor,s=A.limit-A.cursor,A.eq_s_b(1,"g")&&(A.cursor=A.limit-s,u()&&A.slice_del())))}}var v,p,g,k=[new s("",-1,6),new s("รก",0,1),new s("รฉ",0,2),new s("รญ",0,3),new s("รณ",0,4),new s("รบ",0,5)],y=[new s("la",-1,-1),new s("sela",0,-1),new s("le",-1,-1),new s("me",-1,-1),new s("se",-1,-1),new s("lo",-1,-1),new s("selo",5,-1),new s("las",-1,-1),new s("selas",7,-1),new s("les",-1,-1),new s("los",-1,-1),new s("selos",10,-1),new s("nos",-1,-1)],q=[new s("ando",-1,6),new s("iendo",-1,6),new s("yendo",-1,7),new s("รกndo",-1,2),new s("iรฉndo",-1,1),new s("ar",-1,6),new s("er",-1,6),new s("ir",-1,6),new s("รกr",-1,3),new s("รฉr",-1,4),new s("รญr",-1,5)],C=[new s("ic",-1,-1),new s("ad",-1,-1),new s("os",-1,-1),new s("iv",-1,1)],P=[new s("able",-1,1),new s("ible",-1,1),new s("ante",-1,1)],F=[new s("ic",-1,1),new s("abil",-1,1),new s("iv",-1,1)],S=[new s("ica",-1,1),new s("ancia",-1,2),new s("encia",-1,5),new s("adora",-1,2),new s("osa",-1,1),new s("ista",-1,1),new s("iva",-1,9),new s("anza",-1,1),new s("logรญa",-1,3),new s("idad",-1,8),new s("able",-1,1),new s("ible",-1,1),new s("ante",-1,2),new s("mente",-1,7),new s("amente",13,6),new s("aciรณn",-1,2),new s("uciรณn",-1,4),new s("ico",-1,1),new s("ismo",-1,1),new s("oso",-1,1),new s("amiento",-1,1),new s("imiento",-1,1),new s("ivo",-1,9),new s("ador",-1,2),new s("icas",-1,1),new s("ancias",-1,2),new s("encias",-1,5),new s("adoras",-1,2),new s("osas",-1,1),new s("istas",-1,1),new s("ivas",-1,9),new s("anzas",-1,1),new s("logรญas",-1,3),new s("idades",-1,8),new s("ables",-1,1),new s("ibles",-1,1),new s("aciones",-1,2),new s("uciones",-1,4),new s("adores",-1,2),new s("antes",-1,2),new s("icos",-1,1),new s("ismos",-1,1),new s("osos",-1,1),new s("amientos",-1,1),new s("imientos",-1,1),new s("ivos",-1,9)],W=[new s("ya",-1,1),new s("ye",-1,1),new s("yan",-1,1),new s("yen",-1,1),new s("yeron",-1,1),new s("yendo",-1,1),new s("yo",-1,1),new s("yas",-1,1),new s("yes",-1,1),new s("yais",-1,1),new s("yamos",-1,1),new s("yรณ",-1,1)],L=[new s("aba",-1,2),new s("ada",-1,2),new s("ida",-1,2),new s("ara",-1,2),new s("iera",-1,2),new s("รญa",-1,2),new s("arรญa",5,2),new s("erรญa",5,2),new s("irรญa",5,2),new s("ad",-1,2),new s("ed",-1,2),new s("id",-1,2),new s("ase",-1,2),new s("iese",-1,2),new s("aste",-1,2),new s("iste",-1,2),new s("an",-1,2),new s("aban",16,2),new s("aran",16,2),new s("ieran",16,2),new s("รญan",16,2),new s("arรญan",20,2),new s("erรญan",20,2),new s("irรญan",20,2),new s("en",-1,1),new s("asen",24,2),new s("iesen",24,2),new s("aron",-1,2),new s("ieron",-1,2),new s("arรกn",-1,2),new s("erรกn",-1,2),new s("irรกn",-1,2),new s("ado",-1,2),new s("ido",-1,2),new s("ando",-1,2),new s("iendo",-1,2),new s("ar",-1,2),new s("er",-1,2),new s("ir",-1,2),new s("as",-1,2),new s("abas",39,2),new s("adas",39,2),new s("idas",39,2),new s("aras",39,2),new s("ieras",39,2),new s("รญas",39,2),new s("arรญas",45,2),new s("erรญas",45,2),new s("irรญas",45,2),new s("es",-1,1),new s("ases",49,2),new s("ieses",49,2),new s("abais",-1,2),new s("arais",-1,2),new s("ierais",-1,2),new s("รญais",-1,2),new s("arรญais",55,2),new s("erรญais",55,2),new s("irรญais",55,2),new s("aseis",-1,2),new s("ieseis",-1,2),new s("asteis",-1,2),new s("isteis",-1,2),new s("รกis",-1,2),new s("รฉis",-1,1),new s("arรฉis",64,2),new s("erรฉis",64,2),new s("irรฉis",64,2),new s("ados",-1,2),new s("idos",-1,2),new s("amos",-1,2),new s("รกbamos",70,2),new s("รกramos",70,2),new s("iรฉramos",70,2),new s("รญamos",70,2),new s("arรญamos",74,2),new s("erรญamos",74,2),new s("irรญamos",74,2),new s("emos",-1,1),new s("aremos",78,2),new s("eremos",78,2),new s("iremos",78,2),new s("รกsemos",78,2),new s("iรฉsemos",78,2),new s("imos",-1,2),new s("arรกs",-1,2),new s("erรกs",-1,2),new s("irรกs",-1,2),new s("รญs",-1,2),new s("arรก",-1,2),new s("erรก",-1,2),new s("irรก",-1,2),new s("arรฉ",-1,2),new s("erรฉ",-1,2),new s("irรฉ",-1,2),new s("iรณ",-1,2)],z=[new s("a",-1,1),new s("e",-1,2),new s("o",-1,1),new s("os",-1,1),new s("รก",-1,1),new s("รฉ",-1,2),new s("รญ",-1,1),new s("รณ",-1,1)],x=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,4,10],A=new r;this.setCurrent=function(e){A.setCurrent(e)},this.getCurrent=function(){return A.getCurrent()},this.stem=function(){var e=A.cursor;return t(),A.limit_backward=e,A.cursor=A.limit,m(),A.cursor=A.limit,b()||(A.cursor=A.limit,f()||(A.cursor=A.limit,_())),A.cursor=A.limit,h(),A.cursor=A.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.es.stemmer,"stemmer-es"),e.es.stopWordFilter=e.generateStopWordFilter("a al algo algunas algunos ante antes como con contra cual cuando de del desde donde durante e el ella ellas ellos en entre era erais eran eras eres es esa esas ese eso esos esta estaba estabais estaban estabas estad estada estadas estado estados estamos estando estar estaremos estarรก estarรกn estarรกs estarรฉ estarรฉis estarรญa estarรญais estarรญamos estarรญan estarรญas estas este estemos esto estos estoy estuve estuviera estuvierais estuvieran estuvieras estuvieron estuviese estuvieseis estuviesen estuvieses estuvimos estuviste estuvisteis estuviรฉramos estuviรฉsemos estuvo estรก estรกbamos estรกis estรกn estรกs estรฉ estรฉis estรฉn estรฉs fue fuera fuerais fueran fueras fueron fuese fueseis fuesen fueses fui fuimos fuiste fuisteis fuรฉramos fuรฉsemos ha habida habidas habido habidos habiendo habremos habrรก habrรกn habrรกs habrรฉ habrรฉis habrรญa habrรญais habrรญamos habrรญan habrรญas habรฉis habรญa habรญais habรญamos habรญan habรญas han has hasta hay haya hayamos hayan hayas hayรกis he hemos hube hubiera hubierais hubieran hubieras hubieron hubiese hubieseis hubiesen hubieses hubimos hubiste hubisteis hubiรฉramos hubiรฉsemos hubo la las le les lo los me mi mis mucho muchos muy mรกs mรญ mรญa mรญas mรญo mรญos nada ni no nos nosotras nosotros nuestra nuestras nuestro nuestros o os otra otras otro otros para pero poco por porque que quien quienes quรฉ se sea seamos sean seas seremos serรก serรกn serรกs serรฉ serรฉis serรญa serรญais serรญamos serรญan serรญas seรกis sido siendo sin sobre sois somos son soy su sus suya suyas suyo suyos sรญ tambiรฉn tanto te tendremos tendrรก tendrรกn tendrรกs tendrรฉ tendrรฉis tendrรญa tendrรญais tendrรญamos tendrรญan tendrรญas tened tenemos tenga tengamos tengan tengas tengo tengรกis tenida tenidas tenido tenidos teniendo tenรฉis tenรญa tenรญais tenรญamos tenรญan tenรญas ti tiene tienen tienes todo todos tu tus tuve tuviera tuvierais tuvieran tuvieras tuvieron tuviese tuvieseis tuviesen tuvieses tuvimos tuviste tuvisteis tuviรฉramos tuviรฉsemos tuvo tuya tuyas tuyo tuyos tรบ un una uno unos vosotras vosotros vuestra vuestras vuestro vuestros y ya yo รฉl รฉramos".split(" ")),e.Pipeline.registerFunction(e.es.stopWordFilter,"stopWordFilter-es")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.fi.min.js b/assets/javascripts/lunr/min/lunr.fi.min.js new file mode 100644 index 0000000..29f5dfc --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.fi.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Finnish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(i,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(i.lunr)}(this,function(){return function(i){if(void 0===i)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===i.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");i.fi=function(){this.pipeline.reset(),this.pipeline.add(i.fi.trimmer,i.fi.stopWordFilter,i.fi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(i.fi.stemmer))},i.fi.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",i.fi.trimmer=i.trimmerSupport.generateTrimmer(i.fi.wordCharacters),i.Pipeline.registerFunction(i.fi.trimmer,"trimmer-fi"),i.fi.stemmer=function(){var e=i.stemmerSupport.Among,r=i.stemmerSupport.SnowballProgram,n=new function(){function i(){f=A.limit,d=f,n()||(f=A.cursor,n()||(d=A.cursor))}function n(){for(var i;;){if(i=A.cursor,A.in_grouping(W,97,246))break;if(A.cursor=i,i>=A.limit)return!0;A.cursor++}for(A.cursor=i;!A.out_grouping(W,97,246);){if(A.cursor>=A.limit)return!0;A.cursor++}return!1}function t(){return d<=A.cursor}function s(){var i,e;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(h,10)){switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:if(!A.in_grouping_b(x,97,246))return;break;case 2:if(!t())return}A.slice_del()}else A.limit_backward=e}function o(){var i,e,r;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(v,9))switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:r=A.limit-A.cursor,A.eq_s_b(1,"k")||(A.cursor=A.limit-r,A.slice_del());break;case 2:A.slice_del(),A.ket=A.cursor,A.eq_s_b(3,"kse")&&(A.bra=A.cursor,A.slice_from("ksi"));break;case 3:A.slice_del();break;case 4:A.find_among_b(p,6)&&A.slice_del();break;case 5:A.find_among_b(g,6)&&A.slice_del();break;case 6:A.find_among_b(j,2)&&A.slice_del()}else A.limit_backward=e}function l(){return A.find_among_b(q,7)}function a(){return A.eq_s_b(1,"i")&&A.in_grouping_b(L,97,246)}function u(){var i,e,r;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(C,30)){switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:if(!A.eq_s_b(1,"a"))return;break;case 2:case 9:if(!A.eq_s_b(1,"e"))return;break;case 3:if(!A.eq_s_b(1,"i"))return;break;case 4:if(!A.eq_s_b(1,"o"))return;break;case 5:if(!A.eq_s_b(1,"รค"))return;break;case 6:if(!A.eq_s_b(1,"รถ"))return;break;case 7:if(r=A.limit-A.cursor,!l()&&(A.cursor=A.limit-r,!A.eq_s_b(2,"ie"))){A.cursor=A.limit-r;break}if(A.cursor=A.limit-r,A.cursor<=A.limit_backward){A.cursor=A.limit-r;break}A.cursor--,A.bra=A.cursor;break;case 8:if(!A.in_grouping_b(W,97,246)||!A.out_grouping_b(W,97,246))return}A.slice_del(),k=!0}else A.limit_backward=e}function c(){var i,e,r;if(A.cursor>=d)if(e=A.limit_backward,A.limit_backward=d,A.ket=A.cursor,i=A.find_among_b(P,14)){if(A.bra=A.cursor,A.limit_backward=e,1==i){if(r=A.limit-A.cursor,A.eq_s_b(2,"po"))return;A.cursor=A.limit-r}A.slice_del()}else A.limit_backward=e}function m(){var i;A.cursor>=f&&(i=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,A.find_among_b(F,2)?(A.bra=A.cursor,A.limit_backward=i,A.slice_del()):A.limit_backward=i)}function w(){var i,e,r,n,t,s;if(A.cursor>=f){if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,A.eq_s_b(1,"t")&&(A.bra=A.cursor,r=A.limit-A.cursor,A.in_grouping_b(W,97,246)&&(A.cursor=A.limit-r,A.slice_del(),A.limit_backward=e,n=A.limit-A.cursor,A.cursor>=d&&(A.cursor=d,t=A.limit_backward,A.limit_backward=A.cursor,A.cursor=A.limit-n,A.ket=A.cursor,i=A.find_among_b(S,2))))){if(A.bra=A.cursor,A.limit_backward=t,1==i){if(s=A.limit-A.cursor,A.eq_s_b(2,"po"))return;A.cursor=A.limit-s}return void A.slice_del()}A.limit_backward=e}}function _(){var i,e,r,n;if(A.cursor>=f){for(i=A.limit_backward,A.limit_backward=f,e=A.limit-A.cursor,l()&&(A.cursor=A.limit-e,A.ket=A.cursor,A.cursor>A.limit_backward&&(A.cursor--,A.bra=A.cursor,A.slice_del())),A.cursor=A.limit-e,A.ket=A.cursor,A.in_grouping_b(y,97,228)&&(A.bra=A.cursor,A.out_grouping_b(W,97,246)&&A.slice_del()),A.cursor=A.limit-e,A.ket=A.cursor,A.eq_s_b(1,"j")&&(A.bra=A.cursor,r=A.limit-A.cursor,A.eq_s_b(1,"o")?A.slice_del():(A.cursor=A.limit-r,A.eq_s_b(1,"u")&&A.slice_del())),A.cursor=A.limit-e,A.ket=A.cursor,A.eq_s_b(1,"o")&&(A.bra=A.cursor,A.eq_s_b(1,"j")&&A.slice_del()),A.cursor=A.limit-e,A.limit_backward=i;;){if(n=A.limit-A.cursor,A.out_grouping_b(W,97,246)){A.cursor=A.limit-n;break}if(A.cursor=A.limit-n,A.cursor<=A.limit_backward)return;A.cursor--}A.ket=A.cursor,A.cursor>A.limit_backward&&(A.cursor--,A.bra=A.cursor,b=A.slice_to(),A.eq_v_b(b)&&A.slice_del())}}var k,b,d,f,h=[new e("pa",-1,1),new e("sti",-1,2),new e("kaan",-1,1),new e("han",-1,1),new e("kin",-1,1),new e("hรคn",-1,1),new e("kรครคn",-1,1),new e("ko",-1,1),new e("pรค",-1,1),new e("kรถ",-1,1)],p=[new e("lla",-1,-1),new e("na",-1,-1),new e("ssa",-1,-1),new e("ta",-1,-1),new e("lta",3,-1),new e("sta",3,-1)],g=[new e("llรค",-1,-1),new e("nรค",-1,-1),new e("ssรค",-1,-1),new e("tรค",-1,-1),new e("ltรค",3,-1),new e("stรค",3,-1)],j=[new e("lle",-1,-1),new e("ine",-1,-1)],v=[new e("nsa",-1,3),new e("mme",-1,3),new e("nne",-1,3),new e("ni",-1,2),new e("si",-1,1),new e("an",-1,4),new e("en",-1,6),new e("รคn",-1,5),new e("nsรค",-1,3)],q=[new e("aa",-1,-1),new e("ee",-1,-1),new e("ii",-1,-1),new e("oo",-1,-1),new e("uu",-1,-1),new e("รครค",-1,-1),new e("รถรถ",-1,-1)],C=[new e("a",-1,8),new e("lla",0,-1),new e("na",0,-1),new e("ssa",0,-1),new e("ta",0,-1),new e("lta",4,-1),new e("sta",4,-1),new e("tta",4,9),new e("lle",-1,-1),new e("ine",-1,-1),new e("ksi",-1,-1),new e("n",-1,7),new e("han",11,1),new e("den",11,-1,a),new e("seen",11,-1,l),new e("hen",11,2),new e("tten",11,-1,a),new e("hin",11,3),new e("siin",11,-1,a),new e("hon",11,4),new e("hรคn",11,5),new e("hรถn",11,6),new e("รค",-1,8),new e("llรค",22,-1),new e("nรค",22,-1),new e("ssรค",22,-1),new e("tรค",22,-1),new e("ltรค",26,-1),new e("stรค",26,-1),new e("ttรค",26,9)],P=[new e("eja",-1,-1),new e("mma",-1,1),new e("imma",1,-1),new e("mpa",-1,1),new e("impa",3,-1),new e("mmi",-1,1),new e("immi",5,-1),new e("mpi",-1,1),new e("impi",7,-1),new e("ejรค",-1,-1),new e("mmรค",-1,1),new e("immรค",10,-1),new e("mpรค",-1,1),new e("impรค",12,-1)],F=[new e("i",-1,-1),new e("j",-1,-1)],S=[new e("mma",-1,1),new e("imma",0,-1)],y=[17,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8],W=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],L=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],x=[17,97,24,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],A=new r;this.setCurrent=function(i){A.setCurrent(i)},this.getCurrent=function(){return A.getCurrent()},this.stem=function(){var e=A.cursor;return i(),k=!1,A.limit_backward=e,A.cursor=A.limit,s(),A.cursor=A.limit,o(),A.cursor=A.limit,u(),A.cursor=A.limit,c(),A.cursor=A.limit,k?(m(),A.cursor=A.limit):(A.cursor=A.limit,w(),A.cursor=A.limit),_(),!0}};return function(i){return"function"==typeof i.update?i.update(function(i){return n.setCurrent(i),n.stem(),n.getCurrent()}):(n.setCurrent(i),n.stem(),n.getCurrent())}}(),i.Pipeline.registerFunction(i.fi.stemmer,"stemmer-fi"),i.fi.stopWordFilter=i.generateStopWordFilter("ei eivรคt emme en et ette ettรค he heidรคn heidรคt heihin heille heillรค heiltรค heissรค heistรค heitรค hรคn hรคneen hรคnelle hรคnellรค hรคneltรค hรคnen hรคnessรค hรคnestรค hรคnet hรคntรค itse ja johon joiden joihin joiksi joilla joille joilta joina joissa joista joita joka joksi jolla jolle jolta jona jonka jos jossa josta jota jotka kanssa keiden keihin keiksi keille keillรค keiltรค keinรค keissรค keistรค keitรค keneen keneksi kenelle kenellรค keneltรค kenen kenenรค kenessรค kenestรค kenet ketkรค ketkรค ketรค koska kuin kuka kun me meidรคn meidรคt meihin meille meillรค meiltรค meissรค meistรค meitรค mihin miksi mikรค mille millรค miltรค minkรค minkรค minua minulla minulle minulta minun minussa minusta minut minuun minรค minรค missรค mistรค mitkรค mitรค mukaan mutta ne niiden niihin niiksi niille niillรค niiltรค niin niin niinรค niissรค niistรค niitรค noiden noihin noiksi noilla noille noilta noin noina noissa noista noita nuo nyt nรคiden nรคihin nรคiksi nรคille nรคillรค nรคiltรค nรคinรค nรคissรค nรคistรค nรคitรค nรคmรค ole olemme olen olet olette oli olimme olin olisi olisimme olisin olisit olisitte olisivat olit olitte olivat olla olleet ollut on ovat poikki se sekรค sen siihen siinรค siitรค siksi sille sillรค sillรค siltรค sinua sinulla sinulle sinulta sinun sinussa sinusta sinut sinuun sinรค sinรค sitรค tai te teidรคn teidรคt teihin teille teillรค teiltรค teissรค teistรค teitรค tuo tuohon tuoksi tuolla tuolle tuolta tuon tuona tuossa tuosta tuota tรคhรคn tรคksi tรคlle tรคllรค tรคltรค tรคmรค tรคmรคn tรคnรค tรคssรค tรคstรค tรคtรค vaan vai vaikka yli".split(" ")),i.Pipeline.registerFunction(i.fi.stopWordFilter,"stopWordFilter-fi")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.fr.min.js b/assets/javascripts/lunr/min/lunr.fr.min.js new file mode 100644 index 0000000..68cd009 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.fr.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `French` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.fr=function(){this.pipeline.reset(),this.pipeline.add(e.fr.trimmer,e.fr.stopWordFilter,e.fr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.fr.stemmer))},e.fr.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.fr.trimmer=e.trimmerSupport.generateTrimmer(e.fr.wordCharacters),e.Pipeline.registerFunction(e.fr.trimmer,"trimmer-fr"),e.fr.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,s){return!(!W.eq_s(1,e)||(W.ket=W.cursor,!W.in_grouping(F,97,251)))&&(W.slice_from(r),W.cursor=s,!0)}function i(e,r,s){return!!W.eq_s(1,e)&&(W.ket=W.cursor,W.slice_from(r),W.cursor=s,!0)}function n(){for(var r,s;;){if(r=W.cursor,W.in_grouping(F,97,251)){if(W.bra=W.cursor,s=W.cursor,e("u","U",r))continue;if(W.cursor=s,e("i","I",r))continue;if(W.cursor=s,i("y","Y",r))continue}if(W.cursor=r,W.bra=r,!e("y","Y",r)){if(W.cursor=r,W.eq_s(1,"q")&&(W.bra=W.cursor,i("u","U",r)))continue;if(W.cursor=r,r>=W.limit)return;W.cursor++}}}function t(){for(;!W.in_grouping(F,97,251);){if(W.cursor>=W.limit)return!0;W.cursor++}for(;!W.out_grouping(F,97,251);){if(W.cursor>=W.limit)return!0;W.cursor++}return!1}function u(){var e=W.cursor;if(q=W.limit,g=q,p=q,W.in_grouping(F,97,251)&&W.in_grouping(F,97,251)&&W.cursor=W.limit){W.cursor=q;break}W.cursor++}while(!W.in_grouping(F,97,251))}q=W.cursor,W.cursor=e,t()||(g=W.cursor,t()||(p=W.cursor))}function o(){for(var e,r;;){if(r=W.cursor,W.bra=r,!(e=W.find_among(h,4)))break;switch(W.ket=W.cursor,e){case 1:W.slice_from("i");break;case 2:W.slice_from("u");break;case 3:W.slice_from("y");break;case 4:if(W.cursor>=W.limit)return;W.cursor++}}}function c(){return q<=W.cursor}function a(){return g<=W.cursor}function l(){return p<=W.cursor}function w(){var e,r;if(W.ket=W.cursor,e=W.find_among_b(C,43)){switch(W.bra=W.cursor,e){case 1:if(!l())return!1;W.slice_del();break;case 2:if(!l())return!1;W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"ic")&&(W.bra=W.cursor,l()?W.slice_del():W.slice_from("iqU"));break;case 3:if(!l())return!1;W.slice_from("log");break;case 4:if(!l())return!1;W.slice_from("u");break;case 5:if(!l())return!1;W.slice_from("ent");break;case 6:if(!c())return!1;if(W.slice_del(),W.ket=W.cursor,e=W.find_among_b(z,6))switch(W.bra=W.cursor,e){case 1:l()&&(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"at")&&(W.bra=W.cursor,l()&&W.slice_del()));break;case 2:l()?W.slice_del():a()&&W.slice_from("eux");break;case 3:l()&&W.slice_del();break;case 4:c()&&W.slice_from("i")}break;case 7:if(!l())return!1;if(W.slice_del(),W.ket=W.cursor,e=W.find_among_b(y,3))switch(W.bra=W.cursor,e){case 1:l()?W.slice_del():W.slice_from("abl");break;case 2:l()?W.slice_del():W.slice_from("iqU");break;case 3:l()&&W.slice_del()}break;case 8:if(!l())return!1;if(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"at")&&(W.bra=W.cursor,l()&&(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"ic")))){W.bra=W.cursor,l()?W.slice_del():W.slice_from("iqU");break}break;case 9:W.slice_from("eau");break;case 10:if(!a())return!1;W.slice_from("al");break;case 11:if(l())W.slice_del();else{if(!a())return!1;W.slice_from("eux")}break;case 12:if(!a()||!W.out_grouping_b(F,97,251))return!1;W.slice_del();break;case 13:return c()&&W.slice_from("ant"),!1;case 14:return c()&&W.slice_from("ent"),!1;case 15:return r=W.limit-W.cursor,W.in_grouping_b(F,97,251)&&c()&&(W.cursor=W.limit-r,W.slice_del()),!1}return!0}return!1}function f(){var e,r;if(W.cursor=q){if(s=W.limit_backward,W.limit_backward=q,W.ket=W.cursor,e=W.find_among_b(P,7))switch(W.bra=W.cursor,e){case 1:if(l()){if(i=W.limit-W.cursor,!W.eq_s_b(1,"s")&&(W.cursor=W.limit-i,!W.eq_s_b(1,"t")))break;W.slice_del()}break;case 2:W.slice_from("i");break;case 3:W.slice_del();break;case 4:W.eq_s_b(2,"gu")&&W.slice_del()}W.limit_backward=s}}function b(){var e=W.limit-W.cursor;W.find_among_b(U,5)&&(W.cursor=W.limit-e,W.ket=W.cursor,W.cursor>W.limit_backward&&(W.cursor--,W.bra=W.cursor,W.slice_del()))}function d(){for(var e,r=1;W.out_grouping_b(F,97,251);)r--;if(r<=0){if(W.ket=W.cursor,e=W.limit-W.cursor,!W.eq_s_b(1,"รฉ")&&(W.cursor=W.limit-e,!W.eq_s_b(1,"รจ")))return;W.bra=W.cursor,W.slice_from("e")}}function k(){if(!w()&&(W.cursor=W.limit,!f()&&(W.cursor=W.limit,!m())))return W.cursor=W.limit,void _();W.cursor=W.limit,W.ket=W.cursor,W.eq_s_b(1,"Y")?(W.bra=W.cursor,W.slice_from("i")):(W.cursor=W.limit,W.eq_s_b(1,"รง")&&(W.bra=W.cursor,W.slice_from("c")))}var p,g,q,v=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],h=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],z=[new r("iqU",-1,3),new r("abl",-1,3),new r("Iรจr",-1,4),new r("iรจr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],y=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],C=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("itรฉs",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("itรฉ",-1,7)],x=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("รฎmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("รฎtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("รฎt",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],I=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("รฉe",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("รขmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("รขtes",-1,3),new r("รฉes",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("รฉs",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("รจrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("รขt",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("รฉ",-1,2)],P=[new r("e",-1,3),new r("Iรจre",0,2),new r("iรจre",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("รซ",-1,4)],U=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],F=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],S=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],W=new s;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,u(),W.limit_backward=e,W.cursor=W.limit,k(),W.cursor=W.limit,b(),W.cursor=W.limit,d(),W.cursor=W.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celร  ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eรปmes eรปt eรปtes furent fus fusse fussent fusses fussiez fussions fut fรปmes fรปt fรปtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon mรชme n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y ร  รฉtaient รฉtais รฉtait รฉtant รฉtiez รฉtions รฉtรฉ รฉtรฉe รฉtรฉes รฉtรฉs รชtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.hi.min.js b/assets/javascripts/lunr/min/lunr.hi.min.js new file mode 100644 index 0000000..7dbc414 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.hi.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hi=function(){this.pipeline.reset(),this.pipeline.add(e.hi.trimmer,e.hi.stopWordFilter,e.hi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hi.stemmer))},e.hi.wordCharacters="เค€-เคƒเค„-เคเค-เคŸเค -เคฏเคฐ-เคฟเฅ€-เฅเฅ-เฅŸเฅ -เฅฏเฅฐ-เฅฟa-zA-Z๏ฝ-๏ฝš๏ผก-๏ผบ0-9๏ผ-๏ผ™",e.hi.trimmer=e.trimmerSupport.generateTrimmer(e.hi.wordCharacters),e.Pipeline.registerFunction(e.hi.trimmer,"trimmer-hi"),e.hi.stopWordFilter=e.generateStopWordFilter("เค…เคค เค…เคชเคจเคพ เค…เคชเคจเฅ€ เค…เคชเคจเฅ‡ เค…เคญเฅ€ เค…เค‚เคฆเคฐ เค†เคฆเคฟ เค†เคช เค‡เคคเฅเคฏเคพเคฆเคฟ เค‡เคจ เค‡เคจเค•เคพ เค‡เคจเฅเคนเฅ€เค‚ เค‡เคจเฅเคนเฅ‡เค‚ เค‡เคจเฅเคนเฅ‹เค‚ เค‡เคธ เค‡เคธเค•เคพ เค‡เคธเค•เฅ€ เค‡เคธเค•เฅ‡ เค‡เคธเคฎเฅ‡เค‚ เค‡เคธเฅ€ เค‡เคธเฅ‡ เค‰เคจ เค‰เคจเค•เคพ เค‰เคจเค•เฅ€ เค‰เคจเค•เฅ‡ เค‰เคจเค•เฅ‹ เค‰เคจเฅเคนเฅ€เค‚ เค‰เคจเฅเคนเฅ‡เค‚ เค‰เคจเฅเคนเฅ‹เค‚ เค‰เคธ เค‰เคธเค•เฅ‡ เค‰เคธเฅ€ เค‰เคธเฅ‡ เคเค• เคเคตเค‚ เคเคธ เคเคธเฅ‡ เค”เคฐ เค•เคˆ เค•เคฐ เค•เคฐเคคเคพ เค•เคฐเคคเฅ‡ เค•เคฐเคจเคพ เค•เคฐเคจเฅ‡ เค•เคฐเฅ‡เค‚ เค•เคนเคคเฅ‡ เค•เคนเคพ เค•เคพ เค•เคพเฅžเฅ€ เค•เคฟ เค•เคฟเคคเคจเคพ เค•เคฟเคจเฅเคนเฅ‡เค‚ เค•เคฟเคจเฅเคนเฅ‹เค‚ เค•เคฟเคฏเคพ เค•เคฟเคฐ เค•เคฟเคธ เค•เคฟเคธเฅ€ เค•เคฟเคธเฅ‡ เค•เฅ€ เค•เฅเค› เค•เฅเคฒ เค•เฅ‡ เค•เฅ‹ เค•เฅ‹เคˆ เค•เฅŒเคจ เค•เฅŒเคจเคธเคพ เค—เคฏเคพ เค˜เคฐ เคœเคฌ เคœเคนเคพเค เคœเคพ เคœเคฟเคคเคจเคพ เคœเคฟเคจ เคœเคฟเคจเฅเคนเฅ‡เค‚ เคœเคฟเคจเฅเคนเฅ‹เค‚ เคœเคฟเคธ เคœเคฟเคธเฅ‡ เคœเฅ€เคงเคฐ เคœเฅˆเคธเคพ เคœเฅˆเคธเฅ‡ เคœเฅ‹ เคคเค• เคคเคฌ เคคเคฐเคน เคคเคฟเคจ เคคเคฟเคจเฅเคนเฅ‡เค‚ เคคเคฟเคจเฅเคนเฅ‹เค‚ เคคเคฟเคธ เคคเคฟเคธเฅ‡ เคคเฅ‹ เคฅเคพ เคฅเฅ€ เคฅเฅ‡ เคฆเคฌเคพเคฐเคพ เคฆเคฟเคฏเคพ เคฆเฅเคธเคฐเคพ เคฆเฅ‚เคธเคฐเฅ‡ เคฆเฅ‹ เคฆเฅเคตเคพเคฐเคพ เคจ เคจเค•เฅ‡ เคจเคนเฅ€เค‚ เคจเคพ เคจเคฟเคนเคพเคฏเคค เคจเฅ€เคšเฅ‡ เคจเฅ‡ เคชเคฐ เคชเคนเคฒเฅ‡ เคชเฅ‚เคฐเคพ เคชเฅ‡ เคซเคฟเคฐ เคฌเคจเฅ€ เคฌเคนเฅ€ เคฌเคนเฅเคค เคฌเคพเคฆ เคฌเคพเคฒเคพ เคฌเคฟเคฒเค•เฅเคฒ เคญเฅ€ เคญเฅ€เคคเคฐ เคฎเค—เคฐ เคฎเคพเคจเฅ‹ เคฎเฅ‡ เคฎเฅ‡เค‚ เคฏเคฆเคฟ เคฏเคน เคฏเคนเคพเค เคฏเคนเฅ€ เคฏเคพ เคฏเคฟเคน เคฏเฅ‡ เคฐเค–เฅ‡เค‚ เคฐเคนเคพ เคฐเคนเฅ‡ เคฑเฅเคตเคพเคธเคพ เคฒเคฟเค เคฒเคฟเคฏเฅ‡ เคฒเฅ‡เค•เคฟเคจ เคต เคตเฅšเฅˆเคฐเคน เคตเคฐเฅเค— เคตเคน เคตเคนเคพเค เคตเคนเฅ€เค‚ เคตเคพเคฒเฅ‡ เคตเฅเคน เคตเฅ‡ เคตเฅ‹ เคธเค•เคคเคพ เคธเค•เคคเฅ‡ เคธเคฌเคธเฅ‡ เคธเคญเฅ€ เคธเคพเคฅ เคธเคพเคฌเฅเคค เคธเคพเคญ เคธเคพเคฐเคพ เคธเฅ‡ เคธเฅ‹ เคธเค‚เค— เคนเฅ€ เคนเฅเค† เคนเฅเคˆ เคนเฅเค เคนเฅˆ เคนเฅˆเค‚ เคนเฅ‹ เคนเฅ‹เคคเคพ เคนเฅ‹เคคเฅ€ เคนเฅ‹เคคเฅ‡ เคนเฅ‹เคจเคพ เคนเฅ‹เคจเฅ‡".split(" ")),e.hi.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var r=e.wordcut;r.init(),e.hi.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(r){return isLunr2?new e.Token(r.toLowerCase()):r.toLowerCase()});var t=i.toString().toLowerCase().replace(/^\s+/,"");return r.cut(t).split("|")},e.Pipeline.registerFunction(e.hi.stemmer,"stemmer-hi"),e.Pipeline.registerFunction(e.hi.stopWordFilter,"stopWordFilter-hi")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.hu.min.js b/assets/javascripts/lunr/min/lunr.hu.min.js new file mode 100644 index 0000000..ed9d909 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.hu.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Hungarian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hu=function(){this.pipeline.reset(),this.pipeline.add(e.hu.trimmer,e.hu.stopWordFilter,e.hu.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hu.stemmer))},e.hu.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.hu.trimmer=e.trimmerSupport.generateTrimmer(e.hu.wordCharacters),e.Pipeline.registerFunction(e.hu.trimmer,"trimmer-hu"),e.hu.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,n=L.cursor;if(d=L.limit,L.in_grouping(W,97,252))for(;;){if(e=L.cursor,L.out_grouping(W,97,252))return L.cursor=e,L.find_among(g,8)||(L.cursor=e,e=L.limit)return void(d=e);L.cursor++}if(L.cursor=n,L.out_grouping(W,97,252)){for(;!L.in_grouping(W,97,252);){if(L.cursor>=L.limit)return;L.cursor++}d=L.cursor}}function i(){return d<=L.cursor}function a(){var e;if(L.ket=L.cursor,(e=L.find_among_b(h,2))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e")}}function t(){var e=L.limit-L.cursor;return!!L.find_among_b(p,23)&&(L.cursor=L.limit-e,!0)}function s(){if(L.cursor>L.limit_backward){L.cursor--,L.ket=L.cursor;var e=L.cursor-1;L.limit_backward<=e&&e<=L.limit&&(L.cursor=e,L.bra=e,L.slice_del())}}function c(){var e;if(L.ket=L.cursor,(e=L.find_among_b(_,2))&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function o(){L.ket=L.cursor,L.find_among_b(v,44)&&(L.bra=L.cursor,i()&&(L.slice_del(),a()))}function w(){var e;if(L.ket=L.cursor,(e=L.find_among_b(z,3))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("e");break;case 2:case 3:L.slice_from("a")}}function l(){var e;if(L.ket=L.cursor,(e=L.find_among_b(y,6))&&(L.bra=L.cursor,i()))switch(e){case 1:case 2:L.slice_del();break;case 3:L.slice_from("a");break;case 4:L.slice_from("e")}}function u(){var e;if(L.ket=L.cursor,(e=L.find_among_b(j,2))&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function m(){var e;if(L.ket=L.cursor,(e=L.find_among_b(C,7))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e");break;case 3:case 4:case 5:case 6:case 7:L.slice_del()}}function k(){var e;if(L.ket=L.cursor,(e=L.find_among_b(P,12))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 9:L.slice_del();break;case 2:case 5:case 8:L.slice_from("e");break;case 3:case 6:L.slice_from("a")}}function f(){var e;if(L.ket=L.cursor,(e=L.find_among_b(F,31))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 8:case 9:case 12:case 13:case 16:case 17:case 18:L.slice_del();break;case 2:case 5:case 10:case 14:case 19:L.slice_from("a");break;case 3:case 6:case 11:case 15:case 20:L.slice_from("e")}}function b(){var e;if(L.ket=L.cursor,(e=L.find_among_b(S,42))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 5:case 6:case 9:case 10:case 11:case 14:case 15:case 16:case 17:case 20:case 21:case 24:case 25:case 26:case 29:L.slice_del();break;case 2:case 7:case 12:case 18:case 22:case 27:L.slice_from("a");break;case 3:case 8:case 13:case 19:case 23:case 28:L.slice_from("e")}}var d,g=[new n("cs",-1,-1),new n("dzs",-1,-1),new n("gy",-1,-1),new n("ly",-1,-1),new n("ny",-1,-1),new n("sz",-1,-1),new n("ty",-1,-1),new n("zs",-1,-1)],h=[new n("รก",-1,1),new n("รฉ",-1,2)],p=[new n("bb",-1,-1),new n("cc",-1,-1),new n("dd",-1,-1),new n("ff",-1,-1),new n("gg",-1,-1),new n("jj",-1,-1),new n("kk",-1,-1),new n("ll",-1,-1),new n("mm",-1,-1),new n("nn",-1,-1),new n("pp",-1,-1),new n("rr",-1,-1),new n("ccs",-1,-1),new n("ss",-1,-1),new n("zzs",-1,-1),new n("tt",-1,-1),new n("vv",-1,-1),new n("ggy",-1,-1),new n("lly",-1,-1),new n("nny",-1,-1),new n("tty",-1,-1),new n("ssz",-1,-1),new n("zz",-1,-1)],_=[new n("al",-1,1),new n("el",-1,2)],v=[new n("ba",-1,-1),new n("ra",-1,-1),new n("be",-1,-1),new n("re",-1,-1),new n("ig",-1,-1),new n("nak",-1,-1),new n("nek",-1,-1),new n("val",-1,-1),new n("vel",-1,-1),new n("ul",-1,-1),new n("nรกl",-1,-1),new n("nรฉl",-1,-1),new n("bรณl",-1,-1),new n("rรณl",-1,-1),new n("tรณl",-1,-1),new n("bรตl",-1,-1),new n("rรตl",-1,-1),new n("tรตl",-1,-1),new n("รผl",-1,-1),new n("n",-1,-1),new n("an",19,-1),new n("ban",20,-1),new n("en",19,-1),new n("ben",22,-1),new n("kรฉppen",22,-1),new n("on",19,-1),new n("รถn",19,-1),new n("kรฉpp",-1,-1),new n("kor",-1,-1),new n("t",-1,-1),new n("at",29,-1),new n("et",29,-1),new n("kรฉnt",29,-1),new n("ankรฉnt",32,-1),new n("enkรฉnt",32,-1),new n("onkรฉnt",32,-1),new n("ot",29,-1),new n("รฉrt",29,-1),new n("รถt",29,-1),new n("hez",-1,-1),new n("hoz",-1,-1),new n("hรถz",-1,-1),new n("vรก",-1,-1),new n("vรฉ",-1,-1)],z=[new n("รกn",-1,2),new n("รฉn",-1,1),new n("รกnkรฉnt",-1,3)],y=[new n("stul",-1,2),new n("astul",0,1),new n("รกstul",0,3),new n("stรผl",-1,2),new n("estรผl",3,1),new n("รฉstรผl",3,4)],j=[new n("รก",-1,1),new n("รฉ",-1,2)],C=[new n("k",-1,7),new n("ak",0,4),new n("ek",0,6),new n("ok",0,5),new n("รกk",0,1),new n("รฉk",0,2),new n("รถk",0,3)],P=[new n("รฉi",-1,7),new n("รกรฉi",0,6),new n("รฉรฉi",0,5),new n("รฉ",-1,9),new n("kรฉ",3,4),new n("akรฉ",4,1),new n("ekรฉ",4,1),new n("okรฉ",4,1),new n("รกkรฉ",4,3),new n("รฉkรฉ",4,2),new n("รถkรฉ",4,1),new n("รฉรฉ",3,8)],F=[new n("a",-1,18),new n("ja",0,17),new n("d",-1,16),new n("ad",2,13),new n("ed",2,13),new n("od",2,13),new n("รกd",2,14),new n("รฉd",2,15),new n("รถd",2,13),new n("e",-1,18),new n("je",9,17),new n("nk",-1,4),new n("unk",11,1),new n("รกnk",11,2),new n("รฉnk",11,3),new n("รผnk",11,1),new n("uk",-1,8),new n("juk",16,7),new n("รกjuk",17,5),new n("รผk",-1,8),new n("jรผk",19,7),new n("รฉjรผk",20,6),new n("m",-1,12),new n("am",22,9),new n("em",22,9),new n("om",22,9),new n("รกm",22,10),new n("รฉm",22,11),new n("o",-1,18),new n("รก",-1,19),new n("รฉ",-1,20)],S=[new n("id",-1,10),new n("aid",0,9),new n("jaid",1,6),new n("eid",0,9),new n("jeid",3,6),new n("รกid",0,7),new n("รฉid",0,8),new n("i",-1,15),new n("ai",7,14),new n("jai",8,11),new n("ei",7,14),new n("jei",10,11),new n("รกi",7,12),new n("รฉi",7,13),new n("itek",-1,24),new n("eitek",14,21),new n("jeitek",15,20),new n("รฉitek",14,23),new n("ik",-1,29),new n("aik",18,26),new n("jaik",19,25),new n("eik",18,26),new n("jeik",21,25),new n("รกik",18,27),new n("รฉik",18,28),new n("ink",-1,20),new n("aink",25,17),new n("jaink",26,16),new n("eink",25,17),new n("jeink",28,16),new n("รกink",25,18),new n("รฉink",25,19),new n("aitok",-1,21),new n("jaitok",32,20),new n("รกitok",-1,22),new n("im",-1,5),new n("aim",35,4),new n("jaim",36,1),new n("eim",35,4),new n("jeim",38,1),new n("รกim",35,2),new n("รฉim",35,3)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,52,14],L=new r;this.setCurrent=function(e){L.setCurrent(e)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){var n=L.cursor;return e(),L.limit_backward=n,L.cursor=L.limit,c(),L.cursor=L.limit,o(),L.cursor=L.limit,w(),L.cursor=L.limit,l(),L.cursor=L.limit,u(),L.cursor=L.limit,k(),L.cursor=L.limit,f(),L.cursor=L.limit,b(),L.cursor=L.limit,m(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.hu.stemmer,"stemmer-hu"),e.hu.stopWordFilter=e.generateStopWordFilter("a abban ahhoz ahogy ahol aki akik akkor alatt amely amelyek amelyekben amelyeket amelyet amelynek ami amikor amit amolyan amรญg annak arra arrรณl az azok azon azonban azt aztรกn azutรกn azzal azรฉrt be belรผl benne bรกr cikk cikkek cikkeket csak de e ebben eddig egy egyes egyetlen egyik egyre egyรฉb egรฉsz ehhez ekkor el ellen elsรต elรฉg elรต elรตszรถr elรตtt emilyen ennek erre ez ezek ezen ezt ezzel ezรฉrt fel felรฉ hanem hiszen hogy hogyan igen ill ill. illetve ilyen ilyenkor ismรฉt ison itt jobban jรณ jรณl kell kellett keressรผnk keresztรผl ki kรญvรผl kรถzรถtt kรถzรผl legalรกbb legyen lehet lehetett lenne lenni lesz lett maga magรกt majd majd meg mellett mely melyek mert mi mikor milyen minden mindenki mindent mindig mint mintha mit mivel miรฉrt most mรกr mรกs mรกsik mรฉg mรญg nagy nagyobb nagyon ne nekem neki nem nincs nรฉha nรฉhรกny nรฉlkรผl olyan ott pedig persze rรก s sajรกt sem semmi sok sokat sokkal szemben szerint szinte szรกmรกra talรกn tehรกt teljes tovรกbb tovรกbbรก tรถbb ugyanis utolsรณ utรกn utรกna vagy vagyis vagyok valaki valami valamint valรณ van vannak vele vissza viszont volna volt voltak voltam voltunk รกltal รกltalรกban รกt รฉn รฉppen รฉs รญgy รต รตk รตket รถssze รบgy รบj รบjabb รบjra".split(" ")),e.Pipeline.registerFunction(e.hu.stopWordFilter,"stopWordFilter-hu")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.it.min.js b/assets/javascripts/lunr/min/lunr.it.min.js new file mode 100644 index 0000000..344b6a3 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.it.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Italian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.it=function(){this.pipeline.reset(),this.pipeline.add(e.it.trimmer,e.it.stopWordFilter,e.it.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.it.stemmer))},e.it.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.it.trimmer=e.trimmerSupport.generateTrimmer(e.it.wordCharacters),e.Pipeline.registerFunction(e.it.trimmer,"trimmer-it"),e.it.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!x.eq_s(1,e)||(x.ket=x.cursor,!x.in_grouping(L,97,249)))&&(x.slice_from(r),x.cursor=n,!0)}function i(){for(var r,n,i,o,t=x.cursor;;){if(x.bra=x.cursor,r=x.find_among(h,7))switch(x.ket=x.cursor,r){case 1:x.slice_from("ร ");continue;case 2:x.slice_from("รจ");continue;case 3:x.slice_from("รฌ");continue;case 4:x.slice_from("รฒ");continue;case 5:x.slice_from("รน");continue;case 6:x.slice_from("qU");continue;case 7:if(x.cursor>=x.limit)break;x.cursor++;continue}break}for(x.cursor=t;;)for(n=x.cursor;;){if(i=x.cursor,x.in_grouping(L,97,249)){if(x.bra=x.cursor,o=x.cursor,e("u","U",i))break;if(x.cursor=o,e("i","I",i))break}if(x.cursor=i,x.cursor>=x.limit)return void(x.cursor=n);x.cursor++}}function o(e){if(x.cursor=e,!x.in_grouping(L,97,249))return!1;for(;!x.out_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function t(){if(x.in_grouping(L,97,249)){var e=x.cursor;if(x.out_grouping(L,97,249)){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return o(e);x.cursor++}return!0}return o(e)}return!1}function s(){var e,r=x.cursor;if(!t()){if(x.cursor=r,!x.out_grouping(L,97,249))return;if(e=x.cursor,x.out_grouping(L,97,249)){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return x.cursor=e,void(x.in_grouping(L,97,249)&&x.cursor=x.limit)return;x.cursor++}k=x.cursor}function a(){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}for(;!x.out_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function u(){var e=x.cursor;k=x.limit,p=k,g=k,s(),x.cursor=e,a()&&(p=x.cursor,a()&&(g=x.cursor))}function c(){for(var e;;){if(x.bra=x.cursor,!(e=x.find_among(q,3)))break;switch(x.ket=x.cursor,e){case 1:x.slice_from("i");break;case 2:x.slice_from("u");break;case 3:if(x.cursor>=x.limit)return;x.cursor++}}}function w(){return k<=x.cursor}function l(){return p<=x.cursor}function m(){return g<=x.cursor}function f(){var e;if(x.ket=x.cursor,x.find_among_b(C,37)&&(x.bra=x.cursor,(e=x.find_among_b(z,5))&&w()))switch(e){case 1:x.slice_del();break;case 2:x.slice_from("e")}}function v(){var e;if(x.ket=x.cursor,!(e=x.find_among_b(S,51)))return!1;switch(x.bra=x.cursor,e){case 1:if(!m())return!1;x.slice_del();break;case 2:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del());break;case 3:if(!m())return!1;x.slice_from("log");break;case 4:if(!m())return!1;x.slice_from("u");break;case 5:if(!m())return!1;x.slice_from("ente");break;case 6:if(!w())return!1;x.slice_del();break;case 7:if(!l())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(P,4),e&&(x.bra=x.cursor,m()&&(x.slice_del(),1==e&&(x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&x.slice_del()))));break;case 8:if(!m())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(F,3),e&&(x.bra=x.cursor,1==e&&m()&&x.slice_del());break;case 9:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del())))}return!0}function b(){var e,r;x.cursor>=k&&(r=x.limit_backward,x.limit_backward=k,x.ket=x.cursor,e=x.find_among_b(W,87),e&&(x.bra=x.cursor,1==e&&x.slice_del()),x.limit_backward=r)}function d(){var e=x.limit-x.cursor;if(x.ket=x.cursor,x.in_grouping_b(y,97,242)&&(x.bra=x.cursor,w()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(1,"i")&&(x.bra=x.cursor,w()))))return void x.slice_del();x.cursor=x.limit-e}function _(){d(),x.ket=x.cursor,x.eq_s_b(1,"h")&&(x.bra=x.cursor,x.in_grouping_b(U,99,103)&&w()&&x.slice_del())}var g,p,k,h=[new r("",-1,7),new r("qu",0,6),new r("รก",0,1),new r("รฉ",0,2),new r("รญ",0,3),new r("รณ",0,4),new r("รบ",0,5)],q=[new r("",-1,3),new r("I",0,1),new r("U",0,2)],C=[new r("la",-1,-1),new r("cela",0,-1),new r("gliela",0,-1),new r("mela",0,-1),new r("tela",0,-1),new r("vela",0,-1),new r("le",-1,-1),new r("cele",6,-1),new r("gliele",6,-1),new r("mele",6,-1),new r("tele",6,-1),new r("vele",6,-1),new r("ne",-1,-1),new r("cene",12,-1),new r("gliene",12,-1),new r("mene",12,-1),new r("sene",12,-1),new r("tene",12,-1),new r("vene",12,-1),new r("ci",-1,-1),new r("li",-1,-1),new r("celi",20,-1),new r("glieli",20,-1),new r("meli",20,-1),new r("teli",20,-1),new r("veli",20,-1),new r("gli",20,-1),new r("mi",-1,-1),new r("si",-1,-1),new r("ti",-1,-1),new r("vi",-1,-1),new r("lo",-1,-1),new r("celo",31,-1),new r("glielo",31,-1),new r("melo",31,-1),new r("telo",31,-1),new r("velo",31,-1)],z=[new r("ando",-1,1),new r("endo",-1,1),new r("ar",-1,2),new r("er",-1,2),new r("ir",-1,2)],P=[new r("ic",-1,-1),new r("abil",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],F=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],S=[new r("ica",-1,1),new r("logia",-1,3),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,9),new r("anza",-1,1),new r("enza",-1,5),new r("ice",-1,1),new r("atrice",7,1),new r("iche",-1,1),new r("logie",-1,3),new r("abile",-1,1),new r("ibile",-1,1),new r("usione",-1,4),new r("azione",-1,2),new r("uzione",-1,4),new r("atore",-1,2),new r("ose",-1,1),new r("ante",-1,1),new r("mente",-1,1),new r("amente",19,7),new r("iste",-1,1),new r("ive",-1,9),new r("anze",-1,1),new r("enze",-1,5),new r("ici",-1,1),new r("atrici",25,1),new r("ichi",-1,1),new r("abili",-1,1),new r("ibili",-1,1),new r("ismi",-1,1),new r("usioni",-1,4),new r("azioni",-1,2),new r("uzioni",-1,4),new r("atori",-1,2),new r("osi",-1,1),new r("anti",-1,1),new r("amenti",-1,6),new r("imenti",-1,6),new r("isti",-1,1),new r("ivi",-1,9),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,6),new r("imento",-1,6),new r("ivo",-1,9),new r("itร ",-1,8),new r("istร ",-1,1),new r("istรจ",-1,1),new r("istรฌ",-1,1)],W=[new r("isca",-1,1),new r("enda",-1,1),new r("ata",-1,1),new r("ita",-1,1),new r("uta",-1,1),new r("ava",-1,1),new r("eva",-1,1),new r("iva",-1,1),new r("erebbe",-1,1),new r("irebbe",-1,1),new r("isce",-1,1),new r("ende",-1,1),new r("are",-1,1),new r("ere",-1,1),new r("ire",-1,1),new r("asse",-1,1),new r("ate",-1,1),new r("avate",16,1),new r("evate",16,1),new r("ivate",16,1),new r("ete",-1,1),new r("erete",20,1),new r("irete",20,1),new r("ite",-1,1),new r("ereste",-1,1),new r("ireste",-1,1),new r("ute",-1,1),new r("erai",-1,1),new r("irai",-1,1),new r("isci",-1,1),new r("endi",-1,1),new r("erei",-1,1),new r("irei",-1,1),new r("assi",-1,1),new r("ati",-1,1),new r("iti",-1,1),new r("eresti",-1,1),new r("iresti",-1,1),new r("uti",-1,1),new r("avi",-1,1),new r("evi",-1,1),new r("ivi",-1,1),new r("isco",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("Yamo",-1,1),new r("iamo",-1,1),new r("avamo",-1,1),new r("evamo",-1,1),new r("ivamo",-1,1),new r("eremo",-1,1),new r("iremo",-1,1),new r("assimo",-1,1),new r("ammo",-1,1),new r("emmo",-1,1),new r("eremmo",54,1),new r("iremmo",54,1),new r("immo",-1,1),new r("ano",-1,1),new r("iscano",58,1),new r("avano",58,1),new r("evano",58,1),new r("ivano",58,1),new r("eranno",-1,1),new r("iranno",-1,1),new r("ono",-1,1),new r("iscono",65,1),new r("arono",65,1),new r("erono",65,1),new r("irono",65,1),new r("erebbero",-1,1),new r("irebbero",-1,1),new r("assero",-1,1),new r("essero",-1,1),new r("issero",-1,1),new r("ato",-1,1),new r("ito",-1,1),new r("uto",-1,1),new r("avo",-1,1),new r("evo",-1,1),new r("ivo",-1,1),new r("ar",-1,1),new r("ir",-1,1),new r("erร ",-1,1),new r("irร ",-1,1),new r("erรฒ",-1,1),new r("irรฒ",-1,1)],L=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2,1],y=[17,65,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2],U=[17],x=new n;this.setCurrent=function(e){x.setCurrent(e)},this.getCurrent=function(){return x.getCurrent()},this.stem=function(){var e=x.cursor;return i(),x.cursor=e,u(),x.limit_backward=e,x.cursor=x.limit,f(),x.cursor=x.limit,v()||(x.cursor=x.limit,b()),x.cursor=x.limit,_(),x.cursor=x.limit_backward,c(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.it.stemmer,"stemmer-it"),e.it.stopWordFilter=e.generateStopWordFilter("a abbia abbiamo abbiano abbiate ad agl agli ai al all alla alle allo anche avemmo avendo avesse avessero avessi avessimo aveste avesti avete aveva avevamo avevano avevate avevi avevo avrai avranno avrebbe avrebbero avrei avremmo avremo avreste avresti avrete avrร  avrรฒ avuta avute avuti avuto c che chi ci coi col come con contro cui da dagl dagli dai dal dall dalla dalle dallo degl degli dei del dell della delle dello di dov dove e ebbe ebbero ebbi ed era erano eravamo eravate eri ero essendo faccia facciamo facciano facciate faccio facemmo facendo facesse facessero facessi facessimo faceste facesti faceva facevamo facevano facevate facevi facevo fai fanno farai faranno farebbe farebbero farei faremmo faremo fareste faresti farete farร  farรฒ fece fecero feci fosse fossero fossi fossimo foste fosti fu fui fummo furono gli ha hai hanno ho i il in io l la le lei li lo loro lui ma mi mia mie miei mio ne negl negli nei nel nell nella nelle nello noi non nostra nostre nostri nostro o per perchรฉ piรน quale quanta quante quanti quanto quella quelle quelli quello questa queste questi questo sarai saranno sarebbe sarebbero sarei saremmo saremo sareste saresti sarete sarร  sarรฒ se sei si sia siamo siano siate siete sono sta stai stando stanno starai staranno starebbe starebbero starei staremmo staremo stareste staresti starete starร  starรฒ stava stavamo stavano stavate stavi stavo stemmo stesse stessero stessi stessimo steste stesti stette stettero stetti stia stiamo stiano stiate sto su sua sue sugl sugli sui sul sull sulla sulle sullo suo suoi ti tra tu tua tue tuo tuoi tutti tutto un una uno vi voi vostra vostre vostri vostro รจ".split(" ")),e.Pipeline.registerFunction(e.it.stopWordFilter,"stopWordFilter-it")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.ja.min.js b/assets/javascripts/lunr/min/lunr.ja.min.js new file mode 100644 index 0000000..5f254eb --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ja.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(e=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=e);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=e;else if(n(e))break}else if(n(e))break}function n(r){return C.cursor=r,r>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,d=_,t()||(_=C.cursor,_<3&&(_=3),t()||(d=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var r;;)if(C.bra=C.cursor,r=C.find_among(p,3))switch(C.ket=C.cursor,r){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return d<=C.cursor}function a(){var r=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-r,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var r;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.slice_del(),w=!0,a())))}function m(){var r;u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.eq_s_b(3,"gem")||(C.cursor=C.limit-r,C.slice_del(),a())))}function f(){var r,e,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,r=C.find_among_b(h,5))switch(C.bra=C.cursor,r){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(j,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(e=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-e,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,r=C.find_among_b(k,6))switch(C.bra=C.cursor,r){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(z,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var d,_,w,b=[new e("",-1,6),new e("รก",0,1),new e("รค",0,1),new e("รฉ",0,2),new e("รซ",0,2),new e("รญ",0,3),new e("รฏ",0,3),new e("รณ",0,4),new e("รถ",0,4),new e("รบ",0,5),new e("รผ",0,5)],p=[new e("",-1,3),new e("I",0,2),new e("Y",0,1)],g=[new e("dd",-1,-1),new e("kk",-1,-1),new e("tt",-1,-1)],h=[new e("ene",-1,2),new e("se",-1,3),new e("en",-1,2),new e("heden",2,1),new e("s",-1,3)],k=[new e("end",-1,1),new e("ig",-1,2),new e("ing",-1,1),new e("lijk",-1,3),new e("baar",-1,4),new e("bar",-1,5)],v=[new e("aa",-1,-1),new e("ee",-1,-1),new e("oo",-1,-1),new e("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(r){C.setCurrent(r)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var e=C.cursor;return r(),C.cursor=e,o(),C.limit_backward=e,C.cursor=C.limit,f(),C.cursor=C.limit_backward,s(),!0}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.nl.stemmer,"stemmer-nl"),r.nl.stopWordFilter=r.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),r.Pipeline.registerFunction(r.nl.stopWordFilter,"stopWordFilter-nl")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.no.min.js b/assets/javascripts/lunr/min/lunr.no.min.js new file mode 100644 index 0000000..92bc7e4 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.no.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Norwegian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt bรฅde bรฅe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar dรฅ eg ein eit eitt eller elles en enn er et ett etter for fordi fra fรธr ha hadde han hans har hennar henne hennes her hjรฅ ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nรฅ nรฅr og ogsรฅ om opp oss over pรฅ samme seg selv si si sia sidan siden sin sine sitt sjรธl skal skulle slik so som som somme somt sรฅ sรฅnn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vรฅr vรฆre vรฆre vรฆrt รฅ".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.pt.min.js b/assets/javascripts/lunr/min/lunr.pt.min.js new file mode 100644 index 0000000..6c16996 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.pt.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Portuguese` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(k,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("a~");continue;case 2:z.slice_from("o~");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function n(){if(z.out_grouping(y,97,250)){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!0;z.cursor++}return!1}return!0}function i(){if(z.in_grouping(y,97,250))for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return g=z.cursor,!0}function o(){var e,r,s=z.cursor;if(z.in_grouping(y,97,250))if(e=z.cursor,n()){if(z.cursor=e,i())return}else g=z.cursor;if(z.cursor=s,z.out_grouping(y,97,250)){if(r=z.cursor,n()){if(z.cursor=r,!z.in_grouping(y,97,250)||z.cursor>=z.limit)return;z.cursor++}g=z.cursor}}function t(){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return!0}function a(){var e=z.cursor;g=z.limit,b=g,h=g,o(),z.cursor=e,t()&&(b=z.cursor,t()&&(h=z.cursor))}function u(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(q,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("รฃ");continue;case 2:z.slice_from("รต");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function w(){return g<=z.cursor}function m(){return b<=z.cursor}function c(){return h<=z.cursor}function l(){var e;if(z.ket=z.cursor,!(e=z.find_among_b(F,45)))return!1;switch(z.bra=z.cursor,e){case 1:if(!c())return!1;z.slice_del();break;case 2:if(!c())return!1;z.slice_from("log");break;case 3:if(!c())return!1;z.slice_from("u");break;case 4:if(!c())return!1;z.slice_from("ente");break;case 5:if(!m())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(j,4),e&&(z.bra=z.cursor,c()&&(z.slice_del(),1==e&&(z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del()))));break;case 6:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(C,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 7:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(P,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 8:if(!c())return!1;z.slice_del(),z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del());break;case 9:if(!w()||!z.eq_s_b(1,"e"))return!1;z.slice_from("ir")}return!0}function f(){var e,r;if(z.cursor>=g){if(r=z.limit_backward,z.limit_backward=g,z.ket=z.cursor,e=z.find_among_b(S,120))return z.bra=z.cursor,1==e&&z.slice_del(),z.limit_backward=r,!0;z.limit_backward=r}return!1}function d(){var e;z.ket=z.cursor,(e=z.find_among_b(W,7))&&(z.bra=z.cursor,1==e&&w()&&z.slice_del())}function v(e,r){if(z.eq_s_b(1,e)){z.bra=z.cursor;var s=z.limit-z.cursor;if(z.eq_s_b(1,r))return z.cursor=z.limit-s,w()&&z.slice_del(),!1}return!0}function p(){var e;if(z.ket=z.cursor,e=z.find_among_b(L,4))switch(z.bra=z.cursor,e){case 1:w()&&(z.slice_del(),z.ket=z.cursor,z.limit-z.cursor,v("u","g")&&v("i","c"));break;case 2:z.slice_from("c")}}function _(){if(!l()&&(z.cursor=z.limit,!f()))return z.cursor=z.limit,void d();z.cursor=z.limit,z.ket=z.cursor,z.eq_s_b(1,"i")&&(z.bra=z.cursor,z.eq_s_b(1,"c")&&(z.cursor=z.limit,w()&&z.slice_del()))}var h,b,g,k=[new r("",-1,3),new r("รฃ",0,1),new r("รต",0,2)],q=[new r("",-1,3),new r("a~",0,1),new r("o~",0,2)],j=[new r("ic",-1,-1),new r("ad",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],C=[new r("ante",-1,1),new r("avel",-1,1),new r("รญvel",-1,1)],P=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],F=[new r("ica",-1,1),new r("รขncia",-1,1),new r("รชncia",-1,4),new r("ira",-1,9),new r("adora",-1,1),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,8),new r("eza",-1,1),new r("logรญa",-1,2),new r("idade",-1,7),new r("ante",-1,1),new r("mente",-1,6),new r("amente",12,5),new r("รกvel",-1,1),new r("รญvel",-1,1),new r("uciรณn",-1,3),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,1),new r("imento",-1,1),new r("ivo",-1,8),new r("aรงa~o",-1,1),new r("ador",-1,1),new r("icas",-1,1),new r("รชncias",-1,4),new r("iras",-1,9),new r("adoras",-1,1),new r("osas",-1,1),new r("istas",-1,1),new r("ivas",-1,8),new r("ezas",-1,1),new r("logรญas",-1,2),new r("idades",-1,7),new r("uciones",-1,3),new r("adores",-1,1),new r("antes",-1,1),new r("aรงo~es",-1,1),new r("icos",-1,1),new r("ismos",-1,1),new r("osos",-1,1),new r("amentos",-1,1),new r("imentos",-1,1),new r("ivos",-1,8)],S=[new r("ada",-1,1),new r("ida",-1,1),new r("ia",-1,1),new r("aria",2,1),new r("eria",2,1),new r("iria",2,1),new r("ara",-1,1),new r("era",-1,1),new r("ira",-1,1),new r("ava",-1,1),new r("asse",-1,1),new r("esse",-1,1),new r("isse",-1,1),new r("aste",-1,1),new r("este",-1,1),new r("iste",-1,1),new r("ei",-1,1),new r("arei",16,1),new r("erei",16,1),new r("irei",16,1),new r("am",-1,1),new r("iam",20,1),new r("ariam",21,1),new r("eriam",21,1),new r("iriam",21,1),new r("aram",20,1),new r("eram",20,1),new r("iram",20,1),new r("avam",20,1),new r("em",-1,1),new r("arem",29,1),new r("erem",29,1),new r("irem",29,1),new r("assem",29,1),new r("essem",29,1),new r("issem",29,1),new r("ado",-1,1),new r("ido",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("indo",-1,1),new r("ara~o",-1,1),new r("era~o",-1,1),new r("ira~o",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("ir",-1,1),new r("as",-1,1),new r("adas",47,1),new r("idas",47,1),new r("ias",47,1),new r("arias",50,1),new r("erias",50,1),new r("irias",50,1),new r("aras",47,1),new r("eras",47,1),new r("iras",47,1),new r("avas",47,1),new r("es",-1,1),new r("ardes",58,1),new r("erdes",58,1),new r("irdes",58,1),new r("ares",58,1),new r("eres",58,1),new r("ires",58,1),new r("asses",58,1),new r("esses",58,1),new r("isses",58,1),new r("astes",58,1),new r("estes",58,1),new r("istes",58,1),new r("is",-1,1),new r("ais",71,1),new r("eis",71,1),new r("areis",73,1),new r("ereis",73,1),new r("ireis",73,1),new r("รกreis",73,1),new r("รฉreis",73,1),new r("รญreis",73,1),new r("รกsseis",73,1),new r("รฉsseis",73,1),new r("รญsseis",73,1),new r("รกveis",73,1),new r("รญeis",73,1),new r("arรญeis",84,1),new r("erรญeis",84,1),new r("irรญeis",84,1),new r("ados",-1,1),new r("idos",-1,1),new r("amos",-1,1),new r("รกramos",90,1),new r("รฉramos",90,1),new r("รญramos",90,1),new r("รกvamos",90,1),new r("รญamos",90,1),new r("arรญamos",95,1),new r("erรญamos",95,1),new r("irรญamos",95,1),new r("emos",-1,1),new r("aremos",99,1),new r("eremos",99,1),new r("iremos",99,1),new r("รกssemos",99,1),new r("รชssemos",99,1),new r("รญssemos",99,1),new r("imos",-1,1),new r("armos",-1,1),new r("ermos",-1,1),new r("irmos",-1,1),new r("รกmos",-1,1),new r("arรกs",-1,1),new r("erรกs",-1,1),new r("irรกs",-1,1),new r("eu",-1,1),new r("iu",-1,1),new r("ou",-1,1),new r("arรก",-1,1),new r("erรก",-1,1),new r("irรก",-1,1)],W=[new r("a",-1,1),new r("i",-1,1),new r("o",-1,1),new r("os",-1,1),new r("รก",-1,1),new r("รญ",-1,1),new r("รณ",-1,1)],L=[new r("e",-1,1),new r("รง",-1,2),new r("รฉ",-1,1),new r("รช",-1,1)],y=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],z=new s;this.setCurrent=function(e){z.setCurrent(e)},this.getCurrent=function(){return z.getCurrent()},this.stem=function(){var r=z.cursor;return e(),z.cursor=r,a(),z.limit_backward=r,z.cursor=z.limit,_(),z.cursor=z.limit,p(),z.cursor=z.limit_backward,u(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as atรฉ com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivรฉramos estivรฉssemos estou estรก estรกvamos estรฃo eu foi fomos for fora foram forem formos fosse fossem fui fรดramos fรดssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverรก houverรฃo houverรญamos houvesse houvessem houvรฉramos houvรฉssemos hรก hรฃo isso isto jรก lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa nรฃo nรณs o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam serรก serรฃo serรญamos seu seus somos sou sua suas sรฃo sรณ tambรฉm te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terรก terรฃo terรญamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivรฉramos tivรฉssemos tu tua tuas tรฉm tรญnhamos um uma vocรช vocรชs vos ร  ร s รฉramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.ro.min.js b/assets/javascripts/lunr/min/lunr.ro.min.js new file mode 100644 index 0000000..7277140 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ro.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Romanian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=function(){var i=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(e,i){L.eq_s(1,e)&&(L.ket=L.cursor,L.in_grouping(W,97,259)&&L.slice_from(i))}function n(){for(var i,r;;){if(i=L.cursor,L.in_grouping(W,97,259)&&(r=L.cursor,L.bra=r,e("u","U"),L.cursor=r,e("i","I")),L.cursor=i,L.cursor>=L.limit)break;L.cursor++}}function t(){if(L.out_grouping(W,97,259)){for(;!L.in_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}return!0}function a(){if(L.in_grouping(W,97,259))for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}function o(){var e,i,r=L.cursor;if(L.in_grouping(W,97,259)){if(e=L.cursor,!t())return void(h=L.cursor);if(L.cursor=e,!a())return void(h=L.cursor)}L.cursor=r,L.out_grouping(W,97,259)&&(i=L.cursor,t()&&(L.cursor=i,L.in_grouping(W,97,259)&&L.cursor=L.limit)return!1;L.cursor++}for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!1;L.cursor++}return!0}function c(){var e=L.cursor;h=L.limit,k=h,g=h,o(),L.cursor=e,u()&&(k=L.cursor,u()&&(g=L.cursor))}function s(){for(var e;;){if(L.bra=L.cursor,e=L.find_among(z,3))switch(L.ket=L.cursor,e){case 1:L.slice_from("i");continue;case 2:L.slice_from("u");continue;case 3:if(L.cursor>=L.limit)break;L.cursor++;continue}break}}function w(){return h<=L.cursor}function m(){return k<=L.cursor}function l(){return g<=L.cursor}function f(){var e,i;if(L.ket=L.cursor,(e=L.find_among_b(C,16))&&(L.bra=L.cursor,m()))switch(e){case 1:L.slice_del();break;case 2:L.slice_from("a");break;case 3:L.slice_from("e");break;case 4:L.slice_from("i");break;case 5:i=L.limit-L.cursor,L.eq_s_b(2,"ab")||(L.cursor=L.limit-i,L.slice_from("i"));break;case 6:L.slice_from("at");break;case 7:L.slice_from("aลฃi")}}function p(){var e,i=L.limit-L.cursor;if(L.ket=L.cursor,(e=L.find_among_b(P,46))&&(L.bra=L.cursor,m())){switch(e){case 1:L.slice_from("abil");break;case 2:L.slice_from("ibil");break;case 3:L.slice_from("iv");break;case 4:L.slice_from("ic");break;case 5:L.slice_from("at");break;case 6:L.slice_from("it")}return _=!0,L.cursor=L.limit-i,!0}return!1}function d(){var e,i;for(_=!1;;)if(i=L.limit-L.cursor,!p()){L.cursor=L.limit-i;break}if(L.ket=L.cursor,(e=L.find_among_b(F,62))&&(L.bra=L.cursor,l())){switch(e){case 1:L.slice_del();break;case 2:L.eq_s_b(1,"ลฃ")&&(L.bra=L.cursor,L.slice_from("t"));break;case 3:L.slice_from("ist")}_=!0}}function b(){var e,i,r;if(L.cursor>=h){if(i=L.limit_backward,L.limit_backward=h,L.ket=L.cursor,e=L.find_among_b(q,94))switch(L.bra=L.cursor,e){case 1:if(r=L.limit-L.cursor,!L.out_grouping_b(W,97,259)&&(L.cursor=L.limit-r,!L.eq_s_b(1,"u")))break;case 2:L.slice_del()}L.limit_backward=i}}function v(){var e;L.ket=L.cursor,(e=L.find_among_b(S,5))&&(L.bra=L.cursor,w()&&1==e&&L.slice_del())}var _,g,k,h,z=[new i("",-1,3),new i("I",0,1),new i("U",0,2)],C=[new i("ea",-1,3),new i("aลฃia",-1,7),new i("aua",-1,2),new i("iua",-1,4),new i("aลฃie",-1,7),new i("ele",-1,3),new i("ile",-1,5),new i("iile",6,4),new i("iei",-1,4),new i("atei",-1,6),new i("ii",-1,4),new i("ului",-1,1),new i("ul",-1,1),new i("elor",-1,3),new i("ilor",-1,4),new i("iilor",14,4)],P=[new i("icala",-1,4),new i("iciva",-1,4),new i("ativa",-1,5),new i("itiva",-1,6),new i("icale",-1,4),new i("aลฃiune",-1,5),new i("iลฃiune",-1,6),new i("atoare",-1,5),new i("itoare",-1,6),new i("ฤƒtoare",-1,5),new i("icitate",-1,4),new i("abilitate",-1,1),new i("ibilitate",-1,2),new i("ivitate",-1,3),new i("icive",-1,4),new i("ative",-1,5),new i("itive",-1,6),new i("icali",-1,4),new i("atori",-1,5),new i("icatori",18,4),new i("itori",-1,6),new i("ฤƒtori",-1,5),new i("icitati",-1,4),new i("abilitati",-1,1),new i("ivitati",-1,3),new i("icivi",-1,4),new i("ativi",-1,5),new i("itivi",-1,6),new i("icitฤƒi",-1,4),new i("abilitฤƒi",-1,1),new i("ivitฤƒi",-1,3),new i("icitฤƒลฃi",-1,4),new i("abilitฤƒลฃi",-1,1),new i("ivitฤƒลฃi",-1,3),new i("ical",-1,4),new i("ator",-1,5),new i("icator",35,4),new i("itor",-1,6),new i("ฤƒtor",-1,5),new i("iciv",-1,4),new i("ativ",-1,5),new i("itiv",-1,6),new i("icalฤƒ",-1,4),new i("icivฤƒ",-1,4),new i("ativฤƒ",-1,5),new i("itivฤƒ",-1,6)],F=[new i("ica",-1,1),new i("abila",-1,1),new i("ibila",-1,1),new i("oasa",-1,1),new i("ata",-1,1),new i("ita",-1,1),new i("anta",-1,1),new i("ista",-1,3),new i("uta",-1,1),new i("iva",-1,1),new i("ic",-1,1),new i("ice",-1,1),new i("abile",-1,1),new i("ibile",-1,1),new i("isme",-1,3),new i("iune",-1,2),new i("oase",-1,1),new i("ate",-1,1),new i("itate",17,1),new i("ite",-1,1),new i("ante",-1,1),new i("iste",-1,3),new i("ute",-1,1),new i("ive",-1,1),new i("ici",-1,1),new i("abili",-1,1),new i("ibili",-1,1),new i("iuni",-1,2),new i("atori",-1,1),new i("osi",-1,1),new i("ati",-1,1),new i("itati",30,1),new i("iti",-1,1),new i("anti",-1,1),new i("isti",-1,3),new i("uti",-1,1),new i("iลŸti",-1,3),new i("ivi",-1,1),new i("itฤƒi",-1,1),new i("oลŸi",-1,1),new i("itฤƒลฃi",-1,1),new i("abil",-1,1),new i("ibil",-1,1),new i("ism",-1,3),new i("ator",-1,1),new i("os",-1,1),new i("at",-1,1),new i("it",-1,1),new i("ant",-1,1),new i("ist",-1,3),new i("ut",-1,1),new i("iv",-1,1),new i("icฤƒ",-1,1),new i("abilฤƒ",-1,1),new i("ibilฤƒ",-1,1),new i("oasฤƒ",-1,1),new i("atฤƒ",-1,1),new i("itฤƒ",-1,1),new i("antฤƒ",-1,1),new i("istฤƒ",-1,3),new i("utฤƒ",-1,1),new i("ivฤƒ",-1,1)],q=[new i("ea",-1,1),new i("ia",-1,1),new i("esc",-1,1),new i("ฤƒsc",-1,1),new i("ind",-1,1),new i("รขnd",-1,1),new i("are",-1,1),new i("ere",-1,1),new i("ire",-1,1),new i("รขre",-1,1),new i("se",-1,2),new i("ase",10,1),new i("sese",10,2),new i("ise",10,1),new i("use",10,1),new i("รขse",10,1),new i("eลŸte",-1,1),new i("ฤƒลŸte",-1,1),new i("eze",-1,1),new i("ai",-1,1),new i("eai",19,1),new i("iai",19,1),new i("sei",-1,2),new i("eลŸti",-1,1),new i("ฤƒลŸti",-1,1),new i("ui",-1,1),new i("ezi",-1,1),new i("รขi",-1,1),new i("aลŸi",-1,1),new i("seลŸi",-1,2),new i("aseลŸi",29,1),new i("seseลŸi",29,2),new i("iseลŸi",29,1),new i("useลŸi",29,1),new i("รขseลŸi",29,1),new i("iลŸi",-1,1),new i("uลŸi",-1,1),new i("รขลŸi",-1,1),new i("aลฃi",-1,2),new i("eaลฃi",38,1),new i("iaลฃi",38,1),new i("eลฃi",-1,2),new i("iลฃi",-1,2),new i("รขลฃi",-1,2),new i("arฤƒลฃi",-1,1),new i("serฤƒลฃi",-1,2),new i("aserฤƒลฃi",45,1),new i("seserฤƒลฃi",45,2),new i("iserฤƒลฃi",45,1),new i("userฤƒลฃi",45,1),new i("รขserฤƒลฃi",45,1),new i("irฤƒลฃi",-1,1),new i("urฤƒลฃi",-1,1),new i("รขrฤƒลฃi",-1,1),new i("am",-1,1),new i("eam",54,1),new i("iam",54,1),new i("em",-1,2),new i("asem",57,1),new i("sesem",57,2),new i("isem",57,1),new i("usem",57,1),new i("รขsem",57,1),new i("im",-1,2),new i("รขm",-1,2),new i("ฤƒm",-1,2),new i("arฤƒm",65,1),new i("serฤƒm",65,2),new i("aserฤƒm",67,1),new i("seserฤƒm",67,2),new i("iserฤƒm",67,1),new i("userฤƒm",67,1),new i("รขserฤƒm",67,1),new i("irฤƒm",65,1),new i("urฤƒm",65,1),new i("รขrฤƒm",65,1),new i("au",-1,1),new i("eau",76,1),new i("iau",76,1),new i("indu",-1,1),new i("รขndu",-1,1),new i("ez",-1,1),new i("eascฤƒ",-1,1),new i("arฤƒ",-1,1),new i("serฤƒ",-1,2),new i("aserฤƒ",84,1),new i("seserฤƒ",84,2),new i("iserฤƒ",84,1),new i("userฤƒ",84,1),new i("รขserฤƒ",84,1),new i("irฤƒ",-1,1),new i("urฤƒ",-1,1),new i("รขrฤƒ",-1,1),new i("eazฤƒ",-1,1)],S=[new i("a",-1,1),new i("e",-1,1),new i("ie",1,1),new i("i",-1,1),new i("ฤƒ",-1,1)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,2,32,0,0,4],L=new r;this.setCurrent=function(e){L.setCurrent(e)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){var e=L.cursor;return n(),L.cursor=e,c(),L.limit_backward=e,L.cursor=L.limit,f(),L.cursor=L.limit,d(),L.cursor=L.limit,_||(L.cursor=L.limit,b(),L.cursor=L.limit),v(),L.cursor=L.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.ro.stemmer,"stemmer-ro"),e.ro.stopWordFilter=e.generateStopWordFilter("acea aceasta aceastฤƒ aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceลŸti aceลŸtia acolo acord acum ai aia aibฤƒ aici al ale alea altceva altcineva am ar are asemenea asta astea astฤƒzi asupra au avea avem aveลฃi azi aลŸ aลŸadar aลฃi bine bucur bunฤƒ ca care caut ce cel ceva chiar cinci cine cineva contra cu cum cumva curรขnd curรฎnd cรขnd cรขt cรขte cรขtva cรขลฃi cรฎnd cรฎt cรฎte cรฎtva cรฎลฃi cฤƒ cฤƒci cฤƒrei cฤƒror cฤƒrui cฤƒtre da dacฤƒ dar datoritฤƒ datฤƒ dau de deci deja deoarece departe deลŸi din dinaintea dintr- dintre doi doilea douฤƒ drept dupฤƒ dฤƒ ea ei el ele eram este eu eลŸti face fata fi fie fiecare fii fim fiu fiลฃi frumos fฤƒrฤƒ graลฃie halbฤƒ iar ieri la le li lor lui lรขngฤƒ lรฎngฤƒ mai mea mei mele mereu meu mi mie mine mult multฤƒ mulลฃi mulลฃumesc mรขine mรฎine mฤƒ ne nevoie nici nicฤƒieri nimeni nimeri nimic niลŸte noastre noastrฤƒ noi noroc nostru nouฤƒ noลŸtri nu opt ori oricare orice oricine oricum oricรขnd oricรขt oricรฎnd oricรฎt oriunde patra patru patrulea pe pentru peste pic poate pot prea prima primul prin puลฃin puลฃina puลฃinฤƒ pรขnฤƒ pรฎnฤƒ rog sa sale sau se spate spre sub sunt suntem sunteลฃi sutฤƒ sรฎnt sรฎntem sรฎnteลฃi sฤƒ sฤƒi sฤƒu ta tale te timp tine toate toatฤƒ tot totuลŸi toลฃi trei treia treilea tu tฤƒi tฤƒu un una unde undeva unei uneia unele uneori unii unor unora unu unui unuia unul vi voastre voastrฤƒ voi vostru vouฤƒ voลŸtri vreme vreo vreun vฤƒ zece zero zi zice รฎi รฎl รฎmi รฎmpotriva รฎn รฎnainte รฎnaintea รฎncotro รฎncรขt รฎncรฎt รฎntre รฎntrucรขt รฎntrucรฎt รฎลฃi ฤƒla ฤƒlea ฤƒsta ฤƒstea ฤƒลŸtia ลŸapte ลŸase ลŸi ลŸtiu ลฃi ลฃie".split(" ")),e.Pipeline.registerFunction(e.ro.stopWordFilter,"stopWordFilter-ro")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.ru.min.js b/assets/javascripts/lunr/min/lunr.ru.min.js new file mode 100644 index 0000000..186cc48 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ru.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Russian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ru=function(){this.pipeline.reset(),this.pipeline.add(e.ru.trimmer,e.ru.stopWordFilter,e.ru.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ru.stemmer))},e.ru.wordCharacters="ะ€-า„า‡-ิฏแดซแตธโท -โทฟ๊™€-๊šŸ๏ธฎ๏ธฏ",e.ru.trimmer=e.trimmerSupport.generateTrimmer(e.ru.wordCharacters),e.Pipeline.registerFunction(e.ru.trimmer,"trimmer-ru"),e.ru.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,t=new function(){function e(){for(;!W.in_grouping(S,1072,1103);){if(W.cursor>=W.limit)return!1;W.cursor++}return!0}function t(){for(;!W.out_grouping(S,1072,1103);){if(W.cursor>=W.limit)return!1;W.cursor++}return!0}function w(){b=W.limit,_=b,e()&&(b=W.cursor,t()&&e()&&t()&&(_=W.cursor))}function i(){return _<=W.cursor}function u(e,n){var r,t;if(W.ket=W.cursor,r=W.find_among_b(e,n)){switch(W.bra=W.cursor,r){case 1:if(t=W.limit-W.cursor,!W.eq_s_b(1,"ะฐ")&&(W.cursor=W.limit-t,!W.eq_s_b(1,"ั")))return!1;case 2:W.slice_del()}return!0}return!1}function o(){return u(h,9)}function s(e,n){var r;return W.ket=W.cursor,!!(r=W.find_among_b(e,n))&&(W.bra=W.cursor,1==r&&W.slice_del(),!0)}function c(){return s(g,26)}function m(){return!!c()&&(u(C,8),!0)}function f(){return s(k,2)}function l(){return u(P,46)}function a(){s(v,36)}function p(){var e;W.ket=W.cursor,(e=W.find_among_b(F,2))&&(W.bra=W.cursor,i()&&1==e&&W.slice_del())}function d(){var e;if(W.ket=W.cursor,e=W.find_among_b(q,4))switch(W.bra=W.cursor,e){case 1:if(W.slice_del(),W.ket=W.cursor,!W.eq_s_b(1,"ะฝ"))break;W.bra=W.cursor;case 2:if(!W.eq_s_b(1,"ะฝ"))break;case 3:W.slice_del()}}var _,b,h=[new n("ะฒ",-1,1),new n("ะธะฒ",0,2),new n("ั‹ะฒ",0,2),new n("ะฒัˆะธ",-1,1),new n("ะธะฒัˆะธ",3,2),new n("ั‹ะฒัˆะธ",3,2),new n("ะฒัˆะธััŒ",-1,1),new n("ะธะฒัˆะธััŒ",6,2),new n("ั‹ะฒัˆะธััŒ",6,2)],g=[new n("ะตะต",-1,1),new n("ะธะต",-1,1),new n("ะพะต",-1,1),new n("ั‹ะต",-1,1),new n("ะธะผะธ",-1,1),new n("ั‹ะผะธ",-1,1),new n("ะตะน",-1,1),new n("ะธะน",-1,1),new n("ะพะน",-1,1),new n("ั‹ะน",-1,1),new n("ะตะผ",-1,1),new n("ะธะผ",-1,1),new n("ะพะผ",-1,1),new n("ั‹ะผ",-1,1),new n("ะตะณะพ",-1,1),new n("ะพะณะพ",-1,1),new n("ะตะผัƒ",-1,1),new n("ะพะผัƒ",-1,1),new n("ะธั…",-1,1),new n("ั‹ั…",-1,1),new n("ะตัŽ",-1,1),new n("ะพัŽ",-1,1),new n("ัƒัŽ",-1,1),new n("ัŽัŽ",-1,1),new n("ะฐั",-1,1),new n("ัั",-1,1)],C=[new n("ะตะผ",-1,1),new n("ะฝะฝ",-1,1),new n("ะฒัˆ",-1,1),new n("ะธะฒัˆ",2,2),new n("ั‹ะฒัˆ",2,2),new n("ั‰",-1,1),new n("ัŽั‰",5,1),new n("ัƒัŽั‰",6,2)],k=[new n("ััŒ",-1,1),new n("ัั",-1,1)],P=[new n("ะปะฐ",-1,1),new n("ะธะปะฐ",0,2),new n("ั‹ะปะฐ",0,2),new n("ะฝะฐ",-1,1),new n("ะตะฝะฐ",3,2),new n("ะตั‚ะต",-1,1),new n("ะธั‚ะต",-1,2),new n("ะนั‚ะต",-1,1),new n("ะตะนั‚ะต",7,2),new n("ัƒะนั‚ะต",7,2),new n("ะปะธ",-1,1),new n("ะธะปะธ",10,2),new n("ั‹ะปะธ",10,2),new n("ะน",-1,1),new n("ะตะน",13,2),new n("ัƒะน",13,2),new n("ะป",-1,1),new n("ะธะป",16,2),new n("ั‹ะป",16,2),new n("ะตะผ",-1,1),new n("ะธะผ",-1,2),new n("ั‹ะผ",-1,2),new n("ะฝ",-1,1),new n("ะตะฝ",22,2),new n("ะปะพ",-1,1),new n("ะธะปะพ",24,2),new n("ั‹ะปะพ",24,2),new n("ะฝะพ",-1,1),new n("ะตะฝะพ",27,2),new n("ะฝะฝะพ",27,1),new n("ะตั‚",-1,1),new n("ัƒะตั‚",30,2),new n("ะธั‚",-1,2),new n("ั‹ั‚",-1,2),new n("ัŽั‚",-1,1),new n("ัƒัŽั‚",34,2),new n("ัั‚",-1,2),new n("ะฝั‹",-1,1),new n("ะตะฝั‹",37,2),new n("ั‚ัŒ",-1,1),new n("ะธั‚ัŒ",39,2),new n("ั‹ั‚ัŒ",39,2),new n("ะตัˆัŒ",-1,1),new n("ะธัˆัŒ",-1,2),new n("ัŽ",-1,2),new n("ัƒัŽ",44,2)],v=[new n("ะฐ",-1,1),new n("ะตะฒ",-1,1),new n("ะพะฒ",-1,1),new n("ะต",-1,1),new n("ะธะต",3,1),new n("ัŒะต",3,1),new n("ะธ",-1,1),new n("ะตะธ",6,1),new n("ะธะธ",6,1),new n("ะฐะผะธ",6,1),new n("ัะผะธ",6,1),new n("ะธัะผะธ",10,1),new n("ะน",-1,1),new n("ะตะน",12,1),new n("ะธะตะน",13,1),new n("ะธะน",12,1),new n("ะพะน",12,1),new n("ะฐะผ",-1,1),new n("ะตะผ",-1,1),new n("ะธะตะผ",18,1),new n("ะพะผ",-1,1),new n("ัะผ",-1,1),new n("ะธัะผ",21,1),new n("ะพ",-1,1),new n("ัƒ",-1,1),new n("ะฐั…",-1,1),new n("ัั…",-1,1),new n("ะธัั…",26,1),new n("ั‹",-1,1),new n("ัŒ",-1,1),new n("ัŽ",-1,1),new n("ะธัŽ",30,1),new n("ัŒัŽ",30,1),new n("ั",-1,1),new n("ะธั",33,1),new n("ัŒั",33,1)],F=[new n("ะพัั‚",-1,1),new n("ะพัั‚ัŒ",-1,1)],q=[new n("ะตะนัˆะต",-1,1),new n("ะฝ",-1,2),new n("ะตะนัˆ",-1,1),new n("ัŒ",-1,3)],S=[33,65,8,232],W=new r;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){return w(),W.cursor=W.limit,!(W.cursor=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursors||e>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor>1),f=0,l=o0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.sv.min.js b/assets/javascripts/lunr/min/lunr.sv.min.js new file mode 100644 index 0000000..3e5eb64 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.sv.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Swedish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lรถs");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("lรถst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du dรคr dรฅ efter ej eller en er era ert ett frรฅn fรถr ha hade han hans har henne hennes hon honom hur hรคr i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu nรคr nรฅgon nรฅgot nรฅgra och om oss pรฅ samma sedan sig sin sina sitta sjรคlv skulle som sรฅ sรฅdan sรฅdana sรฅdant till under upp ut utan vad var vara varfรถr varit varje vars vart vem vi vid vilka vilkas vilken vilket vรฅr vรฅra vรฅrt รคn รคr รฅt รถver".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.ta.min.js b/assets/javascripts/lunr/min/lunr.ta.min.js new file mode 100644 index 0000000..a644bed --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ta.min.js @@ -0,0 +1 @@ +!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ta=function(){this.pipeline.reset(),this.pipeline.add(e.ta.trimmer,e.ta.stopWordFilter,e.ta.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ta.stemmer))},e.ta.wordCharacters="เฎ€-เฎ‰เฎŠ-เฎเฎ-เฎ™เฎš-เฎŸเฎ -เฎฉเฎช-เฎฏเฎฐ-เฎนเฎบ-เฎฟเฏ€-เฏ‰เฏŠ-เฏเฏ-เฏ™เฏš-เฏŸเฏ -เฏฉเฏช-เฏฏเฏฐ-เฏนเฏบ-เฏฟa-zA-Z๏ฝ-๏ฝš๏ผก-๏ผบ0-9๏ผ-๏ผ™",e.ta.trimmer=e.trimmerSupport.generateTrimmer(e.ta.wordCharacters),e.Pipeline.registerFunction(e.ta.trimmer,"trimmer-ta"),e.ta.stopWordFilter=e.generateStopWordFilter("เฎ…เฎ™เฏเฎ•เฏ เฎ…เฎ™เฏเฎ•เฏ‡ เฎ…เฎคเฏ เฎ…เฎคเฏˆ เฎ…เฎจเฏเฎค เฎ…เฎตเฎฐเฏ เฎ…เฎตเฎฐเฏเฎ•เฎณเฏ เฎ…เฎตเฎณเฏ เฎ…เฎตเฎฉเฏ เฎ…เฎตเฏˆ เฎ†เฎ• เฎ†เฎ•เฎตเฏ‡ เฎ†เฎ•เฏˆเฎฏเฎพเฎฒเฏ เฎ†เฎคเฎฒเฎพเฎฒเฏ เฎ†เฎคเฎฒเฎฟเฎฉเฎพเฎฒเฏ เฎ†เฎฉเฎพเฎฒเฏเฎฎเฏ เฎ†เฎฉเฎพเฎฒเฏ เฎ‡เฎ™เฏเฎ•เฏ เฎ‡เฎ™เฏเฎ•เฏ‡ เฎ‡เฎคเฏ เฎ‡เฎคเฏˆ เฎ‡เฎจเฏเฎค เฎ‡เฎชเฏเฎชเฎŸเฎฟ เฎ‡เฎตเฎฐเฏ เฎ‡เฎตเฎฐเฏเฎ•เฎณเฏ เฎ‡เฎตเฎณเฏ เฎ‡เฎตเฎฉเฏ เฎ‡เฎตเฏˆ เฎ‡เฎตเฏเฎตเฎณเฎตเฏ เฎ‰เฎฉเฎ•เฏเฎ•เฏ เฎ‰เฎฉเฎคเฏ เฎ‰เฎฉเฏ เฎ‰เฎฉเฏเฎฉเฎพเฎฒเฏ เฎŽเฎ™เฏเฎ•เฏ เฎŽเฎ™เฏเฎ•เฏ‡ เฎŽเฎคเฏ เฎŽเฎคเฏˆ เฎŽเฎจเฏเฎค เฎŽเฎชเฏเฎชเฎŸเฎฟ เฎŽเฎตเฎฐเฏ เฎŽเฎตเฎฐเฏเฎ•เฎณเฏ เฎŽเฎตเฎณเฏ เฎŽเฎตเฎฉเฏ เฎŽเฎตเฏˆ เฎŽเฎตเฏเฎตเฎณเฎตเฏ เฎŽเฎฉเฎ•เฏเฎ•เฏ เฎŽเฎฉเฎคเฏ เฎŽเฎฉเฎตเฏ‡ เฎŽเฎฉเฏ เฎŽเฎฉเฏเฎฉ เฎŽเฎฉเฏเฎฉเฎพเฎฒเฏ เฎเฎคเฏ เฎเฎฉเฏ เฎคเฎฉเฎคเฏ เฎคเฎฉเฏเฎฉเฎพเฎฒเฏ เฎคเฎพเฎฉเฏ‡ เฎคเฎพเฎฉเฏ เฎจเฎพเฎ™เฏเฎ•เฎณเฏ เฎจเฎพเฎฎเฏ เฎจเฎพเฎฉเฏ เฎจเฏ€ เฎจเฏ€เฎ™เฏเฎ•เฎณเฏ".split(" ")),e.ta.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var t=e.wordcut;t.init(),e.ta.tokenizer=function(r){if(!arguments.length||null==r||void 0==r)return[];if(Array.isArray(r))return r.map(function(t){return isLunr2?new e.Token(t.toLowerCase()):t.toLowerCase()});var i=r.toString().toLowerCase().replace(/^\s+/,"");return t.cut(i).split("|")},e.Pipeline.registerFunction(e.ta.stemmer,"stemmer-ta"),e.Pipeline.registerFunction(e.ta.stopWordFilter,"stopWordFilter-ta")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.th.min.js b/assets/javascripts/lunr/min/lunr.th.min.js new file mode 100644 index 0000000..dee3aac --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.th.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.th=function(){this.pipeline.reset(),this.pipeline.add(e.th.trimmer),r?this.tokenizer=e.th.tokenizer:(e.tokenizer&&(e.tokenizer=e.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.th.tokenizer))},e.th.wordCharacters="[เธ€-เนฟ]",e.th.trimmer=e.trimmerSupport.generateTrimmer(e.th.wordCharacters),e.Pipeline.registerFunction(e.th.trimmer,"trimmer-th");var t=e.wordcut;t.init(),e.th.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t):t});var n=i.toString().replace(/^\s+/,"");return t.cut(n).split("|")}}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.tr.min.js b/assets/javascripts/lunr/min/lunr.tr.min.js new file mode 100644 index 0000000..563f6ec --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.tr.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Turkish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWordFilter,r.tr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.tr.stemmer))},r.tr.wordCharacters="A-Za-zยชยบร€-ร–ร˜-รถรธ-สธห -หคแด€-แดฅแดฌ-แตœแตข-แตฅแตซ-แตทแตน-แถพแธ€-แปฟโฑโฟโ‚-โ‚œโ„ชโ„ซโ„ฒโ…Žโ… -โ†ˆโฑ -โฑฟ๊œข-๊ž‡๊ž‹-๊žญ๊žฐ-๊žท๊Ÿท-๊Ÿฟ๊ฌฐ-๊ญš๊ญœ-๊ญค๏ฌ€-๏ฌ†๏ผก-๏ผบ๏ฝ-๏ฝš",r.tr.trimmer=r.trimmerSupport.generateTrimmer(r.tr.wordCharacters),r.Pipeline.registerFunction(r.tr.trimmer,"trimmer-tr"),r.tr.stemmer=function(){var i=r.stemmerSupport.Among,e=r.stemmerSupport.SnowballProgram,n=new function(){function r(r,i,e){for(;;){var n=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(r,i,e)){Dr.cursor=Dr.limit-n;break}if(Dr.cursor=Dr.limit-n,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function n(){var i,e;i=Dr.limit-Dr.cursor,r(Wr,97,305);for(var n=0;nDr.limit_backward&&(Dr.cursor--,e=Dr.limit-Dr.cursor,i()))?(Dr.cursor=Dr.limit-e,!0):(Dr.cursor=Dr.limit-n,r()?(Dr.cursor=Dr.limit-n,!1):(Dr.cursor=Dr.limit-n,!(Dr.cursor<=Dr.limit_backward)&&(Dr.cursor--,!!i()&&(Dr.cursor=Dr.limit-n,!0))))}function u(r){return t(r,function(){return Dr.in_grouping_b(Wr,97,305)})}function o(){return u(function(){return Dr.eq_s_b(1,"n")})}function s(){return u(function(){return Dr.eq_s_b(1,"s")})}function c(){return u(function(){return Dr.eq_s_b(1,"y")})}function l(){return t(function(){return Dr.in_grouping_b(Lr,105,305)},function(){return Dr.out_grouping_b(Wr,97,305)})}function a(){return Dr.find_among_b(ur,10)&&l()}function m(){return n()&&Dr.in_grouping_b(Lr,105,305)&&s()}function d(){return Dr.find_among_b(or,2)}function f(){return n()&&Dr.in_grouping_b(Lr,105,305)&&c()}function b(){return n()&&Dr.find_among_b(sr,4)}function w(){return n()&&Dr.find_among_b(cr,4)&&o()}function _(){return n()&&Dr.find_among_b(lr,2)&&c()}function k(){return n()&&Dr.find_among_b(ar,2)}function p(){return n()&&Dr.find_among_b(mr,4)}function g(){return n()&&Dr.find_among_b(dr,2)}function y(){return n()&&Dr.find_among_b(fr,4)}function z(){return n()&&Dr.find_among_b(br,2)}function v(){return n()&&Dr.find_among_b(wr,2)&&c()}function h(){return Dr.eq_s_b(2,"ki")}function q(){return n()&&Dr.find_among_b(_r,2)&&o()}function C(){return n()&&Dr.find_among_b(kr,4)&&c()}function P(){return n()&&Dr.find_among_b(pr,4)}function F(){return n()&&Dr.find_among_b(gr,4)&&c()}function S(){return Dr.find_among_b(yr,4)}function W(){return n()&&Dr.find_among_b(zr,2)}function L(){return n()&&Dr.find_among_b(vr,4)}function x(){return n()&&Dr.find_among_b(hr,8)}function A(){return Dr.find_among_b(qr,2)}function E(){return n()&&Dr.find_among_b(Cr,32)&&c()}function j(){return Dr.find_among_b(Pr,8)&&c()}function T(){return n()&&Dr.find_among_b(Fr,4)&&c()}function Z(){return Dr.eq_s_b(3,"ken")&&c()}function B(){var r=Dr.limit-Dr.cursor;return!(T()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,Z()))))}function D(){if(A()){var r=Dr.limit-Dr.cursor;if(S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T())return!1}return!0}function G(){if(W()){Dr.bra=Dr.cursor,Dr.slice_del();var r=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,x()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,T()||(Dr.cursor=Dr.limit-r)))),nr=!1,!1}return!0}function H(){if(!L())return!0;var r=Dr.limit-Dr.cursor;return!E()&&(Dr.cursor=Dr.limit-r,!j())}function I(){var r,i=Dr.limit-Dr.cursor;return!(S()||(Dr.cursor=Dr.limit-i,F()||(Dr.cursor=Dr.limit-i,P()||(Dr.cursor=Dr.limit-i,C()))))||(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,T()||(Dr.cursor=Dr.limit-r),!1)}function J(){var r,i=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,nr=!0,B()&&(Dr.cursor=Dr.limit-i,D()&&(Dr.cursor=Dr.limit-i,G()&&(Dr.cursor=Dr.limit-i,H()&&(Dr.cursor=Dr.limit-i,I()))))){if(Dr.cursor=Dr.limit-i,!x())return;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T()||(Dr.cursor=Dr.limit-r)}Dr.bra=Dr.cursor,Dr.slice_del()}function K(){var r,i,e,n;if(Dr.ket=Dr.cursor,h()){if(r=Dr.limit-Dr.cursor,p())return Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,a()&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))),!0;if(Dr.cursor=Dr.limit-r,w()){if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,e=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-e,!m()&&(Dr.cursor=Dr.limit-e,!K())))return!0;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}return!0}if(Dr.cursor=Dr.limit-r,g()){if(n=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-n,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-n,!K())return!1;return!0}}return!1}function M(r){if(Dr.ket=Dr.cursor,!g()&&(Dr.cursor=Dr.limit-r,!k()))return!1;var i=Dr.limit-Dr.cursor;if(d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-i,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-i,!K())return!1;return!0}function N(r){if(Dr.ket=Dr.cursor,!z()&&(Dr.cursor=Dr.limit-r,!b()))return!1;var i=Dr.limit-Dr.cursor;return!(!m()&&(Dr.cursor=Dr.limit-i,!d()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)}function O(){var r,i=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,!(!w()&&(Dr.cursor=Dr.limit-i,!v()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,!(!W()||(Dr.bra=Dr.cursor,Dr.slice_del(),!K()))||(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!(a()||(Dr.cursor=Dr.limit-r,m()||(Dr.cursor=Dr.limit-r,K())))||(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)))}function Q(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,!p()&&(Dr.cursor=Dr.limit-e,!f()&&(Dr.cursor=Dr.limit-e,!_())))return!1;if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,a())Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()||(Dr.cursor=Dr.limit-i);else if(Dr.cursor=Dr.limit-r,!W())return!0;return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,K(),!0}function R(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,W())return Dr.bra=Dr.cursor,Dr.slice_del(),void K();if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,q())if(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-r,!m())){if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!W())return;if(Dr.bra=Dr.cursor,Dr.slice_del(),!K())return}Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}else if(Dr.cursor=Dr.limit-e,!M(e)&&(Dr.cursor=Dr.limit-e,!N(e))){if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,y())return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,i=Dr.limit-Dr.cursor,void(a()?(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())):(Dr.cursor=Dr.limit-i,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,K())));if(Dr.cursor=Dr.limit-e,!O()){if(Dr.cursor=Dr.limit-e,d())return Dr.bra=Dr.cursor,void Dr.slice_del();Dr.cursor=Dr.limit-e,K()||(Dr.cursor=Dr.limit-e,Q()||(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,(a()||(Dr.cursor=Dr.limit-e,m()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))))}}}function U(){var r;if(Dr.ket=Dr.cursor,r=Dr.find_among_b(Sr,4))switch(Dr.bra=Dr.cursor,r){case 1:Dr.slice_from("p");break;case 2:Dr.slice_from("รง");break;case 3:Dr.slice_from("t");break;case 4:Dr.slice_from("k")}}function V(){for(;;){var r=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(Wr,97,305)){Dr.cursor=Dr.limit-r;break}if(Dr.cursor=Dr.limit-r,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function X(r,i,e){if(Dr.cursor=Dr.limit-r,V()){var n=Dr.limit-Dr.cursor;if(!Dr.eq_s_b(1,i)&&(Dr.cursor=Dr.limit-n,!Dr.eq_s_b(1,e)))return!0;Dr.cursor=Dr.limit-r;var t=Dr.cursor;return Dr.insert(Dr.cursor,Dr.cursor,e),Dr.cursor=t,!1}return!0}function Y(){var r=Dr.limit-Dr.cursor;(Dr.eq_s_b(1,"d")||(Dr.cursor=Dr.limit-r,Dr.eq_s_b(1,"g")))&&X(r,"a","ฤฑ")&&X(r,"e","i")&&X(r,"o","u")&&X(r,"รถ","รผ")}function $(){for(var r,i=Dr.cursor,e=2;;){for(r=Dr.cursor;!Dr.in_grouping(Wr,97,305);){if(Dr.cursor>=Dr.limit)return Dr.cursor=r,!(e>0)&&(Dr.cursor=i,!0);Dr.cursor++}e--}}function rr(r,i,e){for(;!Dr.eq_s(i,e);){if(Dr.cursor>=Dr.limit)return!0;Dr.cursor++}return(tr=i)!=Dr.limit||(Dr.cursor=r,!1)}function ir(){var r=Dr.cursor;return!rr(r,2,"ad")||(Dr.cursor=r,!rr(r,5,"soyad"))}function er(){var r=Dr.cursor;return!ir()&&(Dr.limit_backward=r,Dr.cursor=Dr.limit,Y(),Dr.cursor=Dr.limit,U(),!0)}var nr,tr,ur=[new i("m",-1,-1),new i("n",-1,-1),new i("miz",-1,-1),new i("niz",-1,-1),new i("muz",-1,-1),new i("nuz",-1,-1),new i("mรผz",-1,-1),new i("nรผz",-1,-1),new i("mฤฑz",-1,-1),new i("nฤฑz",-1,-1)],or=[new i("leri",-1,-1),new i("larฤฑ",-1,-1)],sr=[new i("ni",-1,-1),new i("nu",-1,-1),new i("nรผ",-1,-1),new i("nฤฑ",-1,-1)],cr=[new i("in",-1,-1),new i("un",-1,-1),new i("รผn",-1,-1),new i("ฤฑn",-1,-1)],lr=[new i("a",-1,-1),new i("e",-1,-1)],ar=[new i("na",-1,-1),new i("ne",-1,-1)],mr=[new i("da",-1,-1),new i("ta",-1,-1),new i("de",-1,-1),new i("te",-1,-1)],dr=[new i("nda",-1,-1),new i("nde",-1,-1)],fr=[new i("dan",-1,-1),new i("tan",-1,-1),new i("den",-1,-1),new i("ten",-1,-1)],br=[new i("ndan",-1,-1),new i("nden",-1,-1)],wr=[new i("la",-1,-1),new i("le",-1,-1)],_r=[new i("ca",-1,-1),new i("ce",-1,-1)],kr=[new i("im",-1,-1),new i("um",-1,-1),new i("รผm",-1,-1),new i("ฤฑm",-1,-1)],pr=[new i("sin",-1,-1),new i("sun",-1,-1),new i("sรผn",-1,-1),new i("sฤฑn",-1,-1)],gr=[new i("iz",-1,-1),new i("uz",-1,-1),new i("รผz",-1,-1),new i("ฤฑz",-1,-1)],yr=[new i("siniz",-1,-1),new i("sunuz",-1,-1),new i("sรผnรผz",-1,-1),new i("sฤฑnฤฑz",-1,-1)],zr=[new i("lar",-1,-1),new i("ler",-1,-1)],vr=[new i("niz",-1,-1),new i("nuz",-1,-1),new i("nรผz",-1,-1),new i("nฤฑz",-1,-1)],hr=[new i("dir",-1,-1),new i("tir",-1,-1),new i("dur",-1,-1),new i("tur",-1,-1),new i("dรผr",-1,-1),new i("tรผr",-1,-1),new i("dฤฑr",-1,-1),new i("tฤฑr",-1,-1)],qr=[new i("casฤฑna",-1,-1),new i("cesine",-1,-1)],Cr=[new i("di",-1,-1),new i("ti",-1,-1),new i("dik",-1,-1),new i("tik",-1,-1),new i("duk",-1,-1),new i("tuk",-1,-1),new i("dรผk",-1,-1),new i("tรผk",-1,-1),new i("dฤฑk",-1,-1),new i("tฤฑk",-1,-1),new i("dim",-1,-1),new i("tim",-1,-1),new i("dum",-1,-1),new i("tum",-1,-1),new i("dรผm",-1,-1),new i("tรผm",-1,-1),new i("dฤฑm",-1,-1),new i("tฤฑm",-1,-1),new i("din",-1,-1),new i("tin",-1,-1),new i("dun",-1,-1),new i("tun",-1,-1),new i("dรผn",-1,-1),new i("tรผn",-1,-1),new i("dฤฑn",-1,-1),new i("tฤฑn",-1,-1),new i("du",-1,-1),new i("tu",-1,-1),new i("dรผ",-1,-1),new i("tรผ",-1,-1),new i("dฤฑ",-1,-1),new i("tฤฑ",-1,-1)],Pr=[new i("sa",-1,-1),new i("se",-1,-1),new i("sak",-1,-1),new i("sek",-1,-1),new i("sam",-1,-1),new i("sem",-1,-1),new i("san",-1,-1),new i("sen",-1,-1)],Fr=[new i("miลŸ",-1,-1),new i("muลŸ",-1,-1),new i("mรผลŸ",-1,-1),new i("mฤฑลŸ",-1,-1)],Sr=[new i("b",-1,1),new i("c",-1,2),new i("d",-1,3),new i("ฤŸ",-1,4)],Wr=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,8,0,0,0,0,0,0,1],Lr=[1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,1],xr=[1,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],Ar=[17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130],Er=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],jr=[17],Tr=[65],Zr=[65],Br=[["a",xr,97,305],["e",Ar,101,252],["ฤฑ",Er,97,305],["i",jr,101,105],["o",Tr,111,117],["รถ",Zr,246,252],["u",Tr,111,117]],Dr=new e;this.setCurrent=function(r){Dr.setCurrent(r)},this.getCurrent=function(){return Dr.getCurrent()},this.stem=function(){return!!($()&&(Dr.limit_backward=Dr.cursor,Dr.cursor=Dr.limit,J(),Dr.cursor=Dr.limit,nr&&(R(),Dr.cursor=Dr.limit_backward,er())))}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.tr.stemmer,"stemmer-tr"),r.tr.stopWordFilter=r.generateStopWordFilter("acaba altmฤฑลŸ altฤฑ ama ancak arada aslฤฑnda ayrฤฑca bana bazฤฑ belki ben benden beni benim beri beลŸ bile bin bir biri birkaรง birkez birรงok birลŸey birลŸeyi biz bizden bize bizi bizim bu buna bunda bundan bunlar bunlarฤฑ bunlarฤฑn bunu bunun burada bรถyle bรถylece da daha dahi de defa deฤŸil diye diฤŸer doksan dokuz dolayฤฑ dolayฤฑsฤฑyla dรถrt edecek eden ederek edilecek ediliyor edilmesi ediyor elli en etmesi etti ettiฤŸi ettiฤŸini eฤŸer gibi gรถre halen hangi hatta hem henรผz hep hepsi her herhangi herkesin hiรง hiรงbir iki ile ilgili ise itibaren itibariyle iรงin iลŸte kadar karลŸฤฑn katrilyon kendi kendilerine kendini kendisi kendisine kendisini kez ki kim kimden kime kimi kimse kฤฑrk milyar milyon mu mรผ mฤฑ nasฤฑl ne neden nedenle nerde nerede nereye niye niรงin o olan olarak oldu olduklarฤฑnฤฑ olduฤŸu olduฤŸunu olmadฤฑ olmadฤฑฤŸฤฑ olmak olmasฤฑ olmayan olmaz olsa olsun olup olur olursa oluyor on ona ondan onlar onlardan onlarฤฑ onlarฤฑn onu onun otuz oysa pek raฤŸmen sadece sanki sekiz seksen sen senden seni senin siz sizden sizi sizin tarafฤฑndan trilyon tรผm var vardฤฑ ve veya ya yani yapacak yapmak yaptฤฑ yaptฤฑklarฤฑ yaptฤฑฤŸฤฑ yaptฤฑฤŸฤฑnฤฑ yapฤฑlan yapฤฑlmasฤฑ yapฤฑyor yedi yerine yetmiลŸ yine yirmi yoksa yรผz zaten รงok รงรผnkรผ รถyle รผzere รผรง ลŸey ลŸeyden ลŸeyi ลŸeyler ลŸu ลŸuna ลŸunda ลŸundan ลŸunlarฤฑ ลŸunu ลŸรถyle".split(" ")),r.Pipeline.registerFunction(r.tr.stopWordFilter,"stopWordFilter-tr")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.vi.min.js b/assets/javascripts/lunr/min/lunr.vi.min.js new file mode 100644 index 0000000..22aed28 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.vi.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-zฬ€อฬอ‘ฬ‰ฬฃฬƒอƒร‚รขรŠรชร”รดฤ‚-ฤƒฤ-ฤ‘ฦ -ฦกฦฏ-ฦฐ]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("lร  cรกi nhฦฐng mร ".split(" "))}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.zh.min.js b/assets/javascripts/lunr/min/lunr.zh.min.js new file mode 100644 index 0000000..9838ef9 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.zh.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r(require("@node-rs/jieba")):r()(e.lunr)}(this,function(e){return function(r,t){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==r.version[0];r.zh=function(){this.pipeline.reset(),this.pipeline.add(r.zh.trimmer,r.zh.stopWordFilter,r.zh.stemmer),i?this.tokenizer=r.zh.tokenizer:(r.tokenizer&&(r.tokenizer=r.zh.tokenizer),this.tokenizerFn&&(this.tokenizerFn=r.zh.tokenizer))},r.zh.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(e){return i?new r.Token(e.toLowerCase()):e.toLowerCase()});t&&e.load(t);var o=n.toString().trim().toLowerCase(),s=[];e.cut(o,!0).forEach(function(e){s=s.concat(e.split(" "))}),s=s.filter(function(e){return!!e});var u=0;return s.map(function(e,t){if(i){var n=o.indexOf(e,u),s={};return s.position=[n,e.length],s.index=t,u=n,new r.Token(e,s)}return e})},r.zh.wordCharacters="\\wไธ€-้พฅ",r.zh.trimmer=r.trimmerSupport.generateTrimmer(r.zh.wordCharacters),r.Pipeline.registerFunction(r.zh.trimmer,"trimmer-zh"),r.zh.stemmer=function(){return function(e){return e}}(),r.Pipeline.registerFunction(r.zh.stemmer,"stemmer-zh"),r.zh.stopWordFilter=r.generateStopWordFilter("็š„ ไธ€ ไธ ๅœจ ไบบ ๆœ‰ ๆ˜ฏ ไธบ ไปฅ ไบŽ ไธŠ ไป– ่€Œ ๅŽ ไน‹ ๆฅ ๅŠ ไบ† ๅ›  ไธ‹ ๅฏ ๅˆฐ ็”ฑ ่ฟ™ ไธŽ ไนŸ ๆญค ไฝ† ๅนถ ไธช ๅ…ถ ๅทฒ ๆ—  ๅฐ ๆˆ‘ ไปฌ ่ตท ๆœ€ ๅ† ไปŠ ๅŽป ๅฅฝ ๅช ๅˆ ๆˆ– ๅพˆ ไบฆ ๆŸ ๆŠŠ ้‚ฃ ไฝ  ไนƒ ๅฎƒ ๅง ่ขซ ๆฏ” ๅˆซ ่ถ ๅฝ“ ไปŽ ๅˆฐ ๅพ— ๆ‰“ ๅ‡ก ๅ„ฟ ๅฐ” ่ฏฅ ๅ„ ็ป™ ่ทŸ ๅ’Œ ไฝ• ่ฟ˜ ๅณ ๅ‡  ๆ—ข ็œ‹ ๆฎ ่ท ้  ๅ•ฆ ไบ† ๅฆ ไนˆ ๆฏ ไปฌ ๅ˜› ๆ‹ฟ ๅ“ช ้‚ฃ ๆ‚จ ๅ‡ญ ไธ” ๅด ่ฎฉ ไป ๅ•ฅ ๅฆ‚ ่‹ฅ ไฝฟ ่ฐ ่™ฝ ้š ๅŒ ๆ‰€ ๅฅน ๅ“‡ ๅ—ก ๅพ€ ๅ“ช ไบ› ๅ‘ ๆฒฟ ๅ“Ÿ ็”จ ไบŽ ๅ’ฑ ๅˆ™ ๆ€Ž ๆ›พ ่‡ณ ่‡ด ็€ ่ฏธ ่‡ช".split(" ")),r.Pipeline.registerFunction(r.zh.stopWordFilter,"stopWordFilter-zh")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/tinyseg.js b/assets/javascripts/lunr/tinyseg.js new file mode 100644 index 0000000..167fa6d --- /dev/null +++ b/assets/javascripts/lunr/tinyseg.js @@ -0,0 +1,206 @@ +/** + * export the module via AMD, CommonJS or as a browser global + * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js + */ +;(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory) + } else if (typeof exports === 'object') { + /** + * Node. Does not work with strict CommonJS, but + * only CommonJS-like environments that support module.exports, + * like Node. + */ + module.exports = factory() + } else { + // Browser globals (root is window) + factory()(root.lunr); + } +}(this, function () { + /** + * Just return a value to define the module export. + * This example returns an object, but the module + * can return a function as the exported value. + */ + + return function(lunr) { + // TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript + // (c) 2008 Taku Kudo + // TinySegmenter is freely distributable under the terms of a new BSD licence. + // For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt + + function TinySegmenter() { + var patterns = { + "[ไธ€ไบŒไธ‰ๅ››ไบ”ๅ…ญไธƒๅ…ซไนๅ็™พๅƒไธ‡ๅ„„ๅ…†]":"M", + "[ไธ€-้พ ใ€…ใ€†ใƒตใƒถ]":"H", + "[ใ-ใ‚“]":"I", + "[ใ‚ก-ใƒดใƒผ๏ฝฑ-๏พ๏พž๏ฝฐ]":"K", + "[a-zA-Z๏ฝ-๏ฝš๏ผก-๏ผบ]":"A", + "[0-9๏ผ-๏ผ™]":"N" + } + this.chartype_ = []; + for (var i in patterns) { + var regexp = new RegExp(i); + this.chartype_.push([regexp, patterns[i]]); + } + + this.BIAS__ = -332 + this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378}; + this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920}; + this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266}; + this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352}; + this.BP2__ = {"BO":60,"OO":-1762}; + this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965}; + this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146}; + this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699}; + this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973}; + this.BW1__ = {",ใจ":660,",ๅŒ":727,"B1ใ‚":1404,"B1ๅŒ":542,"ใ€ใจ":660,"ใ€ๅŒ":727,"ใ€ใจ":1682,"ใ‚ใฃ":1505,"ใ„ใ†":1743,"ใ„ใฃ":-2055,"ใ„ใ‚‹":672,"ใ†ใ—":-4817,"ใ†ใ‚“":665,"ใ‹ใ‚‰":3472,"ใŒใ‚‰":600,"ใ“ใ†":-790,"ใ“ใจ":2083,"ใ“ใ‚“":-1262,"ใ•ใ‚‰":-4143,"ใ•ใ‚“":4573,"ใ—ใŸ":2641,"ใ—ใฆ":1104,"ใ™ใง":-3399,"ใใ“":1977,"ใใ‚Œ":-871,"ใŸใก":1122,"ใŸใ‚":601,"ใฃใŸ":3463,"ใคใ„":-802,"ใฆใ„":805,"ใฆใ":1249,"ใงใ":1127,"ใงใ™":3445,"ใงใฏ":844,"ใจใ„":-4915,"ใจใฟ":1922,"ใฉใ“":3887,"ใชใ„":5713,"ใชใฃ":3015,"ใชใฉ":7379,"ใชใ‚“":-1113,"ใซใ—":2468,"ใซใฏ":1498,"ใซใ‚‚":1671,"ใซๅฏพ":-912,"ใฎไธ€":-501,"ใฎไธญ":741,"ใพใ›":2448,"ใพใง":1711,"ใพใพ":2600,"ใพใ‚‹":-2155,"ใ‚„ใ‚€":-1947,"ใ‚ˆใฃ":-2565,"ใ‚ŒใŸ":2369,"ใ‚Œใง":-913,"ใ‚’ใ—":1860,"ใ‚’่ฆ‹":731,"ไบกใ":-1886,"ไบฌ้ƒฝ":2558,"ๅ–ใ‚Š":-2784,"ๅคงใ":-2604,"ๅคง้˜ช":1497,"ๅนณๆ–น":-2314,"ๅผ•ใ":-1336,"ๆ—ฅๆœฌ":-195,"ๆœฌๅฝ“":-2423,"ๆฏŽๆ—ฅ":-2113,"็›ฎๆŒ‡":-724,"๏ผข๏ผ‘ใ‚":1404,"๏ผข๏ผ‘ๅŒ":542,"๏ฝฃใจ":1682}; + this.BW2__ = {"..":-11822,"11":-669,"โ€•โ€•":-5730,"โˆ’โˆ’":-13175,"ใ„ใ†":-1609,"ใ†ใ‹":2490,"ใ‹ใ—":-1350,"ใ‹ใ‚‚":-602,"ใ‹ใ‚‰":-7194,"ใ‹ใ‚Œ":4612,"ใŒใ„":853,"ใŒใ‚‰":-3198,"ใใŸ":1941,"ใใช":-1597,"ใ“ใจ":-8392,"ใ“ใฎ":-4193,"ใ•ใ›":4533,"ใ•ใ‚Œ":13168,"ใ•ใ‚“":-3977,"ใ—ใ„":-1819,"ใ—ใ‹":-545,"ใ—ใŸ":5078,"ใ—ใฆ":972,"ใ—ใช":939,"ใใฎ":-3744,"ใŸใ„":-1253,"ใŸใŸ":-662,"ใŸใ ":-3857,"ใŸใก":-786,"ใŸใจ":1224,"ใŸใฏ":-939,"ใฃใŸ":4589,"ใฃใฆ":1647,"ใฃใจ":-2094,"ใฆใ„":6144,"ใฆใ":3640,"ใฆใ":2551,"ใฆใฏ":-3110,"ใฆใ‚‚":-3065,"ใงใ„":2666,"ใงใ":-1528,"ใงใ—":-3828,"ใงใ™":-4761,"ใงใ‚‚":-4203,"ใจใ„":1890,"ใจใ“":-1746,"ใจใจ":-2279,"ใจใฎ":720,"ใจใฟ":5168,"ใจใ‚‚":-3941,"ใชใ„":-2488,"ใชใŒ":-1313,"ใชใฉ":-6509,"ใชใฎ":2614,"ใชใ‚“":3099,"ใซใŠ":-1615,"ใซใ—":2748,"ใซใช":2454,"ใซใ‚ˆ":-7236,"ใซๅฏพ":-14943,"ใซๅพ“":-4688,"ใซ้–ข":-11388,"ใฎใ‹":2093,"ใฎใง":-7059,"ใฎใซ":-6041,"ใฎใฎ":-6125,"ใฏใ„":1073,"ใฏใŒ":-1033,"ใฏใš":-2532,"ใฐใ‚Œ":1813,"ใพใ—":-1316,"ใพใง":-6621,"ใพใ‚Œ":5409,"ใ‚ใฆ":-3153,"ใ‚‚ใ„":2230,"ใ‚‚ใฎ":-10713,"ใ‚‰ใ‹":-944,"ใ‚‰ใ—":-1611,"ใ‚‰ใซ":-1897,"ใ‚Šใ—":651,"ใ‚Šใพ":1620,"ใ‚ŒใŸ":4270,"ใ‚Œใฆ":849,"ใ‚Œใฐ":4114,"ใ‚ใ†":6067,"ใ‚ใ‚Œ":7901,"ใ‚’้€š":-11877,"ใ‚“ใ ":728,"ใ‚“ใช":-4115,"ไธ€ไบบ":602,"ไธ€ๆ–น":-1375,"ไธ€ๆ—ฅ":970,"ไธ€้ƒจ":-1051,"ไธŠใŒ":-4479,"ไผš็คพ":-1116,"ๅ‡บใฆ":2163,"ๅˆ†ใฎ":-7758,"ๅŒๅ…š":970,"ๅŒๆ—ฅ":-913,"ๅคง้˜ช":-2471,"ๅง”ๅ“ก":-1250,"ๅฐ‘ใช":-1050,"ๅนดๅบฆ":-8669,"ๅนด้–“":-1626,"ๅบœ็œŒ":-2363,"ๆ‰‹ๆจฉ":-1982,"ๆ–ฐ่ž":-4066,"ๆ—ฅๆ–ฐ":-722,"ๆ—ฅๆœฌ":-7068,"ๆ—ฅ็ฑณ":3372,"ๆ›œๆ—ฅ":-601,"ๆœ้ฎฎ":-2355,"ๆœฌไบบ":-2697,"ๆฑไบฌ":-1543,"็„ถใจ":-1384,"็คพไผš":-1276,"็ซ‹ใฆ":-990,"็ฌฌใซ":-1612,"็ฑณๅ›ฝ":-4268,"๏ผ‘๏ผ‘":-669}; + this.BW3__ = {"ใ‚ใŸ":-2194,"ใ‚ใ‚Š":719,"ใ‚ใ‚‹":3846,"ใ„.":-1185,"ใ„ใ€‚":-1185,"ใ„ใ„":5308,"ใ„ใˆ":2079,"ใ„ใ":3029,"ใ„ใŸ":2056,"ใ„ใฃ":1883,"ใ„ใ‚‹":5600,"ใ„ใ‚":1527,"ใ†ใก":1117,"ใ†ใจ":4798,"ใˆใจ":1454,"ใ‹.":2857,"ใ‹ใ€‚":2857,"ใ‹ใ‘":-743,"ใ‹ใฃ":-4098,"ใ‹ใซ":-669,"ใ‹ใ‚‰":6520,"ใ‹ใ‚Š":-2670,"ใŒ,":1816,"ใŒใ€":1816,"ใŒใ":-4855,"ใŒใ‘":-1127,"ใŒใฃ":-913,"ใŒใ‚‰":-4977,"ใŒใ‚Š":-2064,"ใใŸ":1645,"ใ‘ใฉ":1374,"ใ“ใจ":7397,"ใ“ใฎ":1542,"ใ“ใ‚":-2757,"ใ•ใ„":-714,"ใ•ใ‚’":976,"ใ—,":1557,"ใ—ใ€":1557,"ใ—ใ„":-3714,"ใ—ใŸ":3562,"ใ—ใฆ":1449,"ใ—ใช":2608,"ใ—ใพ":1200,"ใ™.":-1310,"ใ™ใ€‚":-1310,"ใ™ใ‚‹":6521,"ใš,":3426,"ใšใ€":3426,"ใšใซ":841,"ใใ†":428,"ใŸ.":8875,"ใŸใ€‚":8875,"ใŸใ„":-594,"ใŸใฎ":812,"ใŸใ‚Š":-1183,"ใŸใ‚‹":-853,"ใ .":4098,"ใ ใ€‚":4098,"ใ ใฃ":1004,"ใฃใŸ":-4748,"ใฃใฆ":300,"ใฆใ„":6240,"ใฆใŠ":855,"ใฆใ‚‚":302,"ใงใ™":1437,"ใงใซ":-1482,"ใงใฏ":2295,"ใจใ†":-1387,"ใจใ—":2266,"ใจใฎ":541,"ใจใ‚‚":-3543,"ใฉใ†":4664,"ใชใ„":1796,"ใชใ":-903,"ใชใฉ":2135,"ใซ,":-1021,"ใซใ€":-1021,"ใซใ—":1771,"ใซใช":1906,"ใซใฏ":2644,"ใฎ,":-724,"ใฎใ€":-724,"ใฎๅญ":-1000,"ใฏ,":1337,"ใฏใ€":1337,"ในใ":2181,"ใพใ—":1113,"ใพใ™":6943,"ใพใฃ":-1549,"ใพใง":6154,"ใพใ‚Œ":-793,"ใ‚‰ใ—":1479,"ใ‚‰ใ‚Œ":6820,"ใ‚‹ใ‚‹":3818,"ใ‚Œ,":854,"ใ‚Œใ€":854,"ใ‚ŒใŸ":1850,"ใ‚Œใฆ":1375,"ใ‚Œใฐ":-3246,"ใ‚Œใ‚‹":1091,"ใ‚ใ‚Œ":-605,"ใ‚“ใ ":606,"ใ‚“ใง":798,"ใ‚ซๆœˆ":990,"ไผš่ญฐ":860,"ๅ…ฅใ‚Š":1232,"ๅคงไผš":2217,"ๅง‹ใ‚":1681,"ๅธ‚":965,"ๆ–ฐ่ž":-5055,"ๆ—ฅ,":974,"ๆ—ฅใ€":974,"็คพไผš":2024,"๏ฝถๆœˆ":990}; + this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832}; + this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649}; + this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393}; + this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841}; + this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68}; + this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591}; + this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685}; + this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156}; + this.TW1__ = {"ใซใคใ„":-4681,"ๆฑไบฌ้ƒฝ":2026}; + this.TW2__ = {"ใ‚ใ‚‹็จ‹":-2049,"ใ„ใฃใŸ":-1256,"ใ“ใ‚ใŒ":-2434,"ใ—ใ‚‡ใ†":3873,"ใใฎๅพŒ":-4430,"ใ ใฃใฆ":-1049,"ใฆใ„ใŸ":1833,"ใจใ—ใฆ":-4657,"ใจใ‚‚ใซ":-4517,"ใ‚‚ใฎใง":1882,"ไธ€ๆฐ—ใซ":-792,"ๅˆใ‚ใฆ":-1512,"ๅŒๆ™‚ใซ":-8097,"ๅคงใใช":-1255,"ๅฏพใ—ใฆ":-2721,"็คพไผšๅ…š":-3216}; + this.TW3__ = {"ใ„ใŸใ ":-1734,"ใ—ใฆใ„":1314,"ใจใ—ใฆ":-4314,"ใซใคใ„":-5483,"ใซใจใฃ":-5989,"ใซๅฝ“ใŸ":-6247,"ใฎใง,":-727,"ใฎใงใ€":-727,"ใฎใ‚‚ใฎ":-600,"ใ‚Œใ‹ใ‚‰":-3752,"ๅไบŒๆœˆ":-2287}; + this.TW4__ = {"ใ„ใ†.":8576,"ใ„ใ†ใ€‚":8576,"ใ‹ใ‚‰ใช":-2348,"ใ—ใฆใ„":2958,"ใŸใŒ,":1516,"ใŸใŒใ€":1516,"ใฆใ„ใ‚‹":1538,"ใจใ„ใ†":1349,"ใพใ—ใŸ":5543,"ใพใ›ใ‚“":1097,"ใ‚ˆใ†ใจ":-4258,"ใ‚ˆใ‚‹ใจ":5865}; + this.UC1__ = {"A":484,"K":93,"M":645,"O":-505}; + this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646}; + this.UC3__ = {"A":-1370,"I":2311}; + this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646}; + this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831}; + this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387}; + this.UP1__ = {"O":-214}; + this.UP2__ = {"B":69,"O":935}; + this.UP3__ = {"B":189}; + this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422}; + this.UQ2__ = {"BH":216,"BI":113,"OK":1759}; + this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212}; + this.UW1__ = {",":156,"ใ€":156,"ใ€Œ":-463,"ใ‚":-941,"ใ†":-127,"ใŒ":-553,"ใ":121,"ใ“":505,"ใง":-201,"ใจ":-547,"ใฉ":-123,"ใซ":-789,"ใฎ":-185,"ใฏ":-847,"ใ‚‚":-466,"ใ‚„":-470,"ใ‚ˆ":182,"ใ‚‰":-292,"ใ‚Š":208,"ใ‚Œ":169,"ใ‚’":-446,"ใ‚“":-137,"ใƒป":-135,"ไธป":-402,"ไบฌ":-268,"ๅŒบ":-912,"ๅˆ":871,"ๅ›ฝ":-460,"ๅคง":561,"ๅง”":729,"ๅธ‚":-411,"ๆ—ฅ":-141,"็†":361,"็”Ÿ":-408,"็œŒ":-386,"้ƒฝ":-718,"๏ฝข":-463,"๏ฝฅ":-135}; + this.UW2__ = {",":-829,"ใ€":-829,"ใ€‡":892,"ใ€Œ":-645,"ใ€":3145,"ใ‚":-538,"ใ„":505,"ใ†":134,"ใŠ":-502,"ใ‹":1454,"ใŒ":-856,"ใ":-412,"ใ“":1141,"ใ•":878,"ใ–":540,"ใ—":1529,"ใ™":-675,"ใ›":300,"ใ":-1011,"ใŸ":188,"ใ ":1837,"ใค":-949,"ใฆ":-291,"ใง":-268,"ใจ":-981,"ใฉ":1273,"ใช":1063,"ใซ":-1764,"ใฎ":130,"ใฏ":-409,"ใฒ":-1273,"ใน":1261,"ใพ":600,"ใ‚‚":-1263,"ใ‚„":-402,"ใ‚ˆ":1639,"ใ‚Š":-579,"ใ‚‹":-694,"ใ‚Œ":571,"ใ‚’":-2516,"ใ‚“":2095,"ใ‚ข":-587,"ใ‚ซ":306,"ใ‚ญ":568,"ใƒƒ":831,"ไธ‰":-758,"ไธ":-2150,"ไธ–":-302,"ไธญ":-968,"ไธป":-861,"ไบ‹":492,"ไบบ":-123,"ไผš":978,"ไฟ":362,"ๅ…ฅ":548,"ๅˆ":-3025,"ๅ‰ฏ":-1566,"ๅŒ—":-3414,"ๅŒบ":-422,"ๅคง":-1769,"ๅคฉ":-865,"ๅคช":-483,"ๅญ":-1519,"ๅญฆ":760,"ๅฎŸ":1023,"ๅฐ":-2009,"ๅธ‚":-813,"ๅนด":-1060,"ๅผท":1067,"ๆ‰‹":-1519,"ๆบ":-1033,"ๆ”ฟ":1522,"ๆ–‡":-1355,"ๆ–ฐ":-1682,"ๆ—ฅ":-1815,"ๆ˜Ž":-1462,"ๆœ€":-630,"ๆœ":-1843,"ๆœฌ":-1650,"ๆฑ":-931,"ๆžœ":-665,"ๆฌก":-2378,"ๆฐ‘":-180,"ๆฐ—":-1740,"็†":752,"็™บ":529,"็›ฎ":-1584,"็›ธ":-242,"็œŒ":-1165,"็ซ‹":-763,"็ฌฌ":810,"็ฑณ":509,"่‡ช":-1353,"่กŒ":838,"่ฅฟ":-744,"่ฆ‹":-3874,"่ชฟ":1010,"่ญฐ":1198,"่พผ":3041,"้–‹":1758,"้–“":-1257,"๏ฝข":-645,"๏ฝฃ":3145,"๏ฝฏ":831,"๏ฝฑ":-587,"๏ฝถ":306,"๏ฝท":568}; + this.UW3__ = {",":4889,"1":-800,"โˆ’":-1723,"ใ€":4889,"ใ€…":-2311,"ใ€‡":5827,"ใ€":2670,"ใ€“":-3573,"ใ‚":-2696,"ใ„":1006,"ใ†":2342,"ใˆ":1983,"ใŠ":-4864,"ใ‹":-1163,"ใŒ":3271,"ใ":1004,"ใ‘":388,"ใ’":401,"ใ“":-3552,"ใ”":-3116,"ใ•":-1058,"ใ—":-395,"ใ™":584,"ใ›":3685,"ใ":-5228,"ใŸ":842,"ใก":-521,"ใฃ":-1444,"ใค":-1081,"ใฆ":6167,"ใง":2318,"ใจ":1691,"ใฉ":-899,"ใช":-2788,"ใซ":2745,"ใฎ":4056,"ใฏ":4555,"ใฒ":-2171,"ใต":-1798,"ใธ":1199,"ใป":-5516,"ใพ":-4384,"ใฟ":-120,"ใ‚":1205,"ใ‚‚":2323,"ใ‚„":-788,"ใ‚ˆ":-202,"ใ‚‰":727,"ใ‚Š":649,"ใ‚‹":5905,"ใ‚Œ":2773,"ใ‚":-1207,"ใ‚’":6620,"ใ‚“":-518,"ใ‚ข":551,"ใ‚ฐ":1319,"ใ‚น":874,"ใƒƒ":-1350,"ใƒˆ":521,"ใƒ ":1109,"ใƒซ":1591,"ใƒญ":2201,"ใƒณ":278,"ใƒป":-3794,"ไธ€":-1619,"ไธ‹":-1759,"ไธ–":-2087,"ไธก":3815,"ไธญ":653,"ไธป":-758,"ไบˆ":-1193,"ไบŒ":974,"ไบบ":2742,"ไปŠ":792,"ไป–":1889,"ไปฅ":-1368,"ไฝŽ":811,"ไฝ•":4265,"ไฝœ":-361,"ไฟ":-2439,"ๅ…ƒ":4858,"ๅ…š":3593,"ๅ…จ":1574,"ๅ…ฌ":-3030,"ๅ…ญ":755,"ๅ…ฑ":-1880,"ๅ††":5807,"ๅ†":3095,"ๅˆ†":457,"ๅˆ":2475,"ๅˆฅ":1129,"ๅ‰":2286,"ๅ‰ฏ":4437,"ๅŠ›":365,"ๅ‹•":-949,"ๅ‹™":-1872,"ๅŒ–":1327,"ๅŒ—":-1038,"ๅŒบ":4646,"ๅƒ":-2309,"ๅˆ":-783,"ๅ”":-1006,"ๅฃ":483,"ๅณ":1233,"ๅ„":3588,"ๅˆ":-241,"ๅŒ":3906,"ๅ’Œ":-837,"ๅ“ก":4513,"ๅ›ฝ":642,"ๅž‹":1389,"ๅ ด":1219,"ๅค–":-241,"ๅฆป":2016,"ๅญฆ":-1356,"ๅฎ‰":-423,"ๅฎŸ":-1008,"ๅฎถ":1078,"ๅฐ":-513,"ๅฐ‘":-3102,"ๅทž":1155,"ๅธ‚":3197,"ๅนณ":-1804,"ๅนด":2416,"ๅบƒ":-1030,"ๅบœ":1605,"ๅบฆ":1452,"ๅปบ":-2352,"ๅฝ“":-3885,"ๅพ—":1905,"ๆ€":-1291,"ๆ€ง":1822,"ๆˆธ":-488,"ๆŒ‡":-3973,"ๆ”ฟ":-2013,"ๆ•™":-1479,"ๆ•ฐ":3222,"ๆ–‡":-1489,"ๆ–ฐ":1764,"ๆ—ฅ":2099,"ๆ—ง":5792,"ๆ˜จ":-661,"ๆ™‚":-1248,"ๆ›œ":-951,"ๆœ€":-937,"ๆœˆ":4125,"ๆœŸ":360,"ๆŽ":3094,"ๆ‘":364,"ๆฑ":-805,"ๆ ธ":5156,"ๆฃฎ":2438,"ๆฅญ":484,"ๆฐ":2613,"ๆฐ‘":-1694,"ๆฑบ":-1073,"ๆณ•":1868,"ๆตท":-495,"็„ก":979,"็‰ฉ":461,"็‰น":-3850,"็”Ÿ":-273,"็”จ":914,"็”บ":1215,"็š„":7313,"็›ด":-1835,"็œ":792,"็œŒ":6293,"็Ÿฅ":-1528,"็ง":4231,"็จŽ":401,"็ซ‹":-960,"็ฌฌ":1201,"็ฑณ":7767,"็ณป":3066,"็ด„":3663,"็ดš":1384,"็ตฑ":-4229,"็ท":1163,"็ทš":1255,"่€…":6457,"่ƒฝ":725,"่‡ช":-2869,"่‹ฑ":785,"่ฆ‹":1044,"่ชฟ":-562,"่ฒก":-733,"่ฒป":1777,"่ปŠ":1835,"่ป":1375,"่พผ":-1504,"้€š":-1136,"้ธ":-681,"้ƒŽ":1026,"้ƒก":4404,"้ƒจ":1200,"้‡‘":2163,"้•ท":421,"้–‹":-1432,"้–“":1302,"้–ข":-1282,"้›จ":2009,"้›ป":-1045,"้ž":2066,"้ง…":1620,"๏ผ‘":-800,"๏ฝฃ":2670,"๏ฝฅ":-3794,"๏ฝฏ":-1350,"๏ฝฑ":551,"๏ฝธ๏พž":1319,"๏ฝฝ":874,"๏พ„":521,"๏พ‘":1109,"๏พ™":1591,"๏พ›":2201,"๏พ":278}; + this.UW4__ = {",":3930,".":3508,"โ€•":-4841,"ใ€":3930,"ใ€‚":3508,"ใ€‡":4999,"ใ€Œ":1895,"ใ€":3798,"ใ€“":-5156,"ใ‚":4752,"ใ„":-3435,"ใ†":-640,"ใˆ":-2514,"ใŠ":2405,"ใ‹":530,"ใŒ":6006,"ใ":-4482,"ใŽ":-3821,"ใ":-3788,"ใ‘":-4376,"ใ’":-4734,"ใ“":2255,"ใ”":1979,"ใ•":2864,"ใ—":-843,"ใ˜":-2506,"ใ™":-731,"ใš":1251,"ใ›":181,"ใ":4091,"ใŸ":5034,"ใ ":5408,"ใก":-3654,"ใฃ":-5882,"ใค":-1659,"ใฆ":3994,"ใง":7410,"ใจ":4547,"ใช":5433,"ใซ":6499,"ใฌ":1853,"ใญ":1413,"ใฎ":7396,"ใฏ":8578,"ใฐ":1940,"ใฒ":4249,"ใณ":-4134,"ใต":1345,"ใธ":6665,"ใน":-744,"ใป":1464,"ใพ":1051,"ใฟ":-2082,"ใ‚€":-882,"ใ‚":-5046,"ใ‚‚":4169,"ใ‚ƒ":-2666,"ใ‚„":2795,"ใ‚‡":-1544,"ใ‚ˆ":3351,"ใ‚‰":-2922,"ใ‚Š":-9726,"ใ‚‹":-14896,"ใ‚Œ":-2613,"ใ‚":-4570,"ใ‚":-1783,"ใ‚’":13150,"ใ‚“":-2352,"ใ‚ซ":2145,"ใ‚ณ":1789,"ใ‚ป":1287,"ใƒƒ":-724,"ใƒˆ":-403,"ใƒก":-1635,"ใƒฉ":-881,"ใƒช":-541,"ใƒซ":-856,"ใƒณ":-3637,"ใƒป":-4371,"ใƒผ":-11870,"ไธ€":-2069,"ไธญ":2210,"ไบˆ":782,"ไบ‹":-190,"ไบ•":-1768,"ไบบ":1036,"ไปฅ":544,"ไผš":950,"ไฝ“":-1286,"ไฝœ":530,"ๅด":4292,"ๅ…ˆ":601,"ๅ…š":-2006,"ๅ…ฑ":-1212,"ๅ†…":584,"ๅ††":788,"ๅˆ":1347,"ๅ‰":1623,"ๅ‰ฏ":3879,"ๅŠ›":-302,"ๅ‹•":-740,"ๅ‹™":-2715,"ๅŒ–":776,"ๅŒบ":4517,"ๅ”":1013,"ๅ‚":1555,"ๅˆ":-1834,"ๅ’Œ":-681,"ๅ“ก":-910,"ๅ™จ":-851,"ๅ›ž":1500,"ๅ›ฝ":-619,"ๅœ’":-1200,"ๅœฐ":866,"ๅ ด":-1410,"ๅก":-2094,"ๅฃซ":-1413,"ๅคš":1067,"ๅคง":571,"ๅญ":-4802,"ๅญฆ":-1397,"ๅฎš":-1057,"ๅฏบ":-809,"ๅฐ":1910,"ๅฑ‹":-1328,"ๅฑฑ":-1500,"ๅณถ":-2056,"ๅท":-2667,"ๅธ‚":2771,"ๅนด":374,"ๅบ":-4556,"ๅพŒ":456,"ๆ€ง":553,"ๆ„Ÿ":916,"ๆ‰€":-1566,"ๆ”ฏ":856,"ๆ”น":787,"ๆ”ฟ":2182,"ๆ•™":704,"ๆ–‡":522,"ๆ–น":-856,"ๆ—ฅ":1798,"ๆ™‚":1829,"ๆœ€":845,"ๆœˆ":-9066,"ๆœจ":-485,"ๆฅ":-442,"ๆ ก":-360,"ๆฅญ":-1043,"ๆฐ":5388,"ๆฐ‘":-2716,"ๆฐ—":-910,"ๆฒข":-939,"ๆธˆ":-543,"็‰ฉ":-735,"็އ":672,"็ƒ":-1267,"็”Ÿ":-1286,"็”ฃ":-1101,"็”ฐ":-2900,"็”บ":1826,"็š„":2586,"็›ฎ":922,"็œ":-3485,"็œŒ":2997,"็ฉบ":-867,"็ซ‹":-2112,"็ฌฌ":788,"็ฑณ":2937,"็ณป":786,"็ด„":2171,"็ตŒ":1146,"็ตฑ":-1169,"็ท":940,"็ทš":-994,"็ฝฒ":749,"่€…":2145,"่ƒฝ":-730,"่ˆฌ":-852,"่กŒ":-792,"่ฆ":792,"่ญฆ":-1184,"่ญฐ":-244,"่ฐท":-1000,"่ณž":730,"่ปŠ":-1481,"่ป":1158,"่ผช":-1433,"่พผ":-3370,"่ฟ‘":929,"้“":-1291,"้ธ":2596,"้ƒŽ":-4866,"้ƒฝ":1192,"้‡Ž":-1100,"้Š€":-2213,"้•ท":357,"้–“":-2344,"้™ข":-2297,"้š›":-2604,"้›ป":-878,"้ ˜":-1659,"้กŒ":-792,"้คจ":-1984,"้ฆ–":1749,"้ซ˜":2120,"๏ฝข":1895,"๏ฝฃ":3798,"๏ฝฅ":-4371,"๏ฝฏ":-724,"๏ฝฐ":-11870,"๏ฝถ":2145,"๏ฝบ":1789,"๏ฝพ":1287,"๏พ„":-403,"๏พ’":-1635,"๏พ—":-881,"๏พ˜":-541,"๏พ™":-856,"๏พ":-3637}; + this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"ใ€":465,"ใ€‚":-299,"ใ€Œ":363,"ใ‚":1655,"ใ„":331,"ใ†":-503,"ใˆ":1199,"ใŠ":527,"ใ‹":647,"ใŒ":-421,"ใ":1624,"ใŽ":1971,"ใ":312,"ใ’":-983,"ใ•":-1537,"ใ—":-1371,"ใ™":-852,"ใ ":-1186,"ใก":1093,"ใฃ":52,"ใค":921,"ใฆ":-18,"ใง":-850,"ใจ":-127,"ใฉ":1682,"ใช":-787,"ใซ":-1224,"ใฎ":-635,"ใฏ":-578,"ใน":1001,"ใฟ":502,"ใ‚":865,"ใ‚ƒ":3350,"ใ‚‡":854,"ใ‚Š":-208,"ใ‚‹":429,"ใ‚Œ":504,"ใ‚":419,"ใ‚’":-1264,"ใ‚“":327,"ใ‚ค":241,"ใƒซ":451,"ใƒณ":-343,"ไธญ":-871,"ไบฌ":722,"ไผš":-1153,"ๅ…š":-654,"ๅ‹™":3519,"ๅŒบ":-901,"ๅ‘Š":848,"ๅ“ก":2104,"ๅคง":-1296,"ๅญฆ":-548,"ๅฎš":1785,"ๅต":-1304,"ๅธ‚":-2991,"ๅธญ":921,"ๅนด":1763,"ๆ€":872,"ๆ‰€":-814,"ๆŒ™":1618,"ๆ–ฐ":-1682,"ๆ—ฅ":218,"ๆœˆ":-4353,"ๆŸป":932,"ๆ ผ":1356,"ๆฉŸ":-1508,"ๆฐ":-1347,"็”ฐ":240,"็”บ":-3912,"็š„":-3149,"็›ธ":1319,"็œ":-1052,"็œŒ":-4003,"็ ”":-997,"็คพ":-278,"็ฉบ":-813,"็ตฑ":1955,"่€…":-2233,"่กจ":663,"่ชž":-1073,"่ญฐ":1219,"้ธ":-1018,"้ƒŽ":-368,"้•ท":786,"้–“":1191,"้กŒ":2368,"้คจ":-689,"๏ผ‘":-514,"๏ผฅ๏ผ’":-32768,"๏ฝข":363,"๏ฝฒ":241,"๏พ™":451,"๏พ":-343}; + this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"ใ€":227,"ใ€‚":808,"ใ‚":-307,"ใ†":189,"ใ‹":241,"ใŒ":-73,"ใ":-121,"ใ“":-200,"ใ˜":1782,"ใ™":383,"ใŸ":-428,"ใฃ":573,"ใฆ":-1014,"ใง":101,"ใจ":-105,"ใช":-253,"ใซ":-149,"ใฎ":-417,"ใฏ":-236,"ใ‚‚":-206,"ใ‚Š":187,"ใ‚‹":-135,"ใ‚’":195,"ใƒซ":-673,"ใƒณ":-496,"ไธ€":-277,"ไธญ":201,"ไปถ":-800,"ไผš":624,"ๅ‰":302,"ๅŒบ":1792,"ๅ“ก":-1212,"ๅง”":798,"ๅญฆ":-960,"ๅธ‚":887,"ๅบƒ":-695,"ๅพŒ":535,"ๆฅญ":-697,"็›ธ":753,"็คพ":-507,"็ฆ":974,"็ฉบ":-822,"่€…":1811,"้€ฃ":463,"้ƒŽ":1082,"๏ผ‘":-270,"๏ผฅ๏ผ‘":306,"๏พ™":-673,"๏พ":-496}; + + return this; + } + TinySegmenter.prototype.ctype_ = function(str) { + for (var i in this.chartype_) { + if (str.match(this.chartype_[i][0])) { + return this.chartype_[i][1]; + } + } + return "O"; + } + + TinySegmenter.prototype.ts_ = function(v) { + if (v) { return v; } + return 0; + } + + TinySegmenter.prototype.segment = function(input) { + if (input == null || input == undefined || input == "") { + return []; + } + var result = []; + var seg = ["B3","B2","B1"]; + var ctype = ["O","O","O"]; + var o = input.split(""); + for (i = 0; i < o.length; ++i) { + seg.push(o[i]); + ctype.push(this.ctype_(o[i])) + } + seg.push("E1"); + seg.push("E2"); + seg.push("E3"); + ctype.push("O"); + ctype.push("O"); + ctype.push("O"); + var word = seg[3]; + var p1 = "U"; + var p2 = "U"; + var p3 = "U"; + for (var i = 4; i < seg.length - 3; ++i) { + var score = this.BIAS__; + var w1 = seg[i-3]; + var w2 = seg[i-2]; + var w3 = seg[i-1]; + var w4 = seg[i]; + var w5 = seg[i+1]; + var w6 = seg[i+2]; + var c1 = ctype[i-3]; + var c2 = ctype[i-2]; + var c3 = ctype[i-1]; + var c4 = ctype[i]; + var c5 = ctype[i+1]; + var c6 = ctype[i+2]; + score += this.ts_(this.UP1__[p1]); + score += this.ts_(this.UP2__[p2]); + score += this.ts_(this.UP3__[p3]); + score += this.ts_(this.BP1__[p1 + p2]); + score += this.ts_(this.BP2__[p2 + p3]); + score += this.ts_(this.UW1__[w1]); + score += this.ts_(this.UW2__[w2]); + score += this.ts_(this.UW3__[w3]); + score += this.ts_(this.UW4__[w4]); + score += this.ts_(this.UW5__[w5]); + score += this.ts_(this.UW6__[w6]); + score += this.ts_(this.BW1__[w2 + w3]); + score += this.ts_(this.BW2__[w3 + w4]); + score += this.ts_(this.BW3__[w4 + w5]); + score += this.ts_(this.TW1__[w1 + w2 + w3]); + score += this.ts_(this.TW2__[w2 + w3 + w4]); + score += this.ts_(this.TW3__[w3 + w4 + w5]); + score += this.ts_(this.TW4__[w4 + w5 + w6]); + score += this.ts_(this.UC1__[c1]); + score += this.ts_(this.UC2__[c2]); + score += this.ts_(this.UC3__[c3]); + score += this.ts_(this.UC4__[c4]); + score += this.ts_(this.UC5__[c5]); + score += this.ts_(this.UC6__[c6]); + score += this.ts_(this.BC1__[c2 + c3]); + score += this.ts_(this.BC2__[c3 + c4]); + score += this.ts_(this.BC3__[c4 + c5]); + score += this.ts_(this.TC1__[c1 + c2 + c3]); + score += this.ts_(this.TC2__[c2 + c3 + c4]); + score += this.ts_(this.TC3__[c3 + c4 + c5]); + score += this.ts_(this.TC4__[c4 + c5 + c6]); + // score += this.ts_(this.TC5__[c4 + c5 + c6]); + score += this.ts_(this.UQ1__[p1 + c1]); + score += this.ts_(this.UQ2__[p2 + c2]); + score += this.ts_(this.UQ3__[p3 + c3]); + score += this.ts_(this.BQ1__[p2 + c2 + c3]); + score += this.ts_(this.BQ2__[p2 + c3 + c4]); + score += this.ts_(this.BQ3__[p3 + c2 + c3]); + score += this.ts_(this.BQ4__[p3 + c3 + c4]); + score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]); + score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]); + score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]); + score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]); + var p = "O"; + if (score > 0) { + result.push(word); + word = ""; + p = "B"; + } + p1 = p2; + p2 = p3; + p3 = p; + word += seg[i]; + } + result.push(word); + + return result; + } + + lunr.TinySegmenter = TinySegmenter; + }; + +})); \ No newline at end of file diff --git a/assets/javascripts/lunr/wordcut.js b/assets/javascripts/lunr/wordcut.js new file mode 100644 index 0000000..146f4b4 --- /dev/null +++ b/assets/javascripts/lunr/wordcut.js @@ -0,0 +1,6708 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.lunr || (g.lunr = {})).wordcut = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1; + }) + this.addWords(words, false) + } + if(finalize){ + this.finalizeDict(); + } + }, + + dictSeek: function (l, r, ch, strOffset, pos) { + var ans = null; + while (l <= r) { + var m = Math.floor((l + r) / 2), + dict_item = this.dict[m], + len = dict_item.length; + if (len <= strOffset) { + l = m + 1; + } else { + var ch_ = dict_item[strOffset]; + if (ch_ < ch) { + l = m + 1; + } else if (ch_ > ch) { + r = m - 1; + } else { + ans = m; + if (pos == LEFT) { + r = m - 1; + } else { + l = m + 1; + } + } + } + } + return ans; + }, + + isFinal: function (acceptor) { + return this.dict[acceptor.l].length == acceptor.strOffset; + }, + + createAcceptor: function () { + return { + l: 0, + r: this.dict.length - 1, + strOffset: 0, + isFinal: false, + dict: this, + transit: function (ch) { + return this.dict.transit(this, ch); + }, + isError: false, + tag: "DICT", + w: 1, + type: "DICT" + }; + }, + + transit: function (acceptor, ch) { + var l = this.dictSeek(acceptor.l, + acceptor.r, + ch, + acceptor.strOffset, + LEFT); + if (l !== null) { + var r = this.dictSeek(l, + acceptor.r, + ch, + acceptor.strOffset, + RIGHT); + acceptor.l = l; + acceptor.r = r; + acceptor.strOffset++; + acceptor.isFinal = this.isFinal(acceptor); + } else { + acceptor.isError = true; + } + return acceptor; + }, + + sortuniq: function(a){ + return a.sort().filter(function(item, pos, arr){ + return !pos || item != arr[pos - 1]; + }) + }, + + flatten: function(a){ + //[[1,2],[3]] -> [1,2,3] + return [].concat.apply([], a); + } +}; +module.exports = WordcutDict; + +}).call(this,"/dist/tmp") +},{"glob":16,"path":22}],3:[function(require,module,exports){ +var WordRule = { + createAcceptor: function(tag) { + if (tag["WORD_RULE"]) + return null; + + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + var lch = ch.toLowerCase(); + if (lch >= "a" && lch <= "z") { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "WORD_RULE", + type: "WORD_RULE", + w: 1}; + } +}; + +var NumberRule = { + createAcceptor: function(tag) { + if (tag["NUMBER_RULE"]) + return null; + + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (ch >= "0" && ch <= "9") { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "NUMBER_RULE", + type: "NUMBER_RULE", + w: 1}; + } +}; + +var SpaceRule = { + tag: "SPACE_RULE", + createAcceptor: function(tag) { + + if (tag["SPACE_RULE"]) + return null; + + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (ch == " " || ch == "\t" || ch == "\r" || ch == "\n" || + ch == "\u00A0" || ch=="\u2003"//nbsp and emsp + ) { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: SpaceRule.tag, + w: 1, + type: "SPACE_RULE"}; + } +} + +var SingleSymbolRule = { + tag: "SINSYM", + createAcceptor: function(tag) { + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (this.strOffset == 0 && ch.match(/^[\@\(\)\/\,\-\."`]$/)) { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "SINSYM", + w: 1, + type: "SINSYM"}; + } +} + + +var LatinRules = [WordRule, SpaceRule, SingleSymbolRule, NumberRule]; + +module.exports = LatinRules; + +},{}],4:[function(require,module,exports){ +var _ = require("underscore") + , WordcutCore = require("./wordcut_core"); +var PathInfoBuilder = { + + /* + buildByPartAcceptors: function(path, acceptors, i) { + var + var genInfos = partAcceptors.reduce(function(genInfos, acceptor) { + + }, []); + + return genInfos; + } + */ + + buildByAcceptors: function(path, finalAcceptors, i) { + var self = this; + var infos = finalAcceptors.map(function(acceptor) { + var p = i - acceptor.strOffset + 1 + , _info = path[p]; + + var info = {p: p, + mw: _info.mw + (acceptor.mw === undefined ? 0 : acceptor.mw), + w: acceptor.w + _info.w, + unk: (acceptor.unk ? acceptor.unk : 0) + _info.unk, + type: acceptor.type}; + + if (acceptor.type == "PART") { + for(var j = p + 1; j <= i; j++) { + path[j].merge = p; + } + info.merge = p; + } + + return info; + }); + return infos.filter(function(info) { return info; }); + }, + + fallback: function(path, leftBoundary, text, i) { + var _info = path[leftBoundary]; + if (text[i].match(/[\u0E48-\u0E4E]/)) { + if (leftBoundary != 0) + leftBoundary = path[leftBoundary].p; + return {p: leftBoundary, + mw: 0, + w: 1 + _info.w, + unk: 1 + _info.unk, + type: "UNK"}; +/* } else if(leftBoundary > 0 && path[leftBoundary].type !== "UNK") { + leftBoundary = path[leftBoundary].p; + return {p: leftBoundary, + w: 1 + _info.w, + unk: 1 + _info.unk, + type: "UNK"}; */ + } else { + return {p: leftBoundary, + mw: _info.mw, + w: 1 + _info.w, + unk: 1 + _info.unk, + type: "UNK"}; + } + }, + + build: function(path, finalAcceptors, i, leftBoundary, text) { + var basicPathInfos = this.buildByAcceptors(path, finalAcceptors, i); + if (basicPathInfos.length > 0) { + return basicPathInfos; + } else { + return [this.fallback(path, leftBoundary, text, i)]; + } + } +}; + +module.exports = function() { + return _.clone(PathInfoBuilder); +} + +},{"./wordcut_core":8,"underscore":25}],5:[function(require,module,exports){ +var _ = require("underscore"); + + +var PathSelector = { + selectPath: function(paths) { + var path = paths.reduce(function(selectedPath, path) { + if (selectedPath == null) { + return path; + } else { + if (path.unk < selectedPath.unk) + return path; + if (path.unk == selectedPath.unk) { + if (path.mw < selectedPath.mw) + return path + if (path.mw == selectedPath.mw) { + if (path.w < selectedPath.w) + return path; + } + } + return selectedPath; + } + }, null); + return path; + }, + + createPath: function() { + return [{p:null, w:0, unk:0, type: "INIT", mw:0}]; + } +}; + +module.exports = function() { + return _.clone(PathSelector); +}; + +},{"underscore":25}],6:[function(require,module,exports){ +function isMatch(pat, offset, ch) { + if (pat.length <= offset) + return false; + var _ch = pat[offset]; + return _ch == ch || + (_ch.match(/[เธเธ‚]/) && ch.match(/[เธ-เธฎ]/)) || + (_ch.match(/[เธกเธš]/) && ch.match(/[เธ-เธฎ]/)) || + (_ch.match(/\u0E49/) && ch.match(/[\u0E48-\u0E4B]/)); +} + +var Rule0 = { + pat: "เน€เธซเธเน‡เธก", + createAcceptor: function(tag) { + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (isMatch(Rule0.pat, this.strOffset,ch)) { + this.isFinal = (this.strOffset + 1 == Rule0.pat.length); + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "THAI_RULE", + type: "THAI_RULE", + w: 1}; + } +}; + +var PartRule = { + createAcceptor: function(tag) { + return {strOffset: 0, + patterns: [ + "เนเธ", "เน€เธ", "เธเน‰", "เธเธเนŒ", "เธเธฒ", "เธเธต", "เธเธด", "เธเธทเธ" + ], + isFinal: false, + transit: function(ch) { + var offset = this.strOffset; + this.patterns = this.patterns.filter(function(pat) { + return isMatch(pat, offset, ch); + }); + + if (this.patterns.length > 0) { + var len = 1 + offset; + this.isFinal = this.patterns.some(function(pat) { + return pat.length == len; + }); + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "PART", + type: "PART", + unk: 1, + w: 1}; + } +}; + +var ThaiRules = [Rule0, PartRule]; + +module.exports = ThaiRules; + +},{}],7:[function(require,module,exports){ +var sys = require("sys") + , WordcutDict = require("./dict") + , WordcutCore = require("./wordcut_core") + , PathInfoBuilder = require("./path_info_builder") + , PathSelector = require("./path_selector") + , Acceptors = require("./acceptors") + , latinRules = require("./latin_rules") + , thaiRules = require("./thai_rules") + , _ = require("underscore"); + + +var Wordcut = Object.create(WordcutCore); +Wordcut.defaultPathInfoBuilder = PathInfoBuilder; +Wordcut.defaultPathSelector = PathSelector; +Wordcut.defaultAcceptors = Acceptors; +Wordcut.defaultLatinRules = latinRules; +Wordcut.defaultThaiRules = thaiRules; +Wordcut.defaultDict = WordcutDict; + + +Wordcut.initNoDict = function(dict_path) { + var self = this; + self.pathInfoBuilder = new self.defaultPathInfoBuilder; + self.pathSelector = new self.defaultPathSelector; + self.acceptors = new self.defaultAcceptors; + self.defaultLatinRules.forEach(function(rule) { + self.acceptors.creators.push(rule); + }); + self.defaultThaiRules.forEach(function(rule) { + self.acceptors.creators.push(rule); + }); +}; + +Wordcut.init = function(dict_path, withDefault, additionalWords) { + withDefault = withDefault || false; + this.initNoDict(); + var dict = _.clone(this.defaultDict); + dict.init(dict_path, withDefault, additionalWords); + this.acceptors.creators.push(dict); +}; + +module.exports = Wordcut; + +},{"./acceptors":1,"./dict":2,"./latin_rules":3,"./path_info_builder":4,"./path_selector":5,"./thai_rules":6,"./wordcut_core":8,"sys":28,"underscore":25}],8:[function(require,module,exports){ +var WordcutCore = { + + buildPath: function(text) { + var self = this + , path = self.pathSelector.createPath() + , leftBoundary = 0; + self.acceptors.reset(); + for (var i = 0; i < text.length; i++) { + var ch = text[i]; + self.acceptors.transit(ch); + + var possiblePathInfos = self + .pathInfoBuilder + .build(path, + self.acceptors.getFinalAcceptors(), + i, + leftBoundary, + text); + var selectedPath = self.pathSelector.selectPath(possiblePathInfos) + + path.push(selectedPath); + if (selectedPath.type !== "UNK") { + leftBoundary = i; + } + } + return path; + }, + + pathToRanges: function(path) { + var e = path.length - 1 + , ranges = []; + + while (e > 0) { + var info = path[e] + , s = info.p; + + if (info.merge !== undefined && ranges.length > 0) { + var r = ranges[ranges.length - 1]; + r.s = info.merge; + s = r.s; + } else { + ranges.push({s:s, e:e}); + } + e = s; + } + return ranges.reverse(); + }, + + rangesToText: function(text, ranges, delimiter) { + return ranges.map(function(r) { + return text.substring(r.s, r.e); + }).join(delimiter); + }, + + cut: function(text, delimiter) { + var path = this.buildPath(text) + , ranges = this.pathToRanges(path); + return this + .rangesToText(text, ranges, + (delimiter === undefined ? "|" : delimiter)); + }, + + cutIntoRanges: function(text, noText) { + var path = this.buildPath(text) + , ranges = this.pathToRanges(path); + + if (!noText) { + ranges.forEach(function(r) { + r.text = text.substring(r.s, r.e); + }); + } + return ranges; + }, + + cutIntoArray: function(text) { + var path = this.buildPath(text) + , ranges = this.pathToRanges(path); + + return ranges.map(function(r) { + return text.substring(r.s, r.e) + }); + } +}; + +module.exports = WordcutCore; + +},{}],9:[function(require,module,exports){ +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// 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 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 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. + +// when used in node, this will actually load the util module we depend on +// versus loading the builtin util module as happens otherwise +// this is a bug in node module loading as far as I am concerned +var util = require('util/'); + +var pSlice = Array.prototype.slice; +var hasOwn = Object.prototype.hasOwnProperty; + +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + +var assert = module.exports = ok; + +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } + else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; + + // try to strip useless frames + var fn_name = stackStartFunction.name; + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; + +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); + +function replacer(key, value) { + if (util.isUndefined(value)) { + return '' + value; + } + if (util.isNumber(value) && !isFinite(value)) { + return value.toString(); + } + if (util.isFunction(value) || util.isRegExp(value)) { + return value.toString(); + } + return value; +} + +function truncate(s, n) { + if (util.isString(s)) { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} + +function getMessage(self) { + return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + + self.operator + ' ' + + truncate(JSON.stringify(self.expected, replacer), 128); +} + +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. + +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. + +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} + +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; + +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; + +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; + +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; + +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +function _deepEqual(actual, expected) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (util.isBuffer(actual) && util.isBuffer(expected)) { + if (actual.length != expected.length) return false; + + for (var i = 0; i < actual.length; i++) { + if (actual[i] !== expected[i]) return false; + } + + return true; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!util.isObject(actual) && !util.isObject(expected)) { + return actual == expected; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b) { + if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) { + return a === b; + } + var aIsArgs = isArguments(a), + bIsArgs = isArguments(b); + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) + return false; + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b); + } + var ka = objectKeys(a), + kb = objectKeys(b), + key, i; + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key])) return false; + } + return true; +} + +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; + +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } else if (actual instanceof expected) { + return true; + } else if (expected.call({}, actual) === true) { + return true; + } + + return false; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (util.isString(expected)) { + message = expected; + expected = null; + } + + try { + block(); + } catch (e) { + actual = e; + } + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + if (!shouldThrow && expectedException(actual, expected)) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } +} + +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws.apply(this, [true].concat(pSlice.call(arguments))); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/message) { + _throws.apply(this, [false].concat(pSlice.call(arguments))); +}; + +assert.ifError = function(err) { if (err) {throw err;}}; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + return keys; +}; + +},{"util/":28}],10:[function(require,module,exports){ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} + +},{}],11:[function(require,module,exports){ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + + +},{"balanced-match":10,"concat-map":13}],12:[function(require,module,exports){ + +},{}],13:[function(require,module,exports){ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +},{}],14:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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 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. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } + throw TypeError('Uncaught, unspecified "error" event.'); + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + handler.apply(this, args); + } + } else if (isObject(handler)) { + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + var m; + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.listenerCount = function(emitter, type) { + var ret; + if (!emitter._events || !emitter._events[type]) + ret = 0; + else if (isFunction(emitter._events[type])) + ret = 1; + else + ret = emitter._events[type].length; + return ret; +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + +},{}],15:[function(require,module,exports){ +(function (process){ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern) + } + + return { + matcher: new Minimatch(pattern), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation unless the user explicitly + // passes in false as the option. + options.nonegate = options.nonegate === false ? false : true + options.nocomment = options.nocomment === false ? false : true + deprecationWarning(options) + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +// TODO(isaacs): remove entirely in v6 +// exported to reset in tests +exports.deprecationWarned +function deprecationWarning(options) { + if (!options.nonegate || !options.nocomment) { + if (process.noDeprecation !== true && !exports.deprecationWarned) { + var msg = 'glob WARNING: comments and negation will be disabled in v6' + if (process.throwDeprecation) + throw new Error(msg) + else if (process.traceDeprecation) + console.trace(msg) + else + console.error(msg) + + exports.deprecationWarned = true + } + } +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +}).call(this,require('_process')) +},{"_process":24,"minimatch":20,"path":22,"path-is-absolute":23}],16:[function(require,module,exports){ +(function (process){ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +glob.hasMagic = function (pattern, options_) { + var options = util._extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} + +}).call(this,require('_process')) +},{"./common.js":15,"./sync.js":17,"_process":24,"assert":9,"events":14,"fs":12,"inflight":18,"inherits":19,"minimatch":20,"once":21,"path":22,"path-is-absolute":23,"util":28}],17:[function(require,module,exports){ +(function (process){ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +}).call(this,require('_process')) +},{"./common.js":15,"./glob.js":16,"_process":24,"assert":9,"fs":12,"minimatch":20,"path":22,"path-is-absolute":23,"util":28}],18:[function(require,module,exports){ +(function (process){ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} + +}).call(this,require('_process')) +},{"_process":24,"once":21,"wrappy":29}],19:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],20:[function(require,module,exports){ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} + +},{"brace-expansion":11,"path":22}],21:[function(require,module,exports){ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} + +},{"wrappy":29}],22:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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 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. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +}).call(this,require('_process')) +},{"_process":24}],23:[function(require,module,exports){ +(function (process){ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; + +}).call(this,require('_process')) +},{"_process":24}],24:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],25:[function(require,module,exports){ +// Underscore.js 1.8.3 +// http://underscorejs.org +// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `exports` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var + push = ArrayProto.push, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind, + nativeCreate = Object.create; + + // Naked function reference for surrogate-prototype-swapping. + var Ctor = function(){}; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.8.3'; + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var optimizeCb = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + }; + + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result โ€” either + // identity, an arbitrary callback, a property matcher, or a property accessor. + var cb = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return optimizeCb(value, context, argCount); + if (_.isObject(value)) return _.matcher(value); + return _.property(value); + }; + _.iteratee = function(value, context) { + return cb(value, context, Infinity); + }; + + // An internal function for creating assigner functions. + var createAssigner = function(keysFunc, undefinedOnly) { + return function(obj) { + var length = arguments.length; + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; + } + } + return obj; + }; + }; + + // An internal function for creating a new object that inherits from another. + var baseCreate = function(prototype) { + if (!_.isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; + }; + + var property = function(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; + }; + + // Helper for collection methods to determine whether a collection + // should be iterated as an array or as an object + // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 + var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + var getLength = property('length'); + var isArrayLike = function(collection) { + var length = getLength(collection); + return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; + }; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var keys = _.keys(obj); + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); + } + } + return obj; + }; + + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + }; + + // Create a reducing function iterating left or right. + function createReduce(dir) { + // Optimized iterator function as using arguments.length + // in the main function will deoptimize the, see #1991. + function iterator(obj, iteratee, memo, keys, index, length) { + for (; index >= 0 && index < length; index += dir) { + var currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + } + + return function(obj, iteratee, memo, context) { + iteratee = optimizeCb(iteratee, context, 4); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length, + index = dir > 0 ? 0 : length - 1; + // Determine the initial value if none is provided. + if (arguments.length < 3) { + memo = obj[keys ? keys[index] : index]; + index += dir; + } + return iterator(obj, iteratee, memo, keys, index, length); + }; + } + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + _.reduce = _.foldl = _.inject = createReduce(1); + + // The right-associative version of reduce, also known as `foldr`. + _.reduceRight = _.foldr = createReduce(-1); + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, predicate, context) { + var key; + if (isArrayLike(obj)) { + key = _.findIndex(obj, predicate, context); + } else { + key = _.findKey(obj, predicate, context); + } + if (key !== void 0 && key !== -1) return obj[key]; + }; + + // Return all the elements that pass a truth test. + // Aliased as `select`. + _.filter = _.select = function(obj, predicate, context) { + var results = []; + predicate = cb(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, _.negate(cb(predicate)), context); + }; + + // Determine whether all of the elements match a truth test. + // Aliased as `all`. + _.every = _.all = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; + }; + + // Determine if at least one element in the object matches a truth test. + // Aliased as `any`. + _.some = _.any = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; + }; + + // Determine if the array or object contains a given item (using `===`). + // Aliased as `includes` and `include`. + _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = _.values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return _.indexOf(obj, item, fromIndex) >= 0; + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + var func = isFunc ? method : value[method]; + return func == null ? func : func.apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs) { + return _.filter(obj, _.matcher(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matcher(attrs)); + }; + + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = isArrayLike(obj) ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = isArrayLike(obj) ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Shuffle a collection, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisherโ€“Yates_shuffle). + _.shuffle = function(obj) { + var set = isArrayLike(obj) ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } + return shuffled; + }; + + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; + + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value: value, + index: index, + criteria: iteratee(value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iteratee, context) { + var result = {}; + iteratee = cb(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, value, key) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; + }); + + // Safely create a real, live array from anything iterable. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (isArrayLike(obj)) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : _.keys(obj).length; + }; + + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = cb(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[0]; + return _.initial(array, array.length - n); + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. + _.initial = function(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[array.length - 1]; + return _.rest(array, Math.max(0, array.length - n)); + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, strict, startIndex) { + var output = [], idx = 0; + for (var i = startIndex || 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { + //flatten current level of array or arguments object + if (!shallow) value = flatten(value, shallow, strict); + var j = 0, len = value.length; + output.length += len; + while (j < len) { + output[idx++] = value[j++]; + } + } else if (!strict) { + output[idx++] = value; + } + } + return output; + }; + + // Flatten out an array, either recursively (by default), or just one level. + _.flatten = function(array, shallow) { + return flatten(array, shallow, false); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!_.contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!_.contains(result, value)) { + result.push(value); + } + } + return result; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(flatten(arguments, true, true)); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = flatten(arguments, true, true, 1); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + return _.unzip(arguments); + }; + + // Complement of _.zip. Unzip accepts an array of arrays and groups + // each array's elements on shared indices + _.unzip = function(array) { + var length = array && _.max(array, getLength).length || 0; + var result = Array(length); + + for (var index = 0; index < length; index++) { + result[index] = _.pluck(array, index); + } + return result; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // Generator function to create the findIndex and findLastIndex functions + function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; + } + + // Returns the first index on an array-like that passes a predicate test + _.findIndex = createPredicateIndexFinder(1); + _.findLastIndex = createPredicateIndexFinder(-1); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; + }; + + // Generator function to create the indexOf and lastIndexOf functions + function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), _.isNaN); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; + } + + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex); + _.lastIndexOf = createIndexFinder(-1, _.findLastIndex); + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; + } + step = step || 1; + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Determines whether to execute a function as a constructor + // or a normal function with the provided arguments + var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (_.isObject(result)) return result; + return self; + }; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); + var args = slice.call(arguments, 2); + var bound = function() { + return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); + }; + return bound; + }; + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; + }; + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + _.bindAll = function(obj) { + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); + } + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = _.partial(_.delay, _, 1); + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; + var previous = 0; + if (!options) options = {}; + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + + if (last < wait && last >= 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; + }; + + // Returns a function that will only be executed on and after the Nth call. + _.after = function(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Returns a function that will only be executed up to (but not including) the Nth call. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } + if (times <= 1) func = null; + return memo; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); + + // Object Functions + // ---------------- + + // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. + var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); + var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + + function collectNonEnumProps(obj, keys) { + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; + + // Constructor is a special case. + var prop = 'constructor'; + if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); + + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { + keys.push(prop); + } + } + } + + // Retrieve the names of an object's own properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + }; + + // Retrieve all the property names of an object. + _.allKeys = function(obj) { + if (!_.isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } + return values; + }; + + // Returns the results of applying the iteratee to each element of the object + // In contrast to _.map it returns an object + _.mapObject = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var keys = _.keys(obj), + length = keys.length, + results = {}, + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = createAssigner(_.allKeys); + + // Assigns a given object with all the own properties in the passed-in object(s) + // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + _.extendOwn = _.assign = createAssigner(_.keys); + + // Returns the first key on an object that passes a predicate test + _.findKey = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = _.keys(obj), key; + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (predicate(obj[key], key, obj)) return key; + } + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(object, oiteratee, context) { + var result = {}, obj = object, iteratee, keys; + if (obj == null) return result; + if (_.isFunction(oiteratee)) { + keys = _.allKeys(obj); + iteratee = optimizeCb(oiteratee, context); + } else { + keys = flatten(arguments, false, false, 1); + iteratee = function(value, key, obj) { return key in obj; }; + obj = Object(obj); + } + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + return result; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(flatten(arguments, false, false, 1), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; + } + return _.pick(obj, iteratee, context); + }; + + // Fill in a given object with default properties. + _.defaults = createAssigner(_.allKeys, true); + + // Creates an object that inherits from the given prototype object. + // If additional properties are provided then they will be added to the + // created object. + _.create = function(prototype, props) { + var result = baseCreate(prototype); + if (props) _.extendOwn(result, props); + return result; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Returns whether an object has a given set of `key:value` pairs. + _.isMatch = function(object, attrs) { + var keys = _.keys(attrs), length = keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; + } + return true; + }; + + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; + } + + var areArrays = className === '[object Array]'; + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; + + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var keys = _.keys(a), key; + length = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (_.keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = keys[length]; + if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; + return _.keys(obj).length === 0; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) === '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) === '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE < 9), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return _.has(obj, 'callee'); + }; + } + + // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, + // IE 11 (#1621), and in Safari 8 (#1929). + if (typeof /./ != 'function' && typeof Int8Array != 'object') { + _.isFunction = function(obj) { + return typeof obj == 'function' || false; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj !== +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iteratees. + _.identity = function(value) { + return value; + }; + + // Predicate-generating functions. Often useful outside of Underscore. + _.constant = function(value) { + return function() { + return value; + }; + }; + + _.noop = function(){}; + + _.property = property; + + // Generates a function for a given object that returns a given property. + _.propertyOf = function(obj) { + return obj == null ? function(){} : function(key) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of + // `key:value` pairs. + _.matcher = _.matches = function(attrs) { + attrs = _.extendOwn({}, attrs); + return function(obj) { + return _.isMatch(obj, attrs); + }; + }; + + // Run a function **n** times. + _.times = function(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { + return new Date().getTime(); + }; + + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + var unescapeMap = _.invert(escapeMap); + + // Functions for escaping and unescaping strings to/from HTML interpolation. + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); + + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property, fallback) { + var value = object == null ? void 0 : object[property]; + if (value === void 0) { + value = fallback; + } + return _.isFunction(value) ? value.call(object) : value; + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offest. + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + try { + var render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function. Start chaining a wrapped Underscore object. + _.chain = function(obj) { + var instance = _(obj); + instance._chain = true; + return instance; + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(instance, obj) { + return instance._chain ? _(obj).chain() : obj; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result(this, func.apply(_, args)); + }; + }); + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; + return result(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + _.each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result(this, method.apply(this._wrapped, arguments)); + }; + }); + + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; + + // Provide unwrapping proxy for some methods used in engine operations + // such as arithmetic and JSON stringification. + _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; + + _.prototype.toString = function() { + return '' + this._wrapped; + }; + + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}.call(this)); + +},{}],26:[function(require,module,exports){ +arguments[4][19][0].apply(exports,arguments) +},{"dup":19}],27:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],28:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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 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. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":27,"_process":24,"inherits":26}],29:[function(require,module,exports){ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} + +},{}]},{},[7])(7) +}); \ No newline at end of file diff --git a/assets/javascripts/workers/search.16e2a7d4.min.js b/assets/javascripts/workers/search.16e2a7d4.min.js new file mode 100644 index 0000000..e0dc159 --- /dev/null +++ b/assets/javascripts/workers/search.16e2a7d4.min.js @@ -0,0 +1,48 @@ +"use strict";(()=>{var ge=Object.create;var W=Object.defineProperty,ye=Object.defineProperties,me=Object.getOwnPropertyDescriptor,ve=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertyNames,G=Object.getOwnPropertySymbols,Se=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable;var J=(t,e,r)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e||(e={}))X.call(e,r)&&J(t,r,e[r]);if(G)for(var r of G(e))Qe.call(e,r)&&J(t,r,e[r]);return t},Z=(t,e)=>ye(t,ve(e));var K=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var be=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xe(e))!X.call(t,i)&&i!==r&&W(t,i,{get:()=>e[i],enumerable:!(n=me(e,i))||n.enumerable});return t};var H=(t,e,r)=>(r=t!=null?ge(Se(t)):{},be(e||!t||!t.__esModule?W(r,"default",{value:t,enumerable:!0}):r,t));var z=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())});var re=K((ee,te)=>{/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + */(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";/*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + */t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var h=t.utils.clone(r)||{};h.position=[a,c],h.index=s.length,s.push(new t.Token(n.slice(a,o),h))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;/*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + */t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ou?h+=2:a==u&&(r+=n[c+1]*i[h+1],c+=2,h+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}if(s.str.length==0&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}s.str.length==1&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var h=s.str.charAt(0),y=s.str.charAt(1),g;y in s.node.edges?g=s.node.edges[y]:(g=new t.TokenSet,s.node.edges[y]=g),s.str.length==1&&(g.final=!0),i.push({node:g,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};/*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + */t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof ee=="object"?te.exports=r():e.lunr=r()}(this,function(){return t})})()});var q=K((Re,ne)=>{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var Le=/["'&<>]/;ne.exports=we;function we(t){var e=""+t,r=Le.exec(e);if(!r)return e;var n,i="",s=0,o=0;for(s=r.index;s=0;r--){let n=t[r];typeof n=="string"?n=document.createTextNode(n):n.parentNode&&n.parentNode.removeChild(n),r?e.insertBefore(this.previousSibling,n):e.replaceChild(n,this)}}}));var ie=H(q());function se(t){let e=new Map,r=new Set;for(let n of t){let[i,s]=n.location.split("#"),o=n.location,a=n.title,u=n.tags,c=(0,ie.default)(n.text).replace(/\s+(?=[,.:;!?])/g,"").replace(/\s+/g," ");if(s){let h=e.get(i);r.has(h)?e.set(o,{location:o,title:a,text:c,parent:h}):(h.title=n.title,h.text=c,r.add(h))}else e.set(o,M({location:o,title:a,text:c},u&&{tags:u}))}return e}var oe=H(q());function ae(t,e){let r=new RegExp(t.separator,"img"),n=(i,s,o)=>`${s}${o}`;return i=>{i=i.replace(/[\s*+\-:~^]+/g," ").trim();let s=new RegExp(`(^|${t.separator})(${i.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return o=>(e?(0,oe.default)(o):o).replace(s,n).replace(/<\/mark>(\s+)]*>/img,"$1")}}function ue(t){let e=new lunr.Query(["title","text"]);return new lunr.QueryParser(t,e).parse(),e.clauses}function ce(t,e){var i;let r=new Set(t),n={};for(let s=0;s!n.has(i)))]}var U=class{constructor({config:e,docs:r,options:n}){this.options=n,this.documents=se(r),this.highlight=ae(e,!1),lunr.tokenizer.separator=new RegExp(e.separator),this.index=lunr(function(){e.lang.length===1&&e.lang[0]!=="en"?this.use(lunr[e.lang[0]]):e.lang.length>1&&this.use(lunr.multiLanguage(...e.lang));let i=Ee(["trimmer","stopWordFilter","stemmer"],n.pipeline);for(let s of e.lang.map(o=>o==="en"?lunr:lunr[o]))for(let o of i)this.pipeline.remove(s[o]),this.searchPipeline.remove(s[o]);this.ref("location"),this.field("title",{boost:1e3}),this.field("text"),this.field("tags",{boost:1e6,extractor:s=>{let{tags:o=[]}=s;return o.reduce((a,u)=>[...a,...lunr.tokenizer(u)],[])}});for(let s of r)this.add(s,{boost:s.boost})})}search(e){if(e)try{let r=this.highlight(e),n=ue(e).filter(o=>o.presence!==lunr.Query.presence.PROHIBITED),i=this.index.search(`${e}*`).reduce((o,{ref:a,score:u,matchData:c})=>{let h=this.documents.get(a);if(typeof h!="undefined"){let{location:y,title:g,text:b,tags:m,parent:Q}=h,p=ce(n,Object.keys(c.metadata)),d=+!Q+ +Object.values(p).every(w=>w);o.push(Z(M({location:y,title:r(g),text:r(b)},m&&{tags:m.map(r)}),{score:u*(1+d),terms:p}))}return o},[]).sort((o,a)=>a.score-o.score).reduce((o,a)=>{let u=this.documents.get(a.location);if(typeof u!="undefined"){let c="parent"in u?u.parent.location:u.location;o.set(c,[...o.get(c)||[],a])}return o},new Map),s;if(this.options.suggestions){let o=this.index.query(a=>{for(let u of n)a.term(u.term,{fields:["title"],presence:lunr.Query.presence.REQUIRED,wildcard:lunr.Query.wildcard.TRAILING})});s=o.length?Object.keys(o[0].matchData.metadata):[]}return M({items:[...i.values()]},typeof s!="undefined"&&{suggestions:s})}catch(r){console.warn(`Invalid query: ${e} \u2013 see https://bit.ly/2s3ChXG`)}return{items:[]}}};var Y;function ke(t){return z(this,null,function*(){let e="../lunr";if(typeof parent!="undefined"&&"IFrameWorker"in parent){let n=document.querySelector("script[src]"),[i]=n.src.split("/worker");e=e.replace("..",i)}let r=[];for(let n of t.lang){switch(n){case"ja":r.push(`${e}/tinyseg.js`);break;case"hi":case"th":r.push(`${e}/wordcut.js`);break}n!=="en"&&r.push(`${e}/min/lunr.${n}.min.js`)}t.lang.length>1&&r.push(`${e}/min/lunr.multi.min.js`),r.length&&(yield importScripts(`${e}/min/lunr.stemmer.support.min.js`,...r))})}function Te(t){return z(this,null,function*(){switch(t.type){case 0:return yield ke(t.data.config),Y=new U(t.data),{type:1};case 2:return{type:3,data:Y?Y.search(t.data):{items:[]}};default:throw new TypeError("Invalid message type")}})}self.lunr=le.default;addEventListener("message",t=>z(void 0,null,function*(){postMessage(yield Te(t.data))}));})(); +//# sourceMappingURL=search.16e2a7d4.min.js.map + diff --git a/assets/javascripts/workers/search.16e2a7d4.min.js.map b/assets/javascripts/workers/search.16e2a7d4.min.js.map new file mode 100644 index 0000000..fa01f37 --- /dev/null +++ b/assets/javascripts/workers/search.16e2a7d4.min.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "sources": ["node_modules/lunr/lunr.js", "node_modules/escape-html/index.js", "src/assets/javascripts/integrations/search/worker/main/index.ts", "src/assets/javascripts/polyfills/index.ts", "src/assets/javascripts/integrations/search/document/index.ts", "src/assets/javascripts/integrations/search/highlighter/index.ts", "src/assets/javascripts/integrations/search/query/_/index.ts", "src/assets/javascripts/integrations/search/_/index.ts"], + "sourceRoot": "../../../..", + "sourcesContent": ["/**\n * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9\n * Copyright (C) 2020 Oliver Nightingale\n * @license MIT\n */\n\n;(function(){\n\n/**\n * A convenience function for configuring and constructing\n * a new lunr Index.\n *\n * A lunr.Builder instance is created and the pipeline setup\n * with a trimmer, stop word filter and stemmer.\n *\n * This builder object is yielded to the configuration function\n * that is passed as a parameter, allowing the list of fields\n * and other builder parameters to be customised.\n *\n * All documents _must_ be added within the passed config function.\n *\n * @example\n * var idx = lunr(function () {\n * this.field('title')\n * this.field('body')\n * this.ref('id')\n *\n * documents.forEach(function (doc) {\n * this.add(doc)\n * }, this)\n * })\n *\n * @see {@link lunr.Builder}\n * @see {@link lunr.Pipeline}\n * @see {@link lunr.trimmer}\n * @see {@link lunr.stopWordFilter}\n * @see {@link lunr.stemmer}\n * @namespace {function} lunr\n */\nvar lunr = function (config) {\n var builder = new lunr.Builder\n\n builder.pipeline.add(\n lunr.trimmer,\n lunr.stopWordFilter,\n lunr.stemmer\n )\n\n builder.searchPipeline.add(\n lunr.stemmer\n )\n\n config.call(builder, builder)\n return builder.build()\n}\n\nlunr.version = \"2.3.9\"\n/*!\n * lunr.utils\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A namespace containing utils for the rest of the lunr library\n * @namespace lunr.utils\n */\nlunr.utils = {}\n\n/**\n * Print a warning message to the console.\n *\n * @param {String} message The message to be printed.\n * @memberOf lunr.utils\n * @function\n */\nlunr.utils.warn = (function (global) {\n /* eslint-disable no-console */\n return function (message) {\n if (global.console && console.warn) {\n console.warn(message)\n }\n }\n /* eslint-enable no-console */\n})(this)\n\n/**\n * Convert an object to a string.\n *\n * In the case of `null` and `undefined` the function returns\n * the empty string, in all other cases the result of calling\n * `toString` on the passed object is returned.\n *\n * @param {Any} obj The object to convert to a string.\n * @return {String} string representation of the passed object.\n * @memberOf lunr.utils\n */\nlunr.utils.asString = function (obj) {\n if (obj === void 0 || obj === null) {\n return \"\"\n } else {\n return obj.toString()\n }\n}\n\n/**\n * Clones an object.\n *\n * Will create a copy of an existing object such that any mutations\n * on the copy cannot affect the original.\n *\n * Only shallow objects are supported, passing a nested object to this\n * function will cause a TypeError.\n *\n * Objects with primitives, and arrays of primitives are supported.\n *\n * @param {Object} obj The object to clone.\n * @return {Object} a clone of the passed object.\n * @throws {TypeError} when a nested object is passed.\n * @memberOf Utils\n */\nlunr.utils.clone = function (obj) {\n if (obj === null || obj === undefined) {\n return obj\n }\n\n var clone = Object.create(null),\n keys = Object.keys(obj)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i],\n val = obj[key]\n\n if (Array.isArray(val)) {\n clone[key] = val.slice()\n continue\n }\n\n if (typeof val === 'string' ||\n typeof val === 'number' ||\n typeof val === 'boolean') {\n clone[key] = val\n continue\n }\n\n throw new TypeError(\"clone is not deep and does not support nested objects\")\n }\n\n return clone\n}\nlunr.FieldRef = function (docRef, fieldName, stringValue) {\n this.docRef = docRef\n this.fieldName = fieldName\n this._stringValue = stringValue\n}\n\nlunr.FieldRef.joiner = \"/\"\n\nlunr.FieldRef.fromString = function (s) {\n var n = s.indexOf(lunr.FieldRef.joiner)\n\n if (n === -1) {\n throw \"malformed field ref string\"\n }\n\n var fieldRef = s.slice(0, n),\n docRef = s.slice(n + 1)\n\n return new lunr.FieldRef (docRef, fieldRef, s)\n}\n\nlunr.FieldRef.prototype.toString = function () {\n if (this._stringValue == undefined) {\n this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef\n }\n\n return this._stringValue\n}\n/*!\n * lunr.Set\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A lunr set.\n *\n * @constructor\n */\nlunr.Set = function (elements) {\n this.elements = Object.create(null)\n\n if (elements) {\n this.length = elements.length\n\n for (var i = 0; i < this.length; i++) {\n this.elements[elements[i]] = true\n }\n } else {\n this.length = 0\n }\n}\n\n/**\n * A complete set that contains all elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.complete = {\n intersect: function (other) {\n return other\n },\n\n union: function () {\n return this\n },\n\n contains: function () {\n return true\n }\n}\n\n/**\n * An empty set that contains no elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.empty = {\n intersect: function () {\n return this\n },\n\n union: function (other) {\n return other\n },\n\n contains: function () {\n return false\n }\n}\n\n/**\n * Returns true if this set contains the specified object.\n *\n * @param {object} object - Object whose presence in this set is to be tested.\n * @returns {boolean} - True if this set contains the specified object.\n */\nlunr.Set.prototype.contains = function (object) {\n return !!this.elements[object]\n}\n\n/**\n * Returns a new set containing only the elements that are present in both\n * this set and the specified set.\n *\n * @param {lunr.Set} other - set to intersect with this set.\n * @returns {lunr.Set} a new set that is the intersection of this and the specified set.\n */\n\nlunr.Set.prototype.intersect = function (other) {\n var a, b, elements, intersection = []\n\n if (other === lunr.Set.complete) {\n return this\n }\n\n if (other === lunr.Set.empty) {\n return other\n }\n\n if (this.length < other.length) {\n a = this\n b = other\n } else {\n a = other\n b = this\n }\n\n elements = Object.keys(a.elements)\n\n for (var i = 0; i < elements.length; i++) {\n var element = elements[i]\n if (element in b.elements) {\n intersection.push(element)\n }\n }\n\n return new lunr.Set (intersection)\n}\n\n/**\n * Returns a new set combining the elements of this and the specified set.\n *\n * @param {lunr.Set} other - set to union with this set.\n * @return {lunr.Set} a new set that is the union of this and the specified set.\n */\n\nlunr.Set.prototype.union = function (other) {\n if (other === lunr.Set.complete) {\n return lunr.Set.complete\n }\n\n if (other === lunr.Set.empty) {\n return this\n }\n\n return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements)))\n}\n/**\n * A function to calculate the inverse document frequency for\n * a posting. This is shared between the builder and the index\n *\n * @private\n * @param {object} posting - The posting for a given term\n * @param {number} documentCount - The total number of documents.\n */\nlunr.idf = function (posting, documentCount) {\n var documentsWithTerm = 0\n\n for (var fieldName in posting) {\n if (fieldName == '_index') continue // Ignore the term index, its not a field\n documentsWithTerm += Object.keys(posting[fieldName]).length\n }\n\n var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5)\n\n return Math.log(1 + Math.abs(x))\n}\n\n/**\n * A token wraps a string representation of a token\n * as it is passed through the text processing pipeline.\n *\n * @constructor\n * @param {string} [str=''] - The string token being wrapped.\n * @param {object} [metadata={}] - Metadata associated with this token.\n */\nlunr.Token = function (str, metadata) {\n this.str = str || \"\"\n this.metadata = metadata || {}\n}\n\n/**\n * Returns the token string that is being wrapped by this object.\n *\n * @returns {string}\n */\nlunr.Token.prototype.toString = function () {\n return this.str\n}\n\n/**\n * A token update function is used when updating or optionally\n * when cloning a token.\n *\n * @callback lunr.Token~updateFunction\n * @param {string} str - The string representation of the token.\n * @param {Object} metadata - All metadata associated with this token.\n */\n\n/**\n * Applies the given function to the wrapped string token.\n *\n * @example\n * token.update(function (str, metadata) {\n * return str.toUpperCase()\n * })\n *\n * @param {lunr.Token~updateFunction} fn - A function to apply to the token string.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.update = function (fn) {\n this.str = fn(this.str, this.metadata)\n return this\n}\n\n/**\n * Creates a clone of this token. Optionally a function can be\n * applied to the cloned token.\n *\n * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.clone = function (fn) {\n fn = fn || function (s) { return s }\n return new lunr.Token (fn(this.str, this.metadata), this.metadata)\n}\n/*!\n * lunr.tokenizer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A function for splitting a string into tokens ready to be inserted into\n * the search index. Uses `lunr.tokenizer.separator` to split strings, change\n * the value of this property to change how strings are split into tokens.\n *\n * This tokenizer will convert its parameter to a string by calling `toString` and\n * then will split this string on the character in `lunr.tokenizer.separator`.\n * Arrays will have their elements converted to strings and wrapped in a lunr.Token.\n *\n * Optional metadata can be passed to the tokenizer, this metadata will be cloned and\n * added as metadata to every token that is created from the object to be tokenized.\n *\n * @static\n * @param {?(string|object|object[])} obj - The object to convert into tokens\n * @param {?object} metadata - Optional metadata to associate with every token\n * @returns {lunr.Token[]}\n * @see {@link lunr.Pipeline}\n */\nlunr.tokenizer = function (obj, metadata) {\n if (obj == null || obj == undefined) {\n return []\n }\n\n if (Array.isArray(obj)) {\n return obj.map(function (t) {\n return new lunr.Token(\n lunr.utils.asString(t).toLowerCase(),\n lunr.utils.clone(metadata)\n )\n })\n }\n\n var str = obj.toString().toLowerCase(),\n len = str.length,\n tokens = []\n\n for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) {\n var char = str.charAt(sliceEnd),\n sliceLength = sliceEnd - sliceStart\n\n if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) {\n\n if (sliceLength > 0) {\n var tokenMetadata = lunr.utils.clone(metadata) || {}\n tokenMetadata[\"position\"] = [sliceStart, sliceLength]\n tokenMetadata[\"index\"] = tokens.length\n\n tokens.push(\n new lunr.Token (\n str.slice(sliceStart, sliceEnd),\n tokenMetadata\n )\n )\n }\n\n sliceStart = sliceEnd + 1\n }\n\n }\n\n return tokens\n}\n\n/**\n * The separator used to split a string into tokens. Override this property to change the behaviour of\n * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens.\n *\n * @static\n * @see lunr.tokenizer\n */\nlunr.tokenizer.separator = /[\\s\\-]+/\n/*!\n * lunr.Pipeline\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Pipelines maintain an ordered list of functions to be applied to all\n * tokens in documents entering the search index and queries being ran against\n * the index.\n *\n * An instance of lunr.Index created with the lunr shortcut will contain a\n * pipeline with a stop word filter and an English language stemmer. Extra\n * functions can be added before or after either of these functions or these\n * default functions can be removed.\n *\n * When run the pipeline will call each function in turn, passing a token, the\n * index of that token in the original list of all tokens and finally a list of\n * all the original tokens.\n *\n * The output of functions in the pipeline will be passed to the next function\n * in the pipeline. To exclude a token from entering the index the function\n * should return undefined, the rest of the pipeline will not be called with\n * this token.\n *\n * For serialisation of pipelines to work, all functions used in an instance of\n * a pipeline should be registered with lunr.Pipeline. Registered functions can\n * then be loaded. If trying to load a serialised pipeline that uses functions\n * that are not registered an error will be thrown.\n *\n * If not planning on serialising the pipeline then registering pipeline functions\n * is not necessary.\n *\n * @constructor\n */\nlunr.Pipeline = function () {\n this._stack = []\n}\n\nlunr.Pipeline.registeredFunctions = Object.create(null)\n\n/**\n * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token\n * string as well as all known metadata. A pipeline function can mutate the token string\n * or mutate (or add) metadata for a given token.\n *\n * A pipeline function can indicate that the passed token should be discarded by returning\n * null, undefined or an empty string. This token will not be passed to any downstream pipeline\n * functions and will not be added to the index.\n *\n * Multiple tokens can be returned by returning an array of tokens. Each token will be passed\n * to any downstream pipeline functions and all will returned tokens will be added to the index.\n *\n * Any number of pipeline functions may be chained together using a lunr.Pipeline.\n *\n * @interface lunr.PipelineFunction\n * @param {lunr.Token} token - A token from the document being processed.\n * @param {number} i - The index of this token in the complete list of tokens for this document/field.\n * @param {lunr.Token[]} tokens - All tokens for this document/field.\n * @returns {(?lunr.Token|lunr.Token[])}\n */\n\n/**\n * Register a function with the pipeline.\n *\n * Functions that are used in the pipeline should be registered if the pipeline\n * needs to be serialised, or a serialised pipeline needs to be loaded.\n *\n * Registering a function does not add it to a pipeline, functions must still be\n * added to instances of the pipeline for them to be used when running a pipeline.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @param {String} label - The label to register this function with\n */\nlunr.Pipeline.registerFunction = function (fn, label) {\n if (label in this.registeredFunctions) {\n lunr.utils.warn('Overwriting existing registered function: ' + label)\n }\n\n fn.label = label\n lunr.Pipeline.registeredFunctions[fn.label] = fn\n}\n\n/**\n * Warns if the function is not registered as a Pipeline function.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @private\n */\nlunr.Pipeline.warnIfFunctionNotRegistered = function (fn) {\n var isRegistered = fn.label && (fn.label in this.registeredFunctions)\n\n if (!isRegistered) {\n lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\\n', fn)\n }\n}\n\n/**\n * Loads a previously serialised pipeline.\n *\n * All functions to be loaded must already be registered with lunr.Pipeline.\n * If any function from the serialised data has not been registered then an\n * error will be thrown.\n *\n * @param {Object} serialised - The serialised pipeline to load.\n * @returns {lunr.Pipeline}\n */\nlunr.Pipeline.load = function (serialised) {\n var pipeline = new lunr.Pipeline\n\n serialised.forEach(function (fnName) {\n var fn = lunr.Pipeline.registeredFunctions[fnName]\n\n if (fn) {\n pipeline.add(fn)\n } else {\n throw new Error('Cannot load unregistered function: ' + fnName)\n }\n })\n\n return pipeline\n}\n\n/**\n * Adds new functions to the end of the pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline.\n */\nlunr.Pipeline.prototype.add = function () {\n var fns = Array.prototype.slice.call(arguments)\n\n fns.forEach(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n this._stack.push(fn)\n }, this)\n}\n\n/**\n * Adds a single function after a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.after = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n pos = pos + 1\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Adds a single function before a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.before = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Removes a function from the pipeline.\n *\n * @param {lunr.PipelineFunction} fn The function to remove from the pipeline.\n */\nlunr.Pipeline.prototype.remove = function (fn) {\n var pos = this._stack.indexOf(fn)\n if (pos == -1) {\n return\n }\n\n this._stack.splice(pos, 1)\n}\n\n/**\n * Runs the current list of functions that make up the pipeline against the\n * passed tokens.\n *\n * @param {Array} tokens The tokens to run through the pipeline.\n * @returns {Array}\n */\nlunr.Pipeline.prototype.run = function (tokens) {\n var stackLength = this._stack.length\n\n for (var i = 0; i < stackLength; i++) {\n var fn = this._stack[i]\n var memo = []\n\n for (var j = 0; j < tokens.length; j++) {\n var result = fn(tokens[j], j, tokens)\n\n if (result === null || result === void 0 || result === '') continue\n\n if (Array.isArray(result)) {\n for (var k = 0; k < result.length; k++) {\n memo.push(result[k])\n }\n } else {\n memo.push(result)\n }\n }\n\n tokens = memo\n }\n\n return tokens\n}\n\n/**\n * Convenience method for passing a string through a pipeline and getting\n * strings out. This method takes care of wrapping the passed string in a\n * token and mapping the resulting tokens back to strings.\n *\n * @param {string} str - The string to pass through the pipeline.\n * @param {?object} metadata - Optional metadata to associate with the token\n * passed to the pipeline.\n * @returns {string[]}\n */\nlunr.Pipeline.prototype.runString = function (str, metadata) {\n var token = new lunr.Token (str, metadata)\n\n return this.run([token]).map(function (t) {\n return t.toString()\n })\n}\n\n/**\n * Resets the pipeline by removing any existing processors.\n *\n */\nlunr.Pipeline.prototype.reset = function () {\n this._stack = []\n}\n\n/**\n * Returns a representation of the pipeline ready for serialisation.\n *\n * Logs a warning if the function has not been registered.\n *\n * @returns {Array}\n */\nlunr.Pipeline.prototype.toJSON = function () {\n return this._stack.map(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n\n return fn.label\n })\n}\n/*!\n * lunr.Vector\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A vector is used to construct the vector space of documents and queries. These\n * vectors support operations to determine the similarity between two documents or\n * a document and a query.\n *\n * Normally no parameters are required for initializing a vector, but in the case of\n * loading a previously dumped vector the raw elements can be provided to the constructor.\n *\n * For performance reasons vectors are implemented with a flat array, where an elements\n * index is immediately followed by its value. E.g. [index, value, index, value]. This\n * allows the underlying array to be as sparse as possible and still offer decent\n * performance when being used for vector calculations.\n *\n * @constructor\n * @param {Number[]} [elements] - The flat list of element index and element value pairs.\n */\nlunr.Vector = function (elements) {\n this._magnitude = 0\n this.elements = elements || []\n}\n\n\n/**\n * Calculates the position within the vector to insert a given index.\n *\n * This is used internally by insert and upsert. If there are duplicate indexes then\n * the position is returned as if the value for that index were to be updated, but it\n * is the callers responsibility to check whether there is a duplicate at that index\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @returns {Number}\n */\nlunr.Vector.prototype.positionForIndex = function (index) {\n // For an empty vector the tuple can be inserted at the beginning\n if (this.elements.length == 0) {\n return 0\n }\n\n var start = 0,\n end = this.elements.length / 2,\n sliceLength = end - start,\n pivotPoint = Math.floor(sliceLength / 2),\n pivotIndex = this.elements[pivotPoint * 2]\n\n while (sliceLength > 1) {\n if (pivotIndex < index) {\n start = pivotPoint\n }\n\n if (pivotIndex > index) {\n end = pivotPoint\n }\n\n if (pivotIndex == index) {\n break\n }\n\n sliceLength = end - start\n pivotPoint = start + Math.floor(sliceLength / 2)\n pivotIndex = this.elements[pivotPoint * 2]\n }\n\n if (pivotIndex == index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex > index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex < index) {\n return (pivotPoint + 1) * 2\n }\n}\n\n/**\n * Inserts an element at an index within the vector.\n *\n * Does not allow duplicates, will throw an error if there is already an entry\n * for this index.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n */\nlunr.Vector.prototype.insert = function (insertIdx, val) {\n this.upsert(insertIdx, val, function () {\n throw \"duplicate index\"\n })\n}\n\n/**\n * Inserts or updates an existing index within the vector.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n * @param {function} fn - A function that is called for updates, the existing value and the\n * requested value are passed as arguments\n */\nlunr.Vector.prototype.upsert = function (insertIdx, val, fn) {\n this._magnitude = 0\n var position = this.positionForIndex(insertIdx)\n\n if (this.elements[position] == insertIdx) {\n this.elements[position + 1] = fn(this.elements[position + 1], val)\n } else {\n this.elements.splice(position, 0, insertIdx, val)\n }\n}\n\n/**\n * Calculates the magnitude of this vector.\n *\n * @returns {Number}\n */\nlunr.Vector.prototype.magnitude = function () {\n if (this._magnitude) return this._magnitude\n\n var sumOfSquares = 0,\n elementsLength = this.elements.length\n\n for (var i = 1; i < elementsLength; i += 2) {\n var val = this.elements[i]\n sumOfSquares += val * val\n }\n\n return this._magnitude = Math.sqrt(sumOfSquares)\n}\n\n/**\n * Calculates the dot product of this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The vector to compute the dot product with.\n * @returns {Number}\n */\nlunr.Vector.prototype.dot = function (otherVector) {\n var dotProduct = 0,\n a = this.elements, b = otherVector.elements,\n aLen = a.length, bLen = b.length,\n aVal = 0, bVal = 0,\n i = 0, j = 0\n\n while (i < aLen && j < bLen) {\n aVal = a[i], bVal = b[j]\n if (aVal < bVal) {\n i += 2\n } else if (aVal > bVal) {\n j += 2\n } else if (aVal == bVal) {\n dotProduct += a[i + 1] * b[j + 1]\n i += 2\n j += 2\n }\n }\n\n return dotProduct\n}\n\n/**\n * Calculates the similarity between this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The other vector to calculate the\n * similarity with.\n * @returns {Number}\n */\nlunr.Vector.prototype.similarity = function (otherVector) {\n return this.dot(otherVector) / this.magnitude() || 0\n}\n\n/**\n * Converts the vector to an array of the elements within the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toArray = function () {\n var output = new Array (this.elements.length / 2)\n\n for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) {\n output[j] = this.elements[i]\n }\n\n return output\n}\n\n/**\n * A JSON serializable representation of the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toJSON = function () {\n return this.elements\n}\n/* eslint-disable */\n/*!\n * lunr.stemmer\n * Copyright (C) 2020 Oliver Nightingale\n * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt\n */\n\n/**\n * lunr.stemmer is an english language stemmer, this is a JavaScript\n * implementation of the PorterStemmer taken from http://tartarus.org/~martin\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token - The string to stem\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n * @function\n */\nlunr.stemmer = (function(){\n var step2list = {\n \"ational\" : \"ate\",\n \"tional\" : \"tion\",\n \"enci\" : \"ence\",\n \"anci\" : \"ance\",\n \"izer\" : \"ize\",\n \"bli\" : \"ble\",\n \"alli\" : \"al\",\n \"entli\" : \"ent\",\n \"eli\" : \"e\",\n \"ousli\" : \"ous\",\n \"ization\" : \"ize\",\n \"ation\" : \"ate\",\n \"ator\" : \"ate\",\n \"alism\" : \"al\",\n \"iveness\" : \"ive\",\n \"fulness\" : \"ful\",\n \"ousness\" : \"ous\",\n \"aliti\" : \"al\",\n \"iviti\" : \"ive\",\n \"biliti\" : \"ble\",\n \"logi\" : \"log\"\n },\n\n step3list = {\n \"icate\" : \"ic\",\n \"ative\" : \"\",\n \"alize\" : \"al\",\n \"iciti\" : \"ic\",\n \"ical\" : \"ic\",\n \"ful\" : \"\",\n \"ness\" : \"\"\n },\n\n c = \"[^aeiou]\", // consonant\n v = \"[aeiouy]\", // vowel\n C = c + \"[^aeiouy]*\", // consonant sequence\n V = v + \"[aeiou]*\", // vowel sequence\n\n mgr0 = \"^(\" + C + \")?\" + V + C, // [C]VC... is m>0\n meq1 = \"^(\" + C + \")?\" + V + C + \"(\" + V + \")?$\", // [C]VC[V] is m=1\n mgr1 = \"^(\" + C + \")?\" + V + C + V + C, // [C]VCVC... is m>1\n s_v = \"^(\" + C + \")?\" + v; // vowel in stem\n\n var re_mgr0 = new RegExp(mgr0);\n var re_mgr1 = new RegExp(mgr1);\n var re_meq1 = new RegExp(meq1);\n var re_s_v = new RegExp(s_v);\n\n var re_1a = /^(.+?)(ss|i)es$/;\n var re2_1a = /^(.+?)([^s])s$/;\n var re_1b = /^(.+?)eed$/;\n var re2_1b = /^(.+?)(ed|ing)$/;\n var re_1b_2 = /.$/;\n var re2_1b_2 = /(at|bl|iz)$/;\n var re3_1b_2 = new RegExp(\"([^aeiouylsz])\\\\1$\");\n var re4_1b_2 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var re_1c = /^(.+?[^aeiou])y$/;\n var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;\n\n var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;\n\n var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;\n var re2_4 = /^(.+?)(s|t)(ion)$/;\n\n var re_5 = /^(.+?)e$/;\n var re_5_1 = /ll$/;\n var re3_5 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var porterStemmer = function porterStemmer(w) {\n var stem,\n suffix,\n firstch,\n re,\n re2,\n re3,\n re4;\n\n if (w.length < 3) { return w; }\n\n firstch = w.substr(0,1);\n if (firstch == \"y\") {\n w = firstch.toUpperCase() + w.substr(1);\n }\n\n // Step 1a\n re = re_1a\n re2 = re2_1a;\n\n if (re.test(w)) { w = w.replace(re,\"$1$2\"); }\n else if (re2.test(w)) { w = w.replace(re2,\"$1$2\"); }\n\n // Step 1b\n re = re_1b;\n re2 = re2_1b;\n if (re.test(w)) {\n var fp = re.exec(w);\n re = re_mgr0;\n if (re.test(fp[1])) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1];\n re2 = re_s_v;\n if (re2.test(stem)) {\n w = stem;\n re2 = re2_1b_2;\n re3 = re3_1b_2;\n re4 = re4_1b_2;\n if (re2.test(w)) { w = w + \"e\"; }\n else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,\"\"); }\n else if (re4.test(w)) { w = w + \"e\"; }\n }\n }\n\n // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say)\n re = re_1c;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n w = stem + \"i\";\n }\n\n // Step 2\n re = re_2;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step2list[suffix];\n }\n }\n\n // Step 3\n re = re_3;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step3list[suffix];\n }\n }\n\n // Step 4\n re = re_4;\n re2 = re2_4;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n if (re.test(stem)) {\n w = stem;\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1] + fp[2];\n re2 = re_mgr1;\n if (re2.test(stem)) {\n w = stem;\n }\n }\n\n // Step 5\n re = re_5;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n re2 = re_meq1;\n re3 = re3_5;\n if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) {\n w = stem;\n }\n }\n\n re = re_5_1;\n re2 = re_mgr1;\n if (re.test(w) && re2.test(w)) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n\n // and turn initial Y back to y\n\n if (firstch == \"y\") {\n w = firstch.toLowerCase() + w.substr(1);\n }\n\n return w;\n };\n\n return function (token) {\n return token.update(porterStemmer);\n }\n})();\n\nlunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')\n/*!\n * lunr.stopWordFilter\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.generateStopWordFilter builds a stopWordFilter function from the provided\n * list of stop words.\n *\n * The built in lunr.stopWordFilter is built using this generator and can be used\n * to generate custom stopWordFilters for applications or non English languages.\n *\n * @function\n * @param {Array} token The token to pass through the filter\n * @returns {lunr.PipelineFunction}\n * @see lunr.Pipeline\n * @see lunr.stopWordFilter\n */\nlunr.generateStopWordFilter = function (stopWords) {\n var words = stopWords.reduce(function (memo, stopWord) {\n memo[stopWord] = stopWord\n return memo\n }, {})\n\n return function (token) {\n if (token && words[token.toString()] !== token.toString()) return token\n }\n}\n\n/**\n * lunr.stopWordFilter is an English language stop word list filter, any words\n * contained in the list will not be passed through the filter.\n *\n * This is intended to be used in the Pipeline. If the token does not pass the\n * filter then undefined will be returned.\n *\n * @function\n * @implements {lunr.PipelineFunction}\n * @params {lunr.Token} token - A token to check for being a stop word.\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n */\nlunr.stopWordFilter = lunr.generateStopWordFilter([\n 'a',\n 'able',\n 'about',\n 'across',\n 'after',\n 'all',\n 'almost',\n 'also',\n 'am',\n 'among',\n 'an',\n 'and',\n 'any',\n 'are',\n 'as',\n 'at',\n 'be',\n 'because',\n 'been',\n 'but',\n 'by',\n 'can',\n 'cannot',\n 'could',\n 'dear',\n 'did',\n 'do',\n 'does',\n 'either',\n 'else',\n 'ever',\n 'every',\n 'for',\n 'from',\n 'get',\n 'got',\n 'had',\n 'has',\n 'have',\n 'he',\n 'her',\n 'hers',\n 'him',\n 'his',\n 'how',\n 'however',\n 'i',\n 'if',\n 'in',\n 'into',\n 'is',\n 'it',\n 'its',\n 'just',\n 'least',\n 'let',\n 'like',\n 'likely',\n 'may',\n 'me',\n 'might',\n 'most',\n 'must',\n 'my',\n 'neither',\n 'no',\n 'nor',\n 'not',\n 'of',\n 'off',\n 'often',\n 'on',\n 'only',\n 'or',\n 'other',\n 'our',\n 'own',\n 'rather',\n 'said',\n 'say',\n 'says',\n 'she',\n 'should',\n 'since',\n 'so',\n 'some',\n 'than',\n 'that',\n 'the',\n 'their',\n 'them',\n 'then',\n 'there',\n 'these',\n 'they',\n 'this',\n 'tis',\n 'to',\n 'too',\n 'twas',\n 'us',\n 'wants',\n 'was',\n 'we',\n 'were',\n 'what',\n 'when',\n 'where',\n 'which',\n 'while',\n 'who',\n 'whom',\n 'why',\n 'will',\n 'with',\n 'would',\n 'yet',\n 'you',\n 'your'\n])\n\nlunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')\n/*!\n * lunr.trimmer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.trimmer is a pipeline function for trimming non word\n * characters from the beginning and end of tokens before they\n * enter the index.\n *\n * This implementation may not work correctly for non latin\n * characters and should either be removed or adapted for use\n * with languages with non-latin characters.\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token The token to pass through the filter\n * @returns {lunr.Token}\n * @see lunr.Pipeline\n */\nlunr.trimmer = function (token) {\n return token.update(function (s) {\n return s.replace(/^\\W+/, '').replace(/\\W+$/, '')\n })\n}\n\nlunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')\n/*!\n * lunr.TokenSet\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A token set is used to store the unique list of all tokens\n * within an index. Token sets are also used to represent an\n * incoming query to the index, this query token set and index\n * token set are then intersected to find which tokens to look\n * up in the inverted index.\n *\n * A token set can hold multiple tokens, as in the case of the\n * index token set, or it can hold a single token as in the\n * case of a simple query token set.\n *\n * Additionally token sets are used to perform wildcard matching.\n * Leading, contained and trailing wildcards are supported, and\n * from this edit distance matching can also be provided.\n *\n * Token sets are implemented as a minimal finite state automata,\n * where both common prefixes and suffixes are shared between tokens.\n * This helps to reduce the space used for storing the token set.\n *\n * @constructor\n */\nlunr.TokenSet = function () {\n this.final = false\n this.edges = {}\n this.id = lunr.TokenSet._nextId\n lunr.TokenSet._nextId += 1\n}\n\n/**\n * Keeps track of the next, auto increment, identifier to assign\n * to a new tokenSet.\n *\n * TokenSets require a unique identifier to be correctly minimised.\n *\n * @private\n */\nlunr.TokenSet._nextId = 1\n\n/**\n * Creates a TokenSet instance from the given sorted array of words.\n *\n * @param {String[]} arr - A sorted array of strings to create the set from.\n * @returns {lunr.TokenSet}\n * @throws Will throw an error if the input array is not sorted.\n */\nlunr.TokenSet.fromArray = function (arr) {\n var builder = new lunr.TokenSet.Builder\n\n for (var i = 0, len = arr.length; i < len; i++) {\n builder.insert(arr[i])\n }\n\n builder.finish()\n return builder.root\n}\n\n/**\n * Creates a token set from a query clause.\n *\n * @private\n * @param {Object} clause - A single clause from lunr.Query.\n * @param {string} clause.term - The query clause term.\n * @param {number} [clause.editDistance] - The optional edit distance for the term.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromClause = function (clause) {\n if ('editDistance' in clause) {\n return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance)\n } else {\n return lunr.TokenSet.fromString(clause.term)\n }\n}\n\n/**\n * Creates a token set representing a single string with a specified\n * edit distance.\n *\n * Insertions, deletions, substitutions and transpositions are each\n * treated as an edit distance of 1.\n *\n * Increasing the allowed edit distance will have a dramatic impact\n * on the performance of both creating and intersecting these TokenSets.\n * It is advised to keep the edit distance less than 3.\n *\n * @param {string} str - The string to create the token set from.\n * @param {number} editDistance - The allowed edit distance to match.\n * @returns {lunr.Vector}\n */\nlunr.TokenSet.fromFuzzyString = function (str, editDistance) {\n var root = new lunr.TokenSet\n\n var stack = [{\n node: root,\n editsRemaining: editDistance,\n str: str\n }]\n\n while (stack.length) {\n var frame = stack.pop()\n\n // no edit\n if (frame.str.length > 0) {\n var char = frame.str.charAt(0),\n noEditNode\n\n if (char in frame.node.edges) {\n noEditNode = frame.node.edges[char]\n } else {\n noEditNode = new lunr.TokenSet\n frame.node.edges[char] = noEditNode\n }\n\n if (frame.str.length == 1) {\n noEditNode.final = true\n }\n\n stack.push({\n node: noEditNode,\n editsRemaining: frame.editsRemaining,\n str: frame.str.slice(1)\n })\n }\n\n if (frame.editsRemaining == 0) {\n continue\n }\n\n // insertion\n if (\"*\" in frame.node.edges) {\n var insertionNode = frame.node.edges[\"*\"]\n } else {\n var insertionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = insertionNode\n }\n\n if (frame.str.length == 0) {\n insertionNode.final = true\n }\n\n stack.push({\n node: insertionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str\n })\n\n // deletion\n // can only do a deletion if we have enough edits remaining\n // and if there are characters left to delete in the string\n if (frame.str.length > 1) {\n stack.push({\n node: frame.node,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // deletion\n // just removing the last character from the str\n if (frame.str.length == 1) {\n frame.node.final = true\n }\n\n // substitution\n // can only do a substitution if we have enough edits remaining\n // and if there are characters left to substitute\n if (frame.str.length >= 1) {\n if (\"*\" in frame.node.edges) {\n var substitutionNode = frame.node.edges[\"*\"]\n } else {\n var substitutionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = substitutionNode\n }\n\n if (frame.str.length == 1) {\n substitutionNode.final = true\n }\n\n stack.push({\n node: substitutionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // transposition\n // can only do a transposition if there are edits remaining\n // and there are enough characters to transpose\n if (frame.str.length > 1) {\n var charA = frame.str.charAt(0),\n charB = frame.str.charAt(1),\n transposeNode\n\n if (charB in frame.node.edges) {\n transposeNode = frame.node.edges[charB]\n } else {\n transposeNode = new lunr.TokenSet\n frame.node.edges[charB] = transposeNode\n }\n\n if (frame.str.length == 1) {\n transposeNode.final = true\n }\n\n stack.push({\n node: transposeNode,\n editsRemaining: frame.editsRemaining - 1,\n str: charA + frame.str.slice(2)\n })\n }\n }\n\n return root\n}\n\n/**\n * Creates a TokenSet from a string.\n *\n * The string may contain one or more wildcard characters (*)\n * that will allow wildcard matching when intersecting with\n * another TokenSet.\n *\n * @param {string} str - The string to create a TokenSet from.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromString = function (str) {\n var node = new lunr.TokenSet,\n root = node\n\n /*\n * Iterates through all characters within the passed string\n * appending a node for each character.\n *\n * When a wildcard character is found then a self\n * referencing edge is introduced to continually match\n * any number of any characters.\n */\n for (var i = 0, len = str.length; i < len; i++) {\n var char = str[i],\n final = (i == len - 1)\n\n if (char == \"*\") {\n node.edges[char] = node\n node.final = final\n\n } else {\n var next = new lunr.TokenSet\n next.final = final\n\n node.edges[char] = next\n node = next\n }\n }\n\n return root\n}\n\n/**\n * Converts this TokenSet into an array of strings\n * contained within the TokenSet.\n *\n * This is not intended to be used on a TokenSet that\n * contains wildcards, in these cases the results are\n * undefined and are likely to cause an infinite loop.\n *\n * @returns {string[]}\n */\nlunr.TokenSet.prototype.toArray = function () {\n var words = []\n\n var stack = [{\n prefix: \"\",\n node: this\n }]\n\n while (stack.length) {\n var frame = stack.pop(),\n edges = Object.keys(frame.node.edges),\n len = edges.length\n\n if (frame.node.final) {\n /* In Safari, at this point the prefix is sometimes corrupted, see:\n * https://github.com/olivernn/lunr.js/issues/279 Calling any\n * String.prototype method forces Safari to \"cast\" this string to what\n * it's supposed to be, fixing the bug. */\n frame.prefix.charAt(0)\n words.push(frame.prefix)\n }\n\n for (var i = 0; i < len; i++) {\n var edge = edges[i]\n\n stack.push({\n prefix: frame.prefix.concat(edge),\n node: frame.node.edges[edge]\n })\n }\n }\n\n return words\n}\n\n/**\n * Generates a string representation of a TokenSet.\n *\n * This is intended to allow TokenSets to be used as keys\n * in objects, largely to aid the construction and minimisation\n * of a TokenSet. As such it is not designed to be a human\n * friendly representation of the TokenSet.\n *\n * @returns {string}\n */\nlunr.TokenSet.prototype.toString = function () {\n // NOTE: Using Object.keys here as this.edges is very likely\n // to enter 'hash-mode' with many keys being added\n //\n // avoiding a for-in loop here as it leads to the function\n // being de-optimised (at least in V8). From some simple\n // benchmarks the performance is comparable, but allowing\n // V8 to optimize may mean easy performance wins in the future.\n\n if (this._str) {\n return this._str\n }\n\n var str = this.final ? '1' : '0',\n labels = Object.keys(this.edges).sort(),\n len = labels.length\n\n for (var i = 0; i < len; i++) {\n var label = labels[i],\n node = this.edges[label]\n\n str = str + label + node.id\n }\n\n return str\n}\n\n/**\n * Returns a new TokenSet that is the intersection of\n * this TokenSet and the passed TokenSet.\n *\n * This intersection will take into account any wildcards\n * contained within the TokenSet.\n *\n * @param {lunr.TokenSet} b - An other TokenSet to intersect with.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.prototype.intersect = function (b) {\n var output = new lunr.TokenSet,\n frame = undefined\n\n var stack = [{\n qNode: b,\n output: output,\n node: this\n }]\n\n while (stack.length) {\n frame = stack.pop()\n\n // NOTE: As with the #toString method, we are using\n // Object.keys and a for loop instead of a for-in loop\n // as both of these objects enter 'hash' mode, causing\n // the function to be de-optimised in V8\n var qEdges = Object.keys(frame.qNode.edges),\n qLen = qEdges.length,\n nEdges = Object.keys(frame.node.edges),\n nLen = nEdges.length\n\n for (var q = 0; q < qLen; q++) {\n var qEdge = qEdges[q]\n\n for (var n = 0; n < nLen; n++) {\n var nEdge = nEdges[n]\n\n if (nEdge == qEdge || qEdge == '*') {\n var node = frame.node.edges[nEdge],\n qNode = frame.qNode.edges[qEdge],\n final = node.final && qNode.final,\n next = undefined\n\n if (nEdge in frame.output.edges) {\n // an edge already exists for this character\n // no need to create a new node, just set the finality\n // bit unless this node is already final\n next = frame.output.edges[nEdge]\n next.final = next.final || final\n\n } else {\n // no edge exists yet, must create one\n // set the finality bit and insert it\n // into the output\n next = new lunr.TokenSet\n next.final = final\n frame.output.edges[nEdge] = next\n }\n\n stack.push({\n qNode: qNode,\n output: next,\n node: node\n })\n }\n }\n }\n }\n\n return output\n}\nlunr.TokenSet.Builder = function () {\n this.previousWord = \"\"\n this.root = new lunr.TokenSet\n this.uncheckedNodes = []\n this.minimizedNodes = {}\n}\n\nlunr.TokenSet.Builder.prototype.insert = function (word) {\n var node,\n commonPrefix = 0\n\n if (word < this.previousWord) {\n throw new Error (\"Out of order word insertion\")\n }\n\n for (var i = 0; i < word.length && i < this.previousWord.length; i++) {\n if (word[i] != this.previousWord[i]) break\n commonPrefix++\n }\n\n this.minimize(commonPrefix)\n\n if (this.uncheckedNodes.length == 0) {\n node = this.root\n } else {\n node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child\n }\n\n for (var i = commonPrefix; i < word.length; i++) {\n var nextNode = new lunr.TokenSet,\n char = word[i]\n\n node.edges[char] = nextNode\n\n this.uncheckedNodes.push({\n parent: node,\n char: char,\n child: nextNode\n })\n\n node = nextNode\n }\n\n node.final = true\n this.previousWord = word\n}\n\nlunr.TokenSet.Builder.prototype.finish = function () {\n this.minimize(0)\n}\n\nlunr.TokenSet.Builder.prototype.minimize = function (downTo) {\n for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) {\n var node = this.uncheckedNodes[i],\n childKey = node.child.toString()\n\n if (childKey in this.minimizedNodes) {\n node.parent.edges[node.char] = this.minimizedNodes[childKey]\n } else {\n // Cache the key for this node since\n // we know it can't change anymore\n node.child._str = childKey\n\n this.minimizedNodes[childKey] = node.child\n }\n\n this.uncheckedNodes.pop()\n }\n}\n/*!\n * lunr.Index\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * An index contains the built index of all documents and provides a query interface\n * to the index.\n *\n * Usually instances of lunr.Index will not be created using this constructor, instead\n * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be\n * used to load previously built and serialized indexes.\n *\n * @constructor\n * @param {Object} attrs - The attributes of the built search index.\n * @param {Object} attrs.invertedIndex - An index of term/field to document reference.\n * @param {Object} attrs.fieldVectors - Field vectors\n * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens.\n * @param {string[]} attrs.fields - The names of indexed document fields.\n * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms.\n */\nlunr.Index = function (attrs) {\n this.invertedIndex = attrs.invertedIndex\n this.fieldVectors = attrs.fieldVectors\n this.tokenSet = attrs.tokenSet\n this.fields = attrs.fields\n this.pipeline = attrs.pipeline\n}\n\n/**\n * A result contains details of a document matching a search query.\n * @typedef {Object} lunr.Index~Result\n * @property {string} ref - The reference of the document this result represents.\n * @property {number} score - A number between 0 and 1 representing how similar this document is to the query.\n * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match.\n */\n\n/**\n * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple\n * query language which itself is parsed into an instance of lunr.Query.\n *\n * For programmatically building queries it is advised to directly use lunr.Query, the query language\n * is best used for human entered text rather than program generated text.\n *\n * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported\n * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello'\n * or 'world', though those that contain both will rank higher in the results.\n *\n * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can\n * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding\n * wildcards will increase the number of documents that will be found but can also have a negative\n * impact on query performance, especially with wildcards at the beginning of a term.\n *\n * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term\n * hello in the title field will match this query. Using a field not present in the index will lead\n * to an error being thrown.\n *\n * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term\n * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported\n * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2.\n * Avoid large values for edit distance to improve query performance.\n *\n * Each term also supports a presence modifier. By default a term's presence in document is optional, however\n * this can be changed to either required or prohibited. For a term's presence to be required in a document the\n * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and\n * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not\n * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'.\n *\n * To escape special characters the backslash character '\\' can be used, this allows searches to include\n * characters that would normally be considered modifiers, e.g. `foo\\~2` will search for a term \"foo~2\" instead\n * of attempting to apply a boost of 2 to the search term \"foo\".\n *\n * @typedef {string} lunr.Index~QueryString\n * @example Simple single term query\n * hello\n * @example Multiple term query\n * hello world\n * @example term scoped to a field\n * title:hello\n * @example term with a boost of 10\n * hello^10\n * @example term with an edit distance of 2\n * hello~2\n * @example terms with presence modifiers\n * -foo +bar baz\n */\n\n/**\n * Performs a search against the index using lunr query syntax.\n *\n * Results will be returned sorted by their score, the most relevant results\n * will be returned first. For details on how the score is calculated, please see\n * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}.\n *\n * For more programmatic querying use lunr.Index#query.\n *\n * @param {lunr.Index~QueryString} queryString - A string containing a lunr query.\n * @throws {lunr.QueryParseError} If the passed query string cannot be parsed.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.search = function (queryString) {\n return this.query(function (query) {\n var parser = new lunr.QueryParser(queryString, query)\n parser.parse()\n })\n}\n\n/**\n * A query builder callback provides a query object to be used to express\n * the query to perform on the index.\n *\n * @callback lunr.Index~queryBuilder\n * @param {lunr.Query} query - The query object to build up.\n * @this lunr.Query\n */\n\n/**\n * Performs a query against the index using the yielded lunr.Query object.\n *\n * If performing programmatic queries against the index, this method is preferred\n * over lunr.Index#search so as to avoid the additional query parsing overhead.\n *\n * A query object is yielded to the supplied function which should be used to\n * express the query to be run against the index.\n *\n * Note that although this function takes a callback parameter it is _not_ an\n * asynchronous operation, the callback is just yielded a query object to be\n * customized.\n *\n * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.query = function (fn) {\n // for each query clause\n // * process terms\n // * expand terms from token set\n // * find matching documents and metadata\n // * get document vectors\n // * score documents\n\n var query = new lunr.Query(this.fields),\n matchingFields = Object.create(null),\n queryVectors = Object.create(null),\n termFieldCache = Object.create(null),\n requiredMatches = Object.create(null),\n prohibitedMatches = Object.create(null)\n\n /*\n * To support field level boosts a query vector is created per\n * field. An empty vector is eagerly created to support negated\n * queries.\n */\n for (var i = 0; i < this.fields.length; i++) {\n queryVectors[this.fields[i]] = new lunr.Vector\n }\n\n fn.call(query, query)\n\n for (var i = 0; i < query.clauses.length; i++) {\n /*\n * Unless the pipeline has been disabled for this term, which is\n * the case for terms with wildcards, we need to pass the clause\n * term through the search pipeline. A pipeline returns an array\n * of processed terms. Pipeline functions may expand the passed\n * term, which means we may end up performing multiple index lookups\n * for a single query term.\n */\n var clause = query.clauses[i],\n terms = null,\n clauseMatches = lunr.Set.empty\n\n if (clause.usePipeline) {\n terms = this.pipeline.runString(clause.term, {\n fields: clause.fields\n })\n } else {\n terms = [clause.term]\n }\n\n for (var m = 0; m < terms.length; m++) {\n var term = terms[m]\n\n /*\n * Each term returned from the pipeline needs to use the same query\n * clause object, e.g. the same boost and or edit distance. The\n * simplest way to do this is to re-use the clause object but mutate\n * its term property.\n */\n clause.term = term\n\n /*\n * From the term in the clause we create a token set which will then\n * be used to intersect the indexes token set to get a list of terms\n * to lookup in the inverted index\n */\n var termTokenSet = lunr.TokenSet.fromClause(clause),\n expandedTerms = this.tokenSet.intersect(termTokenSet).toArray()\n\n /*\n * If a term marked as required does not exist in the tokenSet it is\n * impossible for the search to return any matches. We set all the field\n * scoped required matches set to empty and stop examining any further\n * clauses.\n */\n if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = lunr.Set.empty\n }\n\n break\n }\n\n for (var j = 0; j < expandedTerms.length; j++) {\n /*\n * For each term get the posting and termIndex, this is required for\n * building the query vector.\n */\n var expandedTerm = expandedTerms[j],\n posting = this.invertedIndex[expandedTerm],\n termIndex = posting._index\n\n for (var k = 0; k < clause.fields.length; k++) {\n /*\n * For each field that this query term is scoped by (by default\n * all fields are in scope) we need to get all the document refs\n * that have this term in that field.\n *\n * The posting is the entry in the invertedIndex for the matching\n * term from above.\n */\n var field = clause.fields[k],\n fieldPosting = posting[field],\n matchingDocumentRefs = Object.keys(fieldPosting),\n termField = expandedTerm + \"/\" + field,\n matchingDocumentsSet = new lunr.Set(matchingDocumentRefs)\n\n /*\n * if the presence of this term is required ensure that the matching\n * documents are added to the set of required matches for this clause.\n *\n */\n if (clause.presence == lunr.Query.presence.REQUIRED) {\n clauseMatches = clauseMatches.union(matchingDocumentsSet)\n\n if (requiredMatches[field] === undefined) {\n requiredMatches[field] = lunr.Set.complete\n }\n }\n\n /*\n * if the presence of this term is prohibited ensure that the matching\n * documents are added to the set of prohibited matches for this field,\n * creating that set if it does not yet exist.\n */\n if (clause.presence == lunr.Query.presence.PROHIBITED) {\n if (prohibitedMatches[field] === undefined) {\n prohibitedMatches[field] = lunr.Set.empty\n }\n\n prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet)\n\n /*\n * Prohibited matches should not be part of the query vector used for\n * similarity scoring and no metadata should be extracted so we continue\n * to the next field\n */\n continue\n }\n\n /*\n * The query field vector is populated using the termIndex found for\n * the term and a unit value with the appropriate boost applied.\n * Using upsert because there could already be an entry in the vector\n * for the term we are working with. In that case we just add the scores\n * together.\n */\n queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b })\n\n /**\n * If we've already seen this term, field combo then we've already collected\n * the matching documents and metadata, no need to go through all that again\n */\n if (termFieldCache[termField]) {\n continue\n }\n\n for (var l = 0; l < matchingDocumentRefs.length; l++) {\n /*\n * All metadata for this term/field/document triple\n * are then extracted and collected into an instance\n * of lunr.MatchData ready to be returned in the query\n * results\n */\n var matchingDocumentRef = matchingDocumentRefs[l],\n matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field),\n metadata = fieldPosting[matchingDocumentRef],\n fieldMatch\n\n if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) {\n matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata)\n } else {\n fieldMatch.add(expandedTerm, field, metadata)\n }\n\n }\n\n termFieldCache[termField] = true\n }\n }\n }\n\n /**\n * If the presence was required we need to update the requiredMatches field sets.\n * We do this after all fields for the term have collected their matches because\n * the clause terms presence is required in _any_ of the fields not _all_ of the\n * fields.\n */\n if (clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = requiredMatches[field].intersect(clauseMatches)\n }\n }\n }\n\n /**\n * Need to combine the field scoped required and prohibited\n * matching documents into a global set of required and prohibited\n * matches\n */\n var allRequiredMatches = lunr.Set.complete,\n allProhibitedMatches = lunr.Set.empty\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i]\n\n if (requiredMatches[field]) {\n allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field])\n }\n\n if (prohibitedMatches[field]) {\n allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field])\n }\n }\n\n var matchingFieldRefs = Object.keys(matchingFields),\n results = [],\n matches = Object.create(null)\n\n /*\n * If the query is negated (contains only prohibited terms)\n * we need to get _all_ fieldRefs currently existing in the\n * index. This is only done when we know that the query is\n * entirely prohibited terms to avoid any cost of getting all\n * fieldRefs unnecessarily.\n *\n * Additionally, blank MatchData must be created to correctly\n * populate the results.\n */\n if (query.isNegated()) {\n matchingFieldRefs = Object.keys(this.fieldVectors)\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n var matchingFieldRef = matchingFieldRefs[i]\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRef)\n matchingFields[matchingFieldRef] = new lunr.MatchData\n }\n }\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n /*\n * Currently we have document fields that match the query, but we\n * need to return documents. The matchData and scores are combined\n * from multiple fields belonging to the same document.\n *\n * Scores are calculated by field, using the query vectors created\n * above, and combined into a final document score using addition.\n */\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]),\n docRef = fieldRef.docRef\n\n if (!allRequiredMatches.contains(docRef)) {\n continue\n }\n\n if (allProhibitedMatches.contains(docRef)) {\n continue\n }\n\n var fieldVector = this.fieldVectors[fieldRef],\n score = queryVectors[fieldRef.fieldName].similarity(fieldVector),\n docMatch\n\n if ((docMatch = matches[docRef]) !== undefined) {\n docMatch.score += score\n docMatch.matchData.combine(matchingFields[fieldRef])\n } else {\n var match = {\n ref: docRef,\n score: score,\n matchData: matchingFields[fieldRef]\n }\n matches[docRef] = match\n results.push(match)\n }\n }\n\n /*\n * Sort the results objects by score, highest first.\n */\n return results.sort(function (a, b) {\n return b.score - a.score\n })\n}\n\n/**\n * Prepares the index for JSON serialization.\n *\n * The schema for this JSON blob will be described in a\n * separate JSON schema file.\n *\n * @returns {Object}\n */\nlunr.Index.prototype.toJSON = function () {\n var invertedIndex = Object.keys(this.invertedIndex)\n .sort()\n .map(function (term) {\n return [term, this.invertedIndex[term]]\n }, this)\n\n var fieldVectors = Object.keys(this.fieldVectors)\n .map(function (ref) {\n return [ref, this.fieldVectors[ref].toJSON()]\n }, this)\n\n return {\n version: lunr.version,\n fields: this.fields,\n fieldVectors: fieldVectors,\n invertedIndex: invertedIndex,\n pipeline: this.pipeline.toJSON()\n }\n}\n\n/**\n * Loads a previously serialized lunr.Index\n *\n * @param {Object} serializedIndex - A previously serialized lunr.Index\n * @returns {lunr.Index}\n */\nlunr.Index.load = function (serializedIndex) {\n var attrs = {},\n fieldVectors = {},\n serializedVectors = serializedIndex.fieldVectors,\n invertedIndex = Object.create(null),\n serializedInvertedIndex = serializedIndex.invertedIndex,\n tokenSetBuilder = new lunr.TokenSet.Builder,\n pipeline = lunr.Pipeline.load(serializedIndex.pipeline)\n\n if (serializedIndex.version != lunr.version) {\n lunr.utils.warn(\"Version mismatch when loading serialised index. Current version of lunr '\" + lunr.version + \"' does not match serialized index '\" + serializedIndex.version + \"'\")\n }\n\n for (var i = 0; i < serializedVectors.length; i++) {\n var tuple = serializedVectors[i],\n ref = tuple[0],\n elements = tuple[1]\n\n fieldVectors[ref] = new lunr.Vector(elements)\n }\n\n for (var i = 0; i < serializedInvertedIndex.length; i++) {\n var tuple = serializedInvertedIndex[i],\n term = tuple[0],\n posting = tuple[1]\n\n tokenSetBuilder.insert(term)\n invertedIndex[term] = posting\n }\n\n tokenSetBuilder.finish()\n\n attrs.fields = serializedIndex.fields\n\n attrs.fieldVectors = fieldVectors\n attrs.invertedIndex = invertedIndex\n attrs.tokenSet = tokenSetBuilder.root\n attrs.pipeline = pipeline\n\n return new lunr.Index(attrs)\n}\n/*!\n * lunr.Builder\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Builder performs indexing on a set of documents and\n * returns instances of lunr.Index ready for querying.\n *\n * All configuration of the index is done via the builder, the\n * fields to index, the document reference, the text processing\n * pipeline and document scoring parameters are all set on the\n * builder before indexing.\n *\n * @constructor\n * @property {string} _ref - Internal reference to the document reference field.\n * @property {string[]} _fields - Internal reference to the document fields to index.\n * @property {object} invertedIndex - The inverted index maps terms to document fields.\n * @property {object} documentTermFrequencies - Keeps track of document term frequencies.\n * @property {object} documentLengths - Keeps track of the length of documents added to the index.\n * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing.\n * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing.\n * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index.\n * @property {number} documentCount - Keeps track of the total number of documents indexed.\n * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75.\n * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2.\n * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space.\n * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index.\n */\nlunr.Builder = function () {\n this._ref = \"id\"\n this._fields = Object.create(null)\n this._documents = Object.create(null)\n this.invertedIndex = Object.create(null)\n this.fieldTermFrequencies = {}\n this.fieldLengths = {}\n this.tokenizer = lunr.tokenizer\n this.pipeline = new lunr.Pipeline\n this.searchPipeline = new lunr.Pipeline\n this.documentCount = 0\n this._b = 0.75\n this._k1 = 1.2\n this.termIndex = 0\n this.metadataWhitelist = []\n}\n\n/**\n * Sets the document field used as the document reference. Every document must have this field.\n * The type of this field in the document should be a string, if it is not a string it will be\n * coerced into a string by calling toString.\n *\n * The default ref is 'id'.\n *\n * The ref should _not_ be changed during indexing, it should be set before any documents are\n * added to the index. Changing it during indexing can lead to inconsistent results.\n *\n * @param {string} ref - The name of the reference field in the document.\n */\nlunr.Builder.prototype.ref = function (ref) {\n this._ref = ref\n}\n\n/**\n * A function that is used to extract a field from a document.\n *\n * Lunr expects a field to be at the top level of a document, if however the field\n * is deeply nested within a document an extractor function can be used to extract\n * the right field for indexing.\n *\n * @callback fieldExtractor\n * @param {object} doc - The document being added to the index.\n * @returns {?(string|object|object[])} obj - The object that will be indexed for this field.\n * @example Extracting a nested field\n * function (doc) { return doc.nested.field }\n */\n\n/**\n * Adds a field to the list of document fields that will be indexed. Every document being\n * indexed should have this field. Null values for this field in indexed documents will\n * not cause errors but will limit the chance of that document being retrieved by searches.\n *\n * All fields should be added before adding documents to the index. Adding fields after\n * a document has been indexed will have no effect on already indexed documents.\n *\n * Fields can be boosted at build time. This allows terms within that field to have more\n * importance when ranking search results. Use a field boost to specify that matches within\n * one field are more important than other fields.\n *\n * @param {string} fieldName - The name of a field to index in all documents.\n * @param {object} attributes - Optional attributes associated with this field.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this field.\n * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document.\n * @throws {RangeError} fieldName cannot contain unsupported characters '/'\n */\nlunr.Builder.prototype.field = function (fieldName, attributes) {\n if (/\\//.test(fieldName)) {\n throw new RangeError (\"Field '\" + fieldName + \"' contains illegal character '/'\")\n }\n\n this._fields[fieldName] = attributes || {}\n}\n\n/**\n * A parameter to tune the amount of field length normalisation that is applied when\n * calculating relevance scores. A value of 0 will completely disable any normalisation\n * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b\n * will be clamped to the range 0 - 1.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.b = function (number) {\n if (number < 0) {\n this._b = 0\n } else if (number > 1) {\n this._b = 1\n } else {\n this._b = number\n }\n}\n\n/**\n * A parameter that controls the speed at which a rise in term frequency results in term\n * frequency saturation. The default value is 1.2. Setting this to a higher value will give\n * slower saturation levels, a lower value will result in quicker saturation.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.k1 = function (number) {\n this._k1 = number\n}\n\n/**\n * Adds a document to the index.\n *\n * Before adding fields to the index the index should have been fully setup, with the document\n * ref and all fields to index already having been specified.\n *\n * The document must have a field name as specified by the ref (by default this is 'id') and\n * it should have all fields defined for indexing, though null or undefined values will not\n * cause errors.\n *\n * Entire documents can be boosted at build time. Applying a boost to a document indicates that\n * this document should rank higher in search results than other documents.\n *\n * @param {object} doc - The document to add to the index.\n * @param {object} attributes - Optional attributes associated with this document.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this document.\n */\nlunr.Builder.prototype.add = function (doc, attributes) {\n var docRef = doc[this._ref],\n fields = Object.keys(this._fields)\n\n this._documents[docRef] = attributes || {}\n this.documentCount += 1\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i],\n extractor = this._fields[fieldName].extractor,\n field = extractor ? extractor(doc) : doc[fieldName],\n tokens = this.tokenizer(field, {\n fields: [fieldName]\n }),\n terms = this.pipeline.run(tokens),\n fieldRef = new lunr.FieldRef (docRef, fieldName),\n fieldTerms = Object.create(null)\n\n this.fieldTermFrequencies[fieldRef] = fieldTerms\n this.fieldLengths[fieldRef] = 0\n\n // store the length of this field for this document\n this.fieldLengths[fieldRef] += terms.length\n\n // calculate term frequencies for this field\n for (var j = 0; j < terms.length; j++) {\n var term = terms[j]\n\n if (fieldTerms[term] == undefined) {\n fieldTerms[term] = 0\n }\n\n fieldTerms[term] += 1\n\n // add to inverted index\n // create an initial posting if one doesn't exist\n if (this.invertedIndex[term] == undefined) {\n var posting = Object.create(null)\n posting[\"_index\"] = this.termIndex\n this.termIndex += 1\n\n for (var k = 0; k < fields.length; k++) {\n posting[fields[k]] = Object.create(null)\n }\n\n this.invertedIndex[term] = posting\n }\n\n // add an entry for this term/fieldName/docRef to the invertedIndex\n if (this.invertedIndex[term][fieldName][docRef] == undefined) {\n this.invertedIndex[term][fieldName][docRef] = Object.create(null)\n }\n\n // store all whitelisted metadata about this token in the\n // inverted index\n for (var l = 0; l < this.metadataWhitelist.length; l++) {\n var metadataKey = this.metadataWhitelist[l],\n metadata = term.metadata[metadataKey]\n\n if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) {\n this.invertedIndex[term][fieldName][docRef][metadataKey] = []\n }\n\n this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata)\n }\n }\n\n }\n}\n\n/**\n * Calculates the average document length for this index\n *\n * @private\n */\nlunr.Builder.prototype.calculateAverageFieldLengths = function () {\n\n var fieldRefs = Object.keys(this.fieldLengths),\n numberOfFields = fieldRefs.length,\n accumulator = {},\n documentsWithField = {}\n\n for (var i = 0; i < numberOfFields; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n field = fieldRef.fieldName\n\n documentsWithField[field] || (documentsWithField[field] = 0)\n documentsWithField[field] += 1\n\n accumulator[field] || (accumulator[field] = 0)\n accumulator[field] += this.fieldLengths[fieldRef]\n }\n\n var fields = Object.keys(this._fields)\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i]\n accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName]\n }\n\n this.averageFieldLength = accumulator\n}\n\n/**\n * Builds a vector space model of every document using lunr.Vector\n *\n * @private\n */\nlunr.Builder.prototype.createFieldVectors = function () {\n var fieldVectors = {},\n fieldRefs = Object.keys(this.fieldTermFrequencies),\n fieldRefsLength = fieldRefs.length,\n termIdfCache = Object.create(null)\n\n for (var i = 0; i < fieldRefsLength; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n fieldName = fieldRef.fieldName,\n fieldLength = this.fieldLengths[fieldRef],\n fieldVector = new lunr.Vector,\n termFrequencies = this.fieldTermFrequencies[fieldRef],\n terms = Object.keys(termFrequencies),\n termsLength = terms.length\n\n\n var fieldBoost = this._fields[fieldName].boost || 1,\n docBoost = this._documents[fieldRef.docRef].boost || 1\n\n for (var j = 0; j < termsLength; j++) {\n var term = terms[j],\n tf = termFrequencies[term],\n termIndex = this.invertedIndex[term]._index,\n idf, score, scoreWithPrecision\n\n if (termIdfCache[term] === undefined) {\n idf = lunr.idf(this.invertedIndex[term], this.documentCount)\n termIdfCache[term] = idf\n } else {\n idf = termIdfCache[term]\n }\n\n score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf)\n score *= fieldBoost\n score *= docBoost\n scoreWithPrecision = Math.round(score * 1000) / 1000\n // Converts 1.23456789 to 1.234.\n // Reducing the precision so that the vectors take up less\n // space when serialised. Doing it now so that they behave\n // the same before and after serialisation. Also, this is\n // the fastest approach to reducing a number's precision in\n // JavaScript.\n\n fieldVector.insert(termIndex, scoreWithPrecision)\n }\n\n fieldVectors[fieldRef] = fieldVector\n }\n\n this.fieldVectors = fieldVectors\n}\n\n/**\n * Creates a token set of all tokens in the index using lunr.TokenSet\n *\n * @private\n */\nlunr.Builder.prototype.createTokenSet = function () {\n this.tokenSet = lunr.TokenSet.fromArray(\n Object.keys(this.invertedIndex).sort()\n )\n}\n\n/**\n * Builds the index, creating an instance of lunr.Index.\n *\n * This completes the indexing process and should only be called\n * once all documents have been added to the index.\n *\n * @returns {lunr.Index}\n */\nlunr.Builder.prototype.build = function () {\n this.calculateAverageFieldLengths()\n this.createFieldVectors()\n this.createTokenSet()\n\n return new lunr.Index({\n invertedIndex: this.invertedIndex,\n fieldVectors: this.fieldVectors,\n tokenSet: this.tokenSet,\n fields: Object.keys(this._fields),\n pipeline: this.searchPipeline\n })\n}\n\n/**\n * Applies a plugin to the index builder.\n *\n * A plugin is a function that is called with the index builder as its context.\n * Plugins can be used to customise or extend the behaviour of the index\n * in some way. A plugin is just a function, that encapsulated the custom\n * behaviour that should be applied when building the index.\n *\n * The plugin function will be called with the index builder as its argument, additional\n * arguments can also be passed when calling use. The function will be called\n * with the index builder as its context.\n *\n * @param {Function} plugin The plugin to apply.\n */\nlunr.Builder.prototype.use = function (fn) {\n var args = Array.prototype.slice.call(arguments, 1)\n args.unshift(this)\n fn.apply(this, args)\n}\n/**\n * Contains and collects metadata about a matching document.\n * A single instance of lunr.MatchData is returned as part of every\n * lunr.Index~Result.\n *\n * @constructor\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n * @property {object} metadata - A cloned collection of metadata associated with this document.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData = function (term, field, metadata) {\n var clonedMetadata = Object.create(null),\n metadataKeys = Object.keys(metadata || {})\n\n // Cloning the metadata to prevent the original\n // being mutated during match data combination.\n // Metadata is kept in an array within the inverted\n // index so cloning the data can be done with\n // Array#slice\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n clonedMetadata[key] = metadata[key].slice()\n }\n\n this.metadata = Object.create(null)\n\n if (term !== undefined) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = clonedMetadata\n }\n}\n\n/**\n * An instance of lunr.MatchData will be created for every term that matches a\n * document. However only one instance is required in a lunr.Index~Result. This\n * method combines metadata from another instance of lunr.MatchData with this\n * objects metadata.\n *\n * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData.prototype.combine = function (otherMatchData) {\n var terms = Object.keys(otherMatchData.metadata)\n\n for (var i = 0; i < terms.length; i++) {\n var term = terms[i],\n fields = Object.keys(otherMatchData.metadata[term])\n\n if (this.metadata[term] == undefined) {\n this.metadata[term] = Object.create(null)\n }\n\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j],\n keys = Object.keys(otherMatchData.metadata[term][field])\n\n if (this.metadata[term][field] == undefined) {\n this.metadata[term][field] = Object.create(null)\n }\n\n for (var k = 0; k < keys.length; k++) {\n var key = keys[k]\n\n if (this.metadata[term][field][key] == undefined) {\n this.metadata[term][field][key] = otherMatchData.metadata[term][field][key]\n } else {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key])\n }\n\n }\n }\n }\n}\n\n/**\n * Add metadata for a term/field pair to this instance of match data.\n *\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n */\nlunr.MatchData.prototype.add = function (term, field, metadata) {\n if (!(term in this.metadata)) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = metadata\n return\n }\n\n if (!(field in this.metadata[term])) {\n this.metadata[term][field] = metadata\n return\n }\n\n var metadataKeys = Object.keys(metadata)\n\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n\n if (key in this.metadata[term][field]) {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key])\n } else {\n this.metadata[term][field][key] = metadata[key]\n }\n }\n}\n/**\n * A lunr.Query provides a programmatic way of defining queries to be performed\n * against a {@link lunr.Index}.\n *\n * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method\n * so the query object is pre-initialized with the right index fields.\n *\n * @constructor\n * @property {lunr.Query~Clause[]} clauses - An array of query clauses.\n * @property {string[]} allFields - An array of all available fields in a lunr.Index.\n */\nlunr.Query = function (allFields) {\n this.clauses = []\n this.allFields = allFields\n}\n\n/**\n * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause.\n *\n * This allows wildcards to be added to the beginning and end of a term without having to manually do any string\n * concatenation.\n *\n * The wildcard constants can be bitwise combined to select both leading and trailing wildcards.\n *\n * @constant\n * @default\n * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour\n * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists\n * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with trailing wildcard\n * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING })\n * @example query term with leading and trailing wildcard\n * query.term('foo', {\n * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING\n * })\n */\n\nlunr.Query.wildcard = new String (\"*\")\nlunr.Query.wildcard.NONE = 0\nlunr.Query.wildcard.LEADING = 1\nlunr.Query.wildcard.TRAILING = 2\n\n/**\n * Constants for indicating what kind of presence a term must have in matching documents.\n *\n * @constant\n * @enum {number}\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with required presence\n * query.term('foo', { presence: lunr.Query.presence.REQUIRED })\n */\nlunr.Query.presence = {\n /**\n * Term's presence in a document is optional, this is the default value.\n */\n OPTIONAL: 1,\n\n /**\n * Term's presence in a document is required, documents that do not contain\n * this term will not be returned.\n */\n REQUIRED: 2,\n\n /**\n * Term's presence in a document is prohibited, documents that do contain\n * this term will not be returned.\n */\n PROHIBITED: 3\n}\n\n/**\n * A single clause in a {@link lunr.Query} contains a term and details on how to\n * match that term against a {@link lunr.Index}.\n *\n * @typedef {Object} lunr.Query~Clause\n * @property {string[]} fields - The fields in an index this clause should be matched against.\n * @property {number} [boost=1] - Any boost that should be applied when matching this clause.\n * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be.\n * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline.\n * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended.\n * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents.\n */\n\n/**\n * Adds a {@link lunr.Query~Clause} to this query.\n *\n * Unless the clause contains the fields to be matched all fields will be matched. In addition\n * a default boost of 1 is applied to the clause.\n *\n * @param {lunr.Query~Clause} clause - The clause to add to this query.\n * @see lunr.Query~Clause\n * @returns {lunr.Query}\n */\nlunr.Query.prototype.clause = function (clause) {\n if (!('fields' in clause)) {\n clause.fields = this.allFields\n }\n\n if (!('boost' in clause)) {\n clause.boost = 1\n }\n\n if (!('usePipeline' in clause)) {\n clause.usePipeline = true\n }\n\n if (!('wildcard' in clause)) {\n clause.wildcard = lunr.Query.wildcard.NONE\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) {\n clause.term = \"*\" + clause.term\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) {\n clause.term = \"\" + clause.term + \"*\"\n }\n\n if (!('presence' in clause)) {\n clause.presence = lunr.Query.presence.OPTIONAL\n }\n\n this.clauses.push(clause)\n\n return this\n}\n\n/**\n * A negated query is one in which every clause has a presence of\n * prohibited. These queries require some special processing to return\n * the expected results.\n *\n * @returns boolean\n */\nlunr.Query.prototype.isNegated = function () {\n for (var i = 0; i < this.clauses.length; i++) {\n if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause}\n * to the list of clauses that make up this query.\n *\n * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion\n * to a token or token-like string should be done before calling this method.\n *\n * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an\n * array, each term in the array will share the same options.\n *\n * @param {object|object[]} term - The term(s) to add to the query.\n * @param {object} [options] - Any additional properties to add to the query clause.\n * @returns {lunr.Query}\n * @see lunr.Query#clause\n * @see lunr.Query~Clause\n * @example adding a single term to a query\n * query.term(\"foo\")\n * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard\n * query.term(\"foo\", {\n * fields: [\"title\"],\n * boost: 10,\n * wildcard: lunr.Query.wildcard.TRAILING\n * })\n * @example using lunr.tokenizer to convert a string to tokens before using them as terms\n * query.term(lunr.tokenizer(\"foo bar\"))\n */\nlunr.Query.prototype.term = function (term, options) {\n if (Array.isArray(term)) {\n term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this)\n return this\n }\n\n var clause = options || {}\n clause.term = term.toString()\n\n this.clause(clause)\n\n return this\n}\nlunr.QueryParseError = function (message, start, end) {\n this.name = \"QueryParseError\"\n this.message = message\n this.start = start\n this.end = end\n}\n\nlunr.QueryParseError.prototype = new Error\nlunr.QueryLexer = function (str) {\n this.lexemes = []\n this.str = str\n this.length = str.length\n this.pos = 0\n this.start = 0\n this.escapeCharPositions = []\n}\n\nlunr.QueryLexer.prototype.run = function () {\n var state = lunr.QueryLexer.lexText\n\n while (state) {\n state = state(this)\n }\n}\n\nlunr.QueryLexer.prototype.sliceString = function () {\n var subSlices = [],\n sliceStart = this.start,\n sliceEnd = this.pos\n\n for (var i = 0; i < this.escapeCharPositions.length; i++) {\n sliceEnd = this.escapeCharPositions[i]\n subSlices.push(this.str.slice(sliceStart, sliceEnd))\n sliceStart = sliceEnd + 1\n }\n\n subSlices.push(this.str.slice(sliceStart, this.pos))\n this.escapeCharPositions.length = 0\n\n return subSlices.join('')\n}\n\nlunr.QueryLexer.prototype.emit = function (type) {\n this.lexemes.push({\n type: type,\n str: this.sliceString(),\n start: this.start,\n end: this.pos\n })\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.escapeCharacter = function () {\n this.escapeCharPositions.push(this.pos - 1)\n this.pos += 1\n}\n\nlunr.QueryLexer.prototype.next = function () {\n if (this.pos >= this.length) {\n return lunr.QueryLexer.EOS\n }\n\n var char = this.str.charAt(this.pos)\n this.pos += 1\n return char\n}\n\nlunr.QueryLexer.prototype.width = function () {\n return this.pos - this.start\n}\n\nlunr.QueryLexer.prototype.ignore = function () {\n if (this.start == this.pos) {\n this.pos += 1\n }\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.backup = function () {\n this.pos -= 1\n}\n\nlunr.QueryLexer.prototype.acceptDigitRun = function () {\n var char, charCode\n\n do {\n char = this.next()\n charCode = char.charCodeAt(0)\n } while (charCode > 47 && charCode < 58)\n\n if (char != lunr.QueryLexer.EOS) {\n this.backup()\n }\n}\n\nlunr.QueryLexer.prototype.more = function () {\n return this.pos < this.length\n}\n\nlunr.QueryLexer.EOS = 'EOS'\nlunr.QueryLexer.FIELD = 'FIELD'\nlunr.QueryLexer.TERM = 'TERM'\nlunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE'\nlunr.QueryLexer.BOOST = 'BOOST'\nlunr.QueryLexer.PRESENCE = 'PRESENCE'\n\nlunr.QueryLexer.lexField = function (lexer) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.FIELD)\n lexer.ignore()\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexTerm = function (lexer) {\n if (lexer.width() > 1) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.TERM)\n }\n\n lexer.ignore()\n\n if (lexer.more()) {\n return lunr.QueryLexer.lexText\n }\n}\n\nlunr.QueryLexer.lexEditDistance = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.EDIT_DISTANCE)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexBoost = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.BOOST)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexEOS = function (lexer) {\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n}\n\n// This matches the separator used when tokenising fields\n// within a document. These should match otherwise it is\n// not possible to search for some tokens within a document.\n//\n// It is possible for the user to change the separator on the\n// tokenizer so it _might_ clash with any other of the special\n// characters already used within the search string, e.g. :.\n//\n// This means that it is possible to change the separator in\n// such a way that makes some words unsearchable using a search\n// string.\nlunr.QueryLexer.termSeparator = lunr.tokenizer.separator\n\nlunr.QueryLexer.lexText = function (lexer) {\n while (true) {\n var char = lexer.next()\n\n if (char == lunr.QueryLexer.EOS) {\n return lunr.QueryLexer.lexEOS\n }\n\n // Escape character is '\\'\n if (char.charCodeAt(0) == 92) {\n lexer.escapeCharacter()\n continue\n }\n\n if (char == \":\") {\n return lunr.QueryLexer.lexField\n }\n\n if (char == \"~\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexEditDistance\n }\n\n if (char == \"^\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexBoost\n }\n\n // \"+\" indicates term presence is required\n // checking for length to ensure that only\n // leading \"+\" are considered\n if (char == \"+\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n // \"-\" indicates term presence is prohibited\n // checking for length to ensure that only\n // leading \"-\" are considered\n if (char == \"-\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n if (char.match(lunr.QueryLexer.termSeparator)) {\n return lunr.QueryLexer.lexTerm\n }\n }\n}\n\nlunr.QueryParser = function (str, query) {\n this.lexer = new lunr.QueryLexer (str)\n this.query = query\n this.currentClause = {}\n this.lexemeIdx = 0\n}\n\nlunr.QueryParser.prototype.parse = function () {\n this.lexer.run()\n this.lexemes = this.lexer.lexemes\n\n var state = lunr.QueryParser.parseClause\n\n while (state) {\n state = state(this)\n }\n\n return this.query\n}\n\nlunr.QueryParser.prototype.peekLexeme = function () {\n return this.lexemes[this.lexemeIdx]\n}\n\nlunr.QueryParser.prototype.consumeLexeme = function () {\n var lexeme = this.peekLexeme()\n this.lexemeIdx += 1\n return lexeme\n}\n\nlunr.QueryParser.prototype.nextClause = function () {\n var completedClause = this.currentClause\n this.query.clause(completedClause)\n this.currentClause = {}\n}\n\nlunr.QueryParser.parseClause = function (parser) {\n var lexeme = parser.peekLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.type) {\n case lunr.QueryLexer.PRESENCE:\n return lunr.QueryParser.parsePresence\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expected either a field or a term, found \" + lexeme.type\n\n if (lexeme.str.length >= 1) {\n errorMessage += \" with value '\" + lexeme.str + \"'\"\n }\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n}\n\nlunr.QueryParser.parsePresence = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.str) {\n case \"-\":\n parser.currentClause.presence = lunr.Query.presence.PROHIBITED\n break\n case \"+\":\n parser.currentClause.presence = lunr.Query.presence.REQUIRED\n break\n default:\n var errorMessage = \"unrecognised presence operator'\" + lexeme.str + \"'\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term or field, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term or field, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseField = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n if (parser.query.allFields.indexOf(lexeme.str) == -1) {\n var possibleFields = parser.query.allFields.map(function (f) { return \"'\" + f + \"'\" }).join(', '),\n errorMessage = \"unrecognised field '\" + lexeme.str + \"', possible fields: \" + possibleFields\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.fields = [lexeme.str]\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseTerm = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n parser.currentClause.term = lexeme.str.toLowerCase()\n\n if (lexeme.str.indexOf(\"*\") != -1) {\n parser.currentClause.usePipeline = false\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseEditDistance = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var editDistance = parseInt(lexeme.str, 10)\n\n if (isNaN(editDistance)) {\n var errorMessage = \"edit distance must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.editDistance = editDistance\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseBoost = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var boost = parseInt(lexeme.str, 10)\n\n if (isNaN(boost)) {\n var errorMessage = \"boost must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.boost = boost\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\n /**\n * export the module via AMD, CommonJS or as a browser global\n * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js\n */\n ;(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory)\n } else if (typeof exports === 'object') {\n /**\n * Node. Does not work with strict CommonJS, but\n * only CommonJS-like enviroments that support module.exports,\n * like Node.\n */\n module.exports = factory()\n } else {\n // Browser globals (root is window)\n root.lunr = factory()\n }\n }(this, function () {\n /**\n * Just return a value to define the module export.\n * This example returns an object, but the module\n * can return a function as the exported value.\n */\n return lunr\n }))\n})();\n", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport lunr from \"lunr\"\n\nimport \"~/polyfills\"\n\nimport { Search, SearchIndexConfig } from \"../../_\"\nimport {\n SearchMessage,\n SearchMessageType\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Add support for usage with `iframe-worker` polyfill\n *\n * While `importScripts` is synchronous when executed inside of a web worker,\n * it's not possible to provide a synchronous polyfilled implementation. The\n * cool thing is that awaiting a non-Promise is a noop, so extending the type\n * definition to return a `Promise` shouldn't break anything.\n *\n * @see https://bit.ly/2PjDnXi - GitHub comment\n */\ndeclare global {\n function importScripts(...urls: string[]): Promise | void\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nlet index: Search\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch (= import) multi-language support through `lunr-languages`\n *\n * This function automatically imports the stemmers necessary to process the\n * languages, which are defined through the search index configuration.\n *\n * If the worker runs inside of an `iframe` (when using `iframe-worker` as\n * a shim), the base URL for the stemmers to be loaded must be determined by\n * searching for the first `script` element with a `src` attribute, which will\n * contain the contents of this script.\n *\n * @param config - Search index configuration\n *\n * @returns Promise resolving with no result\n */\nasync function setupSearchLanguages(\n config: SearchIndexConfig\n): Promise {\n let base = \"../lunr\"\n\n /* Detect `iframe-worker` and fix base URL */\n if (typeof parent !== \"undefined\" && \"IFrameWorker\" in parent) {\n const worker = document.querySelector(\"script[src]\")!\n const [path] = worker.src.split(\"/worker\")\n\n /* Prefix base with path */\n base = base.replace(\"..\", path)\n }\n\n /* Add scripts for languages */\n const scripts = []\n for (const lang of config.lang) {\n switch (lang) {\n\n /* Add segmenter for Japanese */\n case \"ja\":\n scripts.push(`${base}/tinyseg.js`)\n break\n\n /* Add segmenter for Hindi and Thai */\n case \"hi\":\n case \"th\":\n scripts.push(`${base}/wordcut.js`)\n break\n }\n\n /* Add language support */\n if (lang !== \"en\")\n scripts.push(`${base}/min/lunr.${lang}.min.js`)\n }\n\n /* Add multi-language support */\n if (config.lang.length > 1)\n scripts.push(`${base}/min/lunr.multi.min.js`)\n\n /* Load scripts synchronously */\n if (scripts.length)\n await importScripts(\n `${base}/min/lunr.stemmer.support.min.js`,\n ...scripts\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Message handler\n *\n * @param message - Source message\n *\n * @returns Target message\n */\nexport async function handler(\n message: SearchMessage\n): Promise {\n switch (message.type) {\n\n /* Search setup message */\n case SearchMessageType.SETUP:\n await setupSearchLanguages(message.data.config)\n index = new Search(message.data)\n return {\n type: SearchMessageType.READY\n }\n\n /* Search query message */\n case SearchMessageType.QUERY:\n return {\n type: SearchMessageType.RESULT,\n data: index ? index.search(message.data) : { items: [] }\n }\n\n /* All other messages */\n default:\n throw new TypeError(\"Invalid message type\")\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Worker\n * ------------------------------------------------------------------------- */\n\n/* @ts-expect-error - expose Lunr.js in global scope, or stemmers won't work */\nself.lunr = lunr\n\n/* Handle messages */\naddEventListener(\"message\", async ev => {\n postMessage(await handler(ev.data))\n})\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Polyfills\n * ------------------------------------------------------------------------- */\n\n/* Polyfill `Object.entries` */\nif (!Object.entries)\n Object.entries = function (obj: object) {\n const data: [string, string][] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push([key, obj[key]])\n\n /* Return entries */\n return data\n }\n\n/* Polyfill `Object.values` */\nif (!Object.values)\n Object.values = function (obj: object) {\n const data: string[] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push(obj[key])\n\n /* Return values */\n return data\n }\n\n/* ------------------------------------------------------------------------- */\n\n/* Polyfills for `Element` */\nif (typeof Element !== \"undefined\") {\n\n /* Polyfill `Element.scrollTo` */\n if (!Element.prototype.scrollTo)\n Element.prototype.scrollTo = function (\n x?: ScrollToOptions | number, y?: number\n ): void {\n if (typeof x === \"object\") {\n this.scrollLeft = x.left!\n this.scrollTop = x.top!\n } else {\n this.scrollLeft = x!\n this.scrollTop = y!\n }\n }\n\n /* Polyfill `Element.replaceWith` */\n if (!Element.prototype.replaceWith)\n Element.prototype.replaceWith = function (\n ...nodes: Array\n ): void {\n const parent = this.parentNode\n if (parent) {\n if (nodes.length === 0)\n parent.removeChild(this)\n\n /* Replace children and create text nodes */\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i]\n if (typeof node === \"string\")\n node = document.createTextNode(node)\n else if (node.parentNode)\n node.parentNode.removeChild(node)\n\n /* Replace child or insert before previous sibling */\n if (!i)\n parent.replaceChild(node, this)\n else\n parent.insertBefore(this.previousSibling!, node)\n }\n }\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexDocument } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search document\n */\nexport interface SearchDocument extends SearchIndexDocument {\n parent?: SearchIndexDocument /* Parent article */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search document mapping\n */\nexport type SearchDocumentMap = Map\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document mapping\n *\n * @param docs - Search index documents\n *\n * @returns Search document map\n */\nexport function setupSearchDocumentMap(\n docs: SearchIndexDocument[]\n): SearchDocumentMap {\n const documents = new Map()\n const parents = new Set()\n for (const doc of docs) {\n const [path, hash] = doc.location.split(\"#\")\n\n /* Extract location, title and tags */\n const location = doc.location\n const title = doc.title\n const tags = doc.tags\n\n /* Escape and cleanup text */\n const text = escapeHTML(doc.text)\n .replace(/\\s+(?=[,.:;!?])/g, \"\")\n .replace(/\\s+/g, \" \")\n\n /* Handle section */\n if (hash) {\n const parent = documents.get(path)!\n\n /* Ignore first section, override article */\n if (!parents.has(parent)) {\n parent.title = doc.title\n parent.text = text\n\n /* Remember that we processed the article */\n parents.add(parent)\n\n /* Add subsequent section */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n parent\n })\n }\n\n /* Add article */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n ...tags && { tags }\n })\n }\n }\n return documents\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexConfig } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlight function\n *\n * @param value - Value\n *\n * @returns Highlighted value\n */\nexport type SearchHighlightFn = (value: string) => string\n\n/**\n * Search highlight factory function\n *\n * @param query - Query value\n *\n * @returns Search highlight function\n */\nexport type SearchHighlightFactoryFn = (query: string) => SearchHighlightFn\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search highlighter\n *\n * @param config - Search index configuration\n * @param escape - Whether to escape HTML\n *\n * @returns Search highlight factory function\n */\nexport function setupSearchHighlighter(\n config: SearchIndexConfig, escape: boolean\n): SearchHighlightFactoryFn {\n const separator = new RegExp(config.separator, \"img\")\n const highlight = (_: unknown, data: string, term: string) => {\n return `${data}${term}`\n }\n\n /* Return factory function */\n return (query: string) => {\n query = query\n .replace(/[\\s*+\\-:~^]+/g, \" \")\n .trim()\n\n /* Create search term match expression */\n const match = new RegExp(`(^|${config.separator})(${\n query\n .replace(/[|\\\\{}()[\\]^$+*?.-]/g, \"\\\\$&\")\n .replace(separator, \"|\")\n })`, \"img\")\n\n /* Highlight string value */\n return value => (\n escape\n ? escapeHTML(value)\n : value\n )\n .replace(match, highlight)\n .replace(/<\\/mark>(\\s+)]*>/img, \"$1\")\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query clause\n */\nexport interface SearchQueryClause {\n presence: lunr.Query.presence /* Clause presence */\n term: string /* Clause term */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search query terms\n */\nexport type SearchQueryTerms = Record\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Parse a search query for analysis\n *\n * @param value - Query value\n *\n * @returns Search query clauses\n */\nexport function parseSearchQuery(\n value: string\n): SearchQueryClause[] {\n const query = new (lunr as any).Query([\"title\", \"text\"])\n const parser = new (lunr as any).QueryParser(value, query)\n\n /* Parse and return query clauses */\n parser.parse()\n return query.clauses\n}\n\n/**\n * Analyze the search query clauses in regard to the search terms found\n *\n * @param query - Search query clauses\n * @param terms - Search terms\n *\n * @returns Search query terms\n */\nexport function getSearchQueryTerms(\n query: SearchQueryClause[], terms: string[]\n): SearchQueryTerms {\n const clauses = new Set(query)\n\n /* Match query clauses against terms */\n const result: SearchQueryTerms = {}\n for (let t = 0; t < terms.length; t++)\n for (const clause of clauses)\n if (terms[t].startsWith(clause.term)) {\n result[clause.term] = true\n clauses.delete(clause)\n }\n\n /* Annotate unmatched non-stopword query clauses */\n for (const clause of clauses)\n if (lunr.stopWordFilter?.(clause.term as any))\n result[clause.term] = false\n\n /* Return query terms */\n return result\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n SearchDocument,\n SearchDocumentMap,\n setupSearchDocumentMap\n} from \"../document\"\nimport {\n SearchHighlightFactoryFn,\n setupSearchHighlighter\n} from \"../highlighter\"\nimport { SearchOptions } from \"../options\"\nimport {\n SearchQueryTerms,\n getSearchQueryTerms,\n parseSearchQuery\n} from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index configuration\n */\nexport interface SearchIndexConfig {\n lang: string[] /* Search languages */\n separator: string /* Search separator */\n}\n\n/**\n * Search index document\n */\nexport interface SearchIndexDocument {\n location: string /* Document location */\n title: string /* Document title */\n text: string /* Document text */\n tags?: string[] /* Document tags */\n boost?: number /* Document boost */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index\n *\n * This interfaces describes the format of the `search_index.json` file which\n * is automatically built by the MkDocs search plugin.\n */\nexport interface SearchIndex {\n config: SearchIndexConfig /* Search index configuration */\n docs: SearchIndexDocument[] /* Search index documents */\n options: SearchOptions /* Search options */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search metadata\n */\nexport interface SearchMetadata {\n score: number /* Score (relevance) */\n terms: SearchQueryTerms /* Search query terms */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search result document\n */\nexport type SearchResultDocument = SearchDocument & SearchMetadata\n\n/**\n * Search result item\n */\nexport type SearchResultItem = SearchResultDocument[]\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search result\n */\nexport interface SearchResult {\n items: SearchResultItem[] /* Search result items */\n suggestions?: string[] /* Search suggestions */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Compute the difference of two lists of strings\n *\n * @param a - 1st list of strings\n * @param b - 2nd list of strings\n *\n * @returns Difference\n */\nfunction difference(a: string[], b: string[]): string[] {\n const [x, y] = [new Set(a), new Set(b)]\n return [\n ...new Set([...x].filter(value => !y.has(value)))\n ]\n}\n\n/* ----------------------------------------------------------------------------\n * Class\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nexport class Search {\n\n /**\n * Search document mapping\n *\n * A mapping of URLs (including hash fragments) to the actual articles and\n * sections of the documentation. The search document mapping must be created\n * regardless of whether the index was prebuilt or not, as Lunr.js itself\n * only stores the actual index.\n */\n protected documents: SearchDocumentMap\n\n /**\n * Search highlight factory function\n */\n protected highlight: SearchHighlightFactoryFn\n\n /**\n * The underlying Lunr.js search index\n */\n protected index: lunr.Index\n\n /**\n * Search options\n */\n protected options: SearchOptions\n\n /**\n * Create the search integration\n *\n * @param data - Search index\n */\n public constructor({ config, docs, options }: SearchIndex) {\n this.options = options\n\n /* Set up document map and highlighter factory */\n this.documents = setupSearchDocumentMap(docs)\n this.highlight = setupSearchHighlighter(config, false)\n\n /* Set separator for tokenizer */\n lunr.tokenizer.separator = new RegExp(config.separator)\n\n /* Create search index */\n this.index = lunr(function () {\n\n /* Set up multi-language support */\n if (config.lang.length === 1 && config.lang[0] !== \"en\") {\n this.use((lunr as any)[config.lang[0]])\n } else if (config.lang.length > 1) {\n this.use((lunr as any).multiLanguage(...config.lang))\n }\n\n /* Compute functions to be removed from the pipeline */\n const fns = difference([\n \"trimmer\", \"stopWordFilter\", \"stemmer\"\n ], options.pipeline)\n\n /* Remove functions from the pipeline for registered languages */\n for (const lang of config.lang.map(language => (\n language === \"en\" ? lunr : (lunr as any)[language]\n ))) {\n for (const fn of fns) {\n this.pipeline.remove(lang[fn])\n this.searchPipeline.remove(lang[fn])\n }\n }\n\n /* Set up reference */\n this.ref(\"location\")\n\n /* Set up fields */\n this.field(\"title\", { boost: 1e3 })\n this.field(\"text\")\n this.field(\"tags\", { boost: 1e6, extractor: doc => {\n const { tags = [] } = doc as SearchDocument\n return tags.reduce((list, tag) => [\n ...list,\n ...lunr.tokenizer(tag)\n ], [] as lunr.Token[])\n } })\n\n /* Index documents */\n for (const doc of docs)\n this.add(doc, { boost: doc.boost })\n })\n }\n\n /**\n * Search for matching documents\n *\n * The search index which MkDocs provides is divided up into articles, which\n * contain the whole content of the individual pages, and sections, which only\n * contain the contents of the subsections obtained by breaking the individual\n * pages up at `h1` ... `h6`. As there may be many sections on different pages\n * with identical titles (for example within this very project, e.g. \"Usage\"\n * or \"Installation\"), they need to be put into the context of the containing\n * page. For this reason, section results are grouped within their respective\n * articles which are the top-level results that are returned.\n *\n * @param query - Query value\n *\n * @returns Search results\n */\n public search(query: string): SearchResult {\n if (query) {\n try {\n const highlight = this.highlight(query)\n\n /* Parse query to extract clauses for analysis */\n const clauses = parseSearchQuery(query)\n .filter(clause => (\n clause.presence !== lunr.Query.presence.PROHIBITED\n ))\n\n /* Perform search and post-process results */\n const groups = this.index.search(`${query}*`)\n\n /* Apply post-query boosts based on title and search query terms */\n .reduce((item, { ref, score, matchData }) => {\n const document = this.documents.get(ref)\n if (typeof document !== \"undefined\") {\n const { location, title, text, tags, parent } = document\n\n /* Compute and analyze search query terms */\n const terms = getSearchQueryTerms(\n clauses,\n Object.keys(matchData.metadata)\n )\n\n /* Highlight title and text and apply post-query boosts */\n const boost = +!parent + +Object.values(terms).every(t => t)\n item.push({\n location,\n title: highlight(title),\n text: highlight(text),\n ...tags && { tags: tags.map(highlight) },\n score: score * (1 + boost),\n terms\n })\n }\n return item\n }, [])\n\n /* Sort search results again after applying boosts */\n .sort((a, b) => b.score - a.score)\n\n /* Group search results by page */\n .reduce((items, result) => {\n const document = this.documents.get(result.location)\n if (typeof document !== \"undefined\") {\n const ref = \"parent\" in document\n ? document.parent!.location\n : document.location\n items.set(ref, [...items.get(ref) || [], result])\n }\n return items\n }, new Map())\n\n /* Generate search suggestions, if desired */\n let suggestions: string[] | undefined\n if (this.options.suggestions) {\n const titles = this.index.query(builder => {\n for (const clause of clauses)\n builder.term(clause.term, {\n fields: [\"title\"],\n presence: lunr.Query.presence.REQUIRED,\n wildcard: lunr.Query.wildcard.TRAILING\n })\n })\n\n /* Retrieve suggestions for best match */\n suggestions = titles.length\n ? Object.keys(titles[0].matchData.metadata)\n : []\n }\n\n /* Return items and suggestions */\n return {\n items: [...groups.values()],\n ...typeof suggestions !== \"undefined\" && { suggestions }\n }\n\n /* Log errors to console (for now) */\n } catch {\n console.warn(`Invalid query: ${query} \u2013 see https://bit.ly/2s3ChXG`)\n }\n }\n\n /* Return nothing in case of error or empty query */\n return { items: [] }\n }\n}\n"], + "mappings": "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L,CAAI,KACrDD,EAAIC,EAER,CAEA,OAAAG,EAAKP,EACLQ,EAAMzB,EACFwB,EAAG,KAAKJ,CAAC,GAAKK,EAAI,KAAKL,CAAC,IAC1BI,EAAKjB,EACLa,EAAIA,EAAE,QAAQI,EAAG,EAAE,GAKjBD,GAAW,MACbH,EAAIG,EAAQ,YAAY,EAAIH,EAAE,OAAO,CAAC,GAGjCA,CACT,EAEA,OAAO,SAAUhD,EAAO,CACtB,OAAOA,EAAM,OAAO+C,CAAa,CACnC,CACF,EAAG,EAEHpG,EAAK,SAAS,iBAAiBA,EAAK,QAAS,SAAS,EACtD;AAAA;AAAA;AAAA,GAkBAA,EAAK,uBAAyB,SAAU8G,EAAW,CACjD,IAAIC,EAAQD,EAAU,OAAO,SAAU7D,EAAM+D,EAAU,CACrD,OAAA/D,EAAK+D,GAAYA,EACV/D,CACT,EAAG,CAAC,CAAC,EAEL,OAAO,SAAUI,EAAO,CACtB,GAAIA,GAAS0D,EAAM1D,EAAM,SAAS,KAAOA,EAAM,SAAS,EAAG,OAAOA,CACpE,CACF,EAeArD,EAAK,eAAiBA,EAAK,uBAAuB,CAChD,IACA,OACA,QACA,SACA,QACA,MACA,SACA,OACA,KACA,QACA,KACA,MACA,MACA,MACA,KACA,KACA,KACA,UACA,OACA,MACA,KACA,MACA,SACA,QACA,OACA,MACA,KACA,OACA,SACA,OACA,OACA,QACA,MACA,OACA,MACA,MACA,MACA,MACA,OACA,KACA,MACA,OACA,MACA,MACA,MACA,UACA,IACA,KACA,KACA,OACA,KACA,KACA,MACA,OACA,QACA,MACA,OACA,SACA,MACA,KACA,QACA,OACA,OACA,KACA,UACA,KACA,MACA,MACA,KACA,MACA,QACA,KACA,OACA,KACA,QACA,MACA,MACA,SACA,OACA,MACA,OACA,MACA,SACA,QACA,KACA,OACA,OACA,OACA,MACA,QACA,OACA,OACA,QACA,QACA,OACA,OACA,MACA,KACA,MACA,OACA,KACA,QACA,MACA,KACA,OACA,OACA,OACA,QACA,QACA,QACA,MACA,OACA,MACA,OACA,OACA,QACA,MACA,MACA,MACF,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", + "names": ["require_lunr", "__commonJSMin", "exports", "module", "lunr", "config", "builder", "global", "message", "obj", "clone", "keys", "key", "val", "docRef", "fieldName", "stringValue", "s", "n", "fieldRef", "elements", "i", "other", "object", "a", "b", "intersection", "element", "posting", "documentCount", "documentsWithTerm", "x", "str", "metadata", "fn", "t", "len", "tokens", "sliceEnd", "sliceStart", "char", "sliceLength", "tokenMetadata", "label", "isRegistered", "serialised", "pipeline", "fnName", "fns", "existingFn", "newFn", "pos", "stackLength", "memo", "j", "result", "k", "token", "index", "start", "end", "pivotPoint", "pivotIndex", "insertIdx", "position", "sumOfSquares", "elementsLength", "otherVector", "dotProduct", "aLen", "bLen", "aVal", "bVal", "output", "step2list", "step3list", "c", "v", "C", "V", "mgr0", "meq1", "mgr1", "s_v", "re_mgr0", "re_mgr1", "re_meq1", "re_s_v", "re_1a", "re2_1a", "re_1b", "re2_1b", "re_1b_2", "re2_1b_2", "re3_1b_2", "re4_1b_2", "re_1c", "re_2", "re_3", "re_4", "re2_4", "re_5", "re_5_1", "re3_5", "porterStemmer", "w", "stem", "suffix", "firstch", "re", "re2", "re3", "re4", "fp", "stopWords", "words", "stopWord", "arr", "clause", "editDistance", "root", "stack", "frame", "noEditNode", "insertionNode", "substitutionNode", "charA", "charB", "transposeNode", "node", "final", "next", "edges", "edge", "labels", "qEdges", "qLen", "nEdges", "nLen", "q", "qEdge", "nEdge", "qNode", "word", "commonPrefix", "nextNode", "downTo", "childKey", "attrs", "queryString", "query", "parser", "matchingFields", "queryVectors", "termFieldCache", "requiredMatches", "prohibitedMatches", "terms", "clauseMatches", "m", "term", "termTokenSet", "expandedTerms", "field", "expandedTerm", "termIndex", "fieldPosting", "matchingDocumentRefs", "termField", "matchingDocumentsSet", "l", "matchingDocumentRef", "matchingFieldRef", "fieldMatch", "allRequiredMatches", "allProhibitedMatches", "matchingFieldRefs", "results", "matches", "fieldVector", "score", "docMatch", "match", "invertedIndex", "fieldVectors", "ref", "serializedIndex", "serializedVectors", "serializedInvertedIndex", "tokenSetBuilder", "tuple", "attributes", "number", "doc", "fields", "extractor", "fieldTerms", "metadataKey", "fieldRefs", "numberOfFields", "accumulator", "documentsWithField", "fieldRefsLength", "termIdfCache", "fieldLength", "termFrequencies", "termsLength", "fieldBoost", "docBoost", "tf", "idf", "scoreWithPrecision", "args", "clonedMetadata", "metadataKeys", "otherMatchData", "allFields", "options", "state", "subSlices", "type", "charCode", "lexer", "lexeme", "completedClause", "errorMessage", "nextLexeme", "possibleFields", "f", "boost", "factory", "require_escape_html", "__commonJSMin", "exports", "module", "matchHtmlRegExp", "escapeHtml", "string", "str", "match", "escape", "html", "index", "lastIndex", "import_lunr", "obj", "data", "key", "x", "y", "nodes", "parent", "i", "node", "import_escape_html", "setupSearchDocumentMap", "docs", "documents", "parents", "doc", "path", "hash", "location", "title", "tags", "text", "escapeHTML", "parent", "__spreadValues", "import_escape_html", "setupSearchHighlighter", "config", "escape", "separator", "highlight", "_", "data", "term", "query", "match", "value", "escapeHTML", "parseSearchQuery", "value", "query", "getSearchQueryTerms", "terms", "_a", "clauses", "result", "t", "clause", "difference", "a", "b", "x", "y", "value", "Search", "config", "docs", "options", "setupSearchDocumentMap", "setupSearchHighlighter", "fns", "lang", "language", "fn", "doc", "tags", "list", "tag", "query", "highlight", "clauses", "parseSearchQuery", "clause", "groups", "item", "ref", "score", "matchData", "document", "location", "title", "text", "parent", "terms", "getSearchQueryTerms", "boost", "t", "__spreadProps", "__spreadValues", "items", "result", "suggestions", "titles", "builder", "e", "index", "setupSearchLanguages", "config", "__async", "base", "worker", "path", "scripts", "lang", "handler", "message", "Search", "lunr", "ev"] +} diff --git a/assets/stylesheets/extra.0d2c79a8.min.css b/assets/stylesheets/extra.0d2c79a8.min.css new file mode 100644 index 0000000..6e23ef1 --- /dev/null +++ b/assets/stylesheets/extra.0d2c79a8.min.css @@ -0,0 +1 @@ +@charset "UTF-8";@keyframes แดดโ‚’แดดโ‚’แดดโ‚’{0%{transform:translate3d(var(--left-start),0,0)}to{transform:translate3d(var(--left-end),110vh,0)}}.แดดโ‚’แดดโ‚’แดดโ‚’{--size:1vw;background:#fff;border:1px solid #ddd;border-radius:50%;cursor:pointer;height:var(--size);opacity:1;position:fixed;top:-5vh;transition:opacity 1s;width:var(--size);z-index:10}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):first-child{--size:0.4vw;--left-start:7vw;--left-end:-8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 12s linear infinite both;animation-delay:-4s;left:24vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(2){--size:0.4vw;--left-start:9vw;--left-end:0vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 18s linear infinite both;animation-delay:-2s;left:68vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(3){--size:0.4vw;--left-start:1vw;--left-end:7vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-6s;left:10vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(4){--size:0.5vw;--left-start:8vw;--left-end:10vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 18s linear infinite both;animation-delay:-8s;left:63vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(5){--size:0.5vw;--left-start:5vw;--left-end:9vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-4s;left:58vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(6){--size:0.1vw;--left-start:3vw;--left-end:10vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-1s;left:55vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(7){--size:0.2vw;--left-start:-2vw;--left-end:6vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-7s;left:50vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(8){--size:0.3vw;--left-start:7vw;--left-end:7vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-3s;left:65vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(9){--size:0.2vw;--left-start:4vw;--left-end:5vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-2s;left:1vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(10){--size:0.3vw;--left-start:2vw;--left-end:-3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 12s linear infinite both;animation-delay:-10s;left:92vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(11){--size:0.2vw;--left-start:1vw;--left-end:8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-6s;left:5vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(12){--size:0.4vw;--left-start:9vw;--left-end:1vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 18s linear infinite both;animation-delay:-3s;left:77vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(13){--size:0.1vw;--left-start:-3vw;--left-end:3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 18s linear infinite both;animation-delay:-7s;left:93vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(14){--size:0.5vw;--left-start:0vw;--left-end:-5vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 12s linear infinite both;animation-delay:-4s;left:35vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(15){--size:0.1vw;--left-start:-9vw;--left-end:4vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 20s linear infinite both;animation-delay:-6s;left:15vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(16){--size:0.1vw;--left-start:1vw;--left-end:9vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 17s linear infinite both;animation-delay:-6s;left:100vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(17){--size:0.1vw;--left-start:1vw;--left-end:0vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 17s linear infinite both;animation-delay:-1s;left:44vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(18){--size:0.4vw;--left-start:-9vw;--left-end:-9vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 16s linear infinite both;animation-delay:-6s;left:69vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(19){--size:0.2vw;--left-start:3vw;--left-end:-8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-1s;left:32vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(20){--size:0.1vw;--left-start:-7vw;--left-end:8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-8s;left:59vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(21){--size:0.2vw;--left-start:-1vw;--left-end:-8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-6s;left:96vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(22){--size:0.2vw;--left-start:9vw;--left-end:1vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-7s;left:78vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(23){--size:0.4vw;--left-start:5vw;--left-end:-2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-10s;left:29vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(24){--size:0.1vw;--left-start:-4vw;--left-end:1vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 20s linear infinite both;animation-delay:-7s;left:83vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(25){--size:0.3vw;--left-start:-1vw;--left-end:2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-8s;left:95vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(26){--size:0.5vw;--left-start:-3vw;--left-end:-6vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 18s linear infinite both;animation-delay:-8s;left:74vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(27){--size:0.5vw;--left-start:9vw;--left-end:-9vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-2s;left:94vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(28){--size:0.1vw;--left-start:0vw;--left-end:-4vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-4s;left:95vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(29){--size:0.5vw;--left-start:8vw;--left-end:4vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-3s;left:42vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(30){--size:0.4vw;--left-start:-5vw;--left-end:0vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-10s;left:8vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(31){--size:0.4vw;--left-start:-7vw;--left-end:3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-4s;left:77vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(32){--size:0.4vw;--left-start:8vw;--left-end:-5vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-3s;left:80vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(33){--size:0.2vw;--left-start:-3vw;--left-end:8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 20s linear infinite both;animation-delay:-6s;left:15vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(34){--size:0.5vw;--left-start:5vw;--left-end:1vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-1s;left:91vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(35){--size:0.3vw;--left-start:-6vw;--left-end:-5vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-5s;left:93vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(36){--size:0.1vw;--left-start:10vw;--left-end:10vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-10s;left:59vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(37){--size:0.3vw;--left-start:4vw;--left-end:6vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-8s;left:35vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(38){--size:0.5vw;--left-start:8vw;--left-end:-3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-6s;left:6vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(39){--size:0.2vw;--left-start:-6vw;--left-end:-2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-7s;left:58vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(40){--size:0.4vw;--left-start:3vw;--left-end:-5vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-4s;left:15vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(41){--size:0.1vw;--left-start:2vw;--left-end:-7vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 17s linear infinite both;animation-delay:-7s;left:24vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(42){--size:0.3vw;--left-start:8vw;--left-end:3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-9s;left:36vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(43){--size:0.2vw;--left-start:-9vw;--left-end:-3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-10s;left:23vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(44){--size:0.1vw;--left-start:4vw;--left-end:-6vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 16s linear infinite both;animation-delay:-6s;left:9vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(45){--size:0.1vw;--left-start:-3vw;--left-end:-5vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 19s linear infinite both;animation-delay:-5s;left:62vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(46){--size:0.3vw;--left-start:0vw;--left-end:2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 20s linear infinite both;animation-delay:-4s;left:1vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(47){--size:0.4vw;--left-start:8vw;--left-end:-4vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-1s;left:76vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(48){--size:0.2vw;--left-start:5vw;--left-end:-3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-5s;left:19vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(49){--size:0.4vw;--left-start:1vw;--left-end:-1vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 18s linear infinite both;animation-delay:-4s;left:72vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(50){--size:0.4vw;--left-start:8vw;--left-end:-6vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 16s linear infinite both;animation-delay:-10s;left:25vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(51){--size:0.1vw;--left-start:-5vw;--left-end:-8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 17s linear infinite both;animation-delay:-9s;left:71vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(52){--size:0.4vw;--left-start:-4vw;--left-end:9vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-7s;left:30vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(53){--size:0.5vw;--left-start:-1vw;--left-end:-8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-4s;left:37vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(54){--size:0.4vw;--left-start:-1vw;--left-end:-1vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 12s linear infinite both;animation-delay:-9s;left:48vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(55){--size:0.5vw;--left-start:8vw;--left-end:6vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 20s linear infinite both;animation-delay:-6s;left:65vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(56){--size:0.4vw;--left-start:9vw;--left-end:5vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 18s linear infinite both;animation-delay:-6s;left:53vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(57){--size:0.4vw;--left-start:3vw;--left-end:-9vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 12s linear infinite both;animation-delay:-1s;left:76vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(58){--size:0.2vw;--left-start:-7vw;--left-end:0vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 16s linear infinite both;animation-delay:-9s;left:54vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(59){--size:0.1vw;--left-start:-9vw;--left-end:-2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 20s linear infinite both;animation-delay:-1s;left:66vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(60){--size:0.3vw;--left-start:-6vw;--left-end:2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-7s;left:91vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(61){--size:0.4vw;--left-start:6vw;--left-end:-8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-7s;left:35vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(62){--size:0.4vw;--left-start:-6vw;--left-end:2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 16s linear infinite both;animation-delay:-3s;left:86vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(63){--size:0.5vw;--left-start:-7vw;--left-end:7vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 20s linear infinite both;animation-delay:-5s;left:86vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(64){--size:0.2vw;--left-start:-9vw;--left-end:1vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-5s;left:53vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(65){--size:0.2vw;--left-start:-2vw;--left-end:3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-6s;left:56vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(66){--size:0.5vw;--left-start:1vw;--left-end:8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 17s linear infinite both;animation-delay:-5s;left:58vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(67){--size:0.5vw;--left-start:2vw;--left-end:9vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-5s;left:14vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(68){--size:0.3vw;--left-start:-1vw;--left-end:6vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-1s;left:100vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(69){--size:0.2vw;--left-start:9vw;--left-end:-2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-7s;left:8vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(70){--size:0.4vw;--left-start:-5vw;--left-end:8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 11s linear infinite both;animation-delay:-4s;left:82vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(71){--size:0.4vw;--left-start:3vw;--left-end:-7vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 13s linear infinite both;animation-delay:-6s;left:26vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(72){--size:0.2vw;--left-start:-2vw;--left-end:-3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 15s linear infinite both;animation-delay:-3s;left:24vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(73){--size:0.3vw;--left-start:-7vw;--left-end:-8vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 16s linear infinite both;animation-delay:-2s;left:2vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(74){--size:0.4vw;--left-start:-9vw;--left-end:-3vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 14s linear infinite both;animation-delay:-10s;left:94vw}.แดดโ‚’แดดโ‚’แดดโ‚’:not(.แดดโ‚’แดดโ‚’แดดโ‚’--gotcha):nth-child(75){--size:0.3vw;--left-start:7vw;--left-end:2vw;animation:แดดโ‚’แดดโ‚’แดดโ‚’ 17s linear infinite both;animation-delay:-2s;left:26vw}.แดดโ‚’แดดโ‚’แดดโ‚’:nth-child(5n){filter:blur(2px)}.แดดโ‚’แดดโ‚’แดดโ‚’--แตโ‚’แต—๊œ€แดดโ‚{opacity:0}.แดดโ‚’แดดโ‚’แดดโ‚’__button{display:block}.แดดโ‚’แดดโ‚’แดดโ‚’__button:after{background-color:currentcolor;content:"";display:block;height:24px;margin:0 auto;-webkit-mask-image:url('data:image/svg+xml;charset=utf-8,');mask-image:url('data:image/svg+xml;charset=utf-8,');-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:24px}.แดดโ‚’แดดโ‚’แดดโ‚’__button[hidden]:after{-webkit-mask-image:url('data:image/svg+xml;charset=utf-8,');mask-image:url('data:image/svg+xml;charset=utf-8,')} \ No newline at end of file diff --git a/assets/stylesheets/extra.0d2c79a8.min.css.map b/assets/stylesheets/extra.0d2c79a8.min.css.map new file mode 100644 index 0000000..cd262c0 --- /dev/null +++ b/assets/stylesheets/extra.0d2c79a8.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["src/assets/stylesheets/extra.scss","../../../src/assets/stylesheets/extra.scss"],"names":[],"mappings":"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","file":"extra.css"} \ No newline at end of file diff --git a/assets/stylesheets/main.975780f9.min.css b/assets/stylesheets/main.975780f9.min.css new file mode 100644 index 0000000..dac48ba --- /dev/null +++ b/assets/stylesheets/main.975780f9.min.css @@ -0,0 +1 @@ +@charset "UTF-8";html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;box-sizing:border-box}*,:after,:before{box-sizing:inherit}@media (prefers-reduced-motion){*,:after,:before{transition:none!important}}body{margin:0}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}hr{border:0;box-sizing:initial;display:block;height:.05rem;overflow:visible;padding:0}small{font-size:80%}sub,sup{line-height:1em}img{border-style:none}table{border-collapse:initial;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{background:#0000;border:0;font-family:inherit;font-size:inherit;margin:0;padding:0}input{border:0;outline:none}:root{--md-primary-fg-color:#4051b5;--md-primary-fg-color--light:#5d6cc0;--md-primary-fg-color--dark:#303fa1;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3;--md-accent-fg-color:#526cfe;--md-accent-fg-color--transparent:#526cfe1a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}:root,[data-md-color-scheme=default]{--md-default-fg-color:#000000de;--md-default-fg-color--light:#0000008a;--md-default-fg-color--lighter:#00000052;--md-default-fg-color--lightest:#00000012;--md-default-bg-color:#fff;--md-default-bg-color--light:#ffffffb3;--md-default-bg-color--lighter:#ffffff4d;--md-default-bg-color--lightest:#ffffff1f;--md-code-fg-color:#36464e;--md-code-bg-color:#f5f5f5;--md-code-hl-color:#ffff0080;--md-code-hl-number-color:#d52a2a;--md-code-hl-special-color:#db1457;--md-code-hl-function-color:#a846b9;--md-code-hl-constant-color:#6e59d9;--md-code-hl-keyword-color:#3f6ec6;--md-code-hl-string-color:#1c7d4d;--md-code-hl-name-color:var(--md-code-fg-color);--md-code-hl-operator-color:var(--md-default-fg-color--light);--md-code-hl-punctuation-color:var(--md-default-fg-color--light);--md-code-hl-comment-color:var(--md-default-fg-color--light);--md-code-hl-generic-color:var(--md-default-fg-color--light);--md-code-hl-variable-color:var(--md-default-fg-color--light);--md-typeset-color:var(--md-default-fg-color);--md-typeset-a-color:var(--md-primary-fg-color);--md-typeset-mark-color:#ffff0080;--md-typeset-del-color:#f5503d26;--md-typeset-ins-color:#0bd57026;--md-typeset-kbd-color:#fafafa;--md-typeset-kbd-accent-color:#fff;--md-typeset-kbd-border-color:#b8b8b8;--md-typeset-table-color:#0000001f;--md-admonition-fg-color:var(--md-default-fg-color);--md-admonition-bg-color:var(--md-default-bg-color);--md-footer-fg-color:#fff;--md-footer-fg-color--light:#ffffffb3;--md-footer-fg-color--lighter:#ffffff4d;--md-footer-bg-color:#000000de;--md-footer-bg-color--dark:#00000052;--md-shadow-z1:0 0.2rem 0.5rem #0000000d,0 0 0.05rem #0000001a;--md-shadow-z2:0 0.2rem 0.5rem #0000001a,0 0 0.05rem #00000040;--md-shadow-z3:0 0.2rem 0.5rem #0003,0 0 0.05rem #00000059}.md-icon svg{fill:currentcolor;display:block;height:1.2rem;width:1.2rem}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--md-text-font-family:var(--md-text-font,_),-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif;--md-code-font-family:var(--md-code-font,_),SFMono-Regular,Consolas,Menlo,monospace}body,input{font-feature-settings:"kern","liga";font-family:var(--md-text-font-family)}body,code,input,kbd,pre{color:var(--md-typeset-color)}code,kbd,pre{font-feature-settings:"kern";font-family:var(--md-code-font-family)}:root{--md-typeset-table-sort-icon:url('data:image/svg+xml;charset=utf-8,');--md-typeset-table-sort-icon--asc:url('data:image/svg+xml;charset=utf-8,');--md-typeset-table-sort-icon--desc:url('data:image/svg+xml;charset=utf-8,')}.md-typeset{-webkit-print-color-adjust:exact;color-adjust:exact;font-size:.8rem;line-height:1.6}@media print{.md-typeset{font-size:.68rem}}.md-typeset blockquote,.md-typeset dl,.md-typeset figure,.md-typeset ol,.md-typeset pre,.md-typeset ul{margin-bottom:1em;margin-top:1em}.md-typeset h1{color:var(--md-default-fg-color--light);font-size:2em;line-height:1.3;margin:0 0 1.25em}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{font-size:1.5625em;line-height:1.4;margin:1.6em 0 .64em}.md-typeset h3{font-size:1.25em;font-weight:400;letter-spacing:-.01em;line-height:1.5;margin:1.6em 0 .8em}.md-typeset h2+h3{margin-top:.8em}.md-typeset h4{font-weight:700;letter-spacing:-.01em;margin:1em 0}.md-typeset h5,.md-typeset h6{color:var(--md-default-fg-color--light);font-size:.8em;font-weight:700;letter-spacing:-.01em;margin:1.25em 0}.md-typeset h5{text-transform:uppercase}.md-typeset hr{border-bottom:.05rem solid var(--md-default-fg-color--lightest);display:flow-root;margin:1.5em 0}.md-typeset a{color:var(--md-typeset-a-color);word-break:break-word}.md-typeset a,.md-typeset a:before{transition:color 125ms}.md-typeset a:focus,.md-typeset a:hover{color:var(--md-accent-fg-color)}.md-typeset a:focus code,.md-typeset a:hover code{background-color:var(--md-accent-fg-color--transparent)}.md-typeset a code{color:currentcolor;transition:background-color 125ms}.md-typeset a.focus-visible{outline-color:var(--md-accent-fg-color);outline-offset:.2rem}.md-typeset code,.md-typeset kbd,.md-typeset pre{color:var(--md-code-fg-color);direction:ltr;font-variant-ligatures:none}@media print{.md-typeset code,.md-typeset kbd,.md-typeset pre{white-space:pre-wrap}}.md-typeset code{background-color:var(--md-code-bg-color);border-radius:.1rem;-webkit-box-decoration-break:clone;box-decoration-break:clone;font-size:.85em;padding:0 .2941176471em;word-break:break-word}.md-typeset code:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}.md-typeset pre{display:flow-root;line-height:1.4;position:relative}.md-typeset pre>code{-webkit-box-decoration-break:slice;box-decoration-break:slice;box-shadow:none;display:block;margin:0;outline-color:var(--md-accent-fg-color);overflow:auto;padding:.7720588235em 1.1764705882em;scrollbar-color:var(--md-default-fg-color--lighter) #0000;scrollbar-width:thin;touch-action:auto;word-break:normal}.md-typeset pre>code:hover{scrollbar-color:var(--md-accent-fg-color) #0000}.md-typeset pre>code::-webkit-scrollbar{height:.2rem;width:.2rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:var(--md-default-fg-color--lighter)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:var(--md-accent-fg-color)}.md-typeset kbd{background-color:var(--md-typeset-kbd-color);border-radius:.1rem;box-shadow:0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem var(--md-typeset-kbd-accent-color) inset;color:var(--md-default-fg-color);display:inline-block;font-size:.75em;padding:0 .6666666667em;vertical-align:text-top;word-break:break-word}.md-typeset mark{background-color:var(--md-typeset-mark-color);-webkit-box-decoration-break:clone;box-decoration-break:clone;color:inherit;word-break:break-word}.md-typeset abbr{border-bottom:.05rem dotted var(--md-default-fg-color--light);cursor:help;text-decoration:none}@media (hover:none){.md-typeset abbr{position:relative}.md-typeset abbr[title]:-webkit-any(:focus,:hover):after{background-color:var(--md-default-fg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z3);color:var(--md-default-bg-color);content:attr(title);display:inline-block;font-size:.7rem;margin-top:2em;max-width:80%;min-width:-webkit-max-content;min-width:max-content;padding:.2rem .3rem;position:absolute;width:auto}.md-typeset abbr[title]:-moz-any(:focus,:hover):after{background-color:var(--md-default-fg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z3);color:var(--md-default-bg-color);content:attr(title);display:inline-block;font-size:.7rem;margin-top:2em;max-width:80%;min-width:-moz-max-content;min-width:max-content;padding:.2rem .3rem;position:absolute;width:auto}[dir=ltr] .md-typeset abbr[title]:-webkit-any(:focus,:hover):after{left:0}[dir=ltr] .md-typeset abbr[title]:-moz-any(:focus,:hover):after{left:0}[dir=ltr] .md-typeset abbr[title]:is(:focus,:hover):after{left:0}[dir=rtl] .md-typeset abbr[title]:-webkit-any(:focus,:hover):after{right:0}[dir=rtl] .md-typeset abbr[title]:-moz-any(:focus,:hover):after{right:0}[dir=rtl] .md-typeset abbr[title]:is(:focus,:hover):after{right:0}.md-typeset abbr[title]:is(:focus,:hover):after{background-color:var(--md-default-fg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z3);color:var(--md-default-bg-color);content:attr(title);display:inline-block;font-size:.7rem;margin-top:2em;max-width:80%;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:.2rem .3rem;position:absolute;width:auto}}.md-typeset small{opacity:.75}[dir=ltr] .md-typeset sub,[dir=ltr] .md-typeset sup{margin-left:.078125em}[dir=rtl] .md-typeset sub,[dir=rtl] .md-typeset sup{margin-right:.078125em}[dir=ltr] .md-typeset blockquote{padding-left:.6rem}[dir=rtl] .md-typeset blockquote{padding-right:.6rem}[dir=ltr] .md-typeset blockquote{border-left:.2rem solid var(--md-default-fg-color--lighter)}[dir=rtl] .md-typeset blockquote{border-right:.2rem solid var(--md-default-fg-color--lighter)}.md-typeset blockquote{color:var(--md-default-fg-color--light);margin-left:0;margin-right:0}.md-typeset ul{list-style-type:disc}[dir=ltr] .md-typeset ol,[dir=ltr] .md-typeset ul{margin-left:.625em}[dir=rtl] .md-typeset ol,[dir=rtl] .md-typeset ul{margin-right:.625em}.md-typeset ol,.md-typeset ul{padding:0}.md-typeset ol:not([hidden]),.md-typeset ul:not([hidden]){display:flow-root}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}[dir=ltr] .md-typeset ol li,[dir=ltr] .md-typeset ul li{margin-left:1.25em}[dir=rtl] .md-typeset ol li,[dir=rtl] .md-typeset ul li{margin-right:1.25em}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li :-webkit-any(ul,ol),.md-typeset ul li :-webkit-any(ul,ol){margin-bottom:.5em;margin-top:.5em}.md-typeset ol li :-moz-any(ul,ol),.md-typeset ul li :-moz-any(ul,ol){margin-bottom:.5em;margin-top:.5em}[dir=ltr] .md-typeset ol li :-webkit-any(ul,ol),[dir=ltr] .md-typeset ul li :-webkit-any(ul,ol){margin-left:.625em}[dir=ltr] .md-typeset ol li :-moz-any(ul,ol),[dir=ltr] .md-typeset ul li :-moz-any(ul,ol){margin-left:.625em}[dir=ltr] .md-typeset ol li :is(ul,ol),[dir=ltr] .md-typeset ul li :is(ul,ol){margin-left:.625em}[dir=rtl] .md-typeset ol li :-webkit-any(ul,ol),[dir=rtl] .md-typeset ul li :-webkit-any(ul,ol){margin-right:.625em}[dir=rtl] .md-typeset ol li :-moz-any(ul,ol),[dir=rtl] .md-typeset ul li :-moz-any(ul,ol){margin-right:.625em}[dir=rtl] .md-typeset ol li :is(ul,ol),[dir=rtl] .md-typeset ul li :is(ul,ol){margin-right:.625em}.md-typeset ol li :is(ul,ol),.md-typeset ul li :is(ul,ol){margin-bottom:.5em;margin-top:.5em}[dir=ltr] .md-typeset dd{margin-left:1.875em}[dir=rtl] .md-typeset dd{margin-right:1.875em}.md-typeset dd{margin-bottom:1.5em;margin-top:1em}.md-typeset img,.md-typeset svg,.md-typeset video{height:auto;max-width:100%}.md-typeset img[align=left]{margin:1em 1em 1em 0}.md-typeset img[align=right]{margin:1em 0 1em 1em}.md-typeset img[align]:only-child{margin-top:0}.md-typeset img[src$="#gh-dark-mode-only"],.md-typeset img[src$="#only-dark"]{display:none}.md-typeset figure{display:flow-root;margin:1em auto;max-width:100%;text-align:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.md-typeset figure img{display:block}.md-typeset figcaption{font-style:italic;margin:1em auto;max-width:24rem}.md-typeset iframe{max-width:100%}.md-typeset table:not([class]){background-color:var(--md-default-bg-color);border:.05rem solid var(--md-typeset-table-color);border-radius:.1rem;display:inline-block;font-size:.64rem;max-width:100%;overflow:auto;touch-action:auto}@media print{.md-typeset table:not([class]){display:table}}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) :-webkit-any(th,td)>:first-child{margin-top:0}.md-typeset table:not([class]) :-moz-any(th,td)>:first-child{margin-top:0}.md-typeset table:not([class]) :is(th,td)>:first-child{margin-top:0}.md-typeset table:not([class]) :-webkit-any(th,td)>:last-child{margin-bottom:0}.md-typeset table:not([class]) :-moz-any(th,td)>:last-child{margin-bottom:0}.md-typeset table:not([class]) :is(th,td)>:last-child{margin-bottom:0}.md-typeset table:not([class]) :-webkit-any(th,td):not([align]){text-align:left}.md-typeset table:not([class]) :-moz-any(th,td):not([align]){text-align:left}.md-typeset table:not([class]) :is(th,td):not([align]){text-align:left}[dir=rtl] .md-typeset table:not([class]) :-webkit-any(th,td):not([align]){text-align:right}[dir=rtl] .md-typeset table:not([class]) :-moz-any(th,td):not([align]){text-align:right}[dir=rtl] .md-typeset table:not([class]) :is(th,td):not([align]){text-align:right}.md-typeset table:not([class]) th{font-weight:700;min-width:5rem;padding:.9375em 1.25em;vertical-align:top}.md-typeset table:not([class]) td{border-top:.05rem solid var(--md-typeset-table-color);padding:.9375em 1.25em;vertical-align:top}.md-typeset table:not([class]) tbody tr{transition:background-color 125ms}.md-typeset table:not([class]) tbody tr:hover{background-color:rgba(0,0,0,.035);box-shadow:0 .05rem 0 var(--md-default-bg-color) inset}.md-typeset table:not([class]) a{word-break:normal}.md-typeset table th[role=columnheader]{cursor:pointer}[dir=ltr] .md-typeset table th[role=columnheader]:after{margin-left:.5em}[dir=rtl] .md-typeset table th[role=columnheader]:after{margin-right:.5em}.md-typeset table th[role=columnheader]:after{content:"";display:inline-block;height:1.2em;-webkit-mask-image:var(--md-typeset-table-sort-icon);mask-image:var(--md-typeset-table-sort-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;transition:background-color 125ms;vertical-align:text-bottom;width:1.2em}.md-typeset table th[role=columnheader]:hover:after{background-color:var(--md-default-fg-color--lighter)}.md-typeset table th[role=columnheader][aria-sort=ascending]:after{background-color:var(--md-default-fg-color--light);-webkit-mask-image:var(--md-typeset-table-sort-icon--asc);mask-image:var(--md-typeset-table-sort-icon--asc)}.md-typeset table th[role=columnheader][aria-sort=descending]:after{background-color:var(--md-default-fg-color--light);-webkit-mask-image:var(--md-typeset-table-sort-icon--desc);mask-image:var(--md-typeset-table-sort-icon--desc)}.md-typeset__scrollwrap{margin:1em -.8rem;overflow-x:auto;touch-action:auto}.md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 .8rem}@media print{.md-typeset__table{display:block}}html .md-typeset__table table{display:table;margin:0;overflow:hidden;width:100%}@media screen and (max-width:44.9375em){.md-content__inner>pre{margin:1em -.8rem}.md-content__inner>pre code{border-radius:0}}.md-banner{background-color:var(--md-footer-bg-color);color:var(--md-footer-fg-color);overflow:auto}@media print{.md-banner{display:none}}.md-banner--warning{background:var(--md-typeset-mark-color);color:var(--md-default-fg-color)}.md-banner__inner{font-size:.7rem;margin:.6rem auto;padding:0 .8rem}[dir=ltr] .md-banner__button{float:right}[dir=rtl] .md-banner__button{float:left}.md-banner__button{color:inherit;cursor:pointer;transition:opacity .25s}.md-banner__button:hover{opacity:.7}html{font-size:125%;height:100%;overflow-x:hidden}@media screen and (min-width:100em){html{font-size:137.5%}}@media screen and (min-width:125em){html{font-size:150%}}body{background-color:var(--md-default-bg-color);display:flex;flex-direction:column;font-size:.5rem;min-height:100%;position:relative;width:100%}@media print{body{display:block}}@media screen and (max-width:59.9375em){body[data-md-scrolllock]{position:fixed}}.md-grid{margin-left:auto;margin-right:auto;max-width:61rem}.md-container{display:flex;flex-direction:column;flex-grow:1}@media print{.md-container{display:block}}.md-main{flex-grow:1}.md-main__inner{display:flex;height:100%;margin-top:1.5rem}.md-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md-toggle{display:none}.md-option{height:0;opacity:0;position:absolute;width:0}.md-option:checked+label:not([hidden]){display:block}.md-option.focus-visible+label{outline-color:var(--md-accent-fg-color);outline-style:auto}.md-skip{background-color:var(--md-default-fg-color);border-radius:.1rem;color:var(--md-default-bg-color);font-size:.64rem;margin:.5rem;opacity:0;outline-color:var(--md-accent-fg-color);padding:.3rem .5rem;position:fixed;transform:translateY(.4rem);z-index:-1}.md-skip:focus{opacity:1;transform:translateY(0);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity 175ms 75ms;z-index:10}@page{margin:25mm}:root{--md-clipboard-icon:url('data:image/svg+xml;charset=utf-8,')}.md-clipboard{border-radius:.1rem;color:var(--md-default-fg-color--lightest);cursor:pointer;height:1.5em;outline-color:var(--md-accent-fg-color);outline-offset:.1rem;position:absolute;right:.5em;top:.5em;transition:color .25s;width:1.5em;z-index:1}@media print{.md-clipboard{display:none}}.md-clipboard:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}:hover>.md-clipboard{color:var(--md-default-fg-color--light)}.md-clipboard:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-clipboard:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-clipboard:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-clipboard:after{background-color:currentcolor;content:"";display:block;height:1.125em;margin:0 auto;-webkit-mask-image:var(--md-clipboard-icon);mask-image:var(--md-clipboard-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:1.125em}.md-clipboard--inline{cursor:pointer}.md-clipboard--inline code{transition:color .25s,background-color .25s}.md-clipboard--inline:-webkit-any(:focus,:hover) code{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-clipboard--inline:-moz-any(:focus,:hover) code{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-clipboard--inline:is(:focus,:hover) code{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}@keyframes consent{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}@keyframes overlay{0%{opacity:0}to{opacity:1}}.md-consent__overlay{animation:overlay .25s both;-webkit-backdrop-filter:blur(.1rem);backdrop-filter:blur(.1rem);background-color:#0000008a;height:100%;opacity:1;position:fixed;top:0;width:100%;z-index:5}.md-consent__inner{animation:consent .5s cubic-bezier(.1,.7,.1,1) both;background-color:var(--md-default-bg-color);border:0;border-radius:.1rem;bottom:0;box-shadow:0 0 .2rem #0000001a,0 .2rem .4rem #0003;max-height:100%;overflow:auto;padding:0;position:fixed;width:100%;z-index:5}.md-consent__form{padding:.8rem}.md-consent__settings{display:none;margin:1em 0}input:checked+.md-consent__settings{display:block}.md-consent__controls{margin-bottom:.8rem}.md-typeset .md-consent__controls .md-button{display:inline}@media screen and (max-width:44.9375em){.md-typeset .md-consent__controls .md-button{display:block;margin-top:.4rem;text-align:center;width:100%}}.md-consent label{cursor:pointer}.md-content{flex-grow:1;min-width:0}.md-content__inner{margin:0 .8rem 1.2rem;padding-top:.6rem}@media screen and (min-width:76.25em){[dir=ltr] .md-sidebar--primary:not([hidden])~.md-content>.md-content__inner{margin-left:1.2rem}[dir=ltr] .md-sidebar--secondary:not([hidden])~.md-content>.md-content__inner,[dir=rtl] .md-sidebar--primary:not([hidden])~.md-content>.md-content__inner{margin-right:1.2rem}[dir=rtl] .md-sidebar--secondary:not([hidden])~.md-content>.md-content__inner{margin-left:1.2rem}}.md-content__inner:before{content:"";display:block;height:.4rem}.md-content__inner>:last-child{margin-bottom:0}[dir=ltr] .md-content__button{float:right}[dir=rtl] .md-content__button{float:left}[dir=ltr] .md-content__button{margin-left:.4rem}[dir=rtl] .md-content__button{margin-right:.4rem}.md-content__button{margin:.4rem 0;padding:0}@media print{.md-content__button{display:none}}.md-typeset .md-content__button{color:var(--md-default-fg-color--lighter)}.md-content__button svg{display:inline;vertical-align:top}[dir=rtl] .md-content__button svg{transform:scaleX(-1)}[dir=ltr] .md-dialog{right:.8rem}[dir=rtl] .md-dialog{left:.8rem}.md-dialog{background-color:var(--md-default-fg-color);border-radius:.1rem;bottom:.8rem;box-shadow:var(--md-shadow-z3);min-width:11.1rem;opacity:0;padding:.4rem .6rem;pointer-events:none;position:fixed;transform:translateY(100%);transition:transform 0ms .4s,opacity .4s;z-index:4}@media print{.md-dialog{display:none}}.md-dialog--active{opacity:1;pointer-events:auto;transform:translateY(0);transition:transform .4s cubic-bezier(.075,.85,.175,1),opacity .4s}.md-dialog__inner{color:var(--md-default-bg-color);font-size:.7rem}.md-feedback{margin:2em 0 1em;text-align:center}.md-feedback fieldset{border:none;margin:0;padding:0}.md-feedback__title{font-weight:700;margin:1em auto}.md-feedback__inner{position:relative}.md-feedback__list{align-content:baseline;display:flex;flex-wrap:wrap;justify-content:center;position:relative}.md-feedback__list:hover .md-icon:not(:disabled){color:var(--md-default-fg-color--lighter)}:disabled .md-feedback__list{min-height:1.8rem}.md-feedback__icon{color:var(--md-default-fg-color--light);cursor:pointer;flex-shrink:0;margin:0 .1rem;transition:color 125ms}.md-feedback__icon:not(:disabled).md-icon:hover{color:var(--md-accent-fg-color)}.md-feedback__icon:disabled{color:var(--md-default-fg-color--lightest);pointer-events:none}.md-feedback__note{opacity:0;position:relative;transform:translateY(.4rem);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s}.md-feedback__note>*{margin:0 auto;max-width:16rem}:disabled .md-feedback__note{opacity:1;transform:translateY(0)}.md-footer{background-color:var(--md-footer-bg-color);color:var(--md-footer-fg-color)}@media print{.md-footer{display:none}}.md-footer__inner{justify-content:space-between;overflow:auto;padding:.2rem}.md-footer__inner:not([hidden]){display:flex}.md-footer__link{display:flex;flex-grow:0.01;outline-color:var(--md-accent-fg-color);overflow:hidden;padding-bottom:.4rem;padding-top:1.4rem;transition:opacity .25s}.md-footer__link:-webkit-any(:focus,:hover){opacity:.7}.md-footer__link:-moz-any(:focus,:hover){opacity:.7}.md-footer__link:is(:focus,:hover){opacity:.7}[dir=rtl] .md-footer__link svg{transform:scaleX(-1)}@media screen and (max-width:44.9375em){.md-footer__link--prev .md-footer__title{display:none}}[dir=ltr] .md-footer__link--next{margin-left:auto}[dir=rtl] .md-footer__link--next{margin-right:auto}.md-footer__link--next{text-align:right}[dir=rtl] .md-footer__link--next{text-align:left}.md-footer__title{flex-grow:1;font-size:.9rem;line-height:2.4rem;max-width:calc(100% - 2.4rem);padding:0 1rem;position:relative;white-space:nowrap}.md-footer__button{margin:.2rem;padding:.4rem}.md-footer__direction{font-size:.64rem;left:0;margin-top:-1rem;opacity:.7;padding:0 1rem;position:absolute;right:0}.md-footer-meta{background-color:var(--md-footer-bg-color--dark)}.md-footer-meta__inner{display:flex;flex-wrap:wrap;justify-content:space-between;padding:.2rem}html .md-footer-meta.md-typeset a{color:var(--md-footer-fg-color--light)}html .md-footer-meta.md-typeset a:-webkit-any(:focus,:hover){color:var(--md-footer-fg-color)}html .md-footer-meta.md-typeset a:-moz-any(:focus,:hover){color:var(--md-footer-fg-color)}html .md-footer-meta.md-typeset a:is(:focus,:hover){color:var(--md-footer-fg-color)}.md-copyright{color:var(--md-footer-fg-color--lighter);font-size:.64rem;margin:auto .6rem;padding:.4rem 0;width:100%}@media screen and (min-width:45em){.md-copyright{width:auto}}.md-copyright__highlight{color:var(--md-footer-fg-color--light)}.md-social{margin:0 .4rem;padding:.2rem 0 .6rem}@media screen and (min-width:45em){.md-social{padding:.6rem 0}}.md-social__link{display:inline-block;height:1.6rem;text-align:center;width:1.6rem}.md-social__link:before{line-height:1.9}.md-social__link svg{fill:currentcolor;max-height:.8rem;vertical-align:-25%}.md-typeset .md-button{border:.1rem solid;border-radius:.1rem;color:var(--md-primary-fg-color);cursor:pointer;display:inline-block;font-weight:700;padding:.625em 2em;transition:color 125ms,background-color 125ms,border-color 125ms}.md-typeset .md-button--primary{background-color:var(--md-primary-fg-color);border-color:var(--md-primary-fg-color);color:var(--md-primary-bg-color)}.md-typeset .md-button:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color);border-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-typeset .md-button:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color);border-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-typeset .md-button:is(:focus,:hover){background-color:var(--md-accent-fg-color);border-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}[dir=ltr] .md-typeset .md-input{border-top-left-radius:.1rem}[dir=ltr] .md-typeset .md-input,[dir=rtl] .md-typeset .md-input{border-top-right-radius:.1rem}[dir=rtl] .md-typeset .md-input{border-top-left-radius:.1rem}.md-typeset .md-input{border-bottom:.1rem solid var(--md-default-fg-color--lighter);box-shadow:var(--md-shadow-z1);font-size:.8rem;height:1.8rem;padding:0 .6rem;transition:border .25s,box-shadow .25s}.md-typeset .md-input:-webkit-any(:focus,:hover){border-bottom-color:var(--md-accent-fg-color);box-shadow:var(--md-shadow-z2)}.md-typeset .md-input:-moz-any(:focus,:hover){border-bottom-color:var(--md-accent-fg-color);box-shadow:var(--md-shadow-z2)}.md-typeset .md-input:is(:focus,:hover){border-bottom-color:var(--md-accent-fg-color);box-shadow:var(--md-shadow-z2)}.md-typeset .md-input--stretch{width:100%}.md-header{background-color:var(--md-primary-fg-color);box-shadow:0 0 .2rem #0000,0 .2rem .4rem #0000;color:var(--md-primary-bg-color);display:block;left:0;position:-webkit-sticky;position:sticky;right:0;top:0;z-index:4}@media print{.md-header{display:none}}.md-header[hidden]{transform:translateY(-100%);transition:transform .25s cubic-bezier(.8,0,.6,1),box-shadow .25s}.md-header--shadow{box-shadow:0 0 .2rem #0000001a,0 .2rem .4rem #0003;transition:transform .25s cubic-bezier(.1,.7,.1,1),box-shadow .25s}.md-header__inner{align-items:center;display:flex;padding:0 .2rem}.md-header__button{color:currentcolor;cursor:pointer;margin:.2rem;outline-color:var(--md-accent-fg-color);padding:.4rem;position:relative;transition:opacity .25s;vertical-align:middle;z-index:1}.md-header__button:hover{opacity:.7}.md-header__button:not([hidden]){display:inline-block}.md-header__button:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}.md-header__button.md-logo{margin:.2rem;padding:.4rem}@media screen and (max-width:76.1875em){.md-header__button.md-logo{display:none}}.md-header__button.md-logo :-webkit-any(img,svg){fill:currentcolor;display:block;height:1.2rem;width:auto}.md-header__button.md-logo :-moz-any(img,svg){fill:currentcolor;display:block;height:1.2rem;width:auto}.md-header__button.md-logo :is(img,svg){fill:currentcolor;display:block;height:1.2rem;width:auto}@media screen and (min-width:60em){.md-header__button[for=__search]{display:none}}.no-js .md-header__button[for=__search]{display:none}[dir=rtl] .md-header__button[for=__search] svg{transform:scaleX(-1)}@media screen and (min-width:76.25em){.md-header__button[for=__drawer]{display:none}}.md-header__topic{display:flex;max-width:100%;position:absolute;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;white-space:nowrap}.md-header__topic+.md-header__topic{opacity:0;pointer-events:none;transform:translateX(1.25rem);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;z-index:-1}[dir=rtl] .md-header__topic+.md-header__topic{transform:translateX(-1.25rem)}.md-header__topic:first-child{font-weight:700}[dir=ltr] .md-header__title{margin-right:.4rem}[dir=rtl] .md-header__title{margin-left:.4rem}[dir=ltr] .md-header__title{margin-left:1rem}[dir=rtl] .md-header__title{margin-right:1rem}.md-header__title{flex-grow:1;font-size:.9rem;height:2.4rem;line-height:2.4rem}.md-header__title--active .md-header__topic{opacity:0;pointer-events:none;transform:translateX(-1.25rem);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;z-index:-1}[dir=rtl] .md-header__title--active .md-header__topic{transform:translateX(1.25rem)}.md-header__title--active .md-header__topic+.md-header__topic{opacity:1;pointer-events:auto;transform:translateX(0);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;z-index:0}.md-header__title>.md-header__ellipsis{height:100%;position:relative;width:100%}.md-header__option{display:flex;flex-shrink:0;max-width:100%;transition:max-width 0ms .25s,opacity .25s .25s;white-space:nowrap}[data-md-toggle=search]:checked~.md-header .md-header__option{max-width:0;opacity:0;transition:max-width 0ms,opacity 0ms}.md-header__source{display:none}@media screen and (min-width:60em){[dir=ltr] .md-header__source{margin-left:1rem}[dir=rtl] .md-header__source{margin-right:1rem}.md-header__source{display:block;max-width:11.7rem;width:11.7rem}}@media screen and (min-width:76.25em){[dir=ltr] .md-header__source{margin-left:1.4rem}[dir=rtl] .md-header__source{margin-right:1.4rem}}:root{--md-nav-icon--prev:url('data:image/svg+xml;charset=utf-8,');--md-nav-icon--next:url('data:image/svg+xml;charset=utf-8,');--md-toc-icon:url('data:image/svg+xml;charset=utf-8,')}.md-nav{font-size:.7rem;line-height:1.3}.md-nav__title{display:block;font-weight:700;overflow:hidden;padding:0 .6rem;text-overflow:ellipsis}.md-nav__title .md-nav__button{display:none}.md-nav__title .md-nav__button img{height:100%;width:auto}.md-nav__title .md-nav__button.md-logo :-webkit-any(img,svg){fill:currentcolor;display:block;height:2.4rem;max-width:100%;object-fit:contain;width:auto}.md-nav__title .md-nav__button.md-logo :-moz-any(img,svg){fill:currentcolor;display:block;height:2.4rem;max-width:100%;object-fit:contain;width:auto}.md-nav__title .md-nav__button.md-logo :is(img,svg){fill:currentcolor;display:block;height:2.4rem;max-width:100%;object-fit:contain;width:auto}.md-nav__list{list-style:none;margin:0;padding:0}.md-nav__item{padding:0 .6rem}[dir=ltr] .md-nav__item .md-nav__item{padding-right:0}[dir=rtl] .md-nav__item .md-nav__item{padding-left:0}.md-nav__link{align-items:center;cursor:pointer;display:flex;justify-content:space-between;margin-top:.625em;overflow:hidden;scroll-snap-align:start;text-overflow:ellipsis;transition:color 125ms}.md-nav__link--passed{color:var(--md-default-fg-color--light)}.md-nav__item .md-nav__link--active{color:var(--md-typeset-a-color)}.md-nav__item .md-nav__link--index [href]{width:100%}.md-nav__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav__link.focus-visible{outline-color:var(--md-accent-fg-color);outline-offset:.2rem}.md-nav--primary .md-nav__link[for=__toc]{display:none}.md-nav--primary .md-nav__link[for=__toc] .md-icon:after{background-color:currentcolor;display:block;height:100%;-webkit-mask-image:var(--md-toc-icon);mask-image:var(--md-toc-icon);width:100%}.md-nav--primary .md-nav__link[for=__toc]~.md-nav{display:none}.md-nav__link>*{cursor:pointer;display:flex}.md-nav__icon{flex-shrink:0}.md-nav__source{display:none}@media screen and (max-width:76.1875em){.md-nav--primary,.md-nav--primary .md-nav{background-color:var(--md-default-bg-color);display:flex;flex-direction:column;height:100%;left:0;position:absolute;right:0;top:0;z-index:1}.md-nav--primary :-webkit-any(.md-nav__title,.md-nav__item){font-size:.8rem;line-height:1.5}.md-nav--primary :-moz-any(.md-nav__title,.md-nav__item){font-size:.8rem;line-height:1.5}.md-nav--primary :is(.md-nav__title,.md-nav__item){font-size:.8rem;line-height:1.5}.md-nav--primary .md-nav__title{background-color:var(--md-default-fg-color--lightest);color:var(--md-default-fg-color--light);cursor:pointer;height:5.6rem;line-height:2.4rem;padding:3rem .8rem .2rem;position:relative;white-space:nowrap}[dir=ltr] .md-nav--primary .md-nav__title .md-nav__icon{left:.4rem}[dir=rtl] .md-nav--primary .md-nav__title .md-nav__icon{right:.4rem}.md-nav--primary .md-nav__title .md-nav__icon{display:block;height:1.2rem;margin:.2rem;position:absolute;top:.4rem;width:1.2rem}.md-nav--primary .md-nav__title .md-nav__icon:after{background-color:currentcolor;content:"";display:block;height:100%;-webkit-mask-image:var(--md-nav-icon--prev);mask-image:var(--md-nav-icon--prev);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:100%}.md-nav--primary .md-nav__title~.md-nav__list{background-color:var(--md-default-bg-color);box-shadow:0 .05rem 0 var(--md-default-fg-color--lightest) inset;overflow-y:auto;scroll-snap-type:y mandatory;touch-action:pan-y}.md-nav--primary .md-nav__title~.md-nav__list>:first-child{border-top:0}.md-nav--primary .md-nav__title[for=__drawer]{background-color:var(--md-primary-fg-color);color:var(--md-primary-bg-color);font-weight:700}.md-nav--primary .md-nav__title .md-logo{display:block;left:.2rem;margin:.2rem;padding:.4rem;position:absolute;right:.2rem;top:.2rem}.md-nav--primary .md-nav__list{flex:1}.md-nav--primary .md-nav__item{border-top:.05rem solid var(--md-default-fg-color--lightest);padding:0}.md-nav--primary .md-nav__item--active>.md-nav__link{color:var(--md-typeset-a-color)}.md-nav--primary .md-nav__item--active>.md-nav__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav--primary .md-nav__item--active>.md-nav__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav--primary .md-nav__item--active>.md-nav__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav--primary .md-nav__link{margin-top:0;padding:.6rem .8rem}[dir=ltr] .md-nav--primary .md-nav__link .md-nav__icon{margin-right:-.2rem}[dir=rtl] .md-nav--primary .md-nav__link .md-nav__icon{margin-left:-.2rem}.md-nav--primary .md-nav__link .md-nav__icon{font-size:1.2rem;height:1.2rem;width:1.2rem}.md-nav--primary .md-nav__link .md-nav__icon:after{background-color:currentcolor;content:"";display:block;height:100%;-webkit-mask-image:var(--md-nav-icon--next);mask-image:var(--md-nav-icon--next);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:100%}[dir=rtl] .md-nav--primary .md-nav__icon:after{transform:scale(-1)}.md-nav--primary .md-nav--secondary .md-nav{background-color:initial;position:static}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:1.4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-right:1.4rem}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-right:2rem}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:2.6rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-right:2.6rem}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:3.2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-right:3.2rem}.md-nav--secondary{background-color:initial}.md-nav__toggle~.md-nav{display:flex;opacity:0;transform:translateX(100%);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity 125ms 50ms}[dir=rtl] .md-nav__toggle~.md-nav{transform:translateX(-100%)}.md-nav__toggle:checked~.md-nav{opacity:1;transform:translateX(0);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity 125ms 125ms}.md-nav__toggle:checked~.md-nav>.md-nav__list{-webkit-backface-visibility:hidden;backface-visibility:hidden}}@media screen and (max-width:59.9375em){.md-nav--primary .md-nav__link[for=__toc]{display:flex}.md-nav--primary .md-nav__link[for=__toc] .md-icon:after{content:""}.md-nav--primary .md-nav__link[for=__toc]+.md-nav__link{display:none}.md-nav--primary .md-nav__link[for=__toc]~.md-nav{display:flex}.md-nav__source{background-color:var(--md-primary-fg-color--dark);color:var(--md-primary-bg-color);display:block;padding:0 .2rem}}@media screen and (min-width:60em) and (max-width:76.1875em){.md-nav--integrated .md-nav__link[for=__toc]{display:flex}.md-nav--integrated .md-nav__link[for=__toc] .md-icon:after{content:""}.md-nav--integrated .md-nav__link[for=__toc]+.md-nav__link{display:none}.md-nav--integrated .md-nav__link[for=__toc]~.md-nav{display:flex}}@media screen and (min-width:60em){.md-nav--secondary .md-nav__title{background:var(--md-default-bg-color);box-shadow:0 0 .4rem .4rem var(--md-default-bg-color);position:-webkit-sticky;position:sticky;top:0;z-index:1}.md-nav--secondary .md-nav__title[for=__toc]{scroll-snap-align:start}.md-nav--secondary .md-nav__title .md-nav__icon{display:none}}@media screen and (min-width:76.25em){.md-nav{transition:max-height .25s cubic-bezier(.86,0,.07,1)}.md-nav--primary .md-nav__title{background:var(--md-default-bg-color);box-shadow:0 0 .4rem .4rem var(--md-default-bg-color);position:-webkit-sticky;position:sticky;top:0;z-index:1}.md-nav--primary .md-nav__title[for=__drawer]{scroll-snap-align:start}.md-nav--primary .md-nav__title .md-nav__icon,.md-nav__toggle~.md-nav{display:none}.md-nav__toggle:-webkit-any(:checked,:indeterminate)~.md-nav{display:block}.md-nav__toggle:-moz-any(:checked,:indeterminate)~.md-nav{display:block}.md-nav__toggle:is(:checked,:indeterminate)~.md-nav{display:block}.md-nav__item--nested>.md-nav>.md-nav__title{display:none}.md-nav__item--section{display:block;margin:1.25em 0}.md-nav__item--section:last-child{margin-bottom:0}.md-nav__item--section>.md-nav__link{font-weight:700;pointer-events:none}.md-nav__item--section>.md-nav__link--index [href]{pointer-events:auto}.md-nav__item--section>.md-nav__link .md-nav__icon{display:none}.md-nav__item--section>.md-nav{display:block}.md-nav__item--section>.md-nav>.md-nav__list>.md-nav__item{padding:0}.md-nav__icon{border-radius:100%;height:.9rem;transition:background-color .25s,transform .25s;width:.9rem}[dir=rtl] .md-nav__icon{transform:rotate(180deg)}.md-nav__icon:hover{background-color:var(--md-accent-fg-color--transparent)}.md-nav__icon:after{background-color:currentcolor;content:"";display:inline-block;height:100%;-webkit-mask-image:var(--md-nav-icon--next);mask-image:var(--md-nav-icon--next);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;vertical-align:-.1rem;width:100%}.md-nav__item--nested .md-nav__toggle:checked~.md-nav__link .md-nav__icon,.md-nav__item--nested .md-nav__toggle:indeterminate~.md-nav__link .md-nav__icon{transform:rotate(90deg)}.md-nav--lifted>.md-nav__list>.md-nav__item,.md-nav--lifted>.md-nav__list>.md-nav__item--nested,.md-nav--lifted>.md-nav__title{display:none}.md-nav--lifted>.md-nav__list>.md-nav__item--active{display:block;padding:0}.md-nav--lifted>.md-nav__list>.md-nav__item--active>.md-nav__link{background:var(--md-default-bg-color);box-shadow:0 0 .4rem .4rem var(--md-default-bg-color);font-weight:700;margin-top:0;padding:0 .6rem;position:-webkit-sticky;position:sticky;top:0;z-index:1}.md-nav--lifted>.md-nav__list>.md-nav__item--active>.md-nav__link:not(.md-nav__link--index){pointer-events:none}.md-nav--lifted>.md-nav__list>.md-nav__item--active>.md-nav__link .md-nav__icon{display:none}.md-nav--lifted .md-nav[data-md-level="1"]{display:block}[dir=ltr] .md-nav--lifted .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-right:.6rem}[dir=rtl] .md-nav--lifted .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-left:.6rem}.md-nav--integrated>.md-nav__list>.md-nav__item--active:not(.md-nav__item--nested){padding:0 .6rem}.md-nav--integrated>.md-nav__list>.md-nav__item--active:not(.md-nav__item--nested)>.md-nav__link{padding:0}[dir=ltr] .md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary{border-left:.05rem solid var(--md-primary-fg-color)}[dir=rtl] .md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary{border-right:.05rem solid var(--md-primary-fg-color)}.md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary{display:block;margin-bottom:1.25em}.md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary>.md-nav__title{display:none}}:root{--md-search-result-icon:url('data:image/svg+xml;charset=utf-8,')}.md-search{position:relative}@media screen and (min-width:60em){.md-search{padding:.2rem 0}}.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__overlay{left:-2.2rem}[dir=rtl] .md-search__overlay{right:-2.2rem}.md-search__overlay{background-color:var(--md-default-bg-color);border-radius:1rem;height:2rem;overflow:hidden;pointer-events:none;position:absolute;top:-1rem;transform-origin:center;transition:transform .3s .1s,opacity .2s .2s;width:2rem}[data-md-toggle=search]:checked~.md-header .md-search__overlay{opacity:1;transition:transform .4s,opacity .1s}}@media screen and (min-width:60em){[dir=ltr] .md-search__overlay{left:0}[dir=rtl] .md-search__overlay{right:0}.md-search__overlay{background-color:#0000008a;cursor:pointer;height:0;position:fixed;top:0;transition:width 0ms .25s,height 0ms .25s,opacity .25s;width:0}[data-md-toggle=search]:checked~.md-header .md-search__overlay{height:200vh;opacity:1;transition:width 0ms,height 0ms,opacity .25s;width:100%}}@media screen and (max-width:29.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{transform:scale(45)}}@media screen and (min-width:30em) and (max-width:44.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{transform:scale(60)}}@media screen and (min-width:45em) and (max-width:59.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{transform:scale(75)}}.md-search__inner{-webkit-backface-visibility:hidden;backface-visibility:hidden}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__inner{left:0}[dir=rtl] .md-search__inner{right:0}.md-search__inner{height:0;opacity:0;overflow:hidden;position:fixed;top:0;transform:translateX(5%);transition:width 0ms .3s,height 0ms .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;width:0;z-index:2}[dir=rtl] .md-search__inner{transform:translateX(-5%)}[data-md-toggle=search]:checked~.md-header .md-search__inner{height:100%;opacity:1;transform:translateX(0);transition:width 0ms 0ms,height 0ms 0ms,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;width:100%}}@media screen and (min-width:60em){[dir=ltr] .md-search__inner{float:right}[dir=rtl] .md-search__inner{float:left}.md-search__inner{padding:.1rem 0;position:relative;transition:width .25s cubic-bezier(.1,.7,.1,1);width:11.7rem}}@media screen and (min-width:60em) and (max-width:76.1875em){[data-md-toggle=search]:checked~.md-header .md-search__inner{width:23.4rem}}@media screen and (min-width:76.25em){[data-md-toggle=search]:checked~.md-header .md-search__inner{width:34.4rem}}.md-search__form{background-color:var(--md-default-bg-color);box-shadow:0 0 .6rem #0000;height:2.4rem;position:relative;transition:color .25s,background-color .25s;z-index:2}@media screen and (min-width:60em){.md-search__form{background-color:#00000042;border-radius:.1rem;height:1.8rem}.md-search__form:hover{background-color:#ffffff1f}}[data-md-toggle=search]:checked~.md-header .md-search__form{background-color:var(--md-default-bg-color);border-radius:.1rem .1rem 0 0;box-shadow:0 0 .6rem #00000012;color:var(--md-default-fg-color)}[dir=ltr] .md-search__input{padding-left:3.6rem;padding-right:2.2rem}[dir=rtl] .md-search__input{padding-left:2.2rem;padding-right:3.6rem}.md-search__input{background:#0000;font-size:.9rem;height:100%;position:relative;text-overflow:ellipsis;width:100%;z-index:2}.md-search__input::placeholder{transition:color .25s}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:var(--md-default-fg-color--light)}.md-search__input::-ms-clear{display:none}@media screen and (max-width:59.9375em){.md-search__input{font-size:.9rem;height:2.4rem;width:100%}}@media screen and (min-width:60em){[dir=ltr] .md-search__input{padding-left:2.2rem}[dir=rtl] .md-search__input{padding-right:2.2rem}.md-search__input{color:inherit;font-size:.8rem}.md-search__input::placeholder{color:var(--md-primary-bg-color--light)}.md-search__input+.md-search__icon{color:var(--md-primary-bg-color)}[data-md-toggle=search]:checked~.md-header .md-search__input{text-overflow:clip}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:var(--md-default-fg-color--light)}}.md-search__icon{cursor:pointer;display:inline-block;height:1.2rem;transition:color .25s,opacity .25s;width:1.2rem}.md-search__icon:hover{opacity:.7}[dir=ltr] .md-search__icon[for=__search]{left:.5rem}[dir=rtl] .md-search__icon[for=__search]{right:.5rem}.md-search__icon[for=__search]{position:absolute;top:.3rem;z-index:2}[dir=rtl] .md-search__icon[for=__search] svg{transform:scaleX(-1)}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__icon[for=__search]{left:.8rem}[dir=rtl] .md-search__icon[for=__search]{right:.8rem}.md-search__icon[for=__search]{top:.6rem}.md-search__icon[for=__search] svg:first-child{display:none}}@media screen and (min-width:60em){.md-search__icon[for=__search]{pointer-events:none}.md-search__icon[for=__search] svg:last-child{display:none}}[dir=ltr] .md-search__options{right:.5rem}[dir=rtl] .md-search__options{left:.5rem}.md-search__options{pointer-events:none;position:absolute;top:.3rem;z-index:2}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__options{right:.8rem}[dir=rtl] .md-search__options{left:.8rem}.md-search__options{top:.6rem}}[dir=ltr] .md-search__options>*{margin-left:.2rem}[dir=rtl] .md-search__options>*{margin-right:.2rem}.md-search__options>*{color:var(--md-default-fg-color--light);opacity:0;transform:scale(.75);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s}.md-search__options>:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__options>*{opacity:1;pointer-events:auto;transform:scale(1)}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__options>:hover{opacity:.7}[dir=ltr] .md-search__suggest{padding-left:3.6rem;padding-right:2.2rem}[dir=rtl] .md-search__suggest{padding-left:2.2rem;padding-right:3.6rem}.md-search__suggest{align-items:center;color:var(--md-default-fg-color--lighter);display:flex;font-size:.9rem;height:100%;opacity:0;position:absolute;top:0;transition:opacity 50ms;white-space:nowrap;width:100%}@media screen and (min-width:60em){[dir=ltr] .md-search__suggest{padding-left:2.2rem}[dir=rtl] .md-search__suggest{padding-right:2.2rem}.md-search__suggest{font-size:.8rem}}[data-md-toggle=search]:checked~.md-header .md-search__suggest{opacity:1;transition:opacity .3s .1s}[dir=ltr] .md-search__output{border-bottom-left-radius:.1rem}[dir=ltr] .md-search__output,[dir=rtl] .md-search__output{border-bottom-right-radius:.1rem}[dir=rtl] .md-search__output{border-bottom-left-radius:.1rem}.md-search__output{overflow:hidden;position:absolute;width:100%;z-index:1}@media screen and (max-width:59.9375em){.md-search__output{bottom:0;top:2.4rem}}@media screen and (min-width:60em){.md-search__output{opacity:0;top:1.9rem;transition:opacity .4s}[data-md-toggle=search]:checked~.md-header .md-search__output{box-shadow:var(--md-shadow-z3);opacity:1}}.md-search__scrollwrap{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--md-default-bg-color);height:100%;overflow-y:auto;touch-action:pan-y}@media (-webkit-max-device-pixel-ratio:1),(max-resolution:1dppx){.md-search__scrollwrap{transform:translateZ(0)}}@media screen and (min-width:60em) and (max-width:76.1875em){.md-search__scrollwrap{width:23.4rem}}@media screen and (min-width:76.25em){.md-search__scrollwrap{width:34.4rem}}@media screen and (min-width:60em){.md-search__scrollwrap{max-height:0;scrollbar-color:var(--md-default-fg-color--lighter) #0000;scrollbar-width:thin}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap:hover{scrollbar-color:var(--md-accent-fg-color) #0000}.md-search__scrollwrap::-webkit-scrollbar{height:.2rem;width:.2rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:var(--md-default-fg-color--lighter)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:var(--md-accent-fg-color)}}.md-search-result{color:var(--md-default-fg-color);word-break:break-word}.md-search-result__meta{background-color:var(--md-default-fg-color--lightest);color:var(--md-default-fg-color--light);font-size:.64rem;line-height:1.8rem;padding:0 .8rem;scroll-snap-align:start}@media screen and (min-width:60em){[dir=ltr] .md-search-result__meta{padding-left:2.2rem}[dir=rtl] .md-search-result__meta{padding-right:2.2rem}}.md-search-result__list{list-style:none;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.md-search-result__item{box-shadow:0 -.05rem var(--md-default-fg-color--lightest)}.md-search-result__item:first-child{box-shadow:none}.md-search-result__link{display:block;outline:none;scroll-snap-align:start;transition:background-color .25s}.md-search-result__link:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent)}.md-search-result__link:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent)}.md-search-result__link:is(:focus,:hover){background-color:var(--md-accent-fg-color--transparent)}.md-search-result__link:last-child p:last-child{margin-bottom:.6rem}.md-search-result__more summary{color:var(--md-typeset-a-color);cursor:pointer;display:block;font-size:.64rem;outline:none;padding:.75em .8rem;scroll-snap-align:start;transition:color .25s,background-color .25s}@media screen and (min-width:60em){[dir=ltr] .md-search-result__more summary{padding-left:2.2rem}[dir=rtl] .md-search-result__more summary{padding-right:2.2rem}}.md-search-result__more summary:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-search-result__more summary:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-search-result__more summary:is(:focus,:hover){background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-search-result__more summary::marker{display:none}.md-search-result__more summary::-webkit-details-marker{display:none}.md-search-result__more summary~*>*{opacity:.65}.md-search-result__article{overflow:hidden;padding:0 .8rem;position:relative}@media screen and (min-width:60em){[dir=ltr] .md-search-result__article{padding-left:2.2rem}[dir=rtl] .md-search-result__article{padding-right:2.2rem}}.md-search-result__article--document .md-search-result__title{font-size:.8rem;font-weight:400;line-height:1.4;margin:.55rem 0}[dir=ltr] .md-search-result__icon{left:0}[dir=rtl] .md-search-result__icon{right:0}.md-search-result__icon{color:var(--md-default-fg-color--light);height:1.2rem;margin:.5rem;position:absolute;width:1.2rem}@media screen and (max-width:59.9375em){.md-search-result__icon{display:none}}.md-search-result__icon:after{background-color:currentcolor;content:"";display:inline-block;height:100%;-webkit-mask-image:var(--md-search-result-icon);mask-image:var(--md-search-result-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:100%}[dir=rtl] .md-search-result__icon:after{transform:scaleX(-1)}.md-search-result__title{font-size:.64rem;font-weight:700;line-height:1.6;margin:.5em 0}.md-search-result__teaser{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:var(--md-default-fg-color--light);display:-webkit-box;font-size:.64rem;line-height:1.6;margin:.5em 0;max-height:2rem;overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:44.9375em){.md-search-result__teaser{-webkit-line-clamp:3;max-height:3rem}}@media screen and (min-width:60em) and (max-width:76.1875em){.md-search-result__teaser{-webkit-line-clamp:3;max-height:3rem}}.md-search-result__teaser mark{background-color:initial;text-decoration:underline}.md-search-result__terms{font-size:.64rem;font-style:italic;margin:.5em 0}.md-search-result mark{background-color:initial;color:var(--md-accent-fg-color)}.md-select{position:relative;z-index:1}.md-select__inner{background-color:var(--md-default-bg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color);left:50%;margin-top:.2rem;max-height:0;opacity:0;position:absolute;top:calc(100% - .2rem);transform:translate3d(-50%,.3rem,0);transition:transform .25s 375ms,opacity .25s .25s,max-height 0ms .5s}.md-select:-webkit-any(:focus-within,:hover) .md-select__inner{max-height:10rem;opacity:1;transform:translate3d(-50%,0,0);-webkit-transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms;transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms}.md-select:-moz-any(:focus-within,:hover) .md-select__inner{max-height:10rem;opacity:1;transform:translate3d(-50%,0,0);-moz-transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms;transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms}.md-select:is(:focus-within,:hover) .md-select__inner{max-height:10rem;opacity:1;transform:translate3d(-50%,0,0);transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms}.md-select__inner:after{border-bottom:.2rem solid #0000;border-bottom-color:var(--md-default-bg-color);border-left:.2rem solid #0000;border-right:.2rem solid #0000;border-top:0;content:"";height:0;left:50%;margin-left:-.2rem;margin-top:-.2rem;position:absolute;top:0;width:0}.md-select__list{border-radius:.1rem;font-size:.8rem;list-style-type:none;margin:0;max-height:inherit;overflow:auto;padding:0}.md-select__item{line-height:1.8rem}[dir=ltr] .md-select__link{padding-left:.6rem;padding-right:1.2rem}[dir=rtl] .md-select__link{padding-left:1.2rem;padding-right:.6rem}.md-select__link{cursor:pointer;display:block;outline:none;scroll-snap-align:start;transition:background-color .25s,color .25s;width:100%}.md-select__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-select__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-select__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-select__link:focus{background-color:var(--md-default-fg-color--lightest)}.md-sidebar{align-self:flex-start;flex-shrink:0;padding:1.2rem 0;position:-webkit-sticky;position:sticky;top:2.4rem;width:12.1rem}@media print{.md-sidebar{display:none}}@media screen and (max-width:76.1875em){[dir=ltr] .md-sidebar--primary{left:-12.1rem}[dir=rtl] .md-sidebar--primary{right:-12.1rem}.md-sidebar--primary{background-color:var(--md-default-bg-color);display:block;height:100%;position:fixed;top:0;transform:translateX(0);transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;width:12.1rem;z-index:5}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{box-shadow:var(--md-shadow-z3);transform:translateX(12.1rem)}[dir=rtl] [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{transform:translateX(-12.1rem)}.md-sidebar--primary .md-sidebar__scrollwrap{bottom:0;left:0;margin:0;overflow:hidden;position:absolute;right:0;scroll-snap-type:none;top:0}}@media screen and (min-width:76.25em){.md-sidebar{height:0}.no-js .md-sidebar{height:auto}.md-header--lifted~.md-container .md-sidebar{top:4.8rem}}.md-sidebar--secondary{display:none;order:2}@media screen and (min-width:60em){.md-sidebar--secondary{height:0}.no-js .md-sidebar--secondary{height:auto}.md-sidebar--secondary:not([hidden]){display:block}.md-sidebar--secondary .md-sidebar__scrollwrap{touch-action:pan-y}}.md-sidebar__scrollwrap{scrollbar-gutter:stable;-webkit-backface-visibility:hidden;backface-visibility:hidden;margin:0 .2rem;overflow-y:auto;scrollbar-color:var(--md-default-fg-color--lighter) #0000;scrollbar-width:thin}.md-sidebar__scrollwrap:hover{scrollbar-color:var(--md-accent-fg-color) #0000}.md-sidebar__scrollwrap::-webkit-scrollbar{height:.2rem;width:.2rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:var(--md-default-fg-color--lighter)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:var(--md-accent-fg-color)}@supports selector(::-webkit-scrollbar){.md-sidebar__scrollwrap{scrollbar-gutter:auto}[dir=ltr] .md-sidebar__inner{padding-right:calc(100% - 11.5rem)}[dir=rtl] .md-sidebar__inner{padding-left:calc(100% - 11.5rem)}}@media screen and (max-width:76.1875em){.md-overlay{background-color:#0000008a;height:0;opacity:0;position:fixed;top:0;transition:width 0ms .25s,height 0ms .25s,opacity .25s;width:0;z-index:5}[data-md-toggle=drawer]:checked~.md-overlay{height:100%;opacity:1;transition:width 0ms,height 0ms,opacity .25s;width:100%}}@keyframes facts{0%{height:0}to{height:.65rem}}@keyframes fact{0%{opacity:0;transform:translateY(100%)}50%{opacity:0}to{opacity:1;transform:translateY(0)}}:root{--md-source-forks-icon:url('data:image/svg+xml;charset=utf-8,');--md-source-repositories-icon:url('data:image/svg+xml;charset=utf-8,');--md-source-stars-icon:url('data:image/svg+xml;charset=utf-8,');--md-source-version-icon:url('data:image/svg+xml;charset=utf-8,')}.md-source{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;font-size:.65rem;line-height:1.2;outline-color:var(--md-accent-fg-color);transition:opacity .25s;white-space:nowrap}.md-source:hover{opacity:.7}.md-source__icon{display:inline-block;height:2.4rem;vertical-align:middle;width:2rem}[dir=ltr] .md-source__icon svg{margin-left:.6rem}[dir=rtl] .md-source__icon svg{margin-right:.6rem}.md-source__icon svg{margin-top:.6rem}[dir=ltr] .md-source__icon+.md-source__repository{margin-left:-2rem}[dir=rtl] .md-source__icon+.md-source__repository{margin-right:-2rem}[dir=ltr] .md-source__icon+.md-source__repository{padding-left:2rem}[dir=rtl] .md-source__icon+.md-source__repository{padding-right:2rem}[dir=ltr] .md-source__repository{margin-left:.6rem}[dir=rtl] .md-source__repository{margin-right:.6rem}.md-source__repository{display:inline-block;max-width:calc(100% - 1.2rem);overflow:hidden;text-overflow:ellipsis;vertical-align:middle}.md-source__facts{display:flex;font-size:.55rem;gap:.4rem;list-style-type:none;margin:.1rem 0 0;opacity:.75;overflow:hidden;padding:0;width:100%}.md-source__repository--active .md-source__facts{animation:facts .25s ease-in}.md-source__fact{overflow:hidden;text-overflow:ellipsis}.md-source__repository--active .md-source__fact{animation:fact .4s ease-out}[dir=ltr] .md-source__fact:before{margin-right:.1rem}[dir=rtl] .md-source__fact:before{margin-left:.1rem}.md-source__fact:before{background-color:currentcolor;content:"";display:inline-block;height:.6rem;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;vertical-align:text-top;width:.6rem}.md-source__fact:nth-child(1n+2){flex-shrink:0}.md-source__fact--version:before{-webkit-mask-image:var(--md-source-version-icon);mask-image:var(--md-source-version-icon)}.md-source__fact--stars:before{-webkit-mask-image:var(--md-source-stars-icon);mask-image:var(--md-source-stars-icon)}.md-source__fact--forks:before{-webkit-mask-image:var(--md-source-forks-icon);mask-image:var(--md-source-forks-icon)}.md-source__fact--repositories:before{-webkit-mask-image:var(--md-source-repositories-icon);mask-image:var(--md-source-repositories-icon)}.md-tabs{background-color:var(--md-primary-fg-color);color:var(--md-primary-bg-color);display:block;line-height:1.3;overflow:auto;width:100%;z-index:3}@media print{.md-tabs{display:none}}@media screen and (max-width:76.1875em){.md-tabs{display:none}}.md-tabs[hidden]{pointer-events:none}[dir=ltr] .md-tabs__list{margin-left:.2rem}[dir=rtl] .md-tabs__list{margin-right:.2rem}.md-tabs__list{contain:content;list-style:none;margin:0;padding:0;white-space:nowrap}.md-tabs__item{display:inline-block;height:2.4rem;padding-left:.6rem;padding-right:.6rem}.md-tabs__link{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;font-size:.7rem;margin-top:.8rem;opacity:.7;outline-color:var(--md-accent-fg-color);outline-offset:.2rem;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s}.md-tabs__link--active,.md-tabs__link:-webkit-any(:focus,:hover){color:inherit;opacity:1}.md-tabs__link--active,.md-tabs__link:-moz-any(:focus,:hover){color:inherit;opacity:1}.md-tabs__link--active,.md-tabs__link:is(:focus,:hover){color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{transition-delay:20ms}.md-tabs__item:nth-child(3) .md-tabs__link{transition-delay:40ms}.md-tabs__item:nth-child(4) .md-tabs__link{transition-delay:60ms}.md-tabs__item:nth-child(5) .md-tabs__link{transition-delay:80ms}.md-tabs__item:nth-child(6) .md-tabs__link{transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{transition-delay:.3s}.md-tabs[hidden] .md-tabs__link{opacity:0;transform:translateY(50%);transition:transform 0ms .1s,opacity .1s}:root{--md-tag-icon:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .md-tags{margin-bottom:.75em;margin-top:-.125em}[dir=ltr] .md-typeset .md-tag{margin-right:.5em}[dir=rtl] .md-typeset .md-tag{margin-left:.5em}.md-typeset .md-tag{background:var(--md-default-fg-color--lightest);border-radius:2.4rem;display:inline-block;font-size:.64rem;font-weight:700;letter-spacing:normal;line-height:1.6;margin-bottom:.5em;padding:.3125em .9375em;vertical-align:middle}.md-typeset .md-tag[href]{-webkit-tap-highlight-color:transparent;color:inherit;outline:none;transition:color 125ms,background-color 125ms}.md-typeset .md-tag[href]:focus,.md-typeset .md-tag[href]:hover{background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}[id]>.md-typeset .md-tag{vertical-align:text-top}.md-typeset .md-tag-icon:before{background-color:var(--md-default-fg-color--lighter);content:"";display:inline-block;height:1.2em;margin-right:.4em;-webkit-mask-image:var(--md-tag-icon);mask-image:var(--md-tag-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;transition:background-color 125ms;vertical-align:text-bottom;width:1.2em}.md-typeset .md-tag-icon:-webkit-any(a:focus,a:hover):before{background-color:var(--md-accent-bg-color)}.md-typeset .md-tag-icon:-moz-any(a:focus,a:hover):before{background-color:var(--md-accent-bg-color)}.md-typeset .md-tag-icon:is(a:focus,a:hover):before{background-color:var(--md-accent-bg-color)}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--md-default-fg-color--lightest);transform:scale(.95)}75%{box-shadow:0 0 0 .625em #0000;transform:scale(1)}to{box-shadow:0 0 0 0 #0000;transform:scale(.95)}}:root{--md-tooltip-width:20rem}.md-tooltip{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--md-default-bg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color);font-family:var(--md-text-font-family);left:clamp(var(--md-tooltip-0,0rem) + .8rem,var(--md-tooltip-x),100vw + var(--md-tooltip-0,0rem) + .8rem - var(--md-tooltip-width) - 2 * .8rem);max-width:calc(100vw - 1.6rem);opacity:0;position:absolute;top:var(--md-tooltip-y);transform:translateY(-.4rem);transition:transform 0ms .25s,opacity .25s,z-index .25s;width:var(--md-tooltip-width);z-index:0}.md-tooltip--active{opacity:1;transform:translateY(0);transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,z-index 0ms;z-index:2}:-webkit-any(.focus-visible>.md-tooltip,.md-tooltip:target){outline:var(--md-accent-fg-color) auto}:-moz-any(.focus-visible>.md-tooltip,.md-tooltip:target){outline:var(--md-accent-fg-color) auto}:is(.focus-visible>.md-tooltip,.md-tooltip:target){outline:var(--md-accent-fg-color) auto}.md-tooltip__inner{font-size:.64rem;padding:.8rem}.md-tooltip__inner.md-typeset>:first-child{margin-top:0}.md-tooltip__inner.md-typeset>:last-child{margin-bottom:0}.md-annotation{font-weight:400;outline:none;white-space:normal}[dir=rtl] .md-annotation{direction:rtl}.md-annotation:not([hidden]){display:inline-block;line-height:1.325}.md-annotation__index{cursor:pointer;font-family:var(--md-code-font-family);font-size:.85em;margin:0 1ch;outline:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:0}.md-annotation .md-annotation__index{color:#fff;transition:z-index .25s}.md-annotation .md-annotation__index:-webkit-any(:focus,:hover){color:#fff}.md-annotation .md-annotation__index:-moz-any(:focus,:hover){color:#fff}.md-annotation .md-annotation__index:is(:focus,:hover){color:#fff}.md-annotation__index:after{background-color:var(--md-default-fg-color--lighter);border-radius:2ch;content:"";height:2.2ch;left:-.125em;margin:0 -.4ch;padding:0 .4ch;position:absolute;top:0;transition:color .25s,background-color .25s;width:calc(100% + 1.2ch);width:max(2.2ch,100% + 1.2ch);z-index:-1}@media not all and (prefers-reduced-motion){[data-md-visible]>.md-annotation__index:after{animation:pulse 2s infinite}}.md-tooltip--active+.md-annotation__index:after{animation:none;transition:color .25s,background-color .25s}code .md-annotation__index{font-family:var(--md-code-font-family);font-size:inherit}:-webkit-any(.md-tooltip--active+.md-annotation__index,:hover>.md-annotation__index){color:var(--md-accent-bg-color)}:-moz-any(.md-tooltip--active+.md-annotation__index,:hover>.md-annotation__index){color:var(--md-accent-bg-color)}:is(.md-tooltip--active+.md-annotation__index,:hover>.md-annotation__index){color:var(--md-accent-bg-color)}:-webkit-any(.md-tooltip--active+.md-annotation__index,:hover>.md-annotation__index):after{background-color:var(--md-accent-fg-color)}:-moz-any(.md-tooltip--active+.md-annotation__index,:hover>.md-annotation__index):after{background-color:var(--md-accent-fg-color)}:is(.md-tooltip--active+.md-annotation__index,:hover>.md-annotation__index):after{background-color:var(--md-accent-fg-color)}.md-tooltip--active+.md-annotation__index{animation:none;transition:none;z-index:2}.md-annotation__index [data-md-annotation-id]{display:inline-block;line-height:90%}.md-annotation__index [data-md-annotation-id]:before{content:attr(data-md-annotation-id);display:inline-block;padding-bottom:.1em;transform:scale(1.15);transition:transform .4s cubic-bezier(.1,.7,.1,1);vertical-align:.065em}@media not print{.md-annotation__index [data-md-annotation-id]:before{content:"+"}:focus-within>.md-annotation__index [data-md-annotation-id]:before{transform:scale(1.25) rotate(45deg)}}[dir=ltr] .md-top{margin-left:50%}[dir=rtl] .md-top{margin-right:50%}.md-top{background-color:var(--md-default-bg-color);border-radius:1.6rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color--light);display:block;font-size:.7rem;outline:none;padding:.4rem .8rem;position:fixed;top:3.2rem;transform:translate(-50%);transition:color 125ms,background-color 125ms,transform 125ms cubic-bezier(.4,0,.2,1),opacity 125ms;z-index:2}@media print{.md-top{display:none}}[dir=rtl] .md-top{transform:translate(50%)}.md-top[hidden]{opacity:0;pointer-events:none;transform:translate(-50%,.2rem);transition-duration:0ms}[dir=rtl] .md-top[hidden]{transform:translate(50%,.2rem)}.md-top:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-top:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-top:is(:focus,:hover){background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-top svg{display:inline-block;vertical-align:-.5em}@keyframes hoverfix{0%{pointer-events:none}}:root{--md-version-icon:url('data:image/svg+xml;charset=utf-8,')}.md-version{flex-shrink:0;font-size:.8rem;height:2.4rem}[dir=ltr] .md-version__current{margin-left:1.4rem;margin-right:.4rem}[dir=rtl] .md-version__current{margin-left:.4rem;margin-right:1.4rem}.md-version__current{color:inherit;cursor:pointer;outline:none;position:relative;top:.05rem}[dir=ltr] .md-version__current:after{margin-left:.4rem}[dir=rtl] .md-version__current:after{margin-right:.4rem}.md-version__current:after{background-color:currentcolor;content:"";display:inline-block;height:.6rem;-webkit-mask-image:var(--md-version-icon);mask-image:var(--md-version-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:.4rem}.md-version__list{background-color:var(--md-default-bg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color);list-style-type:none;margin:.2rem .8rem;max-height:0;opacity:0;overflow:auto;padding:0;position:absolute;scroll-snap-type:y mandatory;top:.15rem;transition:max-height 0ms .5s,opacity .25s .25s;z-index:3}.md-version:-webkit-any(:focus-within,:hover) .md-version__list{max-height:10rem;opacity:1;-webkit-transition:max-height 0ms,opacity .25s;transition:max-height 0ms,opacity .25s}.md-version:-moz-any(:focus-within,:hover) .md-version__list{max-height:10rem;opacity:1;-moz-transition:max-height 0ms,opacity .25s;transition:max-height 0ms,opacity .25s}.md-version:is(:focus-within,:hover) .md-version__list{max-height:10rem;opacity:1;transition:max-height 0ms,opacity .25s}@media (pointer:coarse){.md-version:hover .md-version__list{animation:hoverfix .25s forwards}.md-version:focus-within .md-version__list{animation:none}}.md-version__item{line-height:1.8rem}[dir=ltr] .md-version__link{padding-left:.6rem;padding-right:1.2rem}[dir=rtl] .md-version__link{padding-left:1.2rem;padding-right:.6rem}.md-version__link{cursor:pointer;display:block;outline:none;scroll-snap-align:start;transition:color .25s,background-color .25s;white-space:nowrap;width:100%}.md-version__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-version__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-version__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-version__link:focus{background-color:var(--md-default-fg-color--lightest)}:root{--md-admonition-icon--note:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--abstract:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--info:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--tip:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--success:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--question:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--warning:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--failure:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--danger:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--bug:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--example:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--quote:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .admonition,.md-typeset details{background-color:var(--md-admonition-bg-color);border:.05rem solid #448aff;border-radius:.2rem;box-shadow:var(--md-shadow-z1);color:var(--md-admonition-fg-color);display:flow-root;font-size:.64rem;margin:1.5625em 0;padding:0 .6rem;page-break-inside:avoid}@media print{.md-typeset .admonition,.md-typeset details{box-shadow:none}}.md-typeset .admonition>*,.md-typeset details>*{box-sizing:border-box}.md-typeset .admonition :-webkit-any(.admonition,details),.md-typeset details :-webkit-any(.admonition,details){margin-bottom:1em;margin-top:1em}.md-typeset .admonition :-moz-any(.admonition,details),.md-typeset details :-moz-any(.admonition,details){margin-bottom:1em;margin-top:1em}.md-typeset .admonition :is(.admonition,details),.md-typeset details :is(.admonition,details){margin-bottom:1em;margin-top:1em}.md-typeset .admonition .md-typeset__scrollwrap,.md-typeset details .md-typeset__scrollwrap{margin:1em -.6rem}.md-typeset .admonition .md-typeset__table,.md-typeset details .md-typeset__table{padding:0 .6rem}.md-typeset .admonition>.tabbed-set:only-child,.md-typeset details>.tabbed-set:only-child{margin-top:0}html .md-typeset .admonition>:last-child,html .md-typeset details>:last-child{margin-bottom:.6rem}[dir=ltr] .md-typeset .admonition-title,[dir=ltr] .md-typeset summary{padding-left:2rem;padding-right:.6rem}[dir=rtl] .md-typeset .admonition-title,[dir=rtl] .md-typeset summary{padding-left:.6rem;padding-right:2rem}[dir=ltr] .md-typeset .admonition-title,[dir=ltr] .md-typeset summary{border-left-width:.2rem}[dir=rtl] .md-typeset .admonition-title,[dir=rtl] .md-typeset summary{border-right-width:.2rem}[dir=ltr] .md-typeset .admonition-title,[dir=ltr] .md-typeset summary{border-top-left-radius:.1rem}[dir=ltr] .md-typeset .admonition-title,[dir=ltr] .md-typeset summary,[dir=rtl] .md-typeset .admonition-title,[dir=rtl] .md-typeset summary{border-top-right-radius:.1rem}[dir=rtl] .md-typeset .admonition-title,[dir=rtl] .md-typeset summary{border-top-left-radius:.1rem}.md-typeset .admonition-title,.md-typeset summary{background-color:#448aff1a;border:none;font-weight:700;margin:0 -.6rem;padding-bottom:.4rem;padding-top:.4rem;position:relative}html .md-typeset .admonition-title:last-child,html .md-typeset summary:last-child{margin-bottom:0}[dir=ltr] .md-typeset .admonition-title:before,[dir=ltr] .md-typeset summary:before{left:.6rem}[dir=rtl] .md-typeset .admonition-title:before,[dir=rtl] .md-typeset summary:before{right:.6rem}.md-typeset .admonition-title:before,.md-typeset summary:before{background-color:#448aff;content:"";height:1rem;-webkit-mask-image:var(--md-admonition-icon--note);mask-image:var(--md-admonition-icon--note);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.625em;width:1rem}.md-typeset .admonition-title code,.md-typeset summary code{box-shadow:0 0 0 .05rem var(--md-default-fg-color--lightest)}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.note){border-color:#448aff}.md-typeset :-moz-any(.admonition,details):-moz-any(.note){border-color:#448aff}.md-typeset :is(.admonition,details):is(.note){border-color:#448aff}.md-typeset :-webkit-any(.note)>:-webkit-any(.admonition-title,summary){background-color:#448aff1a}.md-typeset :-moz-any(.note)>:-moz-any(.admonition-title,summary){background-color:#448aff1a}.md-typeset :is(.note)>:is(.admonition-title,summary){background-color:#448aff1a}.md-typeset :-webkit-any(.note)>:-webkit-any(.admonition-title,summary):before{background-color:#448aff;-webkit-mask-image:var(--md-admonition-icon--note);mask-image:var(--md-admonition-icon--note)}.md-typeset :-moz-any(.note)>:-moz-any(.admonition-title,summary):before{background-color:#448aff;mask-image:var(--md-admonition-icon--note)}.md-typeset :is(.note)>:is(.admonition-title,summary):before{background-color:#448aff;-webkit-mask-image:var(--md-admonition-icon--note);mask-image:var(--md-admonition-icon--note)}.md-typeset :-webkit-any(.note)>:-webkit-any(.admonition-title,summary):after{color:#448aff}.md-typeset :-moz-any(.note)>:-moz-any(.admonition-title,summary):after{color:#448aff}.md-typeset :is(.note)>:is(.admonition-title,summary):after{color:#448aff}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.abstract,.summary,.tldr){border-color:#00b0ff}.md-typeset :-moz-any(.admonition,details):-moz-any(.abstract,.summary,.tldr){border-color:#00b0ff}.md-typeset :is(.admonition,details):is(.abstract,.summary,.tldr){border-color:#00b0ff}.md-typeset :-webkit-any(.abstract,.summary,.tldr)>:-webkit-any(.admonition-title,summary){background-color:#00b0ff1a}.md-typeset :-moz-any(.abstract,.summary,.tldr)>:-moz-any(.admonition-title,summary){background-color:#00b0ff1a}.md-typeset :is(.abstract,.summary,.tldr)>:is(.admonition-title,summary){background-color:#00b0ff1a}.md-typeset :-webkit-any(.abstract,.summary,.tldr)>:-webkit-any(.admonition-title,summary):before{background-color:#00b0ff;-webkit-mask-image:var(--md-admonition-icon--abstract);mask-image:var(--md-admonition-icon--abstract)}.md-typeset :-moz-any(.abstract,.summary,.tldr)>:-moz-any(.admonition-title,summary):before{background-color:#00b0ff;mask-image:var(--md-admonition-icon--abstract)}.md-typeset :is(.abstract,.summary,.tldr)>:is(.admonition-title,summary):before{background-color:#00b0ff;-webkit-mask-image:var(--md-admonition-icon--abstract);mask-image:var(--md-admonition-icon--abstract)}.md-typeset :-webkit-any(.abstract,.summary,.tldr)>:-webkit-any(.admonition-title,summary):after{color:#00b0ff}.md-typeset :-moz-any(.abstract,.summary,.tldr)>:-moz-any(.admonition-title,summary):after{color:#00b0ff}.md-typeset :is(.abstract,.summary,.tldr)>:is(.admonition-title,summary):after{color:#00b0ff}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.info,.todo){border-color:#00b8d4}.md-typeset :-moz-any(.admonition,details):-moz-any(.info,.todo){border-color:#00b8d4}.md-typeset :is(.admonition,details):is(.info,.todo){border-color:#00b8d4}.md-typeset :-webkit-any(.info,.todo)>:-webkit-any(.admonition-title,summary){background-color:#00b8d41a}.md-typeset :-moz-any(.info,.todo)>:-moz-any(.admonition-title,summary){background-color:#00b8d41a}.md-typeset :is(.info,.todo)>:is(.admonition-title,summary){background-color:#00b8d41a}.md-typeset :-webkit-any(.info,.todo)>:-webkit-any(.admonition-title,summary):before{background-color:#00b8d4;-webkit-mask-image:var(--md-admonition-icon--info);mask-image:var(--md-admonition-icon--info)}.md-typeset :-moz-any(.info,.todo)>:-moz-any(.admonition-title,summary):before{background-color:#00b8d4;mask-image:var(--md-admonition-icon--info)}.md-typeset :is(.info,.todo)>:is(.admonition-title,summary):before{background-color:#00b8d4;-webkit-mask-image:var(--md-admonition-icon--info);mask-image:var(--md-admonition-icon--info)}.md-typeset :-webkit-any(.info,.todo)>:-webkit-any(.admonition-title,summary):after{color:#00b8d4}.md-typeset :-moz-any(.info,.todo)>:-moz-any(.admonition-title,summary):after{color:#00b8d4}.md-typeset :is(.info,.todo)>:is(.admonition-title,summary):after{color:#00b8d4}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.tip,.hint,.important){border-color:#00bfa5}.md-typeset :-moz-any(.admonition,details):-moz-any(.tip,.hint,.important){border-color:#00bfa5}.md-typeset :is(.admonition,details):is(.tip,.hint,.important){border-color:#00bfa5}.md-typeset :-webkit-any(.tip,.hint,.important)>:-webkit-any(.admonition-title,summary){background-color:#00bfa51a}.md-typeset :-moz-any(.tip,.hint,.important)>:-moz-any(.admonition-title,summary){background-color:#00bfa51a}.md-typeset :is(.tip,.hint,.important)>:is(.admonition-title,summary){background-color:#00bfa51a}.md-typeset :-webkit-any(.tip,.hint,.important)>:-webkit-any(.admonition-title,summary):before{background-color:#00bfa5;-webkit-mask-image:var(--md-admonition-icon--tip);mask-image:var(--md-admonition-icon--tip)}.md-typeset :-moz-any(.tip,.hint,.important)>:-moz-any(.admonition-title,summary):before{background-color:#00bfa5;mask-image:var(--md-admonition-icon--tip)}.md-typeset :is(.tip,.hint,.important)>:is(.admonition-title,summary):before{background-color:#00bfa5;-webkit-mask-image:var(--md-admonition-icon--tip);mask-image:var(--md-admonition-icon--tip)}.md-typeset :-webkit-any(.tip,.hint,.important)>:-webkit-any(.admonition-title,summary):after{color:#00bfa5}.md-typeset :-moz-any(.tip,.hint,.important)>:-moz-any(.admonition-title,summary):after{color:#00bfa5}.md-typeset :is(.tip,.hint,.important)>:is(.admonition-title,summary):after{color:#00bfa5}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.success,.check,.done){border-color:#00c853}.md-typeset :-moz-any(.admonition,details):-moz-any(.success,.check,.done){border-color:#00c853}.md-typeset :is(.admonition,details):is(.success,.check,.done){border-color:#00c853}.md-typeset :-webkit-any(.success,.check,.done)>:-webkit-any(.admonition-title,summary){background-color:#00c8531a}.md-typeset :-moz-any(.success,.check,.done)>:-moz-any(.admonition-title,summary){background-color:#00c8531a}.md-typeset :is(.success,.check,.done)>:is(.admonition-title,summary){background-color:#00c8531a}.md-typeset :-webkit-any(.success,.check,.done)>:-webkit-any(.admonition-title,summary):before{background-color:#00c853;-webkit-mask-image:var(--md-admonition-icon--success);mask-image:var(--md-admonition-icon--success)}.md-typeset :-moz-any(.success,.check,.done)>:-moz-any(.admonition-title,summary):before{background-color:#00c853;mask-image:var(--md-admonition-icon--success)}.md-typeset :is(.success,.check,.done)>:is(.admonition-title,summary):before{background-color:#00c853;-webkit-mask-image:var(--md-admonition-icon--success);mask-image:var(--md-admonition-icon--success)}.md-typeset :-webkit-any(.success,.check,.done)>:-webkit-any(.admonition-title,summary):after{color:#00c853}.md-typeset :-moz-any(.success,.check,.done)>:-moz-any(.admonition-title,summary):after{color:#00c853}.md-typeset :is(.success,.check,.done)>:is(.admonition-title,summary):after{color:#00c853}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.question,.help,.faq){border-color:#64dd17}.md-typeset :-moz-any(.admonition,details):-moz-any(.question,.help,.faq){border-color:#64dd17}.md-typeset :is(.admonition,details):is(.question,.help,.faq){border-color:#64dd17}.md-typeset :-webkit-any(.question,.help,.faq)>:-webkit-any(.admonition-title,summary){background-color:#64dd171a}.md-typeset :-moz-any(.question,.help,.faq)>:-moz-any(.admonition-title,summary){background-color:#64dd171a}.md-typeset :is(.question,.help,.faq)>:is(.admonition-title,summary){background-color:#64dd171a}.md-typeset :-webkit-any(.question,.help,.faq)>:-webkit-any(.admonition-title,summary):before{background-color:#64dd17;-webkit-mask-image:var(--md-admonition-icon--question);mask-image:var(--md-admonition-icon--question)}.md-typeset :-moz-any(.question,.help,.faq)>:-moz-any(.admonition-title,summary):before{background-color:#64dd17;mask-image:var(--md-admonition-icon--question)}.md-typeset :is(.question,.help,.faq)>:is(.admonition-title,summary):before{background-color:#64dd17;-webkit-mask-image:var(--md-admonition-icon--question);mask-image:var(--md-admonition-icon--question)}.md-typeset :-webkit-any(.question,.help,.faq)>:-webkit-any(.admonition-title,summary):after{color:#64dd17}.md-typeset :-moz-any(.question,.help,.faq)>:-moz-any(.admonition-title,summary):after{color:#64dd17}.md-typeset :is(.question,.help,.faq)>:is(.admonition-title,summary):after{color:#64dd17}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.warning,.caution,.attention){border-color:#ff9100}.md-typeset :-moz-any(.admonition,details):-moz-any(.warning,.caution,.attention){border-color:#ff9100}.md-typeset :is(.admonition,details):is(.warning,.caution,.attention){border-color:#ff9100}.md-typeset :-webkit-any(.warning,.caution,.attention)>:-webkit-any(.admonition-title,summary){background-color:#ff91001a}.md-typeset :-moz-any(.warning,.caution,.attention)>:-moz-any(.admonition-title,summary){background-color:#ff91001a}.md-typeset :is(.warning,.caution,.attention)>:is(.admonition-title,summary){background-color:#ff91001a}.md-typeset :-webkit-any(.warning,.caution,.attention)>:-webkit-any(.admonition-title,summary):before{background-color:#ff9100;-webkit-mask-image:var(--md-admonition-icon--warning);mask-image:var(--md-admonition-icon--warning)}.md-typeset :-moz-any(.warning,.caution,.attention)>:-moz-any(.admonition-title,summary):before{background-color:#ff9100;mask-image:var(--md-admonition-icon--warning)}.md-typeset :is(.warning,.caution,.attention)>:is(.admonition-title,summary):before{background-color:#ff9100;-webkit-mask-image:var(--md-admonition-icon--warning);mask-image:var(--md-admonition-icon--warning)}.md-typeset :-webkit-any(.warning,.caution,.attention)>:-webkit-any(.admonition-title,summary):after{color:#ff9100}.md-typeset :-moz-any(.warning,.caution,.attention)>:-moz-any(.admonition-title,summary):after{color:#ff9100}.md-typeset :is(.warning,.caution,.attention)>:is(.admonition-title,summary):after{color:#ff9100}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.failure,.fail,.missing){border-color:#ff5252}.md-typeset :-moz-any(.admonition,details):-moz-any(.failure,.fail,.missing){border-color:#ff5252}.md-typeset :is(.admonition,details):is(.failure,.fail,.missing){border-color:#ff5252}.md-typeset :-webkit-any(.failure,.fail,.missing)>:-webkit-any(.admonition-title,summary){background-color:#ff52521a}.md-typeset :-moz-any(.failure,.fail,.missing)>:-moz-any(.admonition-title,summary){background-color:#ff52521a}.md-typeset :is(.failure,.fail,.missing)>:is(.admonition-title,summary){background-color:#ff52521a}.md-typeset :-webkit-any(.failure,.fail,.missing)>:-webkit-any(.admonition-title,summary):before{background-color:#ff5252;-webkit-mask-image:var(--md-admonition-icon--failure);mask-image:var(--md-admonition-icon--failure)}.md-typeset :-moz-any(.failure,.fail,.missing)>:-moz-any(.admonition-title,summary):before{background-color:#ff5252;mask-image:var(--md-admonition-icon--failure)}.md-typeset :is(.failure,.fail,.missing)>:is(.admonition-title,summary):before{background-color:#ff5252;-webkit-mask-image:var(--md-admonition-icon--failure);mask-image:var(--md-admonition-icon--failure)}.md-typeset :-webkit-any(.failure,.fail,.missing)>:-webkit-any(.admonition-title,summary):after{color:#ff5252}.md-typeset :-moz-any(.failure,.fail,.missing)>:-moz-any(.admonition-title,summary):after{color:#ff5252}.md-typeset :is(.failure,.fail,.missing)>:is(.admonition-title,summary):after{color:#ff5252}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.danger,.error){border-color:#ff1744}.md-typeset :-moz-any(.admonition,details):-moz-any(.danger,.error){border-color:#ff1744}.md-typeset :is(.admonition,details):is(.danger,.error){border-color:#ff1744}.md-typeset :-webkit-any(.danger,.error)>:-webkit-any(.admonition-title,summary){background-color:#ff17441a}.md-typeset :-moz-any(.danger,.error)>:-moz-any(.admonition-title,summary){background-color:#ff17441a}.md-typeset :is(.danger,.error)>:is(.admonition-title,summary){background-color:#ff17441a}.md-typeset :-webkit-any(.danger,.error)>:-webkit-any(.admonition-title,summary):before{background-color:#ff1744;-webkit-mask-image:var(--md-admonition-icon--danger);mask-image:var(--md-admonition-icon--danger)}.md-typeset :-moz-any(.danger,.error)>:-moz-any(.admonition-title,summary):before{background-color:#ff1744;mask-image:var(--md-admonition-icon--danger)}.md-typeset :is(.danger,.error)>:is(.admonition-title,summary):before{background-color:#ff1744;-webkit-mask-image:var(--md-admonition-icon--danger);mask-image:var(--md-admonition-icon--danger)}.md-typeset :-webkit-any(.danger,.error)>:-webkit-any(.admonition-title,summary):after{color:#ff1744}.md-typeset :-moz-any(.danger,.error)>:-moz-any(.admonition-title,summary):after{color:#ff1744}.md-typeset :is(.danger,.error)>:is(.admonition-title,summary):after{color:#ff1744}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.bug){border-color:#f50057}.md-typeset :-moz-any(.admonition,details):-moz-any(.bug){border-color:#f50057}.md-typeset :is(.admonition,details):is(.bug){border-color:#f50057}.md-typeset :-webkit-any(.bug)>:-webkit-any(.admonition-title,summary){background-color:#f500571a}.md-typeset :-moz-any(.bug)>:-moz-any(.admonition-title,summary){background-color:#f500571a}.md-typeset :is(.bug)>:is(.admonition-title,summary){background-color:#f500571a}.md-typeset :-webkit-any(.bug)>:-webkit-any(.admonition-title,summary):before{background-color:#f50057;-webkit-mask-image:var(--md-admonition-icon--bug);mask-image:var(--md-admonition-icon--bug)}.md-typeset :-moz-any(.bug)>:-moz-any(.admonition-title,summary):before{background-color:#f50057;mask-image:var(--md-admonition-icon--bug)}.md-typeset :is(.bug)>:is(.admonition-title,summary):before{background-color:#f50057;-webkit-mask-image:var(--md-admonition-icon--bug);mask-image:var(--md-admonition-icon--bug)}.md-typeset :-webkit-any(.bug)>:-webkit-any(.admonition-title,summary):after{color:#f50057}.md-typeset :-moz-any(.bug)>:-moz-any(.admonition-title,summary):after{color:#f50057}.md-typeset :is(.bug)>:is(.admonition-title,summary):after{color:#f50057}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.example){border-color:#7c4dff}.md-typeset :-moz-any(.admonition,details):-moz-any(.example){border-color:#7c4dff}.md-typeset :is(.admonition,details):is(.example){border-color:#7c4dff}.md-typeset :-webkit-any(.example)>:-webkit-any(.admonition-title,summary){background-color:#7c4dff1a}.md-typeset :-moz-any(.example)>:-moz-any(.admonition-title,summary){background-color:#7c4dff1a}.md-typeset :is(.example)>:is(.admonition-title,summary){background-color:#7c4dff1a}.md-typeset :-webkit-any(.example)>:-webkit-any(.admonition-title,summary):before{background-color:#7c4dff;-webkit-mask-image:var(--md-admonition-icon--example);mask-image:var(--md-admonition-icon--example)}.md-typeset :-moz-any(.example)>:-moz-any(.admonition-title,summary):before{background-color:#7c4dff;mask-image:var(--md-admonition-icon--example)}.md-typeset :is(.example)>:is(.admonition-title,summary):before{background-color:#7c4dff;-webkit-mask-image:var(--md-admonition-icon--example);mask-image:var(--md-admonition-icon--example)}.md-typeset :-webkit-any(.example)>:-webkit-any(.admonition-title,summary):after{color:#7c4dff}.md-typeset :-moz-any(.example)>:-moz-any(.admonition-title,summary):after{color:#7c4dff}.md-typeset :is(.example)>:is(.admonition-title,summary):after{color:#7c4dff}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.quote,.cite){border-color:#9e9e9e}.md-typeset :-moz-any(.admonition,details):-moz-any(.quote,.cite){border-color:#9e9e9e}.md-typeset :is(.admonition,details):is(.quote,.cite){border-color:#9e9e9e}.md-typeset :-webkit-any(.quote,.cite)>:-webkit-any(.admonition-title,summary){background-color:#9e9e9e1a}.md-typeset :-moz-any(.quote,.cite)>:-moz-any(.admonition-title,summary){background-color:#9e9e9e1a}.md-typeset :is(.quote,.cite)>:is(.admonition-title,summary){background-color:#9e9e9e1a}.md-typeset :-webkit-any(.quote,.cite)>:-webkit-any(.admonition-title,summary):before{background-color:#9e9e9e;-webkit-mask-image:var(--md-admonition-icon--quote);mask-image:var(--md-admonition-icon--quote)}.md-typeset :-moz-any(.quote,.cite)>:-moz-any(.admonition-title,summary):before{background-color:#9e9e9e;mask-image:var(--md-admonition-icon--quote)}.md-typeset :is(.quote,.cite)>:is(.admonition-title,summary):before{background-color:#9e9e9e;-webkit-mask-image:var(--md-admonition-icon--quote);mask-image:var(--md-admonition-icon--quote)}.md-typeset :-webkit-any(.quote,.cite)>:-webkit-any(.admonition-title,summary):after{color:#9e9e9e}.md-typeset :-moz-any(.quote,.cite)>:-moz-any(.admonition-title,summary):after{color:#9e9e9e}.md-typeset :is(.quote,.cite)>:is(.admonition-title,summary):after{color:#9e9e9e}:root{--md-footnotes-icon:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .footnote{color:var(--md-default-fg-color--light);font-size:.64rem}[dir=ltr] .md-typeset .footnote>ol{margin-left:0}[dir=rtl] .md-typeset .footnote>ol{margin-right:0}.md-typeset .footnote>ol>li{transition:color 125ms}.md-typeset .footnote>ol>li:target{color:var(--md-default-fg-color)}.md-typeset .footnote>ol>li:focus-within .footnote-backref{opacity:1;transform:translateX(0);transition:none}.md-typeset .footnote>ol>li:-webkit-any(:hover,:target) .footnote-backref{opacity:1;transform:translateX(0)}.md-typeset .footnote>ol>li:-moz-any(:hover,:target) .footnote-backref{opacity:1;transform:translateX(0)}.md-typeset .footnote>ol>li:is(:hover,:target) .footnote-backref{opacity:1;transform:translateX(0)}.md-typeset .footnote>ol>li>:first-child{margin-top:0}.md-typeset .footnote-ref{font-size:.75em;font-weight:700}html .md-typeset .footnote-ref{outline-offset:.1rem}.md-typeset [id^="fnref:"]:target>.footnote-ref{outline:auto}.md-typeset .footnote-backref{color:var(--md-typeset-a-color);display:inline-block;font-size:0;opacity:0;transform:translateX(.25rem);transition:color .25s,transform .25s .25s,opacity 125ms .25s;vertical-align:text-bottom}@media print{.md-typeset .footnote-backref{color:var(--md-typeset-a-color);opacity:1;transform:translateX(0)}}[dir=rtl] .md-typeset .footnote-backref{transform:translateX(-.25rem)}.md-typeset .footnote-backref:hover{color:var(--md-accent-fg-color)}.md-typeset .footnote-backref:before{background-color:currentcolor;content:"";display:inline-block;height:.8rem;-webkit-mask-image:var(--md-footnotes-icon);mask-image:var(--md-footnotes-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:.8rem}[dir=rtl] .md-typeset .footnote-backref:before svg{transform:scaleX(-1)}[dir=ltr] .md-typeset .headerlink{margin-left:.5rem}[dir=rtl] .md-typeset .headerlink{margin-right:.5rem}.md-typeset .headerlink{color:var(--md-default-fg-color--lighter);display:inline-block;opacity:0;transition:color .25s,opacity 125ms}@media print{.md-typeset .headerlink{display:none}}.md-typeset .headerlink:focus,.md-typeset :-webkit-any(:hover,:target)>.headerlink{opacity:1;-webkit-transition:color .25s,opacity 125ms;transition:color .25s,opacity 125ms}.md-typeset .headerlink:focus,.md-typeset :-moz-any(:hover,:target)>.headerlink{opacity:1;-moz-transition:color .25s,opacity 125ms;transition:color .25s,opacity 125ms}.md-typeset .headerlink:focus,.md-typeset :is(:hover,:target)>.headerlink{opacity:1;transition:color .25s,opacity 125ms}.md-typeset .headerlink:-webkit-any(:focus,:hover),.md-typeset :target>.headerlink{color:var(--md-accent-fg-color)}.md-typeset .headerlink:-moz-any(:focus,:hover),.md-typeset :target>.headerlink{color:var(--md-accent-fg-color)}.md-typeset .headerlink:is(:focus,:hover),.md-typeset :target>.headerlink{color:var(--md-accent-fg-color)}.md-typeset :target{--md-scroll-margin:3.6rem;--md-scroll-offset:0rem;scroll-margin-top:calc(var(--md-scroll-margin) - var(--md-scroll-offset))}@media screen and (min-width:76.25em){.md-header--lifted~.md-container .md-typeset :target{--md-scroll-margin:6rem}}.md-typeset :-webkit-any(h1,h2,h3):target{--md-scroll-offset:0.2rem}.md-typeset :-moz-any(h1,h2,h3):target{--md-scroll-offset:0.2rem}.md-typeset :is(h1,h2,h3):target{--md-scroll-offset:0.2rem}.md-typeset h4:target{--md-scroll-offset:0.15rem}.md-typeset div.arithmatex{overflow:auto}@media screen and (max-width:44.9375em){.md-typeset div.arithmatex{margin:0 -.8rem}}.md-typeset div.arithmatex>*{margin-left:auto!important;margin-right:auto!important;padding:0 .8rem;touch-action:auto;width:-webkit-min-content;width:-moz-min-content;width:min-content}.md-typeset div.arithmatex>* mjx-container{margin:0!important}.md-typeset :-webkit-any(del,ins,.comment).critic{-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset :-moz-any(del,ins,.comment).critic{box-decoration-break:clone}.md-typeset :is(del,ins,.comment).critic{-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:var(--md-typeset-del-color)}.md-typeset ins.critic{background-color:var(--md-typeset-ins-color)}.md-typeset .critic.comment{color:var(--md-code-hl-comment-color)}.md-typeset .critic.comment:before{content:"/* "}.md-typeset .critic.comment:after{content:" */"}.md-typeset .critic.block{box-shadow:none;display:block;margin:1em 0;overflow:auto;padding-left:.8rem;padding-right:.8rem}.md-typeset .critic.block>:first-child{margin-top:.5em}.md-typeset .critic.block>:last-child{margin-bottom:.5em}:root{--md-details-icon:url('data:image/svg+xml;charset=utf-8,')}.md-typeset details{display:flow-root;overflow:visible;padding-top:0}.md-typeset details[open]>summary:after{transform:rotate(90deg)}.md-typeset details:not([open]){box-shadow:none;padding-bottom:0}.md-typeset details:not([open])>summary{border-radius:.1rem}[dir=ltr] .md-typeset summary{padding-right:1.8rem}[dir=rtl] .md-typeset summary{padding-left:1.8rem}[dir=ltr] .md-typeset summary{border-top-left-radius:.1rem}[dir=ltr] .md-typeset summary,[dir=rtl] .md-typeset summary{border-top-right-radius:.1rem}[dir=rtl] .md-typeset summary{border-top-left-radius:.1rem}.md-typeset summary{cursor:pointer;display:block;min-height:1rem}.md-typeset summary.focus-visible{outline-color:var(--md-accent-fg-color);outline-offset:.2rem}.md-typeset summary:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}[dir=ltr] .md-typeset summary:after{right:.4rem}[dir=rtl] .md-typeset summary:after{left:.4rem}.md-typeset summary:after{background-color:currentcolor;content:"";height:1rem;-webkit-mask-image:var(--md-details-icon);mask-image:var(--md-details-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.625em;transform:rotate(0deg);transition:transform .25s;width:1rem}[dir=rtl] .md-typeset summary:after{transform:rotate(180deg)}.md-typeset summary::marker{display:none}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset :-webkit-any(.emojione,.twemoji,.gemoji){display:inline-flex;height:1.125em;vertical-align:text-top}.md-typeset :-moz-any(.emojione,.twemoji,.gemoji){display:inline-flex;height:1.125em;vertical-align:text-top}.md-typeset :is(.emojione,.twemoji,.gemoji){display:inline-flex;height:1.125em;vertical-align:text-top}.md-typeset :-webkit-any(.emojione,.twemoji,.gemoji) svg{fill:currentcolor;max-height:100%;width:1.125em}.md-typeset :-moz-any(.emojione,.twemoji,.gemoji) svg{fill:currentcolor;max-height:100%;width:1.125em}.md-typeset :is(.emojione,.twemoji,.gemoji) svg{fill:currentcolor;max-height:100%;width:1.125em}.highlight :-webkit-any(.o,.ow){color:var(--md-code-hl-operator-color)}.highlight :-moz-any(.o,.ow){color:var(--md-code-hl-operator-color)}.highlight :is(.o,.ow){color:var(--md-code-hl-operator-color)}.highlight .p{color:var(--md-code-hl-punctuation-color)}.highlight :-webkit-any(.cpf,.l,.s,.sb,.sc,.s2,.si,.s1,.ss){color:var(--md-code-hl-string-color)}.highlight :-moz-any(.cpf,.l,.s,.sb,.sc,.s2,.si,.s1,.ss){color:var(--md-code-hl-string-color)}.highlight :is(.cpf,.l,.s,.sb,.sc,.s2,.si,.s1,.ss){color:var(--md-code-hl-string-color)}.highlight :-webkit-any(.cp,.se,.sh,.sr,.sx){color:var(--md-code-hl-special-color)}.highlight :-moz-any(.cp,.se,.sh,.sr,.sx){color:var(--md-code-hl-special-color)}.highlight :is(.cp,.se,.sh,.sr,.sx){color:var(--md-code-hl-special-color)}.highlight :-webkit-any(.m,.mb,.mf,.mh,.mi,.il,.mo){color:var(--md-code-hl-number-color)}.highlight :-moz-any(.m,.mb,.mf,.mh,.mi,.il,.mo){color:var(--md-code-hl-number-color)}.highlight :is(.m,.mb,.mf,.mh,.mi,.il,.mo){color:var(--md-code-hl-number-color)}.highlight :-webkit-any(.k,.kd,.kn,.kp,.kr,.kt){color:var(--md-code-hl-keyword-color)}.highlight :-moz-any(.k,.kd,.kn,.kp,.kr,.kt){color:var(--md-code-hl-keyword-color)}.highlight :is(.k,.kd,.kn,.kp,.kr,.kt){color:var(--md-code-hl-keyword-color)}.highlight :-webkit-any(.kc,.n){color:var(--md-code-hl-name-color)}.highlight :-moz-any(.kc,.n){color:var(--md-code-hl-name-color)}.highlight :is(.kc,.n){color:var(--md-code-hl-name-color)}.highlight :-webkit-any(.no,.nb,.bp){color:var(--md-code-hl-constant-color)}.highlight :-moz-any(.no,.nb,.bp){color:var(--md-code-hl-constant-color)}.highlight :is(.no,.nb,.bp){color:var(--md-code-hl-constant-color)}.highlight :-webkit-any(.nc,.ne,.nf,.nn){color:var(--md-code-hl-function-color)}.highlight :-moz-any(.nc,.ne,.nf,.nn){color:var(--md-code-hl-function-color)}.highlight :is(.nc,.ne,.nf,.nn){color:var(--md-code-hl-function-color)}.highlight :-webkit-any(.nd,.ni,.nl,.nt){color:var(--md-code-hl-keyword-color)}.highlight :-moz-any(.nd,.ni,.nl,.nt){color:var(--md-code-hl-keyword-color)}.highlight :is(.nd,.ni,.nl,.nt){color:var(--md-code-hl-keyword-color)}.highlight :-webkit-any(.c,.cm,.c1,.ch,.cs,.sd){color:var(--md-code-hl-comment-color)}.highlight :-moz-any(.c,.cm,.c1,.ch,.cs,.sd){color:var(--md-code-hl-comment-color)}.highlight :is(.c,.cm,.c1,.ch,.cs,.sd){color:var(--md-code-hl-comment-color)}.highlight :-webkit-any(.na,.nv,.vc,.vg,.vi){color:var(--md-code-hl-variable-color)}.highlight :-moz-any(.na,.nv,.vc,.vg,.vi){color:var(--md-code-hl-variable-color)}.highlight :is(.na,.nv,.vc,.vg,.vi){color:var(--md-code-hl-variable-color)}.highlight :-webkit-any(.ge,.gr,.gh,.go,.gp,.gs,.gu,.gt){color:var(--md-code-hl-generic-color)}.highlight :-moz-any(.ge,.gr,.gh,.go,.gp,.gs,.gu,.gt){color:var(--md-code-hl-generic-color)}.highlight :is(.ge,.gr,.gh,.go,.gp,.gs,.gu,.gt){color:var(--md-code-hl-generic-color)}.highlight :-webkit-any(.gd,.gi){border-radius:.1rem;margin:0 -.125em;padding:0 .125em}.highlight :-moz-any(.gd,.gi){border-radius:.1rem;margin:0 -.125em;padding:0 .125em}.highlight :is(.gd,.gi){border-radius:.1rem;margin:0 -.125em;padding:0 .125em}.highlight .gd{background-color:var(--md-typeset-del-color)}.highlight .gi{background-color:var(--md-typeset-ins-color)}.highlight .hll{background-color:var(--md-code-hl-color);display:block;margin:0 -1.1764705882em;padding:0 1.1764705882em}.highlight span.filename{background-color:var(--md-code-bg-color);border-bottom:.05rem solid var(--md-default-fg-color--lightest);border-top-left-radius:.1rem;border-top-right-radius:.1rem;display:flow-root;font-size:.85em;font-weight:700;margin-top:1em;padding:.6617647059em 1.1764705882em;position:relative}.highlight span.filename+pre{margin-top:0}.highlight span.filename+pre>code{border-top-left-radius:0;border-top-right-radius:0}.highlight [data-linenos]:before{background-color:var(--md-code-bg-color);box-shadow:-.05rem 0 var(--md-default-fg-color--lightest) inset;color:var(--md-default-fg-color--light);content:attr(data-linenos);float:left;left:-1.1764705882em;margin-left:-1.1764705882em;margin-right:1.1764705882em;padding-left:1.1764705882em;position:-webkit-sticky;position:sticky;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:3}.highlight code a[id]{position:absolute;visibility:hidden}.highlight code[data-md-copying] .hll{display:contents}.highlight code[data-md-copying] .md-annotation{display:none}.highlighttable{display:flow-root}.highlighttable :-webkit-any(tbody,td){display:block;padding:0}.highlighttable :-moz-any(tbody,td){display:block;padding:0}.highlighttable :is(tbody,td){display:block;padding:0}.highlighttable tr{display:flex}.highlighttable pre{margin:0}.highlighttable th.filename{flex-grow:1;padding:0;text-align:left}.highlighttable th.filename span.filename{margin-top:0}.highlighttable .linenos{background-color:var(--md-code-bg-color);border-bottom-left-radius:.1rem;border-top-left-radius:.1rem;font-size:.85em;padding:.7720588235em 0 .7720588235em 1.1764705882em;-webkit-user-select:none;-moz-user-select:none;user-select:none}.highlighttable .linenodiv{box-shadow:-.05rem 0 var(--md-default-fg-color--lightest) inset;padding-right:.5882352941em}.highlighttable .linenodiv pre{color:var(--md-default-fg-color--light);text-align:right}.highlighttable .code{flex:1;min-width:0}.linenodiv a{color:inherit}.md-typeset .highlighttable{direction:ltr;margin:1em 0}.md-typeset .highlighttable>tbody>tr>.code>div>pre>code{border-bottom-left-radius:0;border-top-left-radius:0}.md-typeset .highlight+.result{border:.05rem solid var(--md-code-bg-color);border-bottom-left-radius:.1rem;border-bottom-right-radius:.1rem;border-top-width:.1rem;margin-top:-1.125em;overflow:visible;padding:0 1em}.md-typeset .highlight+.result:after{clear:both;content:"";display:block}@media screen and (max-width:44.9375em){.md-content__inner>.highlight{margin:1em -.8rem}.md-content__inner>.highlight>.filename,.md-content__inner>.highlight>.highlighttable>tbody>tr>.code>div>pre>code,.md-content__inner>.highlight>.highlighttable>tbody>tr>.filename span.filename,.md-content__inner>.highlight>.highlighttable>tbody>tr>.linenos,.md-content__inner>.highlight>pre>code{border-radius:0}.md-content__inner>.highlight+.result{border-left-width:0;border-radius:0;border-right-width:0;margin-left:-.8rem;margin-right:-.8rem}}.md-typeset .keys kbd:-webkit-any(:before,:after){-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;color:inherit;margin:0;position:relative}.md-typeset .keys kbd:-moz-any(:before,:after){-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;color:inherit;margin:0;position:relative}.md-typeset .keys kbd:is(:before,:after){-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;color:inherit;margin:0;position:relative}.md-typeset .keys span{color:var(--md-default-fg-color--light);padding:0 .2em}.md-typeset .keys .key-alt:before,.md-typeset .keys .key-left-alt:before,.md-typeset .keys .key-right-alt:before{content:"โއ";padding-right:.4em}.md-typeset .keys .key-command:before,.md-typeset .keys .key-left-command:before,.md-typeset .keys .key-right-command:before{content:"โŒ˜";padding-right:.4em}.md-typeset .keys .key-control:before,.md-typeset .keys .key-left-control:before,.md-typeset .keys .key-right-control:before{content:"โŒƒ";padding-right:.4em}.md-typeset .keys .key-left-meta:before,.md-typeset .keys .key-meta:before,.md-typeset .keys .key-right-meta:before{content:"โ—†";padding-right:.4em}.md-typeset .keys .key-left-option:before,.md-typeset .keys .key-option:before,.md-typeset .keys .key-right-option:before{content:"โŒฅ";padding-right:.4em}.md-typeset .keys .key-left-shift:before,.md-typeset .keys .key-right-shift:before,.md-typeset .keys .key-shift:before{content:"โ‡ง";padding-right:.4em}.md-typeset .keys .key-left-super:before,.md-typeset .keys .key-right-super:before,.md-typeset .keys .key-super:before{content:"โ–";padding-right:.4em}.md-typeset .keys .key-left-windows:before,.md-typeset .keys .key-right-windows:before,.md-typeset .keys .key-windows:before{content:"โŠž";padding-right:.4em}.md-typeset .keys .key-arrow-down:before{content:"โ†“";padding-right:.4em}.md-typeset .keys .key-arrow-left:before{content:"โ†";padding-right:.4em}.md-typeset .keys .key-arrow-right:before{content:"โ†’";padding-right:.4em}.md-typeset .keys .key-arrow-up:before{content:"โ†‘";padding-right:.4em}.md-typeset .keys .key-backspace:before{content:"โŒซ";padding-right:.4em}.md-typeset .keys .key-backtab:before{content:"โ‡ค";padding-right:.4em}.md-typeset .keys .key-caps-lock:before{content:"โ‡ช";padding-right:.4em}.md-typeset .keys .key-clear:before{content:"โŒง";padding-right:.4em}.md-typeset .keys .key-context-menu:before{content:"โ˜ฐ";padding-right:.4em}.md-typeset .keys .key-delete:before{content:"โŒฆ";padding-right:.4em}.md-typeset .keys .key-eject:before{content:"โ";padding-right:.4em}.md-typeset .keys .key-end:before{content:"โค“";padding-right:.4em}.md-typeset .keys .key-escape:before{content:"โŽ‹";padding-right:.4em}.md-typeset .keys .key-home:before{content:"โค’";padding-right:.4em}.md-typeset .keys .key-insert:before{content:"โŽ€";padding-right:.4em}.md-typeset .keys .key-page-down:before{content:"โ‡Ÿ";padding-right:.4em}.md-typeset .keys .key-page-up:before{content:"โ‡ž";padding-right:.4em}.md-typeset .keys .key-print-screen:before{content:"โŽ™";padding-right:.4em}.md-typeset .keys .key-tab:after{content:"โ‡ฅ";padding-left:.4em}.md-typeset .keys .key-num-enter:after{content:"โŒค";padding-left:.4em}.md-typeset .keys .key-enter:after{content:"โŽ";padding-left:.4em}:root{--md-tabbed-icon--prev:url('data:image/svg+xml;charset=utf-8,');--md-tabbed-icon--next:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .tabbed-set{border-radius:.1rem;display:flex;flex-flow:column wrap;margin:1em 0;position:relative}.md-typeset .tabbed-set>input{height:0;opacity:0;position:absolute;width:0}.md-typeset .tabbed-set>input:target{--md-scroll-offset:0.625em}.md-typeset .tabbed-labels{-ms-overflow-style:none;box-shadow:0 -.05rem var(--md-default-fg-color--lightest) inset;display:flex;max-width:100%;overflow:auto;scrollbar-width:none}@media print{.md-typeset .tabbed-labels{display:contents}}@media screen{.js .md-typeset .tabbed-labels{position:relative}.js .md-typeset .tabbed-labels:before{background:var(--md-accent-fg-color);bottom:0;content:"";display:block;height:2px;left:0;position:absolute;transform:translateX(var(--md-indicator-x));transition:width 225ms,transform .25s;transition-timing-function:cubic-bezier(.4,0,.2,1);width:var(--md-indicator-width)}}.md-typeset .tabbed-labels::-webkit-scrollbar{display:none}.md-typeset .tabbed-labels>label{border-bottom:.1rem solid #0000;border-radius:.1rem .1rem 0 0;color:var(--md-default-fg-color--light);cursor:pointer;flex-shrink:0;font-size:.64rem;font-weight:700;padding:.78125em 1.25em .625em;scroll-margin-inline-start:1rem;transition:background-color .25s,color .25s;white-space:nowrap;width:auto}@media print{.md-typeset .tabbed-labels>label:first-child{order:1}.md-typeset .tabbed-labels>label:nth-child(2){order:2}.md-typeset .tabbed-labels>label:nth-child(3){order:3}.md-typeset .tabbed-labels>label:nth-child(4){order:4}.md-typeset .tabbed-labels>label:nth-child(5){order:5}.md-typeset .tabbed-labels>label:nth-child(6){order:6}.md-typeset .tabbed-labels>label:nth-child(7){order:7}.md-typeset .tabbed-labels>label:nth-child(8){order:8}.md-typeset .tabbed-labels>label:nth-child(9){order:9}.md-typeset .tabbed-labels>label:nth-child(10){order:10}.md-typeset .tabbed-labels>label:nth-child(11){order:11}.md-typeset .tabbed-labels>label:nth-child(12){order:12}.md-typeset .tabbed-labels>label:nth-child(13){order:13}.md-typeset .tabbed-labels>label:nth-child(14){order:14}.md-typeset .tabbed-labels>label:nth-child(15){order:15}.md-typeset .tabbed-labels>label:nth-child(16){order:16}.md-typeset .tabbed-labels>label:nth-child(17){order:17}.md-typeset .tabbed-labels>label:nth-child(18){order:18}.md-typeset .tabbed-labels>label:nth-child(19){order:19}.md-typeset .tabbed-labels>label:nth-child(20){order:20}}.md-typeset .tabbed-labels>label:hover{color:var(--md-accent-fg-color)}.md-typeset .tabbed-content{width:100%}@media print{.md-typeset .tabbed-content{display:contents}}.md-typeset .tabbed-block{display:none}@media print{.md-typeset .tabbed-block{display:block}.md-typeset .tabbed-block:first-child{order:1}.md-typeset .tabbed-block:nth-child(2){order:2}.md-typeset .tabbed-block:nth-child(3){order:3}.md-typeset .tabbed-block:nth-child(4){order:4}.md-typeset .tabbed-block:nth-child(5){order:5}.md-typeset .tabbed-block:nth-child(6){order:6}.md-typeset .tabbed-block:nth-child(7){order:7}.md-typeset .tabbed-block:nth-child(8){order:8}.md-typeset .tabbed-block:nth-child(9){order:9}.md-typeset .tabbed-block:nth-child(10){order:10}.md-typeset .tabbed-block:nth-child(11){order:11}.md-typeset .tabbed-block:nth-child(12){order:12}.md-typeset .tabbed-block:nth-child(13){order:13}.md-typeset .tabbed-block:nth-child(14){order:14}.md-typeset .tabbed-block:nth-child(15){order:15}.md-typeset .tabbed-block:nth-child(16){order:16}.md-typeset .tabbed-block:nth-child(17){order:17}.md-typeset .tabbed-block:nth-child(18){order:18}.md-typeset .tabbed-block:nth-child(19){order:19}.md-typeset .tabbed-block:nth-child(20){order:20}}.md-typeset .tabbed-block>.highlight:first-child>pre,.md-typeset .tabbed-block>pre:first-child{margin:0}.md-typeset .tabbed-block>.highlight:first-child>pre>code,.md-typeset .tabbed-block>pre:first-child>code{border-top-left-radius:0;border-top-right-radius:0}.md-typeset .tabbed-block>.highlight:first-child>.filename{border-top-left-radius:0;border-top-right-radius:0;margin:0}.md-typeset .tabbed-block>.highlight:first-child>.highlighttable{margin:0}.md-typeset .tabbed-block>.highlight:first-child>.highlighttable>tbody>tr>.filename span.filename,.md-typeset .tabbed-block>.highlight:first-child>.highlighttable>tbody>tr>.linenos{border-top-left-radius:0;border-top-right-radius:0;margin:0}.md-typeset .tabbed-block>.highlight:first-child>.highlighttable>tbody>tr>.code>div>pre>code{border-top-left-radius:0;border-top-right-radius:0}.md-typeset .tabbed-block>.highlight:first-child+.result{margin-top:-.125em}.md-typeset .tabbed-block>.tabbed-set{margin:0}.md-typeset .tabbed-button{align-self:center;border-radius:100%;color:var(--md-default-fg-color--light);cursor:pointer;display:block;height:.9rem;margin-top:.1rem;pointer-events:auto;transition:background-color .25s;width:.9rem}.md-typeset .tabbed-button:hover{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-typeset .tabbed-button:after{background-color:currentcolor;content:"";display:block;height:100%;-webkit-mask-image:var(--md-tabbed-icon--prev);mask-image:var(--md-tabbed-icon--prev);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;transition:background-color .25s,transform .25s;width:100%}.md-typeset .tabbed-control{background:linear-gradient(to right,var(--md-default-bg-color) 60%,#0000);display:flex;height:1.9rem;justify-content:start;pointer-events:none;position:absolute;transition:opacity 125ms;width:1.2rem}[dir=rtl] .md-typeset .tabbed-control{transform:rotate(180deg)}.md-typeset .tabbed-control[hidden]{opacity:0}.md-typeset .tabbed-control--next{background:linear-gradient(to left,var(--md-default-bg-color) 60%,#0000);justify-content:end;right:0}.md-typeset .tabbed-control--next .tabbed-button:after{-webkit-mask-image:var(--md-tabbed-icon--next);mask-image:var(--md-tabbed-icon--next)}@media screen and (max-width:44.9375em){[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels{padding-left:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels{padding-right:.8rem}.md-content__inner>.tabbed-set .tabbed-labels{margin:0 -.8rem;max-width:100vw;scroll-padding-inline-start:.8rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels:after{padding-right:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels:after{padding-left:.8rem}.md-content__inner>.tabbed-set .tabbed-labels:after{content:""}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{margin-left:-.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{margin-right:-.8rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{padding-left:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{padding-right:.8rem}.md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{width:2rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{margin-right:-.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{margin-left:-.8rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{padding-right:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{padding-left:.8rem}.md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{width:2rem}}@media screen{.md-typeset .tabbed-set>input:first-child:checked~.tabbed-labels>:first-child,.md-typeset .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),.md-typeset .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),.md-typeset .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),.md-typeset .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),.md-typeset .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),.md-typeset .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),.md-typeset .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),.md-typeset .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),.md-typeset .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),.md-typeset .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),.md-typeset .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),.md-typeset .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20),.md-typeset .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),.md-typeset .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),.md-typeset .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),.md-typeset .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),.md-typeset .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),.md-typeset .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),.md-typeset .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9){color:var(--md-accent-fg-color)}.md-typeset .no-js .tabbed-set>input:first-child:checked~.tabbed-labels>:first-child,.md-typeset .no-js .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),.md-typeset .no-js .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),.md-typeset .no-js .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),.md-typeset .no-js .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),.md-typeset .no-js .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),.md-typeset .no-js .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),.md-typeset .no-js .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),.md-typeset .no-js .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),.md-typeset .no-js .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),.md-typeset .no-js .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),.md-typeset .no-js .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),.md-typeset .no-js .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20),.md-typeset .no-js .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),.md-typeset .no-js .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),.md-typeset .no-js .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),.md-typeset .no-js .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),.md-typeset .no-js .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),.md-typeset .no-js .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),.md-typeset .no-js .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),.no-js .md-typeset .tabbed-set>input:first-child:checked~.tabbed-labels>:first-child,.no-js .md-typeset .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),.no-js .md-typeset .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),.no-js .md-typeset .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),.no-js .md-typeset .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),.no-js .md-typeset .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),.no-js .md-typeset .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),.no-js .md-typeset .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),.no-js .md-typeset .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),.no-js .md-typeset .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),.no-js .md-typeset .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),.no-js .md-typeset .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),.no-js .md-typeset .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20),.no-js .md-typeset .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),.no-js .md-typeset .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),.no-js .md-typeset .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),.no-js .md-typeset .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),.no-js .md-typeset .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),.no-js .md-typeset .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),.no-js .md-typeset .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9){border-color:var(--md-accent-fg-color)}}.md-typeset .tabbed-set>input:first-child.focus-visible~.tabbed-labels>:first-child,.md-typeset .tabbed-set>input:nth-child(10).focus-visible~.tabbed-labels>:nth-child(10),.md-typeset .tabbed-set>input:nth-child(11).focus-visible~.tabbed-labels>:nth-child(11),.md-typeset .tabbed-set>input:nth-child(12).focus-visible~.tabbed-labels>:nth-child(12),.md-typeset .tabbed-set>input:nth-child(13).focus-visible~.tabbed-labels>:nth-child(13),.md-typeset .tabbed-set>input:nth-child(14).focus-visible~.tabbed-labels>:nth-child(14),.md-typeset .tabbed-set>input:nth-child(15).focus-visible~.tabbed-labels>:nth-child(15),.md-typeset .tabbed-set>input:nth-child(16).focus-visible~.tabbed-labels>:nth-child(16),.md-typeset .tabbed-set>input:nth-child(17).focus-visible~.tabbed-labels>:nth-child(17),.md-typeset .tabbed-set>input:nth-child(18).focus-visible~.tabbed-labels>:nth-child(18),.md-typeset .tabbed-set>input:nth-child(19).focus-visible~.tabbed-labels>:nth-child(19),.md-typeset .tabbed-set>input:nth-child(2).focus-visible~.tabbed-labels>:nth-child(2),.md-typeset .tabbed-set>input:nth-child(20).focus-visible~.tabbed-labels>:nth-child(20),.md-typeset .tabbed-set>input:nth-child(3).focus-visible~.tabbed-labels>:nth-child(3),.md-typeset .tabbed-set>input:nth-child(4).focus-visible~.tabbed-labels>:nth-child(4),.md-typeset .tabbed-set>input:nth-child(5).focus-visible~.tabbed-labels>:nth-child(5),.md-typeset .tabbed-set>input:nth-child(6).focus-visible~.tabbed-labels>:nth-child(6),.md-typeset .tabbed-set>input:nth-child(7).focus-visible~.tabbed-labels>:nth-child(7),.md-typeset .tabbed-set>input:nth-child(8).focus-visible~.tabbed-labels>:nth-child(8),.md-typeset .tabbed-set>input:nth-child(9).focus-visible~.tabbed-labels>:nth-child(9){background-color:var(--md-accent-fg-color--transparent)}.md-typeset .tabbed-set>input:first-child:checked~.tabbed-content>:first-child,.md-typeset .tabbed-set>input:nth-child(10):checked~.tabbed-content>:nth-child(10),.md-typeset .tabbed-set>input:nth-child(11):checked~.tabbed-content>:nth-child(11),.md-typeset .tabbed-set>input:nth-child(12):checked~.tabbed-content>:nth-child(12),.md-typeset .tabbed-set>input:nth-child(13):checked~.tabbed-content>:nth-child(13),.md-typeset .tabbed-set>input:nth-child(14):checked~.tabbed-content>:nth-child(14),.md-typeset .tabbed-set>input:nth-child(15):checked~.tabbed-content>:nth-child(15),.md-typeset .tabbed-set>input:nth-child(16):checked~.tabbed-content>:nth-child(16),.md-typeset .tabbed-set>input:nth-child(17):checked~.tabbed-content>:nth-child(17),.md-typeset .tabbed-set>input:nth-child(18):checked~.tabbed-content>:nth-child(18),.md-typeset .tabbed-set>input:nth-child(19):checked~.tabbed-content>:nth-child(19),.md-typeset .tabbed-set>input:nth-child(2):checked~.tabbed-content>:nth-child(2),.md-typeset .tabbed-set>input:nth-child(20):checked~.tabbed-content>:nth-child(20),.md-typeset .tabbed-set>input:nth-child(3):checked~.tabbed-content>:nth-child(3),.md-typeset .tabbed-set>input:nth-child(4):checked~.tabbed-content>:nth-child(4),.md-typeset .tabbed-set>input:nth-child(5):checked~.tabbed-content>:nth-child(5),.md-typeset .tabbed-set>input:nth-child(6):checked~.tabbed-content>:nth-child(6),.md-typeset .tabbed-set>input:nth-child(7):checked~.tabbed-content>:nth-child(7),.md-typeset .tabbed-set>input:nth-child(8):checked~.tabbed-content>:nth-child(8),.md-typeset .tabbed-set>input:nth-child(9):checked~.tabbed-content>:nth-child(9){display:block}:root{--md-tasklist-icon:url('data:image/svg+xml;charset=utf-8,');--md-tasklist-icon--checked:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .task-list-item{list-style-type:none;position:relative}[dir=ltr] .md-typeset .task-list-item [type=checkbox]{left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}[dir=ltr] .md-typeset .task-list-indicator:before{left:-1.5em}[dir=rtl] .md-typeset .task-list-indicator:before{right:-1.5em}.md-typeset .task-list-indicator:before{background-color:var(--md-default-fg-color--lightest);content:"";height:1.25em;-webkit-mask-image:var(--md-tasklist-icon);mask-image:var(--md-tasklist-icon);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.15em;width:1.25em}.md-typeset [type=checkbox]:checked+.task-list-indicator:before{background-color:#00e676;-webkit-mask-image:var(--md-tasklist-icon--checked);mask-image:var(--md-tasklist-icon--checked)}:root>*{--md-mermaid-font-family:var(--md-text-font-family),sans-serif;--md-mermaid-edge-color:var(--md-code-fg-color);--md-mermaid-node-bg-color:var(--md-accent-fg-color--transparent);--md-mermaid-node-fg-color:var(--md-accent-fg-color);--md-mermaid-label-bg-color:var(--md-default-bg-color);--md-mermaid-label-fg-color:var(--md-code-fg-color)}.mermaid{line-height:normal;margin:1em 0}@media screen and (min-width:45em){[dir=ltr] .md-typeset .inline{float:left}[dir=rtl] .md-typeset .inline{float:right}[dir=ltr] .md-typeset .inline{margin-right:.8rem}[dir=rtl] .md-typeset .inline{margin-left:.8rem}.md-typeset .inline{margin-bottom:.8rem;margin-top:0;width:11.7rem}[dir=ltr] .md-typeset .inline.end{float:right}[dir=rtl] .md-typeset .inline.end{float:left}[dir=ltr] .md-typeset .inline.end{margin-left:.8rem;margin-right:0}[dir=rtl] .md-typeset .inline.end{margin-left:0;margin-right:.8rem}} \ No newline at end of file diff --git a/assets/stylesheets/main.975780f9.min.css.map b/assets/stylesheets/main.975780f9.min.css.map new file mode 100644 index 0000000..5e13ffb --- /dev/null +++ b/assets/stylesheets/main.975780f9.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["src/assets/stylesheets/main/extensions/pymdownx/_keys.scss","../../../src/assets/stylesheets/main.scss","src/assets/stylesheets/main/_resets.scss","src/assets/stylesheets/main/_colors.scss","src/assets/stylesheets/main/_icons.scss","src/assets/stylesheets/main/_typeset.scss","src/assets/stylesheets/utilities/_break.scss","src/assets/stylesheets/main/layout/_banner.scss","src/assets/stylesheets/main/layout/_base.scss","src/assets/stylesheets/main/layout/_clipboard.scss","src/assets/stylesheets/main/layout/_consent.scss","src/assets/stylesheets/main/layout/_content.scss","src/assets/stylesheets/main/layout/_dialog.scss","src/assets/stylesheets/main/layout/_feedback.scss","src/assets/stylesheets/main/layout/_footer.scss","src/assets/stylesheets/main/layout/_form.scss","src/assets/stylesheets/main/layout/_header.scss","src/assets/stylesheets/main/layout/_nav.scss","src/assets/stylesheets/main/layout/_search.scss","src/assets/stylesheets/main/layout/_select.scss","src/assets/stylesheets/main/layout/_sidebar.scss","src/assets/stylesheets/main/layout/_source.scss","src/assets/stylesheets/main/layout/_tabs.scss","src/assets/stylesheets/main/layout/_tag.scss","src/assets/stylesheets/main/layout/_tooltip.scss","src/assets/stylesheets/main/layout/_top.scss","src/assets/stylesheets/main/layout/_version.scss","src/assets/stylesheets/main/extensions/markdown/_admonition.scss","node_modules/material-design-color/material-color.scss","src/assets/stylesheets/main/extensions/markdown/_footnotes.scss","src/assets/stylesheets/main/extensions/markdown/_toc.scss","src/assets/stylesheets/main/extensions/pymdownx/_arithmatex.scss","src/assets/stylesheets/main/extensions/pymdownx/_critic.scss","src/assets/stylesheets/main/extensions/pymdownx/_details.scss","src/assets/stylesheets/main/extensions/pymdownx/_emoji.scss","src/assets/stylesheets/main/extensions/pymdownx/_highlight.scss","src/assets/stylesheets/main/extensions/pymdownx/_tabbed.scss","src/assets/stylesheets/main/extensions/pymdownx/_tasklist.scss","src/assets/stylesheets/main/integrations/_mermaid.scss","src/assets/stylesheets/main/_modifiers.scss"],"names":[],"mappings":"AAgGM,gBCo+GN,CCxiHA,KAEE,6BAAA,CAAA,0BAAA,CAAA,qBAAA,CADA,qBDzBF,CC8BA,iBAGE,kBD3BF,CC8BE,gCANF,iBAOI,yBDzBF,CACF,CC6BA,KACE,QD1BF,CC8BA,qBAIE,uCD3BF,CC+BA,EACE,aAAA,CACA,oBD5BF,CCgCA,GAME,QAAA,CAJA,kBAAA,CADA,aAAA,CAEA,aAAA,CAEA,gBAAA,CADA,SD3BF,CCiCA,MACE,aD9BF,CCkCA,QAEE,eD/BF,CCmCA,IACE,iBDhCF,CCoCA,MACE,uBAAA,CACA,gBDjCF,CCqCA,MAEE,eAAA,CACA,kBDlCF,CCsCA,OAKE,gBAAA,CACA,QAAA,CAFA,mBAAA,CADA,iBAAA,CAFA,QAAA,CACA,SD/BF,CCuCA,MACE,QAAA,CACA,YDpCF,CErDA,MAIE,6BAAA,CACA,oCAAA,CACA,mCAAA,CACA,0BAAA,CACA,sCAAA,CAGA,4BAAA,CACA,2CAAA,CACA,yBAAA,CACA,qCFmDF,CEpCA,qCAGE,+BAAA,CACA,sCAAA,CACA,wCAAA,CACA,yCAAA,CACA,0BAAA,CACA,sCAAA,CACA,wCAAA,CACA,yCAAA,CAGA,0BAAA,CACA,0BAAA,CAGA,4BAAA,CACA,iCAAA,CACA,kCAAA,CACA,mCAAA,CACA,mCAAA,CACA,kCAAA,CACA,iCAAA,CACA,+CAAA,CACA,6DAAA,CACA,gEAAA,CACA,4DAAA,CACA,4DAAA,CACA,6DAAA,CAGA,6CAAA,CAGA,+CAAA,CAGA,iCAAA,CAGA,gCAAA,CACA,gCAAA,CAGA,8BAAA,CACA,kCAAA,CACA,qCAAA,CAGA,kCAAA,CAGA,mDAAA,CACA,mDAAA,CAGA,yBAAA,CACA,qCAAA,CACA,uCAAA,CACA,8BAAA,CACA,oCAAA,CAGA,8DAAA,CAKA,8DAAA,CAKA,0DFaF,CGjHE,aAIE,iBAAA,CAHA,aAAA,CAEA,aAAA,CADA,YHsHJ,CI3HA,KACE,kCAAA,CACA,iCAAA,CAGA,uGAAA,CAKA,mFJ4HF,CItHA,WAGE,mCAAA,CACA,sCJyHF,CIrHA,wBANE,6BJmIF,CI7HA,aAIE,4BAAA,CACA,sCJwHF,CIhHA,MACE,0NAAA,CACA,mNAAA,CACA,oNJmHF,CI5GA,YAGE,gCAAA,CAAA,kBAAA,CAFA,eAAA,CACA,eJgHF,CI3GE,aAPF,YAQI,gBJ8GF,CACF,CI3GE,uGAME,iBAAA,CAAA,cJ6GJ,CIzGE,eAEE,uCAAA,CAEA,aAAA,CACA,eAAA,CAJA,iBJgHJ,CIvGE,8BAPE,eAAA,CAGA,qBJkHJ,CI9GE,eAGE,kBAAA,CACA,eAAA,CAHA,oBJ6GJ,CIrGE,eAGE,gBAAA,CADA,eAAA,CAGA,qBAAA,CADA,eAAA,CAHA,mBJ2GJ,CInGE,kBACE,eJqGJ,CIjGE,eAEE,eAAA,CACA,qBAAA,CAFA,YJqGJ,CI/FE,8BAGE,uCAAA,CAEA,cAAA,CADA,eAAA,CAEA,qBAAA,CAJA,eJqGJ,CI7FE,eACE,wBJ+FJ,CI3FE,eAGE,+DAAA,CAFA,iBAAA,CACA,cJ8FJ,CIzFE,cACE,+BAAA,CACA,qBJ2FJ,CIxFI,mCAEE,sBJyFN,CIrFI,wCAEE,+BJsFN,CInFM,kDACE,uDJqFR,CIhFI,mBACE,kBAAA,CACA,iCJkFN,CI9EI,4BACE,uCAAA,CACA,oBJgFN,CI3EE,iDAGE,6BAAA,CACA,aAAA,CACA,2BJ6EJ,CI1EI,aARF,iDASI,oBJ+EJ,CACF,CI3EE,iBAIE,wCAAA,CACA,mBAAA,CACA,kCAAA,CAAA,0BAAA,CAJA,eAAA,CADA,uBAAA,CAEA,qBJgFJ,CI1EI,qCAEE,uCAAA,CADA,YJ6EN,CIvEE,gBAEE,iBAAA,CACA,eAAA,CAFA,iBJ2EJ,CItEI,qBAQE,kCAAA,CAAA,0BAAA,CADA,eAAA,CANA,aAAA,CACA,QAAA,CAIA,uCAAA,CAFA,aAAA,CADA,oCAAA,CAQA,yDAAA,CADA,oBAAA,CADA,iBAAA,CAJA,iBJ8EN,CIrEM,2BACE,+CJuER,CInEM,wCAEE,YAAA,CADA,WJsER,CIjEM,8CACE,oDJmER,CIhEQ,oDACE,0CJkEV,CI3DE,gBAOE,4CAAA,CACA,mBAAA,CACA,mKACE,CAPF,gCAAA,CAFA,oBAAA,CAGA,eAAA,CAFA,uBAAA,CAGA,uBAAA,CACA,qBJgEJ,CItDE,iBAGE,6CAAA,CACA,kCAAA,CAAA,0BAAA,CAHA,aAAA,CACA,qBJ0DJ,CIpDE,iBAEE,6DAAA,CACA,WAAA,CAFA,oBJwDJ,CInDI,oBANF,iBAOI,iBJsDJ,CInDI,yDAWE,2CAAA,CACA,mBAAA,CACA,8BAAA,CAJA,gCAAA,CAKA,mBAAA,CAXA,oBAAA,CAOA,eAAA,CAHA,cAAA,CADA,aAAA,CADA,6BAAA,CAAA,qBAAA,CAGA,mBAAA,CAPA,iBAAA,CAGA,UJ+DN,CInEI,sDAWE,2CAAA,CACA,mBAAA,CACA,8BAAA,CAJA,gCAAA,CAKA,mBAAA,CAXA,oBAAA,CAOA,eAAA,CAHA,cAAA,CADA,aAAA,CADA,0BAAA,CAAA,qBAAA,CAGA,mBAAA,CAPA,iBAAA,CAGA,UJ+DN,CInEI,mEAEE,MJiEN,CInEI,gEAEE,MJiEN,CInEI,0DAEE,MJiEN,CInEI,mEAEE,OJiEN,CInEI,gEAEE,OJiEN,CInEI,0DAEE,OJiEN,CInEI,gDAWE,2CAAA,CACA,mBAAA,CACA,8BAAA,CAJA,gCAAA,CAKA,mBAAA,CAXA,oBAAA,CAOA,eAAA,CAHA,cAAA,CADA,aAAA,CADA,6BAAA,CAAA,0BAAA,CAAA,qBAAA,CAGA,mBAAA,CAPA,iBAAA,CAGA,UJ+DN,CACF,CIhDE,kBACE,WJkDJ,CI9CE,oDAEE,qBJgDJ,CIlDE,oDAEE,sBJgDJ,CI5CE,iCACE,kBJiDJ,CIlDE,iCACE,mBJiDJ,CIlDE,iCAIE,2DJ8CJ,CIlDE,iCAIE,4DJ8CJ,CIlDE,uBAGE,uCAAA,CADA,aAAA,CAAA,cJgDJ,CI1CE,eACE,oBJ4CJ,CIxCE,kDAEE,kBJ2CJ,CI7CE,kDAEE,mBJ2CJ,CI7CE,8BAGE,SJ0CJ,CIvCI,0DACE,iBJ0CN,CItCI,oCACE,2BJyCN,CItCM,0CACE,2BJyCR,CIpCI,wDAEE,kBJuCN,CIzCI,wDAEE,mBJuCN,CIzCI,oCACE,kBJwCN,CIpCM,kGAEE,aJwCR,CIpCM,0DACE,eJuCR,CInCM,4EACE,kBAAA,CAAA,eJuCR,CIxCM,sEACE,kBAAA,CAAA,eJuCR,CIxCM,gGAEE,kBJsCR,CIxCM,0FAEE,kBJsCR,CIxCM,8EAEE,kBJsCR,CIxCM,gGAEE,mBJsCR,CIxCM,0FAEE,mBJsCR,CIxCM,8EAEE,mBJsCR,CIxCM,0DACE,kBAAA,CAAA,eJuCR,CIhCE,yBAEE,mBJkCJ,CIpCE,yBAEE,oBJkCJ,CIpCE,eACE,mBAAA,CAAA,cJmCJ,CI9BE,kDAIE,WAAA,CADA,cJiCJ,CIzBI,4BAEE,oBJ2BN,CIvBI,6BAEE,oBJyBN,CIrBI,kCACE,YJuBN,CInBI,8EAEE,YJoBN,CIfE,mBACE,iBAAA,CAGA,eAAA,CADA,cAAA,CAEA,iBAAA,CAHA,yBAAA,CAAA,sBAAA,CAAA,iBJoBJ,CIdI,uBACE,aJgBN,CIXE,uBAGE,iBAAA,CADA,eAAA,CADA,eJeJ,CITE,mBACE,cJWJ,CIPE,+BAKE,2CAAA,CACA,iDAAA,CACA,mBAAA,CANA,oBAAA,CAGA,gBAAA,CAFA,cAAA,CACA,aAAA,CAKA,iBJSJ,CINI,aAXF,+BAYI,aJSJ,CACF,CIJI,iCACE,gBJMN,CICM,gEACE,YJCR,CIFM,6DACE,YJCR,CIFM,uDACE,YJCR,CIGM,+DACE,eJDR,CIAM,4DACE,eJDR,CIAM,sDACE,eJDR,CIMI,gEACE,eJJN,CIGI,6DACE,eJJN,CIGI,uDACE,eJJN,CIOM,0EACE,gBJLR,CIIM,uEACE,gBJLR,CIIM,iEACE,gBJLR,CIUI,kCAGE,eAAA,CAFA,cAAA,CACA,sBAAA,CAEA,kBJRN,CIYI,kCAGE,qDAAA,CAFA,sBAAA,CACA,kBJTN,CIcI,wCACE,iCJZN,CIeM,8CACE,iCAAA,CACA,sDJbR,CIkBI,iCACE,iBJhBN,CIqBE,wCACE,cJnBJ,CIsBI,wDAIE,gBJdN,CIUI,wDAIE,iBJdN,CIUI,8CAUE,UAAA,CATA,oBAAA,CAEA,YAAA,CAGA,oDAAA,CAAA,4CAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CACA,iCAAA,CAJA,0BAAA,CAHA,WJZN,CIwBI,oDACE,oDJtBN,CI0BI,mEACE,kDAAA,CACA,yDAAA,CAAA,iDJxBN,CI4BI,oEACE,kDAAA,CACA,0DAAA,CAAA,kDJ1BN,CI+BE,wBACE,iBAAA,CACA,eAAA,CACA,iBJ7BJ,CIiCE,mBACE,oBAAA,CACA,kBAAA,CACA,eJ/BJ,CIkCI,aANF,mBAOI,aJ/BJ,CACF,CIkCI,8BACE,aAAA,CAEA,QAAA,CACA,eAAA,CAFA,UJ9BN,CK7VI,wCD0YF,uBACE,iBJzCF,CI4CE,4BACE,eJ1CJ,CACF,CM/hBA,WAGE,0CAAA,CADA,+BAAA,CADA,aNmiBF,CM9hBE,aANF,WAOI,YNiiBF,CACF,CM9hBE,oBAEE,uCAAA,CADA,gCNiiBJ,CM5hBE,kBAGE,eAAA,CAFA,iBAAA,CACA,eN+hBJ,CM1hBE,6BACE,WN+hBJ,CMhiBE,6BACE,UN+hBJ,CMhiBE,mBAEE,aAAA,CACA,cAAA,CACA,uBN4hBJ,CMzhBI,yBACE,UN2hBN,CO3jBA,KASE,cAAA,CARA,WAAA,CACA,iBP+jBF,CK3ZI,oCEtKJ,KAaI,gBPwjBF,CACF,CKhaI,oCEtKJ,KAkBI,cPwjBF,CACF,COnjBA,KASE,2CAAA,CAPA,YAAA,CACA,qBAAA,CAKA,eAAA,CAHA,eAAA,CAJA,iBAAA,CAGA,UPyjBF,COjjBE,aAZF,KAaI,aPojBF,CACF,CKjaI,wCEhJF,yBAII,cPijBJ,CACF,COxiBA,SAEE,gBAAA,CAAA,iBAAA,CADA,eP4iBF,COviBA,cACE,YAAA,CACA,qBAAA,CACA,WP0iBF,COviBE,aANF,cAOI,aP0iBF,CACF,COtiBA,SACE,WPyiBF,COtiBE,gBACE,YAAA,CACA,WAAA,CACA,iBPwiBJ,COniBA,aACE,eAAA,CAEA,sBAAA,CADA,kBPuiBF,CO7hBA,WACE,YPgiBF,CO3hBA,WAGE,QAAA,CACA,SAAA,CAHA,iBAAA,CACA,OPgiBF,CO3hBE,uCACE,aP6hBJ,COzhBE,+BAEE,uCAAA,CADA,kBP4hBJ,COthBA,SASE,2CAAA,CACA,mBAAA,CAHA,gCAAA,CACA,gBAAA,CAHA,YAAA,CAQA,SAAA,CAFA,uCAAA,CALA,mBAAA,CALA,cAAA,CAWA,2BAAA,CARA,UPgiBF,COphBE,eAGE,SAAA,CADA,uBAAA,CAEA,oEACE,CAJF,UPyhBJ,CO3gBA,MACE,WP8gBF,CQxqBA,MACE,+PR0qBF,CQpqBA,cAQE,mBAAA,CADA,0CAAA,CAIA,cAAA,CALA,YAAA,CAGA,uCAAA,CACA,oBAAA,CATA,iBAAA,CAEA,UAAA,CADA,QAAA,CAUA,qBAAA,CAPA,WAAA,CADA,SR+qBF,CQpqBE,aAfF,cAgBI,YRuqBF,CACF,CQpqBE,kCAEE,uCAAA,CADA,YRuqBJ,CQlqBE,qBACE,uCRoqBJ,CQhqBE,yCACE,+BRkqBJ,CQnqBE,sCACE,+BRkqBJ,CQnqBE,gCACE,+BRkqBJ,CQ7pBE,oBAKE,6BAAA,CAKA,UAAA,CATA,aAAA,CAEA,cAAA,CACA,aAAA,CAEA,2CAAA,CAAA,mCAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CAPA,aRuqBJ,CQ3pBE,sBACE,cR6pBJ,CQ1pBI,2BACE,2CR4pBN,CQtpBI,sDAEE,uDAAA,CADA,+BRypBN,CQ1pBI,mDAEE,uDAAA,CADA,+BRypBN,CQ1pBI,6CAEE,uDAAA,CADA,+BRypBN,CS/tBA,mBACE,GAEE,SAAA,CADA,0BTmuBF,CS/tBA,GAEE,SAAA,CADA,uBTkuBF,CACF,CS7tBA,mBACE,GACE,ST+tBF,CS5tBA,GACE,ST8tBF,CACF,CSntBE,qBASE,2BAAA,CADA,mCAAA,CAAA,2BAAA,CAFA,0BAAA,CADA,WAAA,CAEA,SAAA,CANA,cAAA,CACA,KAAA,CAEA,UAAA,CADA,ST2tBJ,CSjtBE,mBAcE,mDAAA,CANA,2CAAA,CACA,QAAA,CACA,mBAAA,CARA,QAAA,CASA,kDACE,CAPF,eAAA,CAEA,aAAA,CADA,SAAA,CALA,cAAA,CAGA,UAAA,CADA,ST4tBJ,CS7sBE,kBACE,aT+sBJ,CS3sBE,sBACE,YAAA,CACA,YT6sBJ,CS1sBI,oCACE,aT4sBN,CSvsBE,sBACE,mBTysBJ,CStsBI,6CACE,cTwsBN,CKlmBI,wCIvGA,6CAKI,aAAA,CAEA,gBAAA,CACA,iBAAA,CAFA,UT0sBN,CACF,CSnsBE,kBACE,cTqsBJ,CUtyBA,YACE,WAAA,CAIA,WVsyBF,CUnyBE,mBACE,qBAAA,CACA,iBVqyBJ,CKzoBI,sCKtJE,4EACE,kBVkyBN,CU9xBI,0JACE,mBVgyBN,CUjyBI,8EACE,kBVgyBN,CACF,CU3xBI,0BAGE,UAAA,CAFA,aAAA,CACA,YV8xBN,CUzxBI,+BACE,eV2xBN,CUrxBE,8BACE,WV0xBJ,CU3xBE,8BACE,UV0xBJ,CU3xBE,8BAGE,iBVwxBJ,CU3xBE,8BAGE,kBVwxBJ,CU3xBE,oBAEE,cAAA,CAEA,SVuxBJ,CUpxBI,aAPF,oBAQI,YVuxBJ,CACF,CUpxBI,gCACE,yCVsxBN,CUlxBI,wBACE,cAAA,CACA,kBVoxBN,CUjxBM,kCACE,oBVmxBR,CWp1BA,qBAEE,WXk2BF,CWp2BA,qBAEE,UXk2BF,CWp2BA,WAOE,2CAAA,CACA,mBAAA,CALA,YAAA,CAMA,8BAAA,CAJA,iBAAA,CAMA,SAAA,CALA,mBAAA,CASA,mBAAA,CAdA,cAAA,CASA,0BAAA,CAEA,wCACE,CATF,SXg2BF,CWl1BE,aAlBF,WAmBI,YXq1BF,CACF,CWl1BE,mBAEE,SAAA,CAIA,mBAAA,CALA,uBAAA,CAEA,kEXq1BJ,CW90BE,kBACE,gCAAA,CACA,eXg1BJ,CYn3BA,aACE,gBAAA,CACA,iBZs3BF,CYn3BE,sBAGE,WAAA,CAFA,QAAA,CACA,SZs3BJ,CYj3BE,oBAEE,eAAA,CADA,eZo3BJ,CY/2BE,oBACE,iBZi3BJ,CY72BE,mBAIE,sBAAA,CAFA,YAAA,CACA,cAAA,CAEA,sBAAA,CAJA,iBZm3BJ,CY52BI,iDACE,yCZ82BN,CY12BI,6BACE,iBZ42BN,CYv2BE,mBAGE,uCAAA,CACA,cAAA,CAHA,aAAA,CACA,cAAA,CAGA,sBZy2BJ,CYt2BI,gDACE,+BZw2BN,CYp2BI,4BACE,0CAAA,CACA,mBZs2BN,CYj2BE,mBAGE,SAAA,CAFA,iBAAA,CACA,2BAAA,CAEA,8DZm2BJ,CY91BI,qBAEE,aAAA,CADA,eZi2BN,CY51BI,6BAEE,SAAA,CADA,uBZ+1BN,Ca76BA,WAEE,0CAAA,CADA,+Bbi7BF,Ca76BE,aALF,WAMI,Ybg7BF,CACF,Ca76BE,kBACE,6BAAA,CAEA,aAAA,CADA,abg7BJ,Ca56BI,gCACE,Yb86BN,Caz6BE,iBACE,YAAA,CAKA,cAAA,CAIA,uCAAA,CADA,eAAA,CADA,oBAAA,CADA,kBAAA,CAIA,uBbu6BJ,Cap6BI,4CACE,Ubs6BN,Cav6BI,yCACE,Ubs6BN,Cav6BI,mCACE,Ubs6BN,Cal6BI,+BACE,oBbo6BN,CKrxBI,wCQrII,yCACE,Yb65BR,CACF,Cax5BI,iCACE,gBb25BN,Ca55BI,iCACE,iBb25BN,Ca55BI,uBAEE,gBb05BN,Cav5BM,iCACE,eby5BR,Can5BE,kBAEE,WAAA,CAGA,eAAA,CACA,kBAAA,CAHA,6BAAA,CACA,cAAA,CAHA,iBAAA,CAMA,kBbq5BJ,Caj5BE,mBACE,YAAA,CACA,abm5BJ,Ca/4BE,sBAKE,gBAAA,CAHA,MAAA,CACA,gBAAA,CAGA,UAAA,CAFA,cAAA,CAHA,iBAAA,CACA,Obq5BJ,Ca54BA,gBACE,gDb+4BF,Ca54BE,uBACE,YAAA,CACA,cAAA,CACA,6BAAA,CACA,ab84BJ,Ca14BE,kCACE,sCb44BJ,Caz4BI,6DACE,+Bb24BN,Ca54BI,0DACE,+Bb24BN,Ca54BI,oDACE,+Bb24BN,Can4BA,cAIE,wCAAA,CACA,gBAAA,CAHA,iBAAA,CACA,eAAA,CAFA,Ub04BF,CKj2BI,mCQ1CJ,cASI,Ubs4BF,CACF,Cal4BE,yBACE,sCbo4BJ,Ca73BA,WACE,cAAA,CACA,qBbg4BF,CK92BI,mCQpBJ,WAMI,ebg4BF,CACF,Ca73BE,iBACE,oBAAA,CAEA,aAAA,CACA,iBAAA,CAFA,Ybi4BJ,Ca53BI,wBACE,eb83BN,Ca13BI,qBAGE,iBAAA,CAFA,gBAAA,CACA,mBb63BN,CcpiCE,uBAKE,kBAAA,CACA,mBAAA,CAHA,gCAAA,CAIA,cAAA,CANA,oBAAA,CAGA,eAAA,CAFA,kBAAA,CAMA,gEduiCJ,CcjiCI,gCAEE,2CAAA,CACA,uCAAA,CAFA,gCdqiCN,Cc/hCI,kDAEE,0CAAA,CACA,sCAAA,CAFA,+BdmiCN,CcpiCI,+CAEE,0CAAA,CACA,sCAAA,CAFA,+BdmiCN,CcpiCI,yCAEE,0CAAA,CACA,sCAAA,CAFA,+BdmiCN,Cc5hCE,gCAKE,4BdiiCJ,CctiCE,gEAME,6BdgiCJ,CctiCE,gCAME,4BdgiCJ,CctiCE,sBAIE,6DAAA,CAGA,8BAAA,CAJA,eAAA,CAFA,aAAA,CACA,eAAA,CAMA,sCd8hCJ,CczhCI,iDACE,6CAAA,CACA,8Bd2hCN,Cc7hCI,8CACE,6CAAA,CACA,8Bd2hCN,Cc7hCI,wCACE,6CAAA,CACA,8Bd2hCN,CcvhCI,+BACE,UdyhCN,Ce5kCA,WAOE,2CAAA,CAGA,8CACE,CALF,gCAAA,CADA,aAAA,CAFA,MAAA,CAFA,uBAAA,CAAA,eAAA,CAEA,OAAA,CADA,KAAA,CAEA,SfmlCF,CexkCE,aAfF,WAgBI,Yf2kCF,CACF,CexkCE,mBACE,2BAAA,CACA,iEf0kCJ,CepkCE,mBACE,kDACE,CAEF,kEfokCJ,Ce9jCE,kBAEE,kBAAA,CADA,YAAA,CAEA,efgkCJ,Ce5jCE,mBAKE,kBAAA,CAGA,cAAA,CALA,YAAA,CAIA,uCAAA,CAHA,aAAA,CAHA,iBAAA,CAQA,uBAAA,CAHA,qBAAA,CAJA,SfqkCJ,Ce3jCI,yBACE,Uf6jCN,CezjCI,iCACE,oBf2jCN,CevjCI,uCAEE,uCAAA,CADA,Yf0jCN,CerjCI,2BACE,YAAA,CACA,afujCN,CK18BI,wCU/GA,2BAMI,YfujCN,CACF,CepjCM,iDAIE,iBAAA,CAHA,aAAA,CAEA,aAAA,CADA,UfwjCR,Ce1jCM,8CAIE,iBAAA,CAHA,aAAA,CAEA,aAAA,CADA,UfwjCR,Ce1jCM,wCAIE,iBAAA,CAHA,aAAA,CAEA,aAAA,CADA,UfwjCR,CKx+BI,mCUzEA,iCAII,YfijCN,CACF,Ce9iCM,wCACE,YfgjCR,Ce5iCM,+CACE,oBf8iCR,CKn/BI,sCUtDA,iCAII,YfyiCN,CACF,CepiCE,kBAEE,YAAA,CACA,cAAA,CAFA,iBAAA,CAIA,8DACE,CAFF,kBfuiCJ,CejiCI,oCAGE,SAAA,CAIA,mBAAA,CALA,6BAAA,CAEA,8DACE,CAJF,UfuiCN,Ce9hCM,8CACE,8BfgiCR,Ce3hCI,8BACE,ef6hCN,CexhCE,4BAGE,kBf6hCJ,CehiCE,4BAGE,iBf6hCJ,CehiCE,4BAIE,gBf4hCJ,CehiCE,4BAIE,iBf4hCJ,CehiCE,kBACE,WAAA,CAIA,eAAA,CAHA,aAAA,CAIA,kBf0hCJ,CevhCI,4CAGE,SAAA,CAIA,mBAAA,CALA,8BAAA,CAEA,8DACE,CAJF,Uf6hCN,CephCM,sDACE,6BfshCR,CelhCM,8DAGE,SAAA,CAIA,mBAAA,CALA,uBAAA,CAEA,8DACE,CAJF,SfwhCR,Ce7gCI,uCAGE,WAAA,CAFA,iBAAA,CACA,UfghCN,Ce1gCE,mBACE,YAAA,CACA,aAAA,CACA,cAAA,CAEA,+CACE,CAFF,kBf6gCJ,CevgCI,8DACE,WAAA,CACA,SAAA,CACA,oCfygCN,CelgCE,mBACE,YfogCJ,CKzjCI,mCUoDF,6BAQI,gBfogCJ,Ce5gCA,6BAQI,iBfogCJ,Ce5gCA,mBAKI,aAAA,CAEA,iBAAA,CADA,afsgCJ,CACF,CKjkCI,sCUoDF,6BAaI,kBfogCJ,CejhCA,6BAaI,mBfogCJ,CACF,CgB5uCA,MACE,0MAAA,CACA,gMAAA,CACA,yNhB+uCF,CgBzuCA,QACE,eAAA,CACA,ehB4uCF,CgBzuCE,eACE,aAAA,CAGA,eAAA,CADA,eAAA,CADA,eAAA,CAGA,sBhB2uCJ,CgBxuCI,+BACE,YhB0uCN,CgBvuCM,mCAEE,WAAA,CADA,UhB0uCR,CgBluCQ,6DAME,iBAAA,CALA,aAAA,CAGA,aAAA,CADA,cAAA,CAEA,kBAAA,CAHA,UhBwuCV,CgB1uCQ,0DAME,iBAAA,CALA,aAAA,CAGA,aAAA,CADA,cAAA,CAEA,kBAAA,CAHA,UhBwuCV,CgB1uCQ,oDAME,iBAAA,CALA,aAAA,CAGA,aAAA,CADA,cAAA,CAEA,kBAAA,CAHA,UhBwuCV,CgB7tCE,cAGE,eAAA,CAFA,QAAA,CACA,ShBguCJ,CgB3tCE,cACE,ehB6tCJ,CgB1tCI,sCACE,ehB4tCN,CgB7tCI,sCACE,chB4tCN,CgBvtCE,cAEE,kBAAA,CAKA,cAAA,CANA,YAAA,CAEA,6BAAA,CACA,iBAAA,CACA,eAAA,CAIA,uBAAA,CAHA,sBAAA,CAEA,sBhB0tCJ,CgBttCI,sBACE,uChBwtCN,CgBptCI,oCACE,+BhBstCN,CgBltCI,0CACE,UhBotCN,CgBhtCI,yCACE,+BhBktCN,CgBntCI,sCACE,+BhBktCN,CgBntCI,gCACE,+BhBktCN,CgB9sCI,4BACE,uCAAA,CACA,oBhBgtCN,CgB5sCI,0CACE,YhB8sCN,CgB3sCM,yDAKE,6BAAA,CAJA,aAAA,CAEA,WAAA,CACA,qCAAA,CAAA,6BAAA,CAFA,UhBgtCR,CgBzsCM,kDACE,YhB2sCR,CgBtsCI,gBAEE,cAAA,CADA,YhBysCN,CgBnsCE,cACE,ahBqsCJ,CgBjsCE,gBACE,YhBmsCJ,CKjpCI,wCW3CA,0CASE,2CAAA,CAHA,YAAA,CACA,qBAAA,CACA,WAAA,CAJA,MAAA,CAFA,iBAAA,CAEA,OAAA,CADA,KAAA,CAEA,ShBksCJ,CgBvrCI,4DACE,eAAA,CACA,ehByrCN,CgB3rCI,yDACE,eAAA,CACA,ehByrCN,CgB3rCI,mDACE,eAAA,CACA,ehByrCN,CgBrrCI,gCAOE,qDAAA,CAHA,uCAAA,CAIA,cAAA,CANA,aAAA,CAGA,kBAAA,CAFA,wBAAA,CAFA,iBAAA,CAKA,kBhByrCN,CgBprCM,wDAGE,UhB0rCR,CgB7rCM,wDAGE,WhB0rCR,CgB7rCM,8CAIE,aAAA,CAEA,aAAA,CACA,YAAA,CANA,iBAAA,CACA,SAAA,CAGA,YhBwrCR,CgBnrCQ,oDAIE,6BAAA,CAKA,UAAA,CARA,aAAA,CAEA,WAAA,CAEA,2CAAA,CAAA,mCAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CANA,UhB4rCV,CgBhrCM,8CAEE,2CAAA,CACA,gEACE,CAHF,eAAA,CAIA,4BAAA,CACA,kBhBirCR,CgB9qCQ,2DACE,YhBgrCV,CgB3qCM,8CAGE,2CAAA,CAFA,gCAAA,CACA,ehB8qCR,CgBzqCM,yCAIE,aAAA,CADA,UAAA,CAEA,YAAA,CACA,aAAA,CALA,iBAAA,CAEA,WAAA,CADA,ShB+qCR,CgBtqCI,+BACE,MhBwqCN,CgBpqCI,+BAEE,4DAAA,CADA,ShBuqCN,CgBnqCM,qDACE,+BhBqqCR,CgBlqCQ,gFACE,+BhBoqCV,CgBrqCQ,6EACE,+BhBoqCV,CgBrqCQ,uEACE,+BhBoqCV,CgB9pCI,+BACE,YAAA,CACA,mBhBgqCN,CgB7pCM,uDAGE,mBhBgqCR,CgBnqCM,uDAGE,kBhBgqCR,CgBnqCM,6CAIE,gBAAA,CAFA,aAAA,CADA,YhBkqCR,CgB5pCQ,mDAIE,6BAAA,CAKA,UAAA,CARA,aAAA,CAEA,WAAA,CAEA,2CAAA,CAAA,mCAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CANA,UhBqqCV,CgBrpCM,+CACE,mBhBupCR,CgB/oCM,4CAEE,wBAAA,CADA,ehBkpCR,CgB9oCQ,oEACE,mBhBgpCV,CgBjpCQ,oEACE,oBhBgpCV,CgB5oCQ,4EACE,iBhB8oCV,CgB/oCQ,4EACE,kBhB8oCV,CgB1oCQ,oFACE,mBhB4oCV,CgB7oCQ,oFACE,oBhB4oCV,CgBxoCQ,4FACE,mBhB0oCV,CgB3oCQ,4FACE,oBhB0oCV,CgBnoCE,mBACE,wBhBqoCJ,CgBjoCE,wBACE,YAAA,CAEA,SAAA,CADA,0BAAA,CAEA,oEhBmoCJ,CgB9nCI,kCACE,2BhBgoCN,CgB3nCE,gCAEE,SAAA,CADA,uBAAA,CAEA,qEhB6nCJ,CgBxnCI,8CAEE,kCAAA,CAAA,0BhBynCN,CACF,CK/xCI,wCW8KA,0CACE,YhBonCJ,CgBjnCI,yDACE,UhBmnCN,CgB/mCI,wDACE,YhBinCN,CgB7mCI,kDACE,YhB+mCN,CgB1mCE,gBAIE,iDAAA,CADA,gCAAA,CAFA,aAAA,CACA,ehB8mCJ,CACF,CK51CM,6DWuPF,6CACE,YhBwmCJ,CgBrmCI,4DACE,UhBumCN,CgBnmCI,2DACE,YhBqmCN,CgBjmCI,qDACE,YhBmmCN,CACF,CKp1CI,mCWyPA,kCAME,qCAAA,CACA,qDAAA,CANA,uBAAA,CAAA,eAAA,CACA,KAAA,CAGA,ShB8lCJ,CgBzlCI,6CACE,uBhB2lCN,CgBvlCI,gDACE,YhBylCN,CACF,CKn2CI,sCW7JJ,QA6aI,oDhBulCF,CgBplCE,gCAME,qCAAA,CACA,qDAAA,CANA,uBAAA,CAAA,eAAA,CACA,KAAA,CAGA,ShBslCJ,CgBjlCI,8CACE,uBhBmlCN,CgBzkCE,sEACE,YhB8kCJ,CgB1kCE,6DACE,ahB4kCJ,CgB7kCE,0DACE,ahB4kCJ,CgB7kCE,oDACE,ahB4kCJ,CgBxkCE,6CACE,YhB0kCJ,CgBtkCE,uBACE,aAAA,CACA,ehBwkCJ,CgBrkCI,kCACE,ehBukCN,CgBnkCI,qCACE,eAAA,CACA,mBhBqkCN,CgBlkCM,mDACE,mBhBokCR,CgBhkCM,mDACE,YhBkkCR,CgB7jCI,+BACE,ahB+jCN,CgB5jCM,2DACE,ShB8jCR,CgBxjCE,cAGE,kBAAA,CADA,YAAA,CAEA,+CACE,CAJF,WhB6jCJ,CgBrjCI,wBACE,wBhBujCN,CgBnjCI,oBACE,uDhBqjCN,CgBjjCI,oBAKE,6BAAA,CAKA,UAAA,CATA,oBAAA,CAEA,WAAA,CAGA,2CAAA,CAAA,mCAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CALA,qBAAA,CAFA,UhB2jCN,CgB/iCI,0JAEE,uBhBgjCN,CgBliCI,+HACE,YhBwiCN,CgBriCM,oDACE,aAAA,CACA,ShBuiCR,CgBpiCQ,kEAOE,qCAAA,CACA,qDAAA,CAFA,eAAA,CAFA,YAAA,CACA,eAAA,CAJA,uBAAA,CAAA,eAAA,CACA,KAAA,CACA,ShB2iCV,CgBniCU,4FACE,mBhBqiCZ,CgBjiCU,gFACE,YhBmiCZ,CgB3hCI,2CACE,ahB6hCN,CgB1hCM,iFACE,mBhB4hCR,CgB7hCM,iFACE,kBhB4hCR,CgBnhCI,mFACE,ehBqhCN,CgBlhCM,iGACE,ShBohCR,CgB/gCI,qFAGE,mDhBihCN,CgBphCI,qFAGE,oDhBihCN,CgBphCI,2EACE,aAAA,CACA,oBhBkhCN,CgB9gCM,0FACE,YhBghCR,CACF,CiBroDA,MACE,igBjBwoDF,CiBloDA,WACE,iBjBqoDF,CKv+CI,mCY/JJ,WAKI,ejBqoDF,CACF,CiBloDE,kBACE,YjBooDJ,CiBhoDE,oBAEE,SAAA,CADA,SjBmoDJ,CKh+CI,wCYpKF,8BAQI,YjB0oDJ,CiBlpDA,8BAQI,ajB0oDJ,CiBlpDA,oBAYI,2CAAA,CACA,kBAAA,CAHA,WAAA,CACA,eAAA,CAOA,mBAAA,CAZA,iBAAA,CACA,SAAA,CAOA,uBAAA,CACA,4CACE,CAPF,UjByoDJ,CiB7nDI,+DACE,SAAA,CACA,oCjB+nDN,CACF,CKtgDI,mCYjJF,8BAiCI,MjBioDJ,CiBlqDA,8BAiCI,OjBioDJ,CiBlqDA,oBAoCI,0BAAA,CACA,cAAA,CAFA,QAAA,CAJA,cAAA,CACA,KAAA,CAMA,sDACE,CALF,OjBgoDJ,CiBtnDI,+DAME,YAAA,CACA,SAAA,CACA,4CACE,CARF,UjB2nDN,CACF,CKrgDI,wCYxGA,+DAII,mBjB6mDN,CACF,CKnjDM,6DY/DF,+DASI,mBjB6mDN,CACF,CKxjDM,6DY/DF,+DAcI,mBjB6mDN,CACF,CiBxmDE,kBAEE,kCAAA,CAAA,0BjBymDJ,CKvhDI,wCYpFF,4BAQI,MjBgnDJ,CiBxnDA,4BAQI,OjBgnDJ,CiBxnDA,kBAWI,QAAA,CAGA,SAAA,CAFA,eAAA,CANA,cAAA,CACA,KAAA,CAMA,wBAAA,CAEA,qGACE,CANF,OAAA,CADA,SjB+mDJ,CiBlmDI,4BACE,yBjBomDN,CiBhmDI,6DAEE,WAAA,CAEA,SAAA,CADA,uBAAA,CAEA,sGACE,CALF,UjBsmDN,CACF,CKlkDI,mCYjEF,4BA2CI,WjBgmDJ,CiB3oDA,4BA2CI,UjBgmDJ,CiB3oDA,kBA6CI,eAAA,CAHA,iBAAA,CAIA,8CAAA,CAFA,ajB+lDJ,CACF,CKjmDM,6DYOF,6DAII,ajB0lDN,CACF,CKhlDI,sCYfA,6DASI,ajB0lDN,CACF,CiBrlDE,iBAIE,2CAAA,CACA,0BAAA,CAFA,aAAA,CAFA,iBAAA,CAKA,2CACE,CALF,SjB2lDJ,CK7lDI,mCYAF,iBAaI,0BAAA,CACA,mBAAA,CAFA,ajBulDJ,CiBllDI,uBACE,0BjBolDN,CACF,CiBhlDI,4DAEE,2CAAA,CACA,6BAAA,CACA,8BAAA,CAHA,gCjBqlDN,CiB7kDE,4BAKE,mBAAA,CAAA,oBjBklDJ,CiBvlDE,4BAKE,mBAAA,CAAA,oBjBklDJ,CiBvlDE,kBAQE,gBAAA,CAFA,eAAA,CAFA,WAAA,CAHA,iBAAA,CAMA,sBAAA,CAJA,UAAA,CADA,SjBqlDJ,CiB5kDI,+BACE,qBjB8kDN,CiB1kDI,kEAEE,uCjB2kDN,CiBvkDI,6BACE,YjBykDN,CK7mDI,wCYaF,kBA8BI,eAAA,CADA,aAAA,CADA,UjB0kDJ,CACF,CKvoDI,mCYgCF,4BAmCI,mBjB0kDJ,CiB7mDA,4BAmCI,oBjB0kDJ,CiB7mDA,kBAoCI,aAAA,CACA,ejBwkDJ,CiBrkDI,+BACE,uCjBukDN,CiBnkDI,mCACE,gCjBqkDN,CiBjkDI,6DACE,kBjBmkDN,CiBhkDM,wJAEE,uCjBikDR,CACF,CiB3jDE,iBAIE,cAAA,CAHA,oBAAA,CAEA,aAAA,CAEA,kCACE,CAJF,YjBgkDJ,CiBxjDI,uBACE,UjB0jDN,CiBtjDI,yCAGE,UjByjDN,CiB5jDI,yCAGE,WjByjDN,CiB5jDI,+BACE,iBAAA,CACA,SAAA,CAEA,SjBwjDN,CiBrjDM,6CACE,oBjBujDR,CK1pDI,wCY2FA,yCAcI,UjBsjDN,CiBpkDE,yCAcI,WjBsjDN,CiBpkDE,+BAaI,SjBujDN,CiBnjDM,+CACE,YjBqjDR,CACF,CKtrDI,mCY8GA,+BAwBI,mBjBojDN,CiBjjDM,8CACE,YjBmjDR,CACF,CiB7iDE,8BAGE,WjBijDJ,CiBpjDE,8BAGE,UjBijDJ,CiBpjDE,oBAKE,mBAAA,CAJA,iBAAA,CACA,SAAA,CAEA,SjBgjDJ,CKlrDI,wCY8HF,8BAUI,WjB+iDJ,CiBzjDA,8BAUI,UjB+iDJ,CiBzjDA,oBASI,SjBgjDJ,CACF,CiB5iDI,gCACE,iBjBkjDN,CiBnjDI,gCACE,kBjBkjDN,CiBnjDI,sBAEE,uCAAA,CAEA,SAAA,CADA,oBAAA,CAEA,+DjB8iDN,CiBziDM,yCAEE,uCAAA,CADA,YjB4iDR,CiBviDM,yFAGE,SAAA,CACA,mBAAA,CAFA,kBjB0iDR,CiBriDQ,8FACE,UjBuiDV,CiBhiDE,8BAOE,mBAAA,CAAA,oBjBuiDJ,CiB9iDE,8BAOE,mBAAA,CAAA,oBjBuiDJ,CiB9iDE,oBAIE,kBAAA,CAIA,yCAAA,CALA,YAAA,CAMA,eAAA,CAHA,WAAA,CAKA,SAAA,CAVA,iBAAA,CACA,KAAA,CAUA,uBAAA,CAFA,kBAAA,CALA,UjByiDJ,CK5uDI,mCY8LF,8BAgBI,mBjBmiDJ,CiBnjDA,8BAgBI,oBjBmiDJ,CiBnjDA,oBAiBI,ejBkiDJ,CACF,CiB/hDI,+DACE,SAAA,CACA,0BjBiiDN,CiB5hDE,6BAKE,+BjB+hDJ,CiBpiDE,0DAME,gCjB8hDJ,CiBpiDE,6BAME,+BjB8hDJ,CiBpiDE,mBAIE,eAAA,CAHA,iBAAA,CAEA,UAAA,CADA,SjBkiDJ,CK3uDI,wCYuMF,mBAWI,QAAA,CADA,UjB+hDJ,CACF,CKpwDI,mCY0NF,mBAiBI,SAAA,CADA,UAAA,CAEA,sBjB8hDJ,CiB3hDI,8DACE,8BAAA,CACA,SjB6hDN,CACF,CiBxhDE,uBAKE,kCAAA,CAAA,0BAAA,CAFA,2CAAA,CAFA,WAAA,CACA,eAAA,CAOA,kBjBshDJ,CiBnhDI,iEAZF,uBAaI,uBjBshDJ,CACF,CKjzDM,6DY6QJ,uBAkBI,ajBshDJ,CACF,CKhyDI,sCYuPF,uBAuBI,ajBshDJ,CACF,CKryDI,mCYuPF,uBA4BI,YAAA,CAEA,yDAAA,CADA,oBjBuhDJ,CiBnhDI,kEACE,ejBqhDN,CiBjhDI,6BACE,+CjBmhDN,CiB/gDI,0CAEE,YAAA,CADA,WjBkhDN,CiB7gDI,gDACE,oDjB+gDN,CiB5gDM,sDACE,0CjB8gDR,CACF,CiBvgDA,kBACE,gCAAA,CACA,qBjB0gDF,CiBvgDE,wBAKE,qDAAA,CAHA,uCAAA,CACA,gBAAA,CACA,kBAAA,CAHA,eAAA,CAKA,uBjBygDJ,CKz0DI,mCY0TF,kCAUI,mBjBygDJ,CiBnhDA,kCAUI,oBjBygDJ,CACF,CiBrgDE,wBAGE,eAAA,CAFA,QAAA,CACA,SAAA,CAGA,wBAAA,CAAA,qBAAA,CAAA,gBjBsgDJ,CiBlgDE,wBACE,yDjBogDJ,CiBjgDI,oCACE,ejBmgDN,CiB9/CE,wBACE,aAAA,CACA,YAAA,CAEA,uBAAA,CADA,gCjBigDJ,CiB7/CI,mDACE,uDjB+/CN,CiBhgDI,gDACE,uDjB+/CN,CiBhgDI,0CACE,uDjB+/CN,CiB3/CI,gDACE,mBjB6/CN,CiBx/CE,gCAGE,+BAAA,CAGA,cAAA,CALA,aAAA,CAGA,gBAAA,CACA,YAAA,CAHA,mBAAA,CAQA,uBAAA,CAHA,2CjB2/CJ,CKh3DI,mCY8WF,0CAcI,mBjBw/CJ,CiBtgDA,0CAcI,oBjBw/CJ,CACF,CiBr/CI,2DAEE,uDAAA,CADA,+BjBw/CN,CiBz/CI,wDAEE,uDAAA,CADA,+BjBw/CN,CiBz/CI,kDAEE,uDAAA,CADA,+BjBw/CN,CiBn/CI,wCACE,YjBq/CN,CiBh/CI,wDACE,YjBk/CN,CiB9+CI,oCACE,WjBg/CN,CiB3+CE,2BAGE,eAAA,CADA,eAAA,CADA,iBjB++CJ,CKv4DI,mCYuZF,qCAOI,mBjB6+CJ,CiBp/CA,qCAOI,oBjB6+CJ,CACF,CiBv+CM,8DAGE,eAAA,CADA,eAAA,CAEA,eAAA,CAHA,ejB4+CR,CiBn+CE,kCAEE,MjBy+CJ,CiB3+CE,kCAEE,OjBy+CJ,CiB3+CE,wBAME,uCAAA,CAFA,aAAA,CACA,YAAA,CAJA,iBAAA,CAEA,YjBw+CJ,CKv4DI,wCY4ZF,wBAUI,YjBq+CJ,CACF,CiBl+CI,8BAIE,6BAAA,CAKA,UAAA,CARA,oBAAA,CAEA,WAAA,CAEA,+CAAA,CAAA,uCAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CANA,UjB2+CN,CiBj+CM,wCACE,oBjBm+CR,CiB79CE,yBAGE,gBAAA,CADA,eAAA,CAEA,eAAA,CAHA,ajBk+CJ,CiB39CE,0BASE,2BAAA,CACA,oBAAA,CALA,uCAAA,CAJA,mBAAA,CAKA,gBAAA,CACA,eAAA,CAJA,aAAA,CADA,eAAA,CAEA,eAAA,CAIA,sBjB+9CJ,CK56DI,wCYqcF,0BAeI,oBAAA,CADA,ejB89CJ,CACF,CK39DM,6DY8eJ,0BAqBI,oBAAA,CADA,ejB89CJ,CACF,CiB19CI,+BAEE,wBAAA,CADA,yBjB69CN,CiBv9CE,yBAEE,gBAAA,CACA,iBAAA,CAFA,ajB29CJ,CiBr9CE,uBAEE,wBAAA,CADA,+BjBw9CJ,CkB9nEA,WACE,iBAAA,CACA,SlBioEF,CkB9nEE,kBAOE,2CAAA,CACA,mBAAA,CACA,8BAAA,CAHA,gCAAA,CAHA,QAAA,CAEA,gBAAA,CADA,YAAA,CAOA,SAAA,CAVA,iBAAA,CACA,sBAAA,CAQA,mCAAA,CAEA,oElBgoEJ,CkB1nEI,+DACE,gBAAA,CAEA,SAAA,CADA,+BAAA,CAEA,sFACE,CADF,8ElB4nEN,CkBhoEI,4DACE,gBAAA,CAEA,SAAA,CADA,+BAAA,CAEA,mFACE,CADF,8ElB4nEN,CkBhoEI,sDACE,gBAAA,CAEA,SAAA,CADA,+BAAA,CAEA,8ElB4nEN,CkBrnEI,wBAUE,+BAAA,CAAA,8CAAA,CAFA,6BAAA,CAAA,8BAAA,CACA,YAAA,CAEA,UAAA,CANA,QAAA,CAFA,QAAA,CAIA,kBAAA,CADA,iBAAA,CALA,iBAAA,CACA,KAAA,CAEA,OlB8nEN,CkBlnEE,iBAOE,mBAAA,CAFA,eAAA,CACA,oBAAA,CAJA,QAAA,CADA,kBAAA,CAGA,aAAA,CADA,SlBwnEJ,CkBhnEE,iBACE,kBlBknEJ,CkB9mEE,2BAGE,kBAAA,CAAA,oBlBonEJ,CkBvnEE,2BAGE,mBAAA,CAAA,mBlBonEJ,CkBvnEE,iBAKE,cAAA,CAJA,aAAA,CAGA,YAAA,CAKA,uBAAA,CAHA,2CACE,CALF,UlBqnEJ,CkB3mEI,4CACE,+BlB6mEN,CkB9mEI,yCACE,+BlB6mEN,CkB9mEI,mCACE,+BlB6mEN,CkBzmEI,uBACE,qDlB2mEN,CmB/rEA,YAIE,qBAAA,CADA,aAAA,CAGA,gBAAA,CALA,uBAAA,CAAA,eAAA,CACA,UAAA,CAGA,anBmsEF,CmB/rEE,aATF,YAUI,YnBksEF,CACF,CKphEI,wCc3KF,+BAMI,anBssEJ,CmB5sEA,+BAMI,cnBssEJ,CmB5sEA,qBAWI,2CAAA,CAHA,aAAA,CAEA,WAAA,CANA,cAAA,CACA,KAAA,CAOA,uBAAA,CACA,iEACE,CALF,aAAA,CAFA,SnBqsEJ,CmB1rEI,mEACE,8BAAA,CACA,6BnB4rEN,CmBzrEM,6EACE,8BnB2rER,CmBtrEI,6CAEE,QAAA,CAAA,MAAA,CACA,QAAA,CAEA,eAAA,CAJA,iBAAA,CACA,OAAA,CAEA,qBAAA,CAFA,KnB2rEN,CACF,CKnkEI,sCctKJ,YAuDI,QnBsrEF,CmBnrEE,mBACE,WnBqrEJ,CmBjrEE,6CACE,UnBmrEJ,CACF,CmB/qEE,uBACE,YAAA,CACA,OnBirEJ,CKllEI,mCcjGF,uBAMI,QnBirEJ,CmB9qEI,8BACE,WnBgrEN,CmB5qEI,qCACE,anB8qEN,CmB1qEI,+CACE,kBnB4qEN,CACF,CmBvqEE,wBAUE,uBAAA,CANA,kCAAA,CAAA,0BAAA,CAHA,cAAA,CACA,eAAA,CASA,yDAAA,CAFA,oBnBsqEJ,CmBjqEI,8BACE,+CnBmqEN,CmB/pEI,2CAEE,YAAA,CADA,WnBkqEN,CmB7pEI,iDACE,oDnB+pEN,CmB5pEM,uDACE,0CnB8pER,CmBhpEE,wCAGE,wBACE,qBnBgpEJ,CmB5oEE,6BACE,kCnB8oEJ,CmB/oEE,6BACE,iCnB8oEJ,CACF,CK1mEI,wCc5BF,YAME,0BAAA,CADA,QAAA,CAEA,SAAA,CANA,cAAA,CACA,KAAA,CAMA,sDACE,CALF,OAAA,CADA,SnB+oEF,CmBpoEE,4CAEE,WAAA,CACA,SAAA,CACA,4CACE,CAJF,UnByoEJ,CACF,CoBtzEA,iBACE,GACE,QpBwzEF,CoBrzEA,GACE,apBuzEF,CACF,CoBnzEA,gBACE,GAEE,SAAA,CADA,0BpBszEF,CoBlzEA,IACE,SpBozEF,CoBjzEA,GAEE,SAAA,CADA,uBpBozEF,CACF,CoB3yEA,MACE,mgBAAA,CACA,oiBAAA,CACA,0nBAAA,CACA,mhBpB6yEF,CoBvyEA,WAOE,kCAAA,CAAA,0BAAA,CANA,aAAA,CACA,gBAAA,CACA,eAAA,CAEA,uCAAA,CAGA,uBAAA,CAJA,kBpB6yEF,CoBtyEE,iBACE,UpBwyEJ,CoBpyEE,iBACE,oBAAA,CAEA,aAAA,CACA,qBAAA,CAFA,UpBwyEJ,CoBnyEI,+BAEE,iBpBqyEN,CoBvyEI,+BAEE,kBpBqyEN,CoBvyEI,qBACE,gBpBsyEN,CoBjyEI,kDACE,iBpBoyEN,CoBryEI,kDACE,kBpBoyEN,CoBryEI,kDAEE,iBpBmyEN,CoBryEI,kDAEE,kBpBmyEN,CoB9xEE,iCAGE,iBpBmyEJ,CoBtyEE,iCAGE,kBpBmyEJ,CoBtyEE,uBACE,oBAAA,CACA,6BAAA,CAEA,eAAA,CACA,sBAAA,CACA,qBpBgyEJ,CoB5xEE,kBACE,YAAA,CAMA,gBAAA,CALA,SAAA,CAMA,oBAAA,CAJA,gBAAA,CAKA,WAAA,CAHA,eAAA,CADA,SAAA,CAFA,UpBoyEJ,CoB3xEI,iDACE,4BpB6xEN,CoBxxEE,iBACE,eAAA,CACA,sBpB0xEJ,CoBvxEI,gDACE,2BpByxEN,CoBrxEI,kCAIE,kBpB6xEN,CoBjyEI,kCAIE,iBpB6xEN,CoBjyEI,wBAME,6BAAA,CAIA,UAAA,CATA,oBAAA,CAEA,YAAA,CAIA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CAJA,uBAAA,CAHA,WpB+xEN,CoBnxEI,iCACE,apBqxEN,CoBjxEI,iCACE,gDAAA,CAAA,wCpBmxEN,CoB/wEI,+BACE,8CAAA,CAAA,sCpBixEN,CoB7wEI,+BACE,8CAAA,CAAA,sCpB+wEN,CoB3wEI,sCACE,qDAAA,CAAA,6CpB6wEN,CqBp6EA,SASE,2CAAA,CAFA,gCAAA,CAHA,aAAA,CAIA,eAAA,CAFA,aAAA,CADA,UAAA,CAFA,SrB26EF,CqBl6EE,aAZF,SAaI,YrBq6EF,CACF,CK1vEI,wCgBzLJ,SAkBI,YrBq6EF,CACF,CqBl6EE,iBACE,mBrBo6EJ,CqBh6EE,yBAEE,iBrBs6EJ,CqBx6EE,yBAEE,kBrBs6EJ,CqBx6EE,eAME,eAAA,CADA,eAAA,CAJA,QAAA,CAEA,SAAA,CACA,kBrBo6EJ,CqB95EE,eACE,oBAAA,CACA,aAAA,CACA,kBAAA,CAAA,mBrBg6EJ,CqB35EE,eAOE,kCAAA,CAAA,0BAAA,CANA,aAAA,CAEA,eAAA,CADA,gBAAA,CAMA,UAAA,CAJA,uCAAA,CACA,oBAAA,CAIA,8DrB45EJ,CqBv5EI,iEAEE,aAAA,CACA,SrBw5EN,CqB35EI,8DAEE,aAAA,CACA,SrBw5EN,CqB35EI,wDAEE,aAAA,CACA,SrBw5EN,CqBn5EM,2CACE,qBrBq5ER,CqBt5EM,2CACE,qBrBw5ER,CqBz5EM,2CACE,qBrB25ER,CqB55EM,2CACE,qBrB85ER,CqB/5EM,2CACE,oBrBi6ER,CqBl6EM,2CACE,qBrBo6ER,CqBr6EM,2CACE,qBrBu6ER,CqBx6EM,2CACE,qBrB06ER,CqB36EM,4CACE,qBrB66ER,CqB96EM,4CACE,oBrBg7ER,CqBj7EM,4CACE,qBrBm7ER,CqBp7EM,4CACE,qBrBs7ER,CqBv7EM,4CACE,qBrBy7ER,CqB17EM,4CACE,qBrB47ER,CqB77EM,4CACE,oBrB+7ER,CqBz7EI,gCAEE,SAAA,CADA,yBAAA,CAEA,wCrB27EN,CsBxgFA,MACE,wStB2gFF,CsBlgFE,qBAEE,mBAAA,CADA,kBtBsgFJ,CsBjgFE,8BAEE,iBtB4gFJ,CsB9gFE,8BAEE,gBtB4gFJ,CsB9gFE,oBAUE,+CAAA,CACA,oBAAA,CAVA,oBAAA,CAKA,gBAAA,CADA,eAAA,CAGA,qBAAA,CADA,eAAA,CAJA,kBAAA,CACA,uBAAA,CAKA,qBtBqgFJ,CsBhgFI,0BAGE,uCAAA,CAFA,aAAA,CACA,YAAA,CAEA,6CtBkgFN,CsB7/EM,gEAGE,0CAAA,CADA,+BtB+/ER,CsBz/EI,yBACE,uBtB2/EN,CsBn/EI,gCAME,oDAAA,CAMA,UAAA,CAXA,oBAAA,CAEA,YAAA,CACA,iBAAA,CAGA,qCAAA,CAAA,6BAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CACA,iCAAA,CANA,0BAAA,CAHA,WtB+/EN,CsBj/EI,6DACE,0CtBm/EN,CsBp/EI,0DACE,0CtBm/EN,CsBp/EI,oDACE,0CtBm/EN,CuB5jFA,iBACE,GACE,uDAAA,CACA,oBvB+jFF,CuB5jFA,IACE,6BAAA,CACA,kBvB8jFF,CuB3jFA,GACE,wBAAA,CACA,oBvB6jFF,CACF,CuBrjFA,MACE,wBvBujFF,CuBjjFA,YAwBE,kCAAA,CAAA,0BAAA,CALA,2CAAA,CACA,mBAAA,CACA,8BAAA,CAJA,gCAAA,CACA,sCAAA,CAfA,+IACE,CAYF,8BAAA,CASA,SAAA,CAxBA,iBAAA,CACA,uBAAA,CAoBA,4BAAA,CAIA,uDACE,CAZF,6BAAA,CADA,SvB4jFF,CuB1iFE,oBAGE,SAAA,CADA,uBAAA,CAEA,2EACE,CAJF,SvB+iFJ,CuBriFE,4DACE,sCvBuiFJ,CuBxiFE,yDACE,sCvBuiFJ,CuBxiFE,mDACE,sCvBuiFJ,CuBniFE,mBAEE,gBAAA,CADA,avBsiFJ,CuBliFI,2CACE,YvBoiFN,CuBhiFI,0CACE,evBkiFN,CuB1hFA,eACE,eAAA,CAEA,YAAA,CADA,kBvB8hFF,CuB1hFE,yBACE,avB4hFJ,CuBxhFE,6BACE,oBAAA,CAGA,iBvBwhFJ,CuBphFE,sBAOE,cAAA,CAFA,sCAAA,CADA,eAAA,CADA,YAAA,CAGA,YAAA,CALA,iBAAA,CAOA,wBAAA,CAAA,qBAAA,CAAA,gBAAA,CANA,SvB4hFJ,CuBnhFI,qCACE,UAAA,CACA,uBvBqhFN,CuBlhFM,gEACE,UvBohFR,CuBrhFM,6DACE,UvBohFR,CuBrhFM,uDACE,UvBohFR,CuB5gFI,4BAYE,oDAAA,CACA,iBAAA,CAIA,UAAA,CARA,YAAA,CANA,YAAA,CAOA,cAAA,CACA,cAAA,CAVA,iBAAA,CACA,KAAA,CAYA,2CACE,CARF,wBAAA,CACA,6BAAA,CAJA,UvBuhFN,CuBvgFM,4CAGE,8CACE,2BvBugFR,CACF,CuBngFM,gDAIE,cAAA,CAHA,2CvBsgFR,CuB9/EI,2BAEE,sCAAA,CADA,iBvBigFN,CuB5/EI,qFACE,+BvB8/EN,CuB//EI,kFACE,+BvB8/EN,CuB//EI,4EACE,+BvB8/EN,CuB3/EM,2FACE,0CvB6/ER,CuB9/EM,wFACE,0CvB6/ER,CuB9/EM,kFACE,0CvB6/ER,CuBx/EI,0CAGE,cAAA,CADA,eAAA,CADA,SvB4/EN,CuBt/EI,8CACE,oBAAA,CACA,evBw/EN,CuBr/EM,qDAME,mCAAA,CALA,oBAAA,CACA,mBAAA,CAEA,qBAAA,CACA,iDAAA,CAFA,qBvB0/ER,CuBn/EQ,iBAVF,qDAWI,WvBs/ER,CuBn/EQ,mEACE,mCvBq/EV,CACF,CwBntFA,kBAKE,exB+tFF,CwBpuFA,kBAKE,gBxB+tFF,CwBpuFA,QASE,2CAAA,CACA,oBAAA,CAEA,8BAAA,CALA,uCAAA,CAHA,aAAA,CAIA,eAAA,CAGA,YAAA,CALA,mBAAA,CALA,cAAA,CACA,UAAA,CAWA,yBAAA,CACA,mGACE,CAZF,SxBiuFF,CwB/sFE,aArBF,QAsBI,YxBktFF,CACF,CwB/sFE,kBACE,wBxBitFJ,CwB7sFE,gBAEE,SAAA,CAEA,mBAAA,CAHA,+BAAA,CAEA,uBxBgtFJ,CwB5sFI,0BACE,8BxB8sFN,CwBzsFE,mCAEE,0CAAA,CADA,+BxB4sFJ,CwB7sFE,gCAEE,0CAAA,CADA,+BxB4sFJ,CwB7sFE,0BAEE,0CAAA,CADA,+BxB4sFJ,CwBvsFE,YACE,oBAAA,CACA,oBxBysFJ,CyB7vFA,oBACE,GACE,mBzBgwFF,CACF,CyBxvFA,MACE,wfzB0vFF,CyBpvFA,YACE,aAAA,CAEA,eAAA,CADA,azBwvFF,CyBpvFE,+BAOE,kBAAA,CAAA,kBzBqvFJ,CyB5vFE,+BAOE,iBAAA,CAAA,mBzBqvFJ,CyB5vFE,qBAQE,aAAA,CAEA,cAAA,CADA,YAAA,CARA,iBAAA,CAKA,UzBsvFJ,CyB/uFI,qCAIE,iBzBuvFN,CyB3vFI,qCAIE,kBzBuvFN,CyB3vFI,2BAKE,6BAAA,CAKA,UAAA,CATA,oBAAA,CAEA,YAAA,CAGA,yCAAA,CAAA,iCAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CAPA,WzByvFN,CyB5uFE,kBAUE,2CAAA,CACA,mBAAA,CACA,8BAAA,CAJA,gCAAA,CACA,oBAAA,CAJA,kBAAA,CADA,YAAA,CASA,SAAA,CANA,aAAA,CADA,SAAA,CALA,iBAAA,CAgBA,4BAAA,CAfA,UAAA,CAYA,+CACE,CAZF,SzB0vFJ,CyBzuFI,gEACE,gBAAA,CACA,SAAA,CACA,8CACE,CADF,sCzB2uFN,CyB9uFI,6DACE,gBAAA,CACA,SAAA,CACA,2CACE,CADF,sCzB2uFN,CyB9uFI,uDACE,gBAAA,CACA,SAAA,CACA,sCzB2uFN,CyBruFI,wBAGE,oCACE,gCzBquFN,CyBjuFI,2CACE,czBmuFN,CACF,CyB9tFE,kBACE,kBzBguFJ,CyB5tFE,4BAGE,kBAAA,CAAA,oBzBmuFJ,CyBtuFE,4BAGE,mBAAA,CAAA,mBzBmuFJ,CyBtuFE,kBAME,cAAA,CALA,aAAA,CAIA,YAAA,CAKA,uBAAA,CAHA,2CACE,CAJF,kBAAA,CAFA,UzBouFJ,CyBztFI,6CACE,+BzB2tFN,CyB5tFI,0CACE,+BzB2tFN,CyB5tFI,oCACE,+BzB2tFN,CyBvtFI,wBACE,qDzBytFN,C0B1zFA,MAEI,uWAAA,CAAA,8WAAA,CAAA,sPAAA,CAAA,8xBAAA,CAAA,0MAAA,CAAA,gbAAA,CAAA,gMAAA,CAAA,iQAAA,CAAA,0VAAA,CAAA,6aAAA,CAAA,8SAAA,CAAA,gM1Bm1FJ,C0Bv0FE,4CAQE,8CAAA,CACA,2BAAA,CACA,mBAAA,CACA,8BAAA,CANA,mCAAA,CAHA,iBAAA,CAIA,gBAAA,CAHA,iBAAA,CACA,eAAA,CAGA,uB1B80FJ,C0Bv0FI,aAdF,4CAeI,e1B20FJ,CACF,C0Bv0FI,gDACE,qB1B00FN,C0Bt0FI,gHAEE,iBAAA,CADA,c1B00FN,C0B30FI,0GAEE,iBAAA,CADA,c1B00FN,C0B30FI,8FAEE,iBAAA,CADA,c1B00FN,C0Br0FI,4FACE,iB1Bw0FN,C0Bp0FI,kFACE,e1Bu0FN,C0Bn0FI,0FACE,Y1Bs0FN,C0Bl0FI,8EACE,mB1Bq0FN,C0Bh0FE,sEAME,iBAAA,CAAA,mB1Bw0FJ,C0B90FE,sEAME,kBAAA,CAAA,kB1Bw0FJ,C0B90FE,sEAUE,uB1Bo0FJ,C0B90FE,sEAUE,wB1Bo0FJ,C0B90FE,sEAWE,4B1Bm0FJ,C0B90FE,4IAYE,6B1Bk0FJ,C0B90FE,sEAYE,4B1Bk0FJ,C0B90FE,kDAQE,0BAAA,CACA,WAAA,CAFA,eAAA,CAHA,eAAA,CACA,oBAAA,CAAA,iBAAA,CAHA,iB1B40FJ,C0B/zFI,kFACE,e1Bk0FN,C0B9zFI,oFAGE,U1By0FN,C0B50FI,oFAGE,W1By0FN,C0B50FI,gEAME,wBCsIU,CDjIV,UAAA,CANA,WAAA,CAEA,kDAAA,CAAA,0CAAA,CACA,4BAAA,CAAA,oBAAA,CACA,6BAAA,CAAA,qBAAA,CACA,yBAAA,CAAA,iBAAA,CATA,iBAAA,CACA,UAAA,CAEA,U1Bw0FN,C0B7zFI,4DACE,4D1Bg0FN,C0B3yFE,iEACE,oB1B8yFJ,C0B/yFE,2DACE,oB1B8yFJ,C0B/yFE,+CACE,oB1B8yFJ,C0B1yFE,wEACE,0B1B6yFJ,C0B9yFE,kEACE,0B1B6yFJ,C0B9yFE,sDACE,0B1B6yFJ,C0B1yFI,+EACE,wBAnBG,CAoBH,kDAAA,CAAA,0C1B4yFN,C0B9yFI,yEACE,wBAnBG,CAoBH,0C1B4yFN,C0B9yFI,6DACE,wBAnBG,CAoBH,kDAAA,CAAA,0C1B4yFN,C0BxyFI,8EACE,a1B0yFN,C0B3yFI,wEACE,a1B0yFN,C0B3yFI,4DACE,a1B0yFN,C0B1zFE,oFACE,oB1B6zFJ,C0B9zFE,8EACE,oB1B6zFJ,C0B9zFE,kEACE,oB1B6zFJ,C0BzzFE,2FACE,0B1B4zFJ,C0B7zFE,qFACE,0B1B4zFJ,C0B7zFE,yEACE,0B1B4zFJ,C0BzzFI,kGACE,wBAnBG,CAoBH,sDAAA,CAAA,8C1B2zFN,C0B7zFI,4FACE,wBAnBG,CAoBH,8C1B2zFN,C0B7zFI,gFACE,wBAnBG,CAoBH,sDAAA,CAAA,8C1B2zFN,C0BvzFI,iGACE,a1ByzFN,C0B1zFI,2FACE,a1ByzFN,C0B1zFI,+EACE,a1ByzFN,C0Bz0FE,uEACE,oB1B40FJ,C0B70FE,iEACE,oB1B40FJ,C0B70FE,qDACE,oB1B40FJ,C0Bx0FE,8EACE,0B1B20FJ,C0B50FE,wEACE,0B1B20FJ,C0B50FE,4DACE,0B1B20FJ,C0Bx0FI,qFACE,wBAnBG,CAoBH,kDAAA,CAAA,0C1B00FN,C0B50FI,+EACE,wBAnBG,CAoBH,0C1B00FN,C0B50FI,mEACE,wBAnBG,CAoBH,kDAAA,CAAA,0C1B00FN,C0Bt0FI,oFACE,a1Bw0FN,C0Bz0FI,8EACE,a1Bw0FN,C0Bz0FI,kEACE,a1Bw0FN,C0Bx1FE,iFACE,oB1B21FJ,C0B51FE,2EACE,oB1B21FJ,C0B51FE,+DACE,oB1B21FJ,C0Bv1FE,wFACE,0B1B01FJ,C0B31FE,kFACE,0B1B01FJ,C0B31FE,sEACE,0B1B01FJ,C0Bv1FI,+FACE,wBAnBG,CAoBH,iDAAA,CAAA,yC1By1FN,C0B31FI,yFACE,wBAnBG,CAoBH,yC1By1FN,C0B31FI,6EACE,wBAnBG,CAoBH,iDAAA,CAAA,yC1By1FN,C0Br1FI,8FACE,a1Bu1FN,C0Bx1FI,wFACE,a1Bu1FN,C0Bx1FI,4EACE,a1Bu1FN,C0Bv2FE,iFACE,oB1B02FJ,C0B32FE,2EACE,oB1B02FJ,C0B32FE,+DACE,oB1B02FJ,C0Bt2FE,wFACE,0B1By2FJ,C0B12FE,kFACE,0B1By2FJ,C0B12FE,sEACE,0B1By2FJ,C0Bt2FI,+FACE,wBAnBG,CAoBH,qDAAA,CAAA,6C1Bw2FN,C0B12FI,yFACE,wBAnBG,CAoBH,6C1Bw2FN,C0B12FI,6EACE,wBAnBG,CAoBH,qDAAA,CAAA,6C1Bw2FN,C0Bp2FI,8FACE,a1Bs2FN,C0Bv2FI,wFACE,a1Bs2FN,C0Bv2FI,4EACE,a1Bs2FN,C0Bt3FE,gFACE,oB1By3FJ,C0B13FE,0EACE,oB1By3FJ,C0B13FE,8DACE,oB1By3FJ,C0Br3FE,uFACE,0B1Bw3FJ,C0Bz3FE,iFACE,0B1Bw3FJ,C0Bz3FE,qEACE,0B1Bw3FJ,C0Br3FI,8FACE,wBAnBG,CAoBH,sDAAA,CAAA,8C1Bu3FN,C0Bz3FI,wFACE,wBAnBG,CAoBH,8C1Bu3FN,C0Bz3FI,4EACE,wBAnBG,CAoBH,sDAAA,CAAA,8C1Bu3FN,C0Bn3FI,6FACE,a1Bq3FN,C0Bt3FI,uFACE,a1Bq3FN,C0Bt3FI,2EACE,a1Bq3FN,C0Br4FE,wFACE,oB1Bw4FJ,C0Bz4FE,kFACE,oB1Bw4FJ,C0Bz4FE,sEACE,oB1Bw4FJ,C0Bp4FE,+FACE,0B1Bu4FJ,C0Bx4FE,yFACE,0B1Bu4FJ,C0Bx4FE,6EACE,0B1Bu4FJ,C0Bp4FI,sGACE,wBAnBG,CAoBH,qDAAA,CAAA,6C1Bs4FN,C0Bx4FI,gGACE,wBAnBG,CAoBH,6C1Bs4FN,C0Bx4FI,oFACE,wBAnBG,CAoBH,qDAAA,CAAA,6C1Bs4FN,C0Bl4FI,qGACE,a1Bo4FN,C0Br4FI,+FACE,a1Bo4FN,C0Br4FI,mFACE,a1Bo4FN,C0Bp5FE,mFACE,oB1Bu5FJ,C0Bx5FE,6EACE,oB1Bu5FJ,C0Bx5FE,iEACE,oB1Bu5FJ,C0Bn5FE,0FACE,0B1Bs5FJ,C0Bv5FE,oFACE,0B1Bs5FJ,C0Bv5FE,wEACE,0B1Bs5FJ,C0Bn5FI,iGACE,wBAnBG,CAoBH,qDAAA,CAAA,6C1Bq5FN,C0Bv5FI,2FACE,wBAnBG,CAoBH,6C1Bq5FN,C0Bv5FI,+EACE,wBAnBG,CAoBH,qDAAA,CAAA,6C1Bq5FN,C0Bj5FI,gGACE,a1Bm5FN,C0Bp5FI,0FACE,a1Bm5FN,C0Bp5FI,8EACE,a1Bm5FN,C0Bn6FE,0EACE,oB1Bs6FJ,C0Bv6FE,oEACE,oB1Bs6FJ,C0Bv6FE,wDACE,oB1Bs6FJ,C0Bl6FE,iFACE,0B1Bq6FJ,C0Bt6FE,2EACE,0B1Bq6FJ,C0Bt6FE,+DACE,0B1Bq6FJ,C0Bl6FI,wFACE,wBAnBG,CAoBH,oDAAA,CAAA,4C1Bo6FN,C0Bt6FI,kFACE,wBAnBG,CAoBH,4C1Bo6FN,C0Bt6FI,sEACE,wBAnBG,CAoBH,oDAAA,CAAA,4C1Bo6FN,C0Bh6FI,uFACE,a1Bk6FN,C0Bn6FI,iFACE,a1Bk6FN,C0Bn6FI,qEACE,a1Bk6FN,C0Bl7FE,gEACE,oB1Bq7FJ,C0Bt7FE,0DACE,oB1Bq7FJ,C0Bt7FE,8CACE,oB1Bq7FJ,C0Bj7FE,uEACE,0B1Bo7FJ,C0Br7FE,iEACE,0B1Bo7FJ,C0Br7FE,qDACE,0B1Bo7FJ,C0Bj7FI,8EACE,wBAnBG,CAoBH,iDAAA,CAAA,yC1Bm7FN,C0Br7FI,wEACE,wBAnBG,CAoBH,yC1Bm7FN,C0Br7FI,4DACE,wBAnBG,CAoBH,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","file":"main.css"} \ No newline at end of file diff --git a/assets/stylesheets/palette.2505c338.min.css b/assets/stylesheets/palette.2505c338.min.css new file mode 100644 index 0000000..3c005dd --- /dev/null +++ b/assets/stylesheets/palette.2505c338.min.css @@ -0,0 +1 @@ +@media screen{[data-md-color-scheme=slate]{--md-hue:232;--md-default-fg-color:hsla(var(--md-hue),75%,95%,1);--md-default-fg-color--light:hsla(var(--md-hue),75%,90%,0.62);--md-default-fg-color--lighter:hsla(var(--md-hue),75%,90%,0.32);--md-default-fg-color--lightest:hsla(var(--md-hue),75%,90%,0.12);--md-default-bg-color:hsla(var(--md-hue),15%,21%,1);--md-default-bg-color--light:hsla(var(--md-hue),15%,21%,0.54);--md-default-bg-color--lighter:hsla(var(--md-hue),15%,21%,0.26);--md-default-bg-color--lightest:hsla(var(--md-hue),15%,21%,0.07);--md-code-fg-color:hsla(var(--md-hue),18%,86%,1);--md-code-bg-color:hsla(var(--md-hue),15%,15%,1);--md-code-hl-color:#4287ff26;--md-code-hl-number-color:#e6695b;--md-code-hl-special-color:#f06090;--md-code-hl-function-color:#c973d9;--md-code-hl-constant-color:#9383e2;--md-code-hl-keyword-color:#6791e0;--md-code-hl-string-color:#2fb170;--md-code-hl-name-color:var(--md-code-fg-color);--md-code-hl-operator-color:var(--md-default-fg-color--light);--md-code-hl-punctuation-color:var(--md-default-fg-color--light);--md-code-hl-comment-color:var(--md-default-fg-color--light);--md-code-hl-generic-color:var(--md-default-fg-color--light);--md-code-hl-variable-color:var(--md-default-fg-color--light);--md-typeset-color:var(--md-default-fg-color);--md-typeset-a-color:var(--md-primary-fg-color);--md-typeset-mark-color:#4287ff4d;--md-typeset-kbd-color:hsla(var(--md-hue),15%,94%,0.12);--md-typeset-kbd-accent-color:hsla(var(--md-hue),15%,94%,0.2);--md-typeset-kbd-border-color:hsla(var(--md-hue),15%,14%,1);--md-typeset-table-color:hsla(var(--md-hue),75%,95%,0.12);--md-admonition-fg-color:var(--md-default-fg-color);--md-admonition-bg-color:var(--md-default-bg-color);--md-footer-bg-color:hsla(var(--md-hue),15%,12%,0.87);--md-footer-bg-color--dark:hsla(var(--md-hue),15%,10%,1);--md-shadow-z1:0 0.2rem 0.5rem #0003,0 0 0.05rem #0000001a;--md-shadow-z2:0 0.2rem 0.5rem #0000004d,0 0 0.05rem #00000040;--md-shadow-z3:0 0.2rem 0.5rem #0006,0 0 0.05rem #00000059}[data-md-color-scheme=slate] img[src$="#gh-light-mode-only"],[data-md-color-scheme=slate] img[src$="#only-light"]{display:none}[data-md-color-scheme=slate] img[src$="#gh-dark-mode-only"],[data-md-color-scheme=slate] img[src$="#only-dark"]{display:initial}[data-md-color-scheme=slate][data-md-color-primary=pink]{--md-typeset-a-color:#ed5487}[data-md-color-scheme=slate][data-md-color-primary=purple]{--md-typeset-a-color:#bd78c9}[data-md-color-scheme=slate][data-md-color-primary=deep-purple]{--md-typeset-a-color:#a682e3}[data-md-color-scheme=slate][data-md-color-primary=indigo]{--md-typeset-a-color:#6c91d5}[data-md-color-scheme=slate][data-md-color-primary=teal]{--md-typeset-a-color:#00ccb8}[data-md-color-scheme=slate][data-md-color-primary=green]{--md-typeset-a-color:#71c174}[data-md-color-scheme=slate][data-md-color-primary=deep-orange]{--md-typeset-a-color:#ff9575}[data-md-color-scheme=slate][data-md-color-primary=brown]{--md-typeset-a-color:#c7846b}[data-md-color-scheme=slate][data-md-color-primary=black],[data-md-color-scheme=slate][data-md-color-primary=blue-grey],[data-md-color-scheme=slate][data-md-color-primary=grey],[data-md-color-scheme=slate][data-md-color-primary=white]{--md-typeset-a-color:#6c91d5}[data-md-color-switching] *,[data-md-color-switching] :after,[data-md-color-switching] :before{transition-duration:0ms!important}}[data-md-color-accent=red]{--md-accent-fg-color:#ff1947;--md-accent-fg-color--transparent:#ff19471a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=pink]{--md-accent-fg-color:#f50056;--md-accent-fg-color--transparent:#f500561a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=purple]{--md-accent-fg-color:#df41fb;--md-accent-fg-color--transparent:#df41fb1a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=deep-purple]{--md-accent-fg-color:#7c4dff;--md-accent-fg-color--transparent:#7c4dff1a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=indigo]{--md-accent-fg-color:#526cfe;--md-accent-fg-color--transparent:#526cfe1a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=blue]{--md-accent-fg-color:#4287ff;--md-accent-fg-color--transparent:#4287ff1a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=light-blue]{--md-accent-fg-color:#0091eb;--md-accent-fg-color--transparent:#0091eb1a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=cyan]{--md-accent-fg-color:#00bad6;--md-accent-fg-color--transparent:#00bad61a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=teal]{--md-accent-fg-color:#00bda4;--md-accent-fg-color--transparent:#00bda41a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=green]{--md-accent-fg-color:#00c753;--md-accent-fg-color--transparent:#00c7531a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=light-green]{--md-accent-fg-color:#63de17;--md-accent-fg-color--transparent:#63de171a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-accent=lime]{--md-accent-fg-color:#b0eb00;--md-accent-fg-color--transparent:#b0eb001a;--md-accent-bg-color:#000000de;--md-accent-bg-color--light:#0000008a}[data-md-color-accent=yellow]{--md-accent-fg-color:#ffd500;--md-accent-fg-color--transparent:#ffd5001a;--md-accent-bg-color:#000000de;--md-accent-bg-color--light:#0000008a}[data-md-color-accent=amber]{--md-accent-fg-color:#fa0;--md-accent-fg-color--transparent:#ffaa001a;--md-accent-bg-color:#000000de;--md-accent-bg-color--light:#0000008a}[data-md-color-accent=orange]{--md-accent-fg-color:#ff9100;--md-accent-fg-color--transparent:#ff91001a;--md-accent-bg-color:#000000de;--md-accent-bg-color--light:#0000008a}[data-md-color-accent=deep-orange]{--md-accent-fg-color:#ff6e42;--md-accent-fg-color--transparent:#ff6e421a;--md-accent-bg-color:#fff;--md-accent-bg-color--light:#ffffffb3}[data-md-color-primary=red]{--md-primary-fg-color:#ef5552;--md-primary-fg-color--light:#e57171;--md-primary-fg-color--dark:#e53734;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=pink]{--md-primary-fg-color:#e92063;--md-primary-fg-color--light:#ec417a;--md-primary-fg-color--dark:#c3185d;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=purple]{--md-primary-fg-color:#ab47bd;--md-primary-fg-color--light:#bb69c9;--md-primary-fg-color--dark:#8c24a8;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=deep-purple]{--md-primary-fg-color:#7e56c2;--md-primary-fg-color--light:#9574cd;--md-primary-fg-color--dark:#673ab6;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=indigo]{--md-primary-fg-color:#4051b5;--md-primary-fg-color--light:#5d6cc0;--md-primary-fg-color--dark:#303fa1;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=blue]{--md-primary-fg-color:#2094f3;--md-primary-fg-color--light:#42a5f5;--md-primary-fg-color--dark:#1975d2;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=light-blue]{--md-primary-fg-color:#02a6f2;--md-primary-fg-color--light:#28b5f6;--md-primary-fg-color--dark:#0287cf;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=cyan]{--md-primary-fg-color:#00bdd6;--md-primary-fg-color--light:#25c5da;--md-primary-fg-color--dark:#0097a8;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=teal]{--md-primary-fg-color:#009485;--md-primary-fg-color--light:#26a699;--md-primary-fg-color--dark:#007a6c;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=green]{--md-primary-fg-color:#4cae4f;--md-primary-fg-color--light:#68bb6c;--md-primary-fg-color--dark:#398e3d;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=light-green]{--md-primary-fg-color:#8bc34b;--md-primary-fg-color--light:#9ccc66;--md-primary-fg-color--dark:#689f38;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=lime]{--md-primary-fg-color:#cbdc38;--md-primary-fg-color--light:#d3e156;--md-primary-fg-color--dark:#b0b52c;--md-primary-bg-color:#000000de;--md-primary-bg-color--light:#0000008a}[data-md-color-primary=yellow]{--md-primary-fg-color:#ffec3d;--md-primary-fg-color--light:#ffee57;--md-primary-fg-color--dark:#fbc02d;--md-primary-bg-color:#000000de;--md-primary-bg-color--light:#0000008a}[data-md-color-primary=amber]{--md-primary-fg-color:#ffc105;--md-primary-fg-color--light:#ffc929;--md-primary-fg-color--dark:#ffa200;--md-primary-bg-color:#000000de;--md-primary-bg-color--light:#0000008a}[data-md-color-primary=orange]{--md-primary-fg-color:#ffa724;--md-primary-fg-color--light:#ffa724;--md-primary-fg-color--dark:#fa8900;--md-primary-bg-color:#000000de;--md-primary-bg-color--light:#0000008a}[data-md-color-primary=deep-orange]{--md-primary-fg-color:#ff6e42;--md-primary-fg-color--light:#ff8a66;--md-primary-fg-color--dark:#f4511f;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=brown]{--md-primary-fg-color:#795649;--md-primary-fg-color--light:#8d6e62;--md-primary-fg-color--dark:#5d4037;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3}[data-md-color-primary=grey]{--md-primary-fg-color:#757575;--md-primary-fg-color--light:#9e9e9e;--md-primary-fg-color--dark:#616161;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3;--md-typeset-a-color:#4051b5}[data-md-color-primary=blue-grey]{--md-primary-fg-color:#546d78;--md-primary-fg-color--light:#607c8a;--md-primary-fg-color--dark:#455a63;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3;--md-typeset-a-color:#4051b5}[data-md-color-primary=light-green]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#72ad2e}[data-md-color-primary=lime]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#8b990a}[data-md-color-primary=yellow]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#b8a500}[data-md-color-primary=amber]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#d19d00}[data-md-color-primary=orange]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#e68a00}[data-md-color-primary=white]{--md-primary-fg-color:#fff;--md-primary-fg-color--light:#ffffffb3;--md-primary-fg-color--dark:#00000012;--md-primary-bg-color:#000000de;--md-primary-bg-color--light:#0000008a;--md-typeset-a-color:#4051b5}[data-md-color-primary=white] .md-button{color:var(--md-typeset-a-color)}[data-md-color-primary=white] .md-button--primary{background-color:var(--md-typeset-a-color);border-color:var(--md-typeset-a-color);color:#fff}@media screen and (min-width:60em){[data-md-color-primary=white] .md-search__form{background-color:#00000012}[data-md-color-primary=white] .md-search__form:hover{background-color:#00000052}[data-md-color-primary=white] .md-search__input+.md-search__icon{color:#000000de}}@media screen and (min-width:76.25em){[data-md-color-primary=white] .md-tabs{border-bottom:.05rem solid #00000012}}[data-md-color-primary=black]{--md-primary-fg-color:#000;--md-primary-fg-color--light:#0000008a;--md-primary-fg-color--dark:#000;--md-primary-bg-color:#fff;--md-primary-bg-color--light:#ffffffb3;--md-typeset-a-color:#4051b5}[data-md-color-primary=black] .md-button{color:var(--md-typeset-a-color)}[data-md-color-primary=black] .md-button--primary{background-color:var(--md-typeset-a-color);border-color:var(--md-typeset-a-color);color:#fff}[data-md-color-primary=black] .md-header{background-color:#000}@media screen and (max-width:59.9375em){[data-md-color-primary=black] .md-nav__source{background-color:#000000de}}@media screen and (min-width:60em){[data-md-color-primary=black] .md-search__form{background-color:#ffffff1f}[data-md-color-primary=black] .md-search__form:hover{background-color:#ffffff4d}}@media screen and (max-width:76.1875em){html [data-md-color-primary=black] .md-nav--primary .md-nav__title[for=__drawer]{background-color:#000}}@media screen and (min-width:76.25em){[data-md-color-primary=black] .md-tabs{background-color:#000}} \ No newline at end of file diff --git a/assets/stylesheets/palette.2505c338.min.css.map b/assets/stylesheets/palette.2505c338.min.css.map new file mode 100644 index 0000000..3aec190 --- /dev/null +++ b/assets/stylesheets/palette.2505c338.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["src/assets/stylesheets/palette/_scheme.scss","../../../src/assets/stylesheets/palette.scss","src/assets/stylesheets/palette/_accent.scss","src/assets/stylesheets/palette/_primary.scss","src/assets/stylesheets/utilities/_break.scss"],"names":[],"mappings":"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","file":"palette.css"} \ No newline at end of file diff --git a/changelog/index.html b/changelog/index.html new file mode 100644 index 0000000..dc791c2 --- /dev/null +++ b/changelog/index.html @@ -0,0 +1,1105 @@ + + + + + + + + + + + + + + + + + + Changelog - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Changelog

    + +

    +

    Unrealeased (compare) (2023-04-28)

    +

    CI

    +
      +
    • add deployment of docs to cd pipeline (2a8d0de)
    • +
    +

    Code Refactoring

    +
      +
    • clean up gitignore (35ee429)
    • +
    • migrate from sphinx to mkdocs (9e8d74a)
    • +
    • move project to poetry and address flake8 linting issues (5c05102)
    • +
    +

    Docs

    +
      +
    • add first contribution guide (e2d3d4a)
    • +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/contributing/index.html b/contributing/index.html new file mode 100644 index 0000000..f527a08 --- /dev/null +++ b/contributing/index.html @@ -0,0 +1,1172 @@ + + + + + + + + + + + + + + + + + + Contribution Guide - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Open LASSO Python Contribution Guide

    +

    Roles

    +

    There are roughly two roles in which you can contribute:

    +
      +
    • Contributors who just want to add changes from time to time
    • +
    • Maintainers who oversee the repo, code themselves and review contribution + before they can be merged
    • +
    +

    Community

    +

    The community can be found on discord. +Nothing beats a good discussion about existing features, new features or ideas +so jump right in.

    +

    Spirit

    +

    We are all learners, some in the early stage some in the later. +In a code review, we take the patience to imaginarily sit down together and +explain other people why something is recommended differently or how things are +usually done in software or python. +This often seems tedious at first but growing together is important for any kind +of project which wants to grow itself. +So no fear in case of lack of experience but bring your learning spirit. +Samewise to any experienced developer, have patience and explain things. +Take the opportunity to sit down together on discord.

    +

    How to make a Contribution

    +

    Tl;dr;

    +
      +
    1. Fork the open lasso python repository
    2. +
    3. Clone the repo to your filesystem
    4. +
    5. Install task
    6. +
    7. Check out the develop branch
    8. +
    9. Set up the repo for development through task setup
    10. +
    11. Create a new branch from develop with the naming pattern feature/...
    12. +
    13. Make changes, commit and push them
    14. +
    15. Create a Pull Request in your for repo with target on the original repo
    16. +
    17. Add as reviewer open-lasso-python/developers
    18. +
    19. Wait for review patiently but you may nudge us a bit ๐Ÿซถ
    20. +
    21. Perform a Squash Merge and give a reasonable commit message as + <branch type>: <description> where branch_type is one of the categories + below.
    22. +
    +

    You can fork the repo (1) by clicking on for in the top-right of the original +repo. +Cloning the repo (2) is traditionally done with git then of course. +Task is required (3) since it is used to store complex commands such as testing, +linting, build docs, etc. +(4) All development activities originate from the develop branch in which all +Pull Requests are finally merged again. +To create a branch choose a respective naming pattern following the angular +scheme: <branch type>/<issue nr if exists>-<rough description/name>. +Typical branch types are:

    +
      +
    • feature for new features or if you got no clue what it is
    • +
    • bugfix for ๐Ÿ›-fixes
    • +
    • ci for changes on the Continuous Integration pipeline
    • +
    • docs for documentation related works
    • +
    • refactor if the PR just does cleanup ๐Ÿงน and improves the code
    • +
    • test for solely test-related work
    • +
    +

    Don't take these too seriously but they ought to provide rough categories. +They are also used in the commit message when you squash merge a PR where it +is important! +Install all dependencies otherwise obviously you can't code (5). +After making changes and pushing your branch to your forked repo (7 & 8), open a +Pull Request but make the target not develop in your fork but develop in the +original repo (7). +If not done automatically, add the maintainer group as reviewers (9). +Enjoy a healthy code review but be a bit patient with time as people contribute +voluntarily and may privately be occupied (10). +After approval, perform a Squash Merge (11). +A Squash Merge tosses away all the little, dirty commits we all do during +development. +What stays is the final merge commit message and please pay attention here +to format it right. +Why is this important? +This is needed to automatically generate a reasonable changelog during releases. +Thanks for contributing at this point. +Go wild and have fun ๐Ÿฅณ

    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/coverage/.gitignore b/coverage/.gitignore new file mode 100644 index 0000000..ccccf14 --- /dev/null +++ b/coverage/.gitignore @@ -0,0 +1,2 @@ +# Created by coverage.py +* diff --git a/coverage/coverage_html.js b/coverage/coverage_html.js new file mode 100644 index 0000000..4c32118 --- /dev/null +++ b/coverage/coverage_html.js @@ -0,0 +1,624 @@ +// Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +// For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +// Coverage.py HTML report browser code. +/*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */ +/*global coverage: true, document, window, $ */ + +coverage = {}; + +// General helpers +function debounce(callback, wait) { + let timeoutId = null; + return function(...args) { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => { + callback.apply(this, args); + }, wait); + }; +}; + +function checkVisible(element) { + const rect = element.getBoundingClientRect(); + const viewBottom = Math.max(document.documentElement.clientHeight, window.innerHeight); + const viewTop = 30; + return !(rect.bottom < viewTop || rect.top >= viewBottom); +} + +function on_click(sel, fn) { + const elt = document.querySelector(sel); + if (elt) { + elt.addEventListener("click", fn); + } +} + +// Helpers for table sorting +function getCellValue(row, column = 0) { + const cell = row.cells[column] + if (cell.childElementCount == 1) { + const child = cell.firstElementChild + if (child instanceof HTMLTimeElement && child.dateTime) { + return child.dateTime + } else if (child instanceof HTMLDataElement && child.value) { + return child.value + } + } + return cell.innerText || cell.textContent; +} + +function rowComparator(rowA, rowB, column = 0) { + let valueA = getCellValue(rowA, column); + let valueB = getCellValue(rowB, column); + if (!isNaN(valueA) && !isNaN(valueB)) { + return valueA - valueB + } + return valueA.localeCompare(valueB, undefined, {numeric: true}); +} + +function sortColumn(th) { + // Get the current sorting direction of the selected header, + // clear state on other headers and then set the new sorting direction + const currentSortOrder = th.getAttribute("aria-sort"); + [...th.parentElement.cells].forEach(header => header.setAttribute("aria-sort", "none")); + if (currentSortOrder === "none") { + th.setAttribute("aria-sort", th.dataset.defaultSortOrder || "ascending"); + } else { + th.setAttribute("aria-sort", currentSortOrder === "ascending" ? "descending" : "ascending"); + } + + const column = [...th.parentElement.cells].indexOf(th) + + // Sort all rows and afterwards append them in order to move them in the DOM + Array.from(th.closest("table").querySelectorAll("tbody tr")) + .sort((rowA, rowB) => rowComparator(rowA, rowB, column) * (th.getAttribute("aria-sort") === "ascending" ? 1 : -1)) + .forEach(tr => tr.parentElement.appendChild(tr) ); +} + +// Find all the elements with data-shortcut attribute, and use them to assign a shortcut key. +coverage.assign_shortkeys = function () { + document.querySelectorAll("[data-shortcut]").forEach(element => { + document.addEventListener("keypress", event => { + if (event.target.tagName.toLowerCase() === "input") { + return; // ignore keypress from search filter + } + if (event.key === element.dataset.shortcut) { + element.click(); + } + }); + }); +}; + +// Create the events for the filter box. +coverage.wire_up_filter = function () { + // Cache elements. + const table = document.querySelector("table.index"); + const table_body_rows = table.querySelectorAll("tbody tr"); + const no_rows = document.getElementById("no_rows"); + + // Observe filter keyevents. + document.getElementById("filter").addEventListener("input", debounce(event => { + // Keep running total of each metric, first index contains number of shown rows + const totals = new Array(table.rows[0].cells.length).fill(0); + // Accumulate the percentage as fraction + totals[totals.length - 1] = { "numer": 0, "denom": 0 }; + + // Hide / show elements. + table_body_rows.forEach(row => { + if (!row.cells[0].textContent.includes(event.target.value)) { + // hide + row.classList.add("hidden"); + return; + } + + // show + row.classList.remove("hidden"); + totals[0]++; + + for (let column = 1; column < totals.length; column++) { + // Accumulate dynamic totals + cell = row.cells[column] + if (column === totals.length - 1) { + // Last column contains percentage + const [numer, denom] = cell.dataset.ratio.split(" "); + totals[column]["numer"] += parseInt(numer, 10); + totals[column]["denom"] += parseInt(denom, 10); + } else { + totals[column] += parseInt(cell.textContent, 10); + } + } + }); + + // Show placeholder if no rows will be displayed. + if (!totals[0]) { + // Show placeholder, hide table. + no_rows.style.display = "block"; + table.style.display = "none"; + return; + } + + // Hide placeholder, show table. + no_rows.style.display = null; + table.style.display = null; + + const footer = table.tFoot.rows[0]; + // Calculate new dynamic sum values based on visible rows. + for (let column = 1; column < totals.length; column++) { + // Get footer cell element. + const cell = footer.cells[column]; + + // Set value into dynamic footer cell element. + if (column === totals.length - 1) { + // Percentage column uses the numerator and denominator, + // and adapts to the number of decimal places. + const match = /\.([0-9]+)/.exec(cell.textContent); + const places = match ? match[1].length : 0; + const { numer, denom } = totals[column]; + cell.dataset.ratio = `${numer} ${denom}`; + // Check denom to prevent NaN if filtered files contain no statements + cell.textContent = denom + ? `${(numer * 100 / denom).toFixed(places)}%` + : `${(100).toFixed(places)}%`; + } else { + cell.textContent = totals[column]; + } + } + })); + + // Trigger change event on setup, to force filter on page refresh + // (filter value may still be present). + document.getElementById("filter").dispatchEvent(new Event("input")); +}; + +coverage.INDEX_SORT_STORAGE = "COVERAGE_INDEX_SORT_2"; + +// Loaded on index.html +coverage.index_ready = function () { + coverage.assign_shortkeys(); + coverage.wire_up_filter(); + document.querySelectorAll("[data-sortable] th[aria-sort]").forEach( + th => th.addEventListener("click", e => sortColumn(e.target)) + ); + + // Look for a localStorage item containing previous sort settings: + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + + if (stored_list) { + const {column, direction} = JSON.parse(stored_list); + const th = document.querySelector("[data-sortable]").tHead.rows[0].cells[column]; + th.setAttribute("aria-sort", direction === "ascending" ? "descending" : "ascending"); + th.click() + } + + // Watch for page unload events so we can save the final sort settings: + window.addEventListener("unload", function () { + const th = document.querySelector('[data-sortable] th[aria-sort="ascending"], [data-sortable] [aria-sort="descending"]'); + if (!th) { + return; + } + localStorage.setItem(coverage.INDEX_SORT_STORAGE, JSON.stringify({ + column: [...th.parentElement.cells].indexOf(th), + direction: th.getAttribute("aria-sort"), + })); + }); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + + on_click(".button_show_hide_help", coverage.show_hide_help); +}; + +// -- pyfile stuff -- + +coverage.LINE_FILTERS_STORAGE = "COVERAGE_LINE_FILTERS"; + +coverage.pyfile_ready = function () { + // If we're directed to a particular line number, highlight the line. + var frag = location.hash; + if (frag.length > 2 && frag[1] === "t") { + document.querySelector(frag).closest(".n").classList.add("highlight"); + coverage.set_sel(parseInt(frag.substr(2), 10)); + } else { + coverage.set_sel(0); + } + + on_click(".button_toggle_run", coverage.toggle_lines); + on_click(".button_toggle_mis", coverage.toggle_lines); + on_click(".button_toggle_exc", coverage.toggle_lines); + on_click(".button_toggle_par", coverage.toggle_lines); + + on_click(".button_next_chunk", coverage.to_next_chunk_nicely); + on_click(".button_prev_chunk", coverage.to_prev_chunk_nicely); + on_click(".button_top_of_page", coverage.to_top); + on_click(".button_first_chunk", coverage.to_first_chunk); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + on_click(".button_to_index", coverage.to_index); + + on_click(".button_show_hide_help", coverage.show_hide_help); + + coverage.filters = undefined; + try { + coverage.filters = localStorage.getItem(coverage.LINE_FILTERS_STORAGE); + } catch(err) {} + + if (coverage.filters) { + coverage.filters = JSON.parse(coverage.filters); + } + else { + coverage.filters = {run: false, exc: true, mis: true, par: true}; + } + + for (cls in coverage.filters) { + coverage.set_line_visibilty(cls, coverage.filters[cls]); + } + + coverage.assign_shortkeys(); + coverage.init_scroll_markers(); + coverage.wire_up_sticky_header(); + + document.querySelectorAll("[id^=ctxs]").forEach( + cbox => cbox.addEventListener("click", coverage.expand_contexts) + ); + + // Rebuild scroll markers when the window height changes. + window.addEventListener("resize", coverage.build_scroll_markers); +}; + +coverage.toggle_lines = function (event) { + const btn = event.target.closest("button"); + const category = btn.value + const show = !btn.classList.contains("show_" + category); + coverage.set_line_visibilty(category, show); + coverage.build_scroll_markers(); + coverage.filters[category] = show; + try { + localStorage.setItem(coverage.LINE_FILTERS_STORAGE, JSON.stringify(coverage.filters)); + } catch(err) {} +}; + +coverage.set_line_visibilty = function (category, should_show) { + const cls = "show_" + category; + const btn = document.querySelector(".button_toggle_" + category); + if (btn) { + if (should_show) { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.add(cls)); + btn.classList.add(cls); + } + else { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.remove(cls)); + btn.classList.remove(cls); + } + } +}; + +// Return the nth line div. +coverage.line_elt = function (n) { + return document.getElementById("t" + n)?.closest("p"); +}; + +// Set the selection. b and e are line numbers. +coverage.set_sel = function (b, e) { + // The first line selected. + coverage.sel_begin = b; + // The next line not selected. + coverage.sel_end = (e === undefined) ? b+1 : e; +}; + +coverage.to_top = function () { + coverage.set_sel(0, 1); + coverage.scroll_window(0); +}; + +coverage.to_first_chunk = function () { + coverage.set_sel(0, 1); + coverage.to_next_chunk(); +}; + +coverage.to_prev_file = function () { + window.location = document.getElementById("prevFileLink").href; +} + +coverage.to_next_file = function () { + window.location = document.getElementById("nextFileLink").href; +} + +coverage.to_index = function () { + location.href = document.getElementById("indexLink").href; +} + +coverage.show_hide_help = function () { + const helpCheck = document.getElementById("help_panel_state") + helpCheck.checked = !helpCheck.checked; +} + +// Return a string indicating what kind of chunk this line belongs to, +// or null if not a chunk. +coverage.chunk_indicator = function (line_elt) { + const classes = line_elt?.className; + if (!classes) { + return null; + } + const match = classes.match(/\bshow_\w+\b/); + if (!match) { + return null; + } + return match[0]; +}; + +coverage.to_next_chunk = function () { + const c = coverage; + + // Find the start of the next colored chunk. + var probe = c.sel_end; + var chunk_indicator, probe_line; + while (true) { + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + if (chunk_indicator) { + break; + } + probe++; + } + + // There's a next chunk, `probe` points to it. + var begin = probe; + + // Find the end of this chunk. + var next_indicator = chunk_indicator; + while (next_indicator === chunk_indicator) { + probe++; + probe_line = c.line_elt(probe); + next_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(begin, probe); + c.show_selection(); +}; + +coverage.to_prev_chunk = function () { + const c = coverage; + + // Find the end of the prev colored chunk. + var probe = c.sel_begin-1; + var probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + var chunk_indicator = c.chunk_indicator(probe_line); + while (probe > 1 && !chunk_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + } + + // There's a prev chunk, `probe` points to its last line. + var end = probe+1; + + // Find the beginning of this chunk. + var prev_indicator = chunk_indicator; + while (prev_indicator === chunk_indicator) { + probe--; + if (probe <= 0) { + return; + } + probe_line = c.line_elt(probe); + prev_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(probe+1, end); + c.show_selection(); +}; + +// Returns 0, 1, or 2: how many of the two ends of the selection are on +// the screen right now? +coverage.selection_ends_on_screen = function () { + if (coverage.sel_begin === 0) { + return 0; + } + + const begin = coverage.line_elt(coverage.sel_begin); + const end = coverage.line_elt(coverage.sel_end-1); + + return ( + (checkVisible(begin) ? 1 : 0) + + (checkVisible(end) ? 1 : 0) + ); +}; + +coverage.to_next_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the top line on the screen as selection. + + // This will select the top-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(0, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(1); + } else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_next_chunk(); +}; + +coverage.to_prev_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the lowest line on the screen as selection. + + // This will select the bottom-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(document.documentElement.clientHeight-1, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(coverage.lines_len); + } else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_prev_chunk(); +}; + +// Select line number lineno, or if it is in a colored chunk, select the +// entire chunk +coverage.select_line_or_chunk = function (lineno) { + var c = coverage; + var probe_line = c.line_elt(lineno); + if (!probe_line) { + return; + } + var the_indicator = c.chunk_indicator(probe_line); + if (the_indicator) { + // The line is in a highlighted chunk. + // Search backward for the first line. + var probe = lineno; + var indicator = the_indicator; + while (probe > 0 && indicator === the_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + break; + } + indicator = c.chunk_indicator(probe_line); + } + var begin = probe + 1; + + // Search forward for the last line. + probe = lineno; + indicator = the_indicator; + while (indicator === the_indicator) { + probe++; + probe_line = c.line_elt(probe); + indicator = c.chunk_indicator(probe_line); + } + + coverage.set_sel(begin, probe); + } + else { + coverage.set_sel(lineno); + } +}; + +coverage.show_selection = function () { + // Highlight the lines in the chunk + document.querySelectorAll("#source .highlight").forEach(e => e.classList.remove("highlight")); + for (let probe = coverage.sel_begin; probe < coverage.sel_end; probe++) { + coverage.line_elt(probe).querySelector(".n").classList.add("highlight"); + } + + coverage.scroll_to_selection(); +}; + +coverage.scroll_to_selection = function () { + // Scroll the page if the chunk isn't fully visible. + if (coverage.selection_ends_on_screen() < 2) { + const element = coverage.line_elt(coverage.sel_begin); + coverage.scroll_window(element.offsetTop - 60); + } +}; + +coverage.scroll_window = function (to_pos) { + window.scroll({top: to_pos, behavior: "smooth"}); +}; + +coverage.init_scroll_markers = function () { + // Init some variables + coverage.lines_len = document.querySelectorAll("#source > p").length; + + // Build html + coverage.build_scroll_markers(); +}; + +coverage.build_scroll_markers = function () { + const temp_scroll_marker = document.getElementById("scroll_marker") + if (temp_scroll_marker) temp_scroll_marker.remove(); + // Don't build markers if the window has no scroll bar. + if (document.body.scrollHeight <= window.innerHeight) { + return; + } + + const marker_scale = window.innerHeight / document.body.scrollHeight; + const line_height = Math.min(Math.max(3, window.innerHeight / coverage.lines_len), 10); + + let previous_line = -99, last_mark, last_top; + + const scroll_marker = document.createElement("div"); + scroll_marker.id = "scroll_marker"; + document.getElementById("source").querySelectorAll( + "p.show_run, p.show_mis, p.show_exc, p.show_exc, p.show_par" + ).forEach(element => { + const line_top = Math.floor(element.offsetTop * marker_scale); + const line_number = parseInt(element.querySelector(".n a").id.substr(1)); + + if (line_number === previous_line + 1) { + // If this solid missed block just make previous mark higher. + last_mark.style.height = `${line_top + line_height - last_top}px`; + } else { + // Add colored line in scroll_marker block. + last_mark = document.createElement("div"); + last_mark.id = `m${line_number}`; + last_mark.classList.add("marker"); + last_mark.style.height = `${line_height}px`; + last_mark.style.top = `${line_top}px`; + scroll_marker.append(last_mark); + last_top = line_top; + } + + previous_line = line_number; + }); + + // Append last to prevent layout calculation + document.body.append(scroll_marker); +}; + +coverage.wire_up_sticky_header = function () { + const header = document.querySelector("header"); + const header_bottom = ( + header.querySelector(".content h2").getBoundingClientRect().top - + header.getBoundingClientRect().top + ); + + function updateHeader() { + if (window.scrollY > header_bottom) { + header.classList.add("sticky"); + } else { + header.classList.remove("sticky"); + } + } + + window.addEventListener("scroll", updateHeader); + updateHeader(); +}; + +coverage.expand_contexts = function (e) { + var ctxs = e.target.parentNode.querySelector(".ctxs"); + + if (!ctxs.classList.contains("expanded")) { + var ctxs_text = ctxs.textContent; + var width = Number(ctxs_text[0]); + ctxs.textContent = ""; + for (var i = 1; i < ctxs_text.length; i += width) { + key = ctxs_text.substring(i, i + width).trim(); + ctxs.appendChild(document.createTextNode(contexts[key])); + ctxs.appendChild(document.createElement("br")); + } + ctxs.classList.add("expanded"); + } +}; + +document.addEventListener("DOMContentLoaded", () => { + if (document.body.classList.contains("indexfile")) { + coverage.index_ready(); + } else { + coverage.pyfile_ready(); + } +}); diff --git a/coverage/covindex.html b/coverage/covindex.html new file mode 100644 index 0000000..54f6415 --- /dev/null +++ b/coverage/covindex.html @@ -0,0 +1,501 @@ + + + + + Coverage report + + + + + +
    +
    +

    Coverage report: + 50% +

    + +
    + +
    +

    + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Modulestatementsmissingexcludedcoverage
    lasso/__init__.py000100%
    lasso/diffcrash/__init__.py2200%
    lasso/diffcrash/diffcrash_run.py58758700%
    lasso/diffcrash/run.py393900%
    lasso/dimred/__init__.py200100%
    lasso/dimred/dimred_run.py451158065%
    lasso/dimred/graph_laplacian.py474700%
    lasso/dimred/hashing.py21721700%
    lasso/dimred/hashing_sphere.py858500%
    lasso/dimred/run.py282800%
    lasso/dimred/sphere/__init__.py000100%
    lasso/dimred/sphere/algorithms.py676700%
    lasso/dimred/svd/__init__.py000100%
    lasso/dimred/svd/clustering_betas.py223115048%
    lasso/dimred/svd/html_str_eles.py400100%
    lasso/dimred/svd/keyword_types.py1600100%
    lasso/dimred/svd/plot_beta_clusters.py6522066%
    lasso/dimred/svd/pod_functions.py301097%
    lasso/dimred/svd/subsampling_methods.py12056053%
    lasso/dimred/svd/test_clustering_betas.py2700100%
    lasso/dimred/svd/test_plot_betas_clusters.py1800100%
    lasso/dimred/svd/test_pod_functions.py2400100%
    lasso/dimred/svd/test_subsampling_methods.py4600100%
    lasso/dimred/test_dimred_run.py731099%
    lasso/dimred/test_plot_creator.py523094%
    lasso/dyna/__init__.py600100%
    lasso/dyna/array_type.py15700100%
    lasso/dyna/binout.py11293017%
    lasso/dyna/d3plot.py39071941050%
    lasso/dyna/d3plot_header.py41547089%
    lasso/dyna/femzip_mapper.py22861073%
    lasso/dyna/filter_type.py800100%
    lasso/dyna/lsda_py3.py424363014%
    lasso/dyna/test_d3plot.py1987096%
    lasso/dyna/test_d3plot_header.py4200100%
    lasso/dyna/test_mapper.py1028092%
    lasso/femzip/__init__.py200100%
    lasso/femzip/femzip_api.py417269035%
    lasso/femzip/fz_config.py1136095%
    lasso/io/__init__.py000100%
    lasso/io/binary_buffer.py7810087%
    lasso/io/files.py3100100%
    lasso/io/test_binary_buffer.py4400100%
    lasso/io/test_files.py1400100%
    lasso/logging.py225077%
    lasso/math/__init__.py000100%
    lasso/math/sampling.py229059%
    lasso/math/stochastic.py900100%
    lasso/math/test_sampling.py600100%
    lasso/math/test_stochastic.py900100%
    lasso/plotting/__init__.py200100%
    lasso/plotting/plot_shell_mesh.py8068015%
    lasso/plotting/resources/__init__.py000100%
    lasso/utils/__init__.py000100%
    lasso/utils/console_coloring.py345085%
    lasso/utils/decorators.py282800%
    lasso/utils/language.py212100%
    lasso/utils/rich_progress_bars.py7845042%
    Total88324414050%
    +

    + No items found using the specified filter. +

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d___init___py.html b/coverage/d_233c5ceebba6ed8d___init___py.html new file mode 100644 index 0000000..6ae23c3 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d___init___py.html @@ -0,0 +1,104 @@ + + + + + Coverage for lasso/dyna/__init__.py: 100% + + + + + +
    + +
    +
    +

    1from .d3plot import D3plot 

    +

    2from .binout import Binout 

    +

    3from .array_type import ArrayType 

    +

    4from .filter_type import FilterType 

    +

    5from .d3plot_header import D3plotHeader, D3plotFiletype 

    +

    6 

    +

    7__all__ = ["Binout", "D3plot", "ArrayType", "FilterType", "D3plotHeader", "D3plotFiletype"] 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_array_type_py.html b/coverage/d_233c5ceebba6ed8d_array_type_py.html new file mode 100644 index 0000000..5a1fa1c --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_array_type_py.html @@ -0,0 +1,702 @@ + + + + + Coverage for lasso/dyna/array_type.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dyna/array_type.py: + 100% +

    + +

    + 157 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import typing 

    +

    2 

    +

    3 

    +

    4class ArrayType: 

    +

    5 """Specifies the names for specific arrays 

    +

    6 

    +

    7 Enums from this class shall be used as a preferred practice 

    +

    8 instead of the string array names to ensure compatibility. 

    +

    9 

    +

    10 Attributes 

    +

    11 ---------- 

    +

    12 global_timesteps: str 

    +

    13 array shape: (n_timesteps) 

    +

    14 global_kinetic_energy: str 

    +

    15 array shape: (n_timesteps) 

    +

    16 global_internal_energy: str 

    +

    17 array shape: (n_timesteps) 

    +

    18 global_total_energy: str 

    +

    19 array shape: (n_timesteps) 

    +

    20 global_velocity: str 

    +

    21 array shape: (n_timesteps) 

    +

    22 node_ids: str 

    +

    23 array shape: (n_nodes) 

    +

    24 node_coordinates: str 

    +

    25 array shape: (n_nodes, x_y_z) 

    +

    26 node_displacement: str 

    +

    27 array shape: (n_states, n_nodes, x_y_z) 

    +

    28 node_velocity: str 

    +

    29 array shape: (n_states, n_nodes, x_y_z) 

    +

    30 node_acceleration: str 

    +

    31 array shape: (n_states, n_nodes, x_y_z) 

    +

    32 node_is_alive: str 

    +

    33 array shape: (n_states, n_nodes) 

    +

    34 node_temperature: str 

    +

    35 array shape: (n_states, n_nodes) or (n_states, n_nodes, 3) 

    +

    36 node_heat_flux: str 

    +

    37 array shape: (n_states, n_nodes, 3) 

    +

    38 node_mass_scaling: str 

    +

    39 array shape: (n_states, n_nodes) 

    +

    40 node_temperature_gradient: str 

    +

    41 array shape: (n_states, n_nodes) 

    +

    42 node_residual_forces: str 

    +

    43 array shape: (n_states, n_nodes, fx_fy_fz) 

    +

    44 node_residual_moments: str 

    +

    45 array shape: (n_states, n_nodes, mx_my_mz) 

    +

    46 element_solid_node_indexes: str 

    +

    47 array shape: (n_solids, 8) 

    +

    48 element_solid_part_indexes: str 

    +

    49 array shape: (n_solids) 

    +

    50 element_solid_ids: str 

    +

    51 array shape: (n_solids) 

    +

    52 element_solid_thermal_data: str 

    +

    53 array shape: (n_states, n_solids, n_solids_thermal_vars) 

    +

    54 element_solid_stress: str 

    +

    55 array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) 

    +

    56 element_solid_effective_plastic_strain: str 

    +

    57 array shape: (n_states, n_solid_layers, n_solids) 

    +

    58 element_solid_history_variables: str 

    +

    59 array shape: (n_states, n_solids, n_solid_layers, n_solids_history_vars) 

    +

    60 element_solid_strain: str 

    +

    61 array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) 

    +

    62 element_solid_plastic_strain_tensor: str 

    +

    63 array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) 

    +

    64 element_solid_thermal_strain_tensor: str 

    +

    65 array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) 

    +

    66 element_solid_is_alive: str 

    +

    67 array shape: (n_states, n_solids) 

    +

    68 element_solid_extra_nodes: str 

    +

    69 array shape: (n_solids, 2) 

    +

    70 element_solid_node10_extra_node_indexes: str 

    +

    71 array shape: (n_solids, 2) 

    +

    72 element_solid_node20_element_index: str 

    +

    73 array shape: (n_node20_solids) 

    +

    74 element_solid_node20_extra_node_indexes: str 

    +

    75 array shape: (n_node20_solids, 12) 

    +

    76 element_solid_node27_element_index: str 

    +

    77 array shape: (n_node27_solids) 

    +

    78 element_solid_node27_extra_node_indexes: str 

    +

    79 array shape: (n_node27_solids, 27) 

    +

    80 element_solid_node21_penta_element_index: str 

    +

    81 array shape: (n_node21p_solids) 

    +

    82 element_solid_node21_penta_extra_node_indexes: str 

    +

    83 array shape: (n_node21p_solids, 21) 

    +

    84 element_solid_node15_tetras_element_index: str 

    +

    85 array shape: (n_node15t_solids) 

    +

    86 element_solid_node15_tetras_extra_node_indexes: str 

    +

    87 array shape: (n_node15t_solids, 7) 

    +

    88 element_solid_node20_tetras_element_index: str 

    +

    89 array shape: (n_node20t_solids) 

    +

    90 element_solid_node20_tetras_extra_node_indexes: str 

    +

    91 array shape: (n_node20t_solids, 20) 

    +

    92 element_solid_node40_pentas_element_index: str 

    +

    93 array shape: (n_node40h_solids) 

    +

    94 element_solid_node40_pentas_extra_node_indexes: str 

    +

    95 array shape: (n_node40h_solids, 40) 

    +

    96 element_solid_node64_hexas_element_index: str 

    +

    97 array shape: (n_node64h_solids) 

    +

    98 element_solid_node64_hexas_extra_node_indexes: str 

    +

    99 array shape: (n_node64h_solids, 64) 

    +

    100 element_tshell_part_indexes: str 

    +

    101 array shape: (n_tshells) 

    +

    102 element_tshell_node_indexes: str 

    +

    103 array shape: (n_tshells, 8) 

    +

    104 element_tshell_ids: str 

    +

    105 array shape: (n_tshells) 

    +

    106 element_tshell_stress: str 

    +

    107 array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) 

    +

    108 element_tshell_effective_plastic_strain: str 

    +

    109 array shape: (n_states, n_tshells, n_tshells_layers) 

    +

    110 element_tshell_history_variables: str 

    +

    111 array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) 

    +

    112 element_tshell_is_alive: str 

    +

    113 array shape: (n_states, n_tshells) 

    +

    114 element_tshell_strain: str 

    +

    115 array shape: (n_states, n_tshells, upper_lower, xx_yy_zz_xy_yz_xz) 

    +

    116 element_beam_part_indexes: str 

    +

    117 array shape: (n_beams) 

    +

    118 element_beam_node_indexes: str 

    +

    119 array shape: (n_beams, 5) 

    +

    120 element_beam_ids: str 

    +

    121 array shape: (n_beams) 

    +

    122 element_beam_axial_force: str 

    +

    123 array shape: (n_states, n_beams) 

    +

    124 element_beam_shear_force: str 

    +

    125 array shape: (n_states, n_beams, s_t) 

    +

    126 element_beam_bending_moment: str 

    +

    127 array shape: (n_states, n_beams, s_t) 

    +

    128 element_beam_torsion_moment: str 

    +

    129 array shape: (n_states, n_beams) 

    +

    130 element_beam_shear_stress: str 

    +

    131 array shape: (n_states, n_beams, n_beams_layers, rs_rt) 

    +

    132 element_beam_axial_stress: str 

    +

    133 array shape: (n_states, n_beams, n_beams_layers) 

    +

    134 element_beam_plastic_strain: str 

    +

    135 array shape: (n_states, n_beams, n_beams_layers) 

    +

    136 element_beam_axial_strain: str 

    +

    137 array shape: (n_states, n_beams, n_beams_layers) 

    +

    138 element_beam_history_vars: str 

    +

    139 array shape: (n_states, n_beams, n_beams_layers+3, n_beams_history_vars) 

    +

    140 element_beam_is_alive: str 

    +

    141 array shape: (n_states, n_beams) 

    +

    142 element_shell_part_indexes: str 

    +

    143 array shape (n_shells, 4) 

    +

    144 element_shell_node_indexes: str 

    +

    145 array shape (n_shells) 

    +

    146 element_shell_ids: str 

    +

    147 array shape (n_shells) 

    +

    148 element_shell_stress: str 

    +

    149 array shape (n_states, n_shells_non_rigid, n_shell_layers, xx_yy_zz_xy_yz_xz) 

    +

    150 element_shell_effective_plastic_strain: str 

    +

    151 array shape (n_states, n_shells_non_rigid, n_shell_layers) 

    +

    152 element_shell_history_vars: str 

    +

    153 array shape (n_states, n_shells_non_rigid, n_shell_layers, n_shell_history_vars) 

    +

    154 element_shell_bending_moment: str 

    +

    155 array shape (n_states, n_shells_non_rigid, mx_my_mxy) 

    +

    156 element_shell_shear_force: str 

    +

    157 array shape (n_states, n_shells_non_rigid, qx_qy) 

    +

    158 element_shell_normal_force: str 

    +

    159 array shape (n_states, n_shells_non_rigid, nx_ny_nxy) 

    +

    160 element_shell_thickness: str 

    +

    161 array shape (n_states, n_shells_non_rigid) 

    +

    162 element_shell_unknown_variables: str 

    +

    163 array shape (n_states, n_shells_non_rigid, 2) 

    +

    164 element_shell_internal_energy: str 

    +

    165 array shape (n_states, n_shells_non_rigid) 

    +

    166 element_shell_strain: str 

    +

    167 array shape (n_states, n_shells_non_rigid, upper_lower, xx_yy_zz_xy_yz_xz) 

    +

    168 element_shell_is_alive: str 

    +

    169 array shape (n_states, n_shells_non_rigid) 

    +

    170 element_shell_node8_extra_node_indexes: str 

    +

    171 array shape (n_shells, 4) 

    +

    172 element_shell_node8_element_index: str 

    +

    173 array shape: (n_shells) 

    +

    174 element_shell_plastic_strain_tensor: str 

    +

    175 array shape(n_states, n_shells_non_rigid, n_layers, 6) 

    +

    176 element_shell_thermal_strain_tensor: str 

    +

    177 array shape(n_states, n_shells_non_rigid, 6) 

    +

    178 part_material_type: str 

    +

    179 array shape: (n_parts) 

    +

    180 part_ids: str 

    +

    181 array shape: (n_parts) 

    +

    182 part_ids_unordered: str 

    +

    183 array shape: (n_parts) 

    +

    184 part_ids_cross_references: str 

    +

    185 array shape: (n_parts) 

    +

    186 part_titles: str 

    +

    187 array shape: (n_parts) 

    +

    188 part_titles_ids: str 

    +

    189 array shape: (n_parts) 

    +

    190 part_internal_energy: str 

    +

    191 array shape: (n_states, n_parts) 

    +

    192 part_kinetic_energy: str 

    +

    193 array shape: (n_states, n_parts) 

    +

    194 part_velocity: str 

    +

    195 array shape: (n_states, n_parts, x_y_z) 

    +

    196 part_mass: str 

    +

    197 array shape: (n_states, n_parts) 

    +

    198 part_hourglass_energy: str 

    +

    199 array shape: (n_states, n_parts) 

    +

    200 sph_node_indexes: str 

    +

    201 array shape: (n_sph_nodes) 

    +

    202 sph_node_material_index: str 

    +

    203 array shape: (n_sph_nodes) 

    +

    204 sph_is_alive: str 

    +

    205 array shape: (n_states, n_sph_particles) 

    +

    206 sph_radius: str 

    +

    207 array shape: (n_states, n_sph_particles) 

    +

    208 sph_pressure: str 

    +

    209 array shape: (n_states, n_sph_particles) 

    +

    210 sph_stress: str 

    +

    211 array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) 

    +

    212 sph_effective_plastic_strain: str 

    +

    213 array shape: (n_states, n_sph_particles) 

    +

    214 sph_density: str 

    +

    215 array shape: (n_states, n_sph_particles) 

    +

    216 sph_internal_energy: str 

    +

    217 array shape: (n_states, n_sph_particles) 

    +

    218 sph_n_neighbors: str 

    +

    219 array shape: (n_states, n_sph_particles) 

    +

    220 sph_strain: str 

    +

    221 array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) 

    +

    222 sph_strainrate: str 

    +

    223 array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) 

    +

    224 sph_mass: str 

    +

    225 array shape: (n_states, n_sph_particles) 

    +

    226 sph_deletion: str 

    +

    227 array shape: (n_states, n_sph_particles) 

    +

    228 sph_history_vars: str 

    +

    229 array shape: (n_states, n_sph_particles, n_sph_history_vars) 

    +

    230 airbag_variable_names: str 

    +

    231 array shape: (n_variables) 

    +

    232 airbag_variable_types: str 

    +

    233 array shape: (n_variables) 

    +

    234 airbags_first_particle_id: str 

    +

    235 array shape: (n_airbags) 

    +

    236 airbags_n_particles: str 

    +

    237 array shape: (n_airbags) 

    +

    238 airbags_ids: str 

    +

    239 array shape: (n_airbags) 

    +

    240 airbags_n_gas_mixtures: str 

    +

    241 array shape: (n_airbags) 

    +

    242 airbags_n_chambers: str 

    +

    243 array shape: (n_airbags) 

    +

    244 airbag_n_active_particles: str 

    +

    245 array shape: (n_states, n_airbags) 

    +

    246 airbag_bag_volume: str 

    +

    247 array shape: (n_states, n_airbags) 

    +

    248 airbag_particle_gas_id: str 

    +

    249 array shape: (n_states, n_airbag_particles) 

    +

    250 airbag_particle_chamber_id: str 

    +

    251 array shape: (n_states, n_airbag_particles) 

    +

    252 airbag_particle_leakage: str 

    +

    253 array shape: (n_states, n_airbag_particles) 

    +

    254 airbag_particle_mass: str 

    +

    255 array shape: (n_states, n_airbag_particles) 

    +

    256 airbag_particle_radius: str 

    +

    257 array shape: (n_states, n_airbag_particles) 

    +

    258 airbag_particle_spin_energy: str 

    +

    259 array shape: (n_states, n_airbag_particles) 

    +

    260 airbag_particle_translation_energy: str 

    +

    261 array shape: (n_states, n_airbag_particles) 

    +

    262 airbag_particle_nearest_segment_distance: str 

    +

    263 array shape: (n_states, n_airbag_particles) 

    +

    264 airbag_particle_position: str 

    +

    265 array shape: (n_states, n_airbag_particles, x_y_z) 

    +

    266 airbag_particle_velocity: str 

    +

    267 array shape: (n_states, n_airbag_particles, x_y_z) 

    +

    268 rigid_road_node_ids: str 

    +

    269 array shape: (rigid_road_n_nodes) 

    +

    270 rigid_road_node_coordinates: str 

    +

    271 array shape: (rigid_road_n_nodes, x_y_z) 

    +

    272 rigid_road_ids: str 

    +

    273 array shape: (n_roads) 

    +

    274 rigid_road_n_segments: str 

    +

    275 array shape: (n_roads) 

    +

    276 rigid_road_segment_node_ids: str 

    +

    277 list!: (n_roads, 4*n_road_segments) 

    +

    278 rigid_road_segment_road_id: str 

    +

    279 list!: (n_roads, n_road_segments) 

    +

    280 rigid_road_displacement: str 

    +

    281 array shape: (n_states, n_roads, x_y_z) 

    +

    282 rigid_road_velocity: str 

    +

    283 array shape: (n_states, n_roads, x_y_z) 

    +

    284 rigid_body_part_indexes: str 

    +

    285 array shape: (n_rigid_bodies) 

    +

    286 rigid_body_n_nodes: str 

    +

    287 array shape: (n_rigid_bodies) 

    +

    288 rigid_body_node_indexes_list: str 

    +

    289 list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) 

    +

    290 rigid_body_n_active_nodes: str 

    +

    291 array shape: (n_rigid_bodies) 

    +

    292 rigid_body_active_node_indexes_list: str 

    +

    293 list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) 

    +

    294 rigid_body_coordinates: str 

    +

    295 array shape: (n_states, n_rigid_bodies, x_y_z) 

    +

    296 rigid_body_rotation_matrix: str 

    +

    297 array shape: (n_states, n_rigid_bodies, 9) 

    +

    298 rigid_body_velocity: str 

    +

    299 array shape: (n_states, n_rigid_bodies, x_y_z) 

    +

    300 rigid_body_rot_velocity: str 

    +

    301 array shape: (n_states, n_rigid_bodies, x_y_z) 

    +

    302 rigid_body_acceleration: str 

    +

    303 array shape: (n_states, n_rigid_bodies, x_y_z) 

    +

    304 rigid_body_rot_acceleration: str 

    +

    305 array shape: (n_states, n_rigid_bodies, x_y_z) 

    +

    306 contact_title_ids: str 

    +

    307 array shape: (n_contacts) 

    +

    308 contact_titles: str 

    +

    309 array shape: (n_contacts) 

    +

    310 ale_material_ids: str 

    +

    311 array shape: (n_ale_material) 

    +

    312 rigid_wall_force: str 

    +

    313 array shape: (n_states, n_rigid_walls) 

    +

    314 rigid_wall_position: str 

    +

    315 array shape: (n_states, n_rigid_walls, x_y_z) 

    +

    316 """ 

    +

    317 

    +

    318 # global 

    +

    319 global_timesteps = "timesteps" 

    +

    320 global_kinetic_energy = "global_kinetic_energy" 

    +

    321 global_internal_energy = "global_internal_energy" 

    +

    322 global_total_energy = "global_total_energy" 

    +

    323 global_velocity = "global_velocity" 

    +

    324 # nodes 

    +

    325 node_ids = "node_ids" 

    +

    326 node_coordinates = "node_coordinates" 

    +

    327 node_displacement = "node_displacement" 

    +

    328 node_velocity = "node_velocity" 

    +

    329 node_acceleration = "node_acceleration" 

    +

    330 node_is_alive = "node_is_alive" 

    +

    331 node_temperature = "node_temperature" 

    +

    332 node_heat_flux = "node_heat_flux" 

    +

    333 node_mass_scaling = "node_mass_scaling" 

    +

    334 node_temperature_gradient = "node_temperature_gradient" 

    +

    335 node_residual_forces = "node_residual_forces" 

    +

    336 node_residual_moments = "node_residual_moments" 

    +

    337 # solids 

    +

    338 element_solid_node_indexes = "element_solid_node_indexes" 

    +

    339 element_solid_part_indexes = "element_solid_part_indexes" 

    +

    340 element_solid_ids = "element_solid_ids" 

    +

    341 element_solid_thermal_data = "element_solid_thermal_data" 

    +

    342 element_solid_stress = "element_solid_stress" 

    +

    343 element_solid_effective_plastic_strain = "element_solid_effective_plastic_strain" 

    +

    344 element_solid_history_variables = "element_solid_history_variables" 

    +

    345 element_solid_strain = "element_solid_strain" 

    +

    346 element_solid_plastic_strain_tensor = "element_solid_plastic_strain_tensor" 

    +

    347 element_solid_thermal_strain_tensor = "element_solid_thermal_strain_tensor" 

    +

    348 element_solid_is_alive = "element_solid_is_alive" 

    +

    349 element_solid_extra_nodes = "element_solid_extra_nodes" 

    +

    350 element_solid_node10_extra_node_indexes = "element_solid_node10_extra_node_indexes" 

    +

    351 element_solid_node20_element_index = "element_solid_node20_element_index" 

    +

    352 element_solid_node20_extra_node_indexes = "element_solid_node20_extra_node_indexes" 

    +

    353 element_solid_node27_element_index = "element_solid_node27_element_index" 

    +

    354 element_solid_node27_extra_node_indexes = "element_solid_node27_extra_node_indexes" 

    +

    355 element_solid_node21_penta_element_index = "element_solid_node21_penta_element_index" 

    +

    356 element_solid_node21_penta_extra_node_indexes = "element_solid_node21_penta_extra_node_indexes" 

    +

    357 element_solid_node15_tetras_element_index = "element_solid_node15_tetras_element_index" 

    +

    358 element_solid_node15_tetras_extra_node_indexes = ( 

    +

    359 "element_solid_node15_tetras_extra_node_indexes" 

    +

    360 ) 

    +

    361 element_solid_node20_tetras_element_index = "element_solid_node20_tetras_element_index" 

    +

    362 element_solid_node20_tetras_extra_node_indexes = ( 

    +

    363 "element_solid_node20_tetras_extra_node_indexes" 

    +

    364 ) 

    +

    365 element_solid_node40_pentas_element_index = "element_solid_node40_pentas_element_index" 

    +

    366 element_solid_node40_pentas_extra_node_indexes = ( 

    +

    367 "element_solid_node40_pentas_extra_node_indexes" 

    +

    368 ) 

    +

    369 element_solid_node64_hexas_element_index = "element_solid_node64_hexas_element_index" 

    +

    370 element_solid_node64_hexas_extra_node_indexes = "element_solid_node64_hexas_extra_node_indexes" 

    +

    371 

    +

    372 # tshells 

    +

    373 element_tshell_part_indexes = "element_tshell_part_indexes" 

    +

    374 element_tshell_node_indexes = "element_tshell_node_indexes" 

    +

    375 element_tshell_ids = "element_tshell_ids" 

    +

    376 element_tshell_stress = "element_tshell_stress" 

    +

    377 element_tshell_effective_plastic_strain = "element_tshell_effective_plastic_strain" 

    +

    378 element_tshell_history_variables = "element_tshell_history_variables" 

    +

    379 element_tshell_is_alive = "element_tshell_is_alive" 

    +

    380 element_tshell_strain = "element_tshell_strain" 

    +

    381 # beams 

    +

    382 element_beam_part_indexes = "element_beam_part_indexes" 

    +

    383 element_beam_node_indexes = "element_beam_node_indexes" 

    +

    384 element_beam_ids = "element_beam_ids" 

    +

    385 

    +

    386 element_beam_axial_force = "element_beam_axial_force" 

    +

    387 element_beam_shear_force = "element_beam_shear_force" 

    +

    388 element_beam_bending_moment = "element_beam_bending_moment" 

    +

    389 element_beam_torsion_moment = "element_beam_torsion_moment" 

    +

    390 element_beam_shear_stress = "element_beam_shear_stress" 

    +

    391 element_beam_axial_stress = "element_beam_axial_stress" 

    +

    392 element_beam_plastic_strain = "element_beam_plastic_strain" 

    +

    393 element_beam_axial_strain = "element_beam_axial_strain" 

    +

    394 element_beam_history_vars = "element_beam_history_vars" 

    +

    395 element_beam_is_alive = "element_beam_is_alive" 

    +

    396 # shells 

    +

    397 element_shell_part_indexes = "element_shell_part_indexes" 

    +

    398 element_shell_node_indexes = "element_shell_node_indexes" 

    +

    399 element_shell_ids = "element_shell_ids" 

    +

    400 element_shell_stress = "element_shell_stress" 

    +

    401 element_shell_effective_plastic_strain = "element_shell_effective_plastic_strain" 

    +

    402 element_shell_history_vars = "element_shell_history_vars" 

    +

    403 element_shell_bending_moment = "element_shell_bending_moment" 

    +

    404 element_shell_shear_force = "element_shell_shear_force" 

    +

    405 element_shell_normal_force = "element_shell_normal_force" 

    +

    406 element_shell_thickness = "element_shell_thickness" 

    +

    407 element_shell_unknown_variables = "element_shell_unknown_variables" 

    +

    408 element_shell_internal_energy = "element_shell_internal_energy" 

    +

    409 element_shell_strain = "element_shell_strain" 

    +

    410 element_shell_is_alive = "element_shell_is_alive" 

    +

    411 element_shell_node8_extra_node_indexes = "element_shell_node8_extra_node_indexes" 

    +

    412 element_shell_node8_element_index = "element_shell_node8_element_index" 

    +

    413 element_shell_plastic_strain_tensor = "element_shell_plastic_strain_tensor" 

    +

    414 element_shell_thermal_strain_tensor = "element_shell_thermal_strain_tensor" 

    +

    415 # parts 

    +

    416 part_material_type = "part_material_type" 

    +

    417 part_ids = "part_ids" 

    +

    418 part_ids_unordered = "part_ids_unordered" 

    +

    419 part_ids_cross_references = "part_ids_cross_references" 

    +

    420 part_titles = "part_titles" 

    +

    421 part_titles_ids = "part_titles_ids" 

    +

    422 part_internal_energy = "part_internal_energy" 

    +

    423 part_kinetic_energy = "part_kinetic_energy" 

    +

    424 part_velocity = "part_velocity" 

    +

    425 part_mass = "part_mass" 

    +

    426 part_hourglass_energy = "part_hourglass_energy" 

    +

    427 # sph 

    +

    428 sph_node_indexes = "sph_node_indexes" 

    +

    429 sph_node_material_index = "sph_node_material_index" 

    +

    430 sph_is_alive = "sph_is_alive" 

    +

    431 sph_radius = "sph_radius" 

    +

    432 sph_pressure = "sph_pressure" 

    +

    433 sph_stress = "sph_stress" 

    +

    434 sph_effective_plastic_strain = "sph_effective_plastic_strain" 

    +

    435 sph_density = "sph_density" 

    +

    436 sph_internal_energy = "sph_internal_energy" 

    +

    437 sph_n_neighbors = "sph_n_neighbors" 

    +

    438 sph_strain = "sph_strain" 

    +

    439 sph_strainrate = "sph_strainrate" 

    +

    440 sph_mass = "sph_mass" 

    +

    441 sph_deletion = "sph_deletion" 

    +

    442 sph_history_vars = "sph_history_vars" 

    +

    443 # airbag 

    +

    444 airbag_variable_names = "airbag_variable_names" 

    +

    445 airbag_variable_types = "airbag_variable_types" 

    +

    446 

    +

    447 airbags_first_particle_id = "airbags_first_particle_id" 

    +

    448 airbags_n_particles = "airbags_n_particles" 

    +

    449 airbags_ids = "airbags_ids" 

    +

    450 airbags_n_gas_mixtures = "airbags_n_gas_mixtures" 

    +

    451 airbags_n_chambers = "airbags_n_chambers" 

    +

    452 

    +

    453 airbag_n_active_particles = "airbag_n_active_particles" 

    +

    454 airbag_bag_volume = "airbag_bag_volume" 

    +

    455 

    +

    456 airbag_particle_gas_id = "airbag_particle_gas_id" 

    +

    457 airbag_particle_chamber_id = "airbag_particle_chamber_id" 

    +

    458 airbag_particle_leakage = "airbag_particle_leakage" 

    +

    459 airbag_particle_mass = "airbag_particle_mass" 

    +

    460 airbag_particle_radius = "airbag_particle_radius" 

    +

    461 airbag_particle_spin_energy = "airbag_particle_spin_energy" 

    +

    462 airbag_particle_translation_energy = "airbag_particle_translation_energy" 

    +

    463 airbag_particle_nearest_segment_distance = "airbag_particle_nearest_segment_distance" 

    +

    464 airbag_particle_position = "airbag_particle_position" 

    +

    465 airbag_particle_velocity = "airbag_particle_velocity" 

    +

    466 # rigid roads 

    +

    467 rigid_road_node_ids = "rigid_road_node_ids" 

    +

    468 rigid_road_node_coordinates = "rigid_road_node_coordinates" 

    +

    469 rigid_road_ids = "rigid_road_ids" 

    +

    470 rigid_road_n_segments = "rigid_road_n_segments" 

    +

    471 rigid_road_segment_node_ids = "rigid_road_segment_node_ids" 

    +

    472 rigid_road_segment_road_id = "rigid_road_segment_road_id" 

    +

    473 rigid_road_displacement = "rigid_road_displacement" 

    +

    474 rigid_road_velocity = "rigid_road_velocity" 

    +

    475 # rigid body 

    +

    476 rigid_body_part_indexes = "rigid_body_part_index" 

    +

    477 rigid_body_n_nodes = "rigid_body_n_nodes" 

    +

    478 rigid_body_node_indexes_list = "rigid_body_node_indexes_list" 

    +

    479 rigid_body_n_active_nodes = "rigid_body_n_active_nodes" 

    +

    480 rigid_body_active_node_indexes_list = "rigid_body_active_node_indexes_list" 

    +

    481 rigid_body_coordinates = "rigid_body_coordinates" 

    +

    482 rigid_body_rotation_matrix = "rigid_body_rotation_matrix" 

    +

    483 rigid_body_velocity = "rigid_body_velocity" 

    +

    484 rigid_body_rot_velocity = "rigid_body_rotational_velocity" 

    +

    485 rigid_body_acceleration = "rigid_body_acceleration" 

    +

    486 rigid_body_rot_acceleration = "rigid_body_rotational_acceleration" 

    +

    487 # contact info 

    +

    488 contact_title_ids = "contact_title_ids" 

    +

    489 contact_titles = "contact_titles" 

    +

    490 # ALE 

    +

    491 ale_material_ids = "ale_material_ids" 

    +

    492 # rigid wall 

    +

    493 rigid_wall_force = "rigid_wall_force" 

    +

    494 rigid_wall_position = "rigid_wall_position" 

    +

    495 

    +

    496 @staticmethod 

    +

    497 def get_state_array_names() -> typing.List[str]: 

    +

    498 """Get the names of all state arrays 

    +

    499 

    +

    500 Returns: 

    +

    501 -------- 

    +

    502 state_array_names: List[str] 

    +

    503 list of state array names 

    +

    504 """ 

    +

    505 return [ 

    +

    506 # global 

    +

    507 ArrayType.global_timesteps, 

    +

    508 ArrayType.global_kinetic_energy, 

    +

    509 ArrayType.global_internal_energy, 

    +

    510 ArrayType.global_total_energy, 

    +

    511 ArrayType.global_velocity, 

    +

    512 # parts 

    +

    513 ArrayType.part_internal_energy, 

    +

    514 ArrayType.part_kinetic_energy, 

    +

    515 ArrayType.part_velocity, 

    +

    516 ArrayType.part_mass, 

    +

    517 ArrayType.part_hourglass_energy, 

    +

    518 # rigid wall 

    +

    519 ArrayType.rigid_wall_force, 

    +

    520 ArrayType.rigid_wall_position, 

    +

    521 # nodes 

    +

    522 ArrayType.node_temperature, 

    +

    523 ArrayType.node_heat_flux, 

    +

    524 ArrayType.node_mass_scaling, 

    +

    525 ArrayType.node_displacement, 

    +

    526 ArrayType.node_velocity, 

    +

    527 ArrayType.node_acceleration, 

    +

    528 ArrayType.node_temperature_gradient, 

    +

    529 ArrayType.node_residual_forces, 

    +

    530 ArrayType.node_residual_moments, 

    +

    531 # solids 

    +

    532 ArrayType.element_solid_thermal_data, 

    +

    533 ArrayType.element_solid_stress, 

    +

    534 ArrayType.element_solid_effective_plastic_strain, 

    +

    535 ArrayType.element_solid_history_variables, 

    +

    536 ArrayType.element_solid_strain, 

    +

    537 ArrayType.element_solid_is_alive, 

    +

    538 ArrayType.element_solid_plastic_strain_tensor, 

    +

    539 ArrayType.element_solid_thermal_strain_tensor, 

    +

    540 # thick shells 

    +

    541 ArrayType.element_tshell_stress, 

    +

    542 ArrayType.element_tshell_effective_plastic_strain, 

    +

    543 ArrayType.element_tshell_history_variables, 

    +

    544 ArrayType.element_tshell_strain, 

    +

    545 ArrayType.element_tshell_is_alive, 

    +

    546 # beams 

    +

    547 ArrayType.element_beam_axial_force, 

    +

    548 ArrayType.element_beam_shear_force, 

    +

    549 ArrayType.element_beam_bending_moment, 

    +

    550 ArrayType.element_beam_torsion_moment, 

    +

    551 ArrayType.element_beam_shear_stress, 

    +

    552 ArrayType.element_beam_axial_stress, 

    +

    553 ArrayType.element_beam_plastic_strain, 

    +

    554 ArrayType.element_beam_axial_strain, 

    +

    555 ArrayType.element_beam_history_vars, 

    +

    556 ArrayType.element_beam_is_alive, 

    +

    557 # shells 

    +

    558 ArrayType.element_shell_stress, 

    +

    559 ArrayType.element_shell_effective_plastic_strain, 

    +

    560 ArrayType.element_shell_history_vars, 

    +

    561 ArrayType.element_shell_bending_moment, 

    +

    562 ArrayType.element_shell_shear_force, 

    +

    563 ArrayType.element_shell_normal_force, 

    +

    564 ArrayType.element_shell_thickness, 

    +

    565 ArrayType.element_shell_unknown_variables, 

    +

    566 ArrayType.element_shell_internal_energy, 

    +

    567 ArrayType.element_shell_strain, 

    +

    568 ArrayType.element_shell_is_alive, 

    +

    569 ArrayType.element_shell_plastic_strain_tensor, 

    +

    570 ArrayType.element_shell_thermal_strain_tensor, 

    +

    571 # sph 

    +

    572 ArrayType.sph_deletion, 

    +

    573 ArrayType.sph_radius, 

    +

    574 ArrayType.sph_pressure, 

    +

    575 ArrayType.sph_stress, 

    +

    576 ArrayType.sph_effective_plastic_strain, 

    +

    577 ArrayType.sph_density, 

    +

    578 ArrayType.sph_internal_energy, 

    +

    579 ArrayType.sph_n_neighbors, 

    +

    580 ArrayType.sph_strain, 

    +

    581 ArrayType.sph_mass, 

    +

    582 # airbag 

    +

    583 ArrayType.airbag_n_active_particles, 

    +

    584 ArrayType.airbag_bag_volume, 

    +

    585 ArrayType.airbag_particle_gas_id, 

    +

    586 ArrayType.airbag_particle_chamber_id, 

    +

    587 ArrayType.airbag_particle_leakage, 

    +

    588 ArrayType.airbag_particle_mass, 

    +

    589 ArrayType.airbag_particle_radius, 

    +

    590 ArrayType.airbag_particle_spin_energy, 

    +

    591 ArrayType.airbag_particle_translation_energy, 

    +

    592 ArrayType.airbag_particle_nearest_segment_distance, 

    +

    593 ArrayType.airbag_particle_position, 

    +

    594 ArrayType.airbag_particle_velocity, 

    +

    595 # rigid road 

    +

    596 ArrayType.rigid_road_displacement, 

    +

    597 ArrayType.rigid_road_velocity, 

    +

    598 # rigid body 

    +

    599 ArrayType.rigid_body_coordinates, 

    +

    600 ArrayType.rigid_body_rotation_matrix, 

    +

    601 ArrayType.rigid_body_velocity, 

    +

    602 ArrayType.rigid_body_rot_velocity, 

    +

    603 ArrayType.rigid_body_acceleration, 

    +

    604 ArrayType.rigid_body_rot_acceleration, 

    +

    605 ] 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_binout_py.html b/coverage/d_233c5ceebba6ed8d_binout_py.html new file mode 100644 index 0000000..a8929db --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_binout_py.html @@ -0,0 +1,577 @@ + + + + + Coverage for lasso/dyna/binout.py: 17% + + + + + +
    +
    +

    + Coverage for lasso/dyna/binout.py: + 17% +

    + +

    + 112 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import glob 

    +

    2from typing import List, Union 

    +

    3 

    +

    4import h5py 

    +

    5import numpy as np 

    +

    6import pandas as pd 

    +

    7 

    +

    8from .lsda_py3 import Lsda 

    +

    9 

    +

    10 

    +

    11class Binout: 

    +

    12 """This class is meant to read binouts from LS-Dyna 

    +

    13 

    +

    14 Parameters 

    +

    15 ---------- 

    +

    16 filepath: str 

    +

    17 Path to the binout to read. May contain * (glob) for selecting multiple 

    +

    18 files. 

    +

    19 

    +

    20 Attributes 

    +

    21 ---------- 

    +

    22 filelist: List[str] 

    +

    23 List of files which are opened. 

    +

    24 lsda: Lsda 

    +

    25 The underlying LS-Dyna binout reader instance from code from LSTC. 

    +

    26 lsda_root: Symbol 

    +

    27 Root lsda symbol which is like a root directory to traverse the 

    +

    28 content of the binout file. 

    +

    29 

    +

    30 Notes 

    +

    31 ----- 

    +

    32 This class is only a utility wrapper for Lsda from LSTC. 

    +

    33 

    +

    34 Examples 

    +

    35 -------- 

    +

    36 >>> binout = Binout("path/to/binout") 

    +

    37 """ 

    +

    38 

    +

    39 def __init__(self, filepath: str): 

    +

    40 """Constructor for a binout 

    +

    41 

    +

    42 Parameters 

    +

    43 ---------- 

    +

    44 filepath: str 

    +

    45 path to the binout or pattern 

    +

    46 

    +

    47 Notes 

    +

    48 ----- 

    +

    49 The class loads the file given in the filepath. By giving a 

    +

    50 search pattern such as: "binout*", all files with that 

    +

    51 pattern will be loaded. 

    +

    52 

    +

    53 Examples 

    +

    54 -------- 

    +

    55 >>> # reads a single binout 

    +

    56 >>> binout = Binout("path/to/binout0000") 

    +

    57 >>> binout.filelist 

    +

    58 ['path/to/binout0000'] 

    +

    59 

    +

    60 >>> # reads multiple files 

    +

    61 >>> binout = Binout("path/to/binout*") 

    +

    62 >>> binout.filelist 

    +

    63 ['path/to/binout0000','path/to/binout0001'] 

    +

    64 """ 

    +

    65 

    +

    66 self.filelist = glob.glob(filepath) 

    +

    67 

    +

    68 # check file existance 

    +

    69 if not self.filelist: 

    +

    70 raise IOError("No file was found.") 

    +

    71 

    +

    72 # open lsda buffer 

    +

    73 self.lsda = Lsda(self.filelist, "r") 

    +

    74 self.lsda_root = self.lsda.root 

    +

    75 

    +

    76 def read(self, *path) -> Union[List[str], str, np.ndarray]: 

    +

    77 """Read all data from Binout (top to low level) 

    +

    78 

    +

    79 Parameters 

    +

    80 ---------- 

    +

    81 path: Union[Tuple[str, ...], List[str], str] 

    +

    82 internal path in the folder structure of the binout 

    +

    83 

    +

    84 Returns 

    +

    85 ------- 

    +

    86 ret: Union[List[str], str, np.ndarray] 

    +

    87 list of subdata within the folder or data itself (array or string) 

    +

    88 

    +

    89 Notes 

    +

    90 ----- 

    +

    91 This function is used to read any data from the binout. It has been used 

    +

    92 to make the access to the data more comfortable. The return type depends 

    +

    93 on the given path: 

    +

    94 

    +

    95 - `binout.read()`: `List[str] names of directories (in binout) 

    +

    96 - `binout.read(dir)`: `List[str]` names of variables or subdirs 

    +

    97 - `binout.read(dir1, ..., variable)`: np.array data 

    +

    98 

    +

    99 If you have multiple outputs with different ids (e.g. in nodout for 

    +

    100 multiple nodes) then don't forget to read the id array for 

    +

    101 identification or id-labels. 

    +

    102 

    +

    103 Examples 

    +

    104 -------- 

    +

    105 >>> from lasso.dyna import Binout 

    +

    106 >>> binout = Binout("test/binout") 

    +

    107 >>> # get top dirs 

    +

    108 >>> binout.read() 

    +

    109 ['swforc'] 

    +

    110 >>> binout.read("swforc") 

    +

    111 ['title', 'failure', 'ids', 'failure_time', ...] 

    +

    112 >>> binout.read("swforc","shear").shape 

    +

    113 (321L, 26L) 

    +

    114 >>> binout.read("swforc","ids").shape 

    +

    115 (26L,) 

    +

    116 >>> binout.read("swforc","ids") 

    +

    117 array([52890, 52891, 52892, ...]) 

    +

    118 >>> # read a string value 

    +

    119 >>> binout.read("swforc","date") 

    +

    120 '11/05/2013' 

    +

    121 """ 

    +

    122 

    +

    123 return self._decode_path(path) 

    +

    124 

    +

    125 def as_df(self, *args) -> pd.DataFrame: 

    +

    126 """read data and convert to pandas dataframe if possible 

    +

    127 

    +

    128 Parameters 

    +

    129 ---------- 

    +

    130 *args: Union[Tuple[str, ...], List[str], str] 

    +

    131 internal path in the folder structure of the binout 

    +

    132 

    +

    133 Returns 

    +

    134 ------- 

    +

    135 df: pandas.DataFrame 

    +

    136 data converted to pandas dataframe 

    +

    137 

    +

    138 Raises 

    +

    139 ------ 

    +

    140 ValueError 

    +

    141 if the data cannot be converted to a pandas dataframe 

    +

    142 

    +

    143 Examples 

    +

    144 -------- 

    +

    145 >>> from lasso.dyna import Binout 

    +

    146 >>> binout = Binout('path/to/binout') 

    +

    147 

    +

    148 Read a time-dependent array. 

    +

    149 

    +

    150 >>> binout.as_df('glstat', 'eroded_kinetic_energy') 

    +

    151 time 

    +

    152 0.00000 0.000000 

    +

    153 0.19971 0.000000 

    +

    154 0.39942 0.000000 

    +

    155 0.59976 0.000000 

    +

    156 0.79947 0.000000 

    +

    157 ... 

    +

    158 119.19978 105.220786 

    +

    159 119.39949 105.220786 

    +

    160 119.59983 105.220786 

    +

    161 119.79954 105.220786 

    +

    162 119.99988 105.220786 

    +

    163 Name: eroded_kinetic_energy, Length: 601, dtype: float64 

    +

    164 

    +

    165 Read a time and id-dependent array. 

    +

    166 

    +

    167 >>> binout.as_df('secforc', 'x_force') 

    +

    168 1 2 3 ... 33 34 

    +

    169 time . 

    +

    170 0.00063 2.168547e-16 2.275245e-15 -3.118639e-14 ... -5.126108e-13 4.592941e-16 

    +

    171 0.20034 3.514243e-04 3.797908e-04 -1.701294e-03 ... 2.530416e-11 2.755493e-07 

    +

    172 0.40005 3.052490e-03 3.242951e-02 -2.699926e-02 ... 6.755315e-06 -2.608923e-03 

    +

    173 0.60039 -1.299816e-02 4.930999e-02 -1.632376e-02 ... 8.941705e-05 -2.203455e-02 

    +

    174 0.80010 1.178485e-02 4.904512e-02 -9.740204e-03 ... 5.648263e-05 -6.999854e-02 

    +

    175 ... ... ... ... ... ... ... 

    +

    176 119.00007 9.737679e-01 -8.833702e+00 1.298964e+01 ... -9.977377e-02 7.883521e+00 

    +

    177 119.20041 7.421170e-01 -8.849411e+00 1.253505e+01 ... -1.845916e-01 7.791409e+00 

    +

    178 119.40012 9.946615e-01 -8.541475e+00 1.188757e+01 ... -3.662228e-02 7.675800e+00 

    +

    179 119.60046 9.677638e-01 -8.566695e+00 1.130774e+01 ... 5.144208e-02 7.273052e+00 

    +

    180 119.80017 1.035165e+00 -8.040828e+00 1.124044e+01 ... -1.213450e-02 7.188395e+00 

    +

    181 """ 

    +

    182 

    +

    183 data = self.read(*args) 

    +

    184 

    +

    185 # validate time-based data 

    +

    186 if not isinstance(data, np.ndarray): 

    +

    187 err_msg = "data is not a numpy array but has type '{0}'" 

    +

    188 raise ValueError(err_msg.format(type(data))) 

    +

    189 

    +

    190 time_array = self.read(*args[:-1], "time") 

    +

    191 if data.shape[0] != time_array.shape[0]: 

    +

    192 raise ValueError("data series length does not match time array length") 

    +

    193 

    +

    194 time_pdi = pd.Index(time_array, name="time") 

    +

    195 

    +

    196 # create dataframe 

    +

    197 if data.ndim > 1: 

    +

    198 df = pd.DataFrame(index=time_pdi) 

    +

    199 

    +

    200 if args[0] == "rcforc": 

    +

    201 ids = [ 

    +

    202 (str(i) + "m") if j else (str(i) + "s") 

    +

    203 for i, j in zip(self.read("rcforc", "ids"), self.read("rcforc", "side")) 

    +

    204 ] 

    +

    205 else: 

    +

    206 ids = self.read(*args[:-1], "ids") 

    +

    207 

    +

    208 for i, j in enumerate(ids): 

    +

    209 df[str(j)] = data.T[i] 

    +

    210 

    +

    211 else: 

    +

    212 df = pd.Series(data, index=time_pdi, name=args[-1]) 

    +

    213 

    +

    214 return df 

    +

    215 

    +

    216 def _decode_path(self, path): 

    +

    217 """Decode a path and get whatever is inside. 

    +

    218 

    +

    219 Parameters 

    +

    220 ---------- 

    +

    221 path: List[str] 

    +

    222 path within the binout 

    +

    223 

    +

    224 Notes 

    +

    225 ----- 

    +

    226 Usually returns the folder children. If there are variables in the folder 

    +

    227 (usually also if a subfolder metadata exists), then the variables will 

    +

    228 be printed from these directories. 

    +

    229 

    +

    230 Returns 

    +

    231 ------- 

    +

    232 ret: Union[List[str], np.ndarray] 

    +

    233 either sub folder list or data array 

    +

    234 """ 

    +

    235 

    +

    236 i_level = len(path) 

    +

    237 

    +

    238 if i_level == 0: # root subfolders 

    +

    239 return self._bstr_to_str(list(self.lsda_root.children.keys())) 

    +

    240 

    +

    241 # some subdir 

    +

    242 # try if path can be resolved (then it's a dir) 

    +

    243 # in this case print the subfolders or subvars 

    +

    244 try: 

    +

    245 dir_symbol = self._get_symbol(self.lsda_root, path) 

    +

    246 

    +

    247 if "metadata" in dir_symbol.children: 

    +

    248 return self._collect_variables(dir_symbol) 

    +

    249 return self._bstr_to_str(list(dir_symbol.children.keys())) 

    +

    250 

    +

    251 # an error is risen, if the path is not resolvable 

    +

    252 # this could be, because we want to read a var 

    +

    253 except ValueError: 

    +

    254 return self._get_variable(path) 

    +

    255 

    +

    256 def _get_symbol(self, symbol, path): 

    +

    257 """Get a symbol from a path via lsda 

    +

    258 

    +

    259 Parameters 

    +

    260 ---------- 

    +

    261 symbol: Symbol 

    +

    262 current directory which is a Lsda.Symbol 

    +

    263 

    +

    264 Returns 

    +

    265 ------- 

    +

    266 symbol: Symbol 

    +

    267 final symbol after recursive search of path 

    +

    268 """ 

    +

    269 

    +

    270 # check 

    +

    271 if symbol is None: 

    +

    272 raise ValueError("Symbol may not be none.") 

    +

    273 

    +

    274 # no further path, return current symbol 

    +

    275 if len(path) == 0: 

    +

    276 return symbol 

    +

    277 

    +

    278 # more subsymbols to search for 

    +

    279 sub_path = list(path) # copy 

    +

    280 next_symbol_name = sub_path.pop(0) 

    +

    281 

    +

    282 next_symbol = symbol.get(next_symbol_name) 

    +

    283 if next_symbol is None: 

    +

    284 raise ValueError(f"Cannot find: {next_symbol_name}") 

    +

    285 

    +

    286 return self._get_symbol(next_symbol, sub_path) 

    +

    287 

    +

    288 def _get_variable(self, path): 

    +

    289 """Read a variable from a given path 

    +

    290 

    +

    291 Parameters 

    +

    292 ---------- 

    +

    293 path: List[str] 

    +

    294 path to the variable 

    +

    295 

    +

    296 Returns 

    +

    297 ------- 

    +

    298 data: np.ndarray 

    +

    299 """ 

    +

    300 

    +

    301 dir_symbol = self._get_symbol(self.lsda_root, path[:-1]) 

    +

    302 # variables are somehow binary strings ... dirs not 

    +

    303 variable_name = self._str_to_bstr(path[-1]) 

    +

    304 

    +

    305 # var in metadata 

    +

    306 if ("metadata" in dir_symbol.children) and ( 

    +

    307 variable_name in dir_symbol.get("metadata").children 

    +

    308 ): 

    +

    309 var_symbol = dir_symbol.get("metadata").get(variable_name) 

    +

    310 var_type = var_symbol.type 

    +

    311 

    +

    312 # symbol is a string 

    +

    313 if var_type == 1: 

    +

    314 return self._to_string(var_symbol.read()) 

    +

    315 

    +

    316 # symbol is numeric data 

    +

    317 return np.asarray(var_symbol.read()) 

    +

    318 

    +

    319 # var in state data ... hopefully 

    +

    320 time = [] 

    +

    321 data = [] 

    +

    322 for subdir_name, subdir_symbol in dir_symbol.children.items(): 

    +

    323 

    +

    324 # skip metadata 

    +

    325 if subdir_name == "metadata": 

    +

    326 continue 

    +

    327 

    +

    328 # read data 

    +

    329 if variable_name in subdir_symbol.children: 

    +

    330 state_data = subdir_symbol.get(variable_name).read() 

    +

    331 if len(state_data) == 1: 

    +

    332 data.append(state_data[0]) 

    +

    333 else: # more than one data entry 

    +

    334 data.append(state_data) 

    +

    335 

    +

    336 time_symbol = subdir_symbol.get(b"time") 

    +

    337 if time_symbol: 

    +

    338 time += time_symbol.read() 

    +

    339 

    +

    340 # return sorted by time 

    +

    341 if len(time) == len(data): 

    +

    342 return np.array(data)[np.argsort(time)] 

    +

    343 

    +

    344 return np.array(data) 

    +

    345 

    +

    346 def _collect_variables(self, symbol): 

    +

    347 """Collect all variables from a symbol 

    +

    348 

    +

    349 Parameters 

    +

    350 ---------- 

    +

    351 symbol: Symbol 

    +

    352 

    +

    353 Returns 

    +

    354 ------- 

    +

    355 variable_names: List[str] 

    +

    356 

    +

    357 Notes 

    +

    358 ----- 

    +

    359 This function collect all variables from the state dirs and metadata. 

    +

    360 """ 

    +

    361 

    +

    362 var_names = set() 

    +

    363 for _, subdir_symbol in symbol.children.items(): 

    +

    364 var_names = var_names.union(subdir_symbol.children.keys()) 

    +

    365 

    +

    366 return self._bstr_to_str(list(var_names)) 

    +

    367 

    +

    368 def _to_string(self, data_array): 

    +

    369 """Convert a data series of numbers (usually ints) to a string 

    +

    370 

    +

    371 Parameters 

    +

    372 ---------- 

    +

    373 data_array: Union[int, np.ndarray] 

    +

    374 some data array 

    +

    375 

    +

    376 Returns 

    +

    377 ------- 

    +

    378 string: str 

    +

    379 data array converted to characters 

    +

    380 

    +

    381 Notes 

    +

    382 ----- 

    +

    383 This is needed for the reason that sometimes the binary data 

    +

    384 within the files are strings. 

    +

    385 """ 

    +

    386 

    +

    387 return "".join([chr(entry) for entry in data_array]) 

    +

    388 

    +

    389 def _bstr_to_str(self, arg): 

    +

    390 """Encodes or decodes a string correctly regarding python version 

    +

    391 

    +

    392 Parameters 

    +

    393 ---------- 

    +

    394 arg: Union[str, bytes] 

    +

    395 

    +

    396 Returns 

    +

    397 ------- 

    +

    398 string: str 

    +

    399 converted to python version 

    +

    400 """ 

    +

    401 

    +

    402 # in case of a list call this function with its atomic strings 

    +

    403 if isinstance(arg, (list, tuple)): 

    +

    404 return [self._bstr_to_str(entry) for entry in arg] 

    +

    405 

    +

    406 # convert a string (dependent on python version) 

    +

    407 if not isinstance(arg, str): 

    +

    408 return arg.decode("utf-8") 

    +

    409 

    +

    410 return arg 

    +

    411 

    +

    412 def _str_to_bstr(self, string): 

    +

    413 """Convert a string to a binary string python version independent 

    +

    414 

    +

    415 Parameters 

    +

    416 ---------- 

    +

    417 string: str 

    +

    418 

    +

    419 Returns 

    +

    420 ------- 

    +

    421 string: bytes 

    +

    422 """ 

    +

    423 

    +

    424 if not isinstance(string, bytes): 

    +

    425 return string.encode("utf-8") 

    +

    426 

    +

    427 return string 

    +

    428 

    +

    429 def save_hdf5(self, filepath, compression="gzip"): 

    +

    430 """Save a binout as HDF5 

    +

    431 

    +

    432 Parameters 

    +

    433 ---------- 

    +

    434 filepath: str 

    +

    435 path where the HDF5 shall be saved 

    +

    436 compression: str 

    +

    437 compression technique (see h5py docs) 

    +

    438 

    +

    439 Examples 

    +

    440 -------- 

    +

    441 >>> binout = Binout("path/to/binout") 

    +

    442 >>> binout.save_hdf5("path/to/binout.h5") 

    +

    443 """ 

    +

    444 

    +

    445 with h5py.File(filepath, "w") as fh: 

    +

    446 self._save_all_variables(fh, compression) 

    +

    447 

    +

    448 def _save_all_variables(self, hdf5_grp, compression, *path): 

    +

    449 """Iterates through all variables in the Binout 

    +

    450 

    +

    451 Parameters 

    +

    452 ---------- 

    +

    453 hdf5_grp: Group 

    +

    454 group object in the HDF5, where all the data 

    +

    455 shall be saved into (of course in a tree like 

    +

    456 manner) 

    +

    457 compression: str 

    +

    458 compression technique (see h5py docs) 

    +

    459 path: Tuple[str, ...] 

    +

    460 entry path in the binout 

    +

    461 """ 

    +

    462 

    +

    463 ret = self.read(*path) 

    +

    464 path_str = "/".join(path) 

    +

    465 

    +

    466 # iterate through subdirs 

    +

    467 if isinstance(ret, list): 

    +

    468 

    +

    469 if path_str: 

    +

    470 hdf5_grp = hdf5_grp.create_group(path_str) 

    +

    471 

    +

    472 for entry in ret: 

    +

    473 path_child = path + (entry,) 

    +

    474 self._save_all_variables(hdf5_grp, compression, *path_child) 

    +

    475 # children are variables 

    +

    476 else: 

    +

    477 # can not save strings, only list of strings ... 

    +

    478 if isinstance(ret, str): 

    +

    479 ret = np.array([ret], dtype=np.dtype("S")) 

    +

    480 hdf5_grp.create_dataset(path[-1], data=ret, compression=compression) 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_d3plot_header_py.html b/coverage/d_233c5ceebba6ed8d_d3plot_header_py.html new file mode 100644 index 0000000..f9f5b42 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_d3plot_header_py.html @@ -0,0 +1,1294 @@ + + + + + Coverage for lasso/dyna/d3plot_header.py: 89% + + + + + +
    +
    +

    + Coverage for lasso/dyna/d3plot_header.py: + 89% +

    + +

    + 415 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import enum 

    +

    2from typing import Any, Dict, Tuple, Union 

    +

    3 

    +

    4import numpy as np 

    +

    5import rich 

    +

    6 

    +

    7from ..io.binary_buffer import BinaryBuffer 

    +

    8from ..logging import get_logger 

    +

    9 

    +

    10# We have a lot of docstrings here but even if not so, we want to contain the 

    +

    11# code here. 

    +

    12# pylint: disable=too-many-lines 

    +

    13 

    +

    14LOGGER = get_logger(__file__) 

    +

    15 

    +

    16 

    +

    17def get_digit(number: int, i_digit: int) -> int: 

    +

    18 """Get a digit from a number 

    +

    19 

    +

    20 Parameters 

    +

    21 ---------- 

    +

    22 number: int 

    +

    23 number to get digit from 

    +

    24 i_digit: int 

    +

    25 index of the digit 

    +

    26 

    +

    27 Returns 

    +

    28 ------- 

    +

    29 digit: int 

    +

    30 digit or 0 if i_digit is too large 

    +

    31 

    +

    32 Notes 

    +

    33 ----- 

    +

    34 `i_digit` does refer to a digit from the 

    +

    35 lowest position counting. Thus, 

    +

    36 123 with `i_digit=0` is `3`. 

    +

    37 """ 

    +

    38 digit_list = [] 

    +

    39 

    +

    40 # pylint: disable = inconsistent-return-statements 

    +

    41 def _get_digit_recursive(x: int): 

    +

    42 if x < 10: 

    +

    43 digit_list.append(x) 

    +

    44 return x 

    +

    45 _get_digit_recursive(x // 10) 

    +

    46 digit_list.append(x % 10) 

    +

    47 

    +

    48 # do the thing 

    +

    49 _get_digit_recursive(number) 

    +

    50 

    +

    51 # revert list from smallest to biggest 

    +

    52 digit_list = digit_list[::-1] 

    +

    53 

    +

    54 return digit_list[i_digit] if i_digit < len(digit_list) else 0 

    +

    55 

    +

    56 

    +

    57class D3plotFiletype(enum.Enum): 

    +

    58 """Enum for the filetype of a D3plot""" 

    +

    59 

    +

    60 D3PLOT = 1 

    +

    61 D3PART = 5 

    +

    62 D3EIGV = 11 

    +

    63 INTFOR = 4 

    +

    64 

    +

    65 

    +

    66def d3plot_filetype_from_integer(value: int) -> D3plotFiletype: 

    +

    67 """Get a D3plotFiletype object from an integer 

    +

    68 

    +

    69 Parameters 

    +

    70 ---------- 

    +

    71 value: int 

    +

    72 integer value representing the filetype 

    +

    73 

    +

    74 Returns 

    +

    75 ------- 

    +

    76 filetype: D3plotFiletype 

    +

    77 d3plot filetype object 

    +

    78 

    +

    79 Raises 

    +

    80 ------ 

    +

    81 RuntimeError if invalid value. 

    +

    82 """ 

    +

    83 

    +

    84 valid_entries = { 

    +

    85 entry.value: entry 

    +

    86 for entry in D3plotFiletype.__members__.values() 

    +

    87 if entry.value != 4 # no intfor 

    +

    88 } 

    +

    89 

    +

    90 if value not in valid_entries: 

    +

    91 valid_filetypes = ",".join( 

    +

    92 f"{key} ({value.value})" 

    +

    93 for key, value in D3plotFiletype.__members__.items() 

    +

    94 if value.value != 4 

    +

    95 ) 

    +

    96 err_msg = f"Invalid filetype value of {value}. Expected one of: {valid_filetypes}" 

    +

    97 raise ValueError(err_msg) 

    +

    98 

    +

    99 return valid_entries[value] 

    +

    100 

    +

    101 

    +

    102# pylint: disable = too-many-instance-attributes 

    +

    103class D3plotHeader: 

    +

    104 """Class for reading only header information of a d3plot 

    +

    105 

    +

    106 Attributes 

    +

    107 ---------- 

    +

    108 filepath: str 

    +

    109 Filepath of the processed file. 

    +

    110 itype: np.dtype 

    +

    111 Integer type of d3plot. 

    +

    112 ftype: np.dtype 

    +

    113 Floating point type of d3plot. 

    +

    114 wordsize: int 

    +

    115 size of words in bytes (4 = single precision, 8 = double precision). 

    +

    116 raw_header: Dict[str, Any] 

    +

    117 Raw header data as dict. 

    +

    118 external_numbers_dtype: np.dtype 

    +

    119 Integer type of user ids. 

    +

    120 n_header_bytes: int 

    +

    121 Number of bytes of header (at least 256 or more). 

    +

    122 title: str 

    +

    123 Main title. 

    +

    124 title2: str 

    +

    125 Optional, secondary title. 

    +

    126 runtime: int 

    +

    127 Runtime of the d3plot as timestamp. 

    +

    128 filetype: D3plotFiletype 

    +

    129 Filetype such as d3plot or d3part. 

    +

    130 source_version: int 

    +

    131 Source version of LS-Dyna. 

    +

    132 release_version: str 

    +

    133 Release version of LS-Dyna. 

    +

    134 version: float 

    +

    135 Version of LS-Dyna. 

    +

    136 extra_long_header: bool 

    +

    137 If header was longer than default. 

    +

    138 n_dimensions: int 

    +

    139 Number of dimensions, usually three. 

    +

    140 n_global_vars: int 

    +

    141 How many global vars for each state. 

    +

    142 n_adapted_element_pairs: int 

    +

    143 How many adapted element pairs. 

    +

    144 has_node_deletion_data: bool 

    +

    145 If node deletion data is present. 

    +

    146 has_element_deletion_data: bool 

    +

    147 If element deletion data is present. 

    +

    148 has_numbering_section: bool 

    +

    149 If a user numbering section is present. 

    +

    150 has_material_type_section: bool 

    +

    151 If material type section was written. 

    +

    152 n_numbering_section_words: int 

    +

    153 Amount of words for numbering section. 

    +

    154 has_invariant_numbering: bool 

    +

    155 If invariant numbering is used whatever that means. 

    +

    156 quadratic_elems_has_full_connectivity: bool 

    +

    157 If quadric elements have full connectivity. 

    +

    158 quadratic_elems_has_data_at_integration_points: bool 

    +

    159 If quadric elements data is at integration points. 

    +

    160 n_post_branches: int 

    +

    161 Unused and unknown. 

    +

    162 n_types: Tuple[int, ...] 

    +

    163 Behind geometry these are integers indicating additional data such as 

    +

    164 part names. 

    +

    165 n_parts: int 

    +

    166 Obviously number of parts. 

    +

    167 n_nodes: int 

    +

    168 Number of nodes. 

    +

    169 has_node_temperatures: bool 

    +

    170 If node temperature is present. 

    +

    171 has_node_temperature_layers: bool 

    +

    172 If node temperatures are layered. 

    +

    173 has_node_heat_flux: bool 

    +

    174 If node heat flux is present. 

    +

    175 has_node_mass_scaling: bool 

    +

    176 Mass scaling is written. 

    +

    177 has_node_displacement: bool 

    +

    178 Node displacement is written. 

    +

    179 has_node_velocity: bool 

    +

    180 Node velocity is written. 

    +

    181 has_node_acceleration: bool 

    +

    182 Node acceleration is written. 

    +

    183 has_node_temperature_gradient: bool 

    +

    184 Node temperature gradient is written. 

    +

    185 has_node_residual_forces: bool 

    +

    186 Node residual forces are written. 

    +

    187 has_node_residual_moments: bool 

    +

    188 Node residual moments are written. 

    +

    189 has_node_max_contact_penetration_absolute: bool 

    +

    190 Node contact penetration info exist. 

    +

    191 has_node_max_contact_penetration_relative: bool 

    +

    192 Node relative contact penetration info was written. 

    +

    193 has_node_contact_energy_density: int 

    +

    194 Node energy density was written. 

    +

    195 n_shell_tshell_layers: int 

    +

    196 Number of layers for shells and thick shells. 

    +

    197 n_shell_tshell_history_vars: int 

    +

    198 Number of history vars for shells and thick shells. 

    +

    199 has_shell_tshell_stress: bool 

    +

    200 If shells and thick shells have stresses. 

    +

    201 has_shell_tshell_pstrain: bool 

    +

    202 If shells and thick shells have eff. plastic strain. 

    +

    203 has_element_strain: bool 

    +

    204 If all elements have strain. 

    +

    205 has_solid_shell_plastic_strain_tensor: bool 

    +

    206 If solids have plastic strain tensor. 

    +

    207 has_solid_shell_thermal_strain_tensor: bool 

    +

    208 If solids have thermal strain tensor. 

    +

    209 n_solids: int 

    +

    210 Number of solids. 

    +

    211 n_solid_vars: int 

    +

    212 Number of solid variables per element and state. 

    +

    213 n_solid_materials: int 

    +

    214 Number of solid materials/parts. 

    +

    215 n_solid_history_vars: int 

    +

    216 Number of solid history variables. 

    +

    217 n_solid_thermal_vars: int 

    +

    218 Number of solid thermal variables. 

    +

    219 n_solids_20_node_hexas: int 

    +

    220 Number of 20-node solid hexas. 

    +

    221 n_solids_27_node_hexas: int 

    +

    222 Number of 27-node solid hexas. 

    +

    223 n_solids_21_node_pentas: int 

    +

    224 Number of 21-node solid pentas. 

    +

    225 n_solids_15_node_tetras: int 

    +

    226 Number of 15-node solid tetras. 

    +

    227 n_solids_20_node_tetras: int 

    +

    228 Number of 20-node solid tetras. 

    +

    229 n_solids_40_node_pentas: int 

    +

    230 Number of 40-node solid pentas. 

    +

    231 n_solids_64_node_hexas: int 

    +

    232 Number of 64-node solid hexas. 

    +

    233 has_solid_2_extra_nodes: bool 

    +

    234 If two extra nodes were written for solids. 

    +

    235 has_solid_stress: bool 

    +

    236 If solid stress is present. 

    +

    237 has_solid_pstrain: bool 

    +

    238 If solid eff. plastic strain is present. 

    +

    239 has_quadratic_solids: bool 

    +

    240 If quadratic solids were used. 

    +

    241 has_cubic_solids: bool 

    +

    242 If cubic solids were used. 

    +

    243 has_solid_internal_energy_density: bool 

    +

    244 If solids have internal energy density. 

    +

    245 n_solid_layers: int 

    +

    246 Number of solid layers. 

    +

    247 n_shells: int 

    +

    248 Number of shells. 

    +

    249 n_shell_vars: int 

    +

    250 Number of shell vars per element and state. 

    +

    251 n_shell_materials: int 

    +

    252 Number of shell materials/parts. 

    +

    253 n_shells_8_nodes: int 

    +

    254 Number of 8-node shells. 

    +

    255 has_shell_four_inplane_gauss_points: bool 

    +

    256 If shells have four inplace gaussian integration points. 

    +

    257 has_shell_forces: bool 

    +

    258 If shell forces are present. 

    +

    259 has_shell_extra_variables: bool 

    +

    260 If extra shell variables such as forces are present. 

    +

    261 has_shell_internal_energy_density: bool 

    +

    262 If shell internal energy density is present. 

    +

    263 n_thick_shells: int 

    +

    264 Number of thick shell elements. 

    +

    265 n_thick_shell_vars: int 

    +

    266 Number of thick shell element vars. 

    +

    267 n_thick_shell_materials: int 

    +

    268 Number of thick shell materials/parts. 

    +

    269 has_thick_shell_energy_density: bool 

    +

    270 If thick shells have energy density. 

    +

    271 thick_shell_energy_density_position: int 

    +

    272 Nnused. 

    +

    273 n_beams: int 

    +

    274 Number of beam elements. 

    +

    275 n_beam_vars: int 

    +

    276 Number of state variables per beam element. 

    +

    277 n_beam_materials: int 

    +

    278 Number of beam materials. 

    +

    279 n_beam_history_vars: int 

    +

    280 Number of beam history variables. 

    +

    281 n_airbags: int 

    +

    282 Number of airbags. 

    +

    283 has_airbag_n_chambers: bool 

    +

    284 If airbags have number of chambers var. 

    +

    285 has_rigid_road_surface: bool 

    +

    286 If rigid road surface was written. 

    +

    287 has_rigid_body_data: bool 

    +

    288 If rigid body section was written. 

    +

    289 has_reduced_rigid_body_data: bool 

    +

    290 If the reduced set of rigid body data was written. 

    +

    291 n_rigid_wall_vars: int 

    +

    292 Number of rigid wall vars. 

    +

    293 n_sph_nodes: int 

    +

    294 Number of sph nodes. 

    +

    295 n_sph_materials: int 

    +

    296 Number of sph materials. 

    +

    297 n_ale_materials: int 

    +

    298 Number of ale materials. 

    +

    299 n_ale_fluid_groups: int 

    +

    300 Number of ale fluid groups. 

    +

    301 has_cfd_data: bool 

    +

    302 If CFD-Data was written. 

    +

    303 has_multi_solver_data: bool 

    +

    304 If multi-solver data was written. 

    +

    305 cfd_extra_data: int 

    +

    306 If cfd data contains extra section. 

    +

    307 legacy_code_type: int 

    +

    308 Originally a code indicator but unused nowadays. 

    +

    309 unused_numst: int 

    +

    310 Unused and not explained in docs. 

    +

    311 """ 

    +

    312 

    +

    313 # meta 

    +

    314 filepath: str = "" 

    +

    315 

    +

    316 # file info 

    +

    317 itype: np.dtype = np.int32 

    +

    318 ftype: np.dtype = np.float32 

    +

    319 wordsize: int = 4 

    +

    320 raw_header: Dict[str, Any] = {} 

    +

    321 external_numbers_dtype = np.int32 

    +

    322 n_header_bytes: int = 0 

    +

    323 

    +

    324 # header 

    +

    325 title: str = "" 

    +

    326 title2: str = "" 

    +

    327 runtime: int = 0 

    +

    328 filetype: D3plotFiletype = D3plotFiletype.D3PLOT 

    +

    329 

    +

    330 source_version: int = 0 

    +

    331 release_version: str = "" 

    +

    332 version: float = 0.0 

    +

    333 extra_long_header: bool = False 

    +

    334 

    +

    335 # general info 

    +

    336 n_dimensions: int = 3 

    +

    337 n_global_vars: int = 0 

    +

    338 n_adapted_element_pairs: int = 0 

    +

    339 has_node_deletion_data: bool = False 

    +

    340 has_element_deletion_data: bool = False 

    +

    341 has_numbering_section: bool = False 

    +

    342 has_material_type_section: bool = False 

    +

    343 n_numbering_section_words: int = 0 

    +

    344 has_invariant_numbering: bool = False 

    +

    345 quadratic_elems_has_full_connectivity: bool = False 

    +

    346 quadratic_elems_has_data_at_integration_points: bool = False 

    +

    347 n_post_branches: int = 0 

    +

    348 n_types: Tuple[int, ...] = tuple() 

    +

    349 

    +

    350 # parts 

    +

    351 n_parts: int = 0 

    +

    352 

    +

    353 # nodes 

    +

    354 n_nodes: int = 0 

    +

    355 has_node_temperatures: bool = False 

    +

    356 has_node_temperature_layers: bool = False 

    +

    357 has_node_heat_flux: bool = False 

    +

    358 has_node_mass_scaling: bool = False 

    +

    359 has_node_displacement: bool = False 

    +

    360 has_node_velocity: bool = False 

    +

    361 has_node_acceleration: bool = False 

    +

    362 has_node_temperature_gradient: bool = False 

    +

    363 has_node_residual_forces: bool = False 

    +

    364 has_node_residual_moments: bool = False 

    +

    365 has_node_max_contact_penetration_absolute: bool = False 

    +

    366 has_node_max_contact_penetration_relative: bool = False 

    +

    367 has_node_contact_energy_density: int = False 

    +

    368 

    +

    369 # elements 

    +

    370 n_shell_tshell_layers: int = 3 

    +

    371 n_shell_tshell_history_vars: int = 0 

    +

    372 has_shell_tshell_stress: bool = False 

    +

    373 has_shell_tshell_pstrain: bool = False 

    +

    374 has_element_strain: bool = False 

    +

    375 has_solid_shell_plastic_strain_tensor: bool = False 

    +

    376 has_solid_shell_thermal_strain_tensor: bool = False 

    +

    377 

    +

    378 # solids 

    +

    379 n_solids: int = 0 

    +

    380 n_solid_vars: int = 0 

    +

    381 n_solid_materials: int = 0 

    +

    382 n_solid_history_vars: int = 0 

    +

    383 n_solid_thermal_vars: int = 0 

    +

    384 n_solids_20_node_hexas: int = 0 

    +

    385 n_solids_27_node_hexas: int = 0 

    +

    386 n_solids_21_node_pentas: int = 0 

    +

    387 n_solids_15_node_tetras: int = 0 

    +

    388 n_solids_20_node_tetras: int = 0 

    +

    389 n_solids_40_node_pentas: int = 0 

    +

    390 n_solids_64_node_hexas: int = 0 

    +

    391 has_solid_2_extra_nodes: bool = False 

    +

    392 has_solid_stress: bool = False 

    +

    393 has_solid_pstrain: bool = False 

    +

    394 has_quadratic_solids: bool = False 

    +

    395 has_cubic_solids: bool = False 

    +

    396 has_solid_internal_energy_density: bool = False 

    +

    397 

    +

    398 # shells 

    +

    399 n_shells: int = 0 

    +

    400 n_shell_vars: int = 0 

    +

    401 n_shell_materials: int = 0 

    +

    402 n_shells_8_nodes: int = 0 

    +

    403 has_shell_four_inplane_gauss_points: bool = False 

    +

    404 has_shell_forces: bool = False 

    +

    405 has_shell_extra_variables: bool = False 

    +

    406 has_shell_internal_energy_density: bool = False 

    +

    407 # has_shell_internal_energy: bool = False 

    +

    408 

    +

    409 # thick shells 

    +

    410 n_thick_shells: int = 0 

    +

    411 n_thick_shell_vars: int = 0 

    +

    412 n_thick_shell_materials: int = 0 

    +

    413 has_thick_shell_energy_density: bool = False 

    +

    414 thick_shell_energy_density_position: int = 0 

    +

    415 

    +

    416 # beams 

    +

    417 n_beams: int = 0 

    +

    418 n_beam_vars: int = 0 

    +

    419 n_beam_materials: int = 0 

    +

    420 n_beam_history_vars: int = 0 

    +

    421 

    +

    422 # airbags 

    +

    423 n_airbags: int = 0 

    +

    424 has_airbag_n_chambers: bool = False 

    +

    425 

    +

    426 # rigid roads 

    +

    427 has_rigid_road_surface: bool = False 

    +

    428 

    +

    429 # rigid bodies 

    +

    430 has_rigid_body_data: bool = False 

    +

    431 has_reduced_rigid_body_data: bool = False 

    +

    432 

    +

    433 # sph 

    +

    434 n_sph_nodes: int = 0 

    +

    435 n_sph_materials: int = 0 

    +

    436 

    +

    437 # ale 

    +

    438 n_ale_materials: int = 0 

    +

    439 n_ale_fluid_groups: int = 0 

    +

    440 

    +

    441 # cfd 

    +

    442 has_cfd_data: bool = False 

    +

    443 

    +

    444 # multi-solver 

    +

    445 has_multi_solver_data: bool = False 

    +

    446 cfd_extra_data: int = 0 

    +

    447 

    +

    448 # historical artifacts 

    +

    449 legacy_code_type: int = 6 

    +

    450 unused_numst: int = 0 

    +

    451 

    +

    452 def __init__(self, filepath: Union[str, BinaryBuffer, None] = None): 

    +

    453 """Create a D3plotHeader instance 

    +

    454 

    +

    455 Parameters 

    +

    456 ---------- 

    +

    457 filepath: Union[str, BinaryBuffer, None] 

    +

    458 path to a d3plot file or a buffer holding d3plot memory 

    +

    459 

    +

    460 Returns 

    +

    461 ------- 

    +

    462 header: D3plotHeader 

    +

    463 d3plot header instance 

    +

    464 

    +

    465 Examples 

    +

    466 -------- 

    +

    467 Create an empty header file 

    +

    468 

    +

    469 >>> header = D3plotHeader() 

    +

    470 

    +

    471 Now load only the header of a d3plot. 

    +

    472 

    +

    473 >>> header.load_file("path/to/d3plot") 

    +

    474 

    +

    475 Or we can do the above together. 

    +

    476 

    +

    477 >>> header = D3plotHeader("path/to/d3plot") 

    +

    478 

    +

    479 Notes 

    +

    480 ----- 

    +

    481 This class does not load the entire memory of a d3plot 

    +

    482 but merely what is required to parse the header information. 

    +

    483 Thus, it is safe to use on big files. 

    +

    484 """ 

    +

    485 

    +

    486 if filepath is not None: 

    +

    487 self.load_file(filepath) 

    +

    488 

    +

    489 def print(self) -> None: 

    +

    490 """Print the header""" 

    +

    491 rich.print(self.__dict__) 

    +

    492 

    +

    493 def _read_file_buffer(self, filepath: str) -> BinaryBuffer: 

    +

    494 """Reads a d3plots header 

    +

    495 

    +

    496 Parameters 

    +

    497 ---------- 

    +

    498 filepath: str 

    +

    499 path to d3plot 

    +

    500 

    +

    501 Returns 

    +

    502 ------- 

    +

    503 bb: BinaryBuffer 

    +

    504 buffer holding the exact header data in binary form 

    +

    505 """ 

    +

    506 

    +

    507 LOGGER.debug("_read_file_buffer start") 

    +

    508 LOGGER.debug("filepath: %s", filepath) 

    +

    509 

    +

    510 # load first 64 single words 

    +

    511 n_words_header = 64 

    +

    512 n_bytes_hdr_guessed = 64 * self.wordsize 

    +

    513 bb = BinaryBuffer(filepath, n_bytes_hdr_guessed) 

    +

    514 

    +

    515 # check if single or double 

    +

    516 self.wordsize, self.itype, self.ftype = self._determine_file_settings(bb) 

    +

    517 

    +

    518 # Oops, seems other wordsize is used 

    +

    519 if self.wordsize != D3plotHeader.wordsize: 

    +

    520 bb = BinaryBuffer(filepath, n_words_header * self.wordsize) 

    +

    521 

    +

    522 # check for extra long header 

    +

    523 n_header_bytes = self._determine_n_bytes(bb, self.wordsize) 

    +

    524 if len(bb) <= n_header_bytes: 

    +

    525 bb = BinaryBuffer(filepath, n_bytes=n_header_bytes) 

    +

    526 

    +

    527 LOGGER.debug("_read_file_buffer end") 

    +

    528 

    +

    529 return bb 

    +

    530 

    +

    531 def _determine_n_bytes(self, bb: BinaryBuffer, wordsize: int) -> int: 

    +

    532 """Determines how many bytes the header has 

    +

    533 

    +

    534 Returns 

    +

    535 ------- 

    +

    536 size: int 

    +

    537 size of the header in bytes 

    +

    538 """ 

    +

    539 

    +

    540 LOGGER.debug("_determine_n_bytes start") 

    +

    541 

    +

    542 n_base_words = 64 

    +

    543 min_n_bytes = n_base_words * wordsize 

    +

    544 

    +

    545 if len(bb) < n_base_words * wordsize: 

    +

    546 err_msg = "File or file buffer must have at least '{0}' bytes instead of '{1}'" 

    +

    547 raise RuntimeError(err_msg.format(min_n_bytes, len(bb))) 

    +

    548 

    +

    549 n_extra_header_words = int(bb.read_number(57 * self.wordsize, self.itype)) 

    +

    550 

    +

    551 LOGGER.debug("_determine_n_bytes end") 

    +

    552 

    +

    553 return (n_base_words + n_extra_header_words) * wordsize 

    +

    554 

    +

    555 def load_file(self, file: Union[str, BinaryBuffer]) -> "D3plotHeader": 

    +

    556 """Load d3plot header from a d3plot file 

    +

    557 

    +

    558 Parameters 

    +

    559 ---------- 

    +

    560 file: Union[str, BinaryBuffer] 

    +

    561 path to d3plot or `BinaryBuffer` holding memory of d3plot 

    +

    562 

    +

    563 Returns 

    +

    564 ------- 

    +

    565 self: D3plotHeader 

    +

    566 returning self on success 

    +

    567 

    +

    568 Notes 

    +

    569 ----- 

    +

    570 This routine only loads the minimal amount of data 

    +

    571 that is neccessary. Thus it is safe to use on huge files. 

    +

    572 

    +

    573 Examples 

    +

    574 -------- 

    +

    575 >>> header = D3plotHeader().load_file("path/to/d3plot") 

    +

    576 >>> header.n_shells 

    +

    577 19684 

    +

    578 """ 

    +

    579 

    +

    580 # pylint: disable = too-many-locals, too-many-branches, too-many-statements 

    +

    581 

    +

    582 LOGGER.debug("_load_file start") 

    +

    583 LOGGER.debug("file: %s", file) 

    +

    584 

    +

    585 if not isinstance(file, (str, BinaryBuffer)): 

    +

    586 err_msg = "Argument 'file' must have type 'str' or 'lasso.io.BinaryBuffer'." 

    +

    587 raise ValueError(err_msg) 

    +

    588 

    +

    589 # get the memory 

    +

    590 if isinstance(file, str): 

    +

    591 bb = self._read_file_buffer(file) 

    +

    592 self.n_header_bytes = len(bb) 

    +

    593 else: 

    +

    594 bb = file 

    +

    595 self.wordsize, self.itype, self.ftype = self._determine_file_settings(bb) 

    +

    596 self.n_header_bytes = self._determine_n_bytes(bb, self.wordsize) 

    +

    597 

    +

    598 LOGGER.debug("n_header_bytes: %d", self.n_header_bytes) 

    +

    599 

    +

    600 # read header 

    +

    601 header_words = { 

    +

    602 "title": [0 * self.wordsize, str, 9 * self.wordsize], 

    +

    603 "runtime": [10 * self.wordsize, self.itype], 

    +

    604 "filetype": [11 * self.wordsize, self.itype], 

    +

    605 "source_version": [12 * self.wordsize, self.itype], 

    +

    606 "release_version": [13 * self.wordsize, str, 1 * self.wordsize], 

    +

    607 "version": [14 * self.wordsize, self.ftype], 

    +

    608 "ndim": [15 * self.wordsize, self.itype], 

    +

    609 "numnp": [16 * self.wordsize, self.itype], 

    +

    610 "icode": [17 * self.wordsize, self.itype], 

    +

    611 "nglbv": [18 * self.wordsize, self.itype], 

    +

    612 "it": [19 * self.wordsize, self.itype], 

    +

    613 "iu": [20 * self.wordsize, self.itype], 

    +

    614 "iv": [21 * self.wordsize, self.itype], 

    +

    615 "ia": [22 * self.wordsize, self.itype], 

    +

    616 "nel8": [23 * self.wordsize, self.itype], 

    +

    617 "nummat8": [24 * self.wordsize, self.itype], 

    +

    618 "numds": [25 * self.wordsize, self.itype], 

    +

    619 "numst": [26 * self.wordsize, self.itype], 

    +

    620 "nv3d": [27 * self.wordsize, self.itype], 

    +

    621 "nel2": [28 * self.wordsize, self.itype], 

    +

    622 "nummat2": [29 * self.wordsize, self.itype], 

    +

    623 "nv1d": [30 * self.wordsize, self.itype], 

    +

    624 "nel4": [31 * self.wordsize, self.itype], 

    +

    625 "nummat4": [32 * self.wordsize, self.itype], 

    +

    626 "nv2d": [33 * self.wordsize, self.itype], 

    +

    627 "neiph": [34 * self.wordsize, self.itype], 

    +

    628 "neips": [35 * self.wordsize, self.itype], 

    +

    629 "maxint": [36 * self.wordsize, self.itype], 

    +

    630 "nmsph": [37 * self.wordsize, self.itype], 

    +

    631 "ngpsph": [38 * self.wordsize, self.itype], 

    +

    632 "narbs": [39 * self.wordsize, self.itype], 

    +

    633 "nelt": [40 * self.wordsize, self.itype], 

    +

    634 "nummatt": [41 * self.wordsize, self.itype], 

    +

    635 "nv3dt": [42 * self.wordsize, self.itype], 

    +

    636 "ioshl1": [43 * self.wordsize, self.itype], 

    +

    637 "ioshl2": [44 * self.wordsize, self.itype], 

    +

    638 "ioshl3": [45 * self.wordsize, self.itype], 

    +

    639 "ioshl4": [46 * self.wordsize, self.itype], 

    +

    640 "ialemat": [47 * self.wordsize, self.itype], 

    +

    641 "ncfdv1": [48 * self.wordsize, self.itype], 

    +

    642 "ncfdv2": [49 * self.wordsize, self.itype], 

    +

    643 "nadapt": [50 * self.wordsize, self.itype], 

    +

    644 "nmmat": [51 * self.wordsize, self.itype], 

    +

    645 "numfluid": [52 * self.wordsize, self.itype], 

    +

    646 "inn": [53 * self.wordsize, self.itype], 

    +

    647 "npefg": [54 * self.wordsize, self.itype], 

    +

    648 "nel48": [55 * self.wordsize, self.itype], 

    +

    649 "idtdt": [56 * self.wordsize, self.itype], 

    +

    650 "extra": [57 * self.wordsize, self.itype], 

    +

    651 } 

    +

    652 

    +

    653 header_extra_words = { 

    +

    654 "nel20": [64 * self.wordsize, self.itype], 

    +

    655 "nt3d": [65 * self.wordsize, self.itype], 

    +

    656 "nel27": [66 * self.wordsize, self.itype], 

    +

    657 "neipb": [67 * self.wordsize, self.itype], 

    +

    658 "nel21p": [68 * self.wordsize, self.itype], 

    +

    659 "nel15t": [69 * self.wordsize, self.itype], 

    +

    660 "soleng": [70 * self.wordsize, self.itype], 

    +

    661 "nel20t": [71 * self.wordsize, self.itype], 

    +

    662 "nel40p": [72 * self.wordsize, self.itype], 

    +

    663 "nel64": [73 * self.wordsize, self.itype], 

    +

    664 "quadr": [74 * self.wordsize, self.itype], 

    +

    665 "cubic": [75 * self.wordsize, self.itype], 

    +

    666 "tsheng": [76 * self.wordsize, self.itype], 

    +

    667 "nbranch": [77 * self.wordsize, self.itype], 

    +

    668 "penout": [78 * self.wordsize, self.itype], 

    +

    669 "engout": [79 * self.wordsize, self.itype], 

    +

    670 } 

    +

    671 

    +

    672 # read header for real 

    +

    673 self.raw_header = self.read_words(bb, header_words) 

    +

    674 

    +

    675 if self.raw_header["extra"] != 0: 

    +

    676 self.read_words(bb, header_extra_words, self.raw_header) 

    +

    677 else: 

    +

    678 for name, (_, dtype) in header_extra_words.items(): 

    +

    679 self.raw_header[name] = dtype() 

    +

    680 

    +

    681 # PARSE HEADER (no fun ahead) 

    +

    682 if isinstance(file, str): 

    +

    683 self.filepath = file 

    +

    684 elif isinstance(file, BinaryBuffer): 

    +

    685 if isinstance(file.filepath_, str): 

    +

    686 self.filepath = file.filepath_ 

    +

    687 elif isinstance(file.filepath_, list) and len(file.filepath_) > 0: 

    +

    688 self.filepath = file.filepath_[0] 

    +

    689 

    +

    690 self.title = self.raw_header["title"].strip() 

    +

    691 self.runtime = self.raw_header["runtime"] 

    +

    692 

    +

    693 # filetype 

    +

    694 filetype = self.raw_header["filetype"] 

    +

    695 if filetype > 1000: 

    +

    696 filetype -= 1000 

    +

    697 self.external_numbers_dtype = np.int64 

    +

    698 else: 

    +

    699 self.external_numbers_dtype = np.int32 

    +

    700 

    +

    701 self.filetype = d3plot_filetype_from_integer(filetype) 

    +

    702 

    +

    703 self.source_version = self.raw_header["source_version"] 

    +

    704 self.release_version = self.raw_header["release_version"] # .split("\0", 1)[0] 

    +

    705 self.version = self.raw_header["version"] 

    +

    706 

    +

    707 # ndim 

    +

    708 ndim = self.raw_header["ndim"] 

    +

    709 if ndim in (5, 7): 

    +

    710 self.has_material_type_section = True 

    +

    711 ndim = 3 

    +

    712 # self.raw_header['elem_connectivity_unpacked'] = True 

    +

    713 if ndim == 4: 

    +

    714 ndim = 3 

    +

    715 # self.raw_header['elem_connectivity_unpacked'] = True 

    +

    716 if 5 < ndim < 8: 

    +

    717 ndim = 3 

    +

    718 self.has_rigid_road_surface = True 

    +

    719 if ndim in (8, 9): 

    +

    720 ndim = 3 

    +

    721 self.has_rigid_body_data = True 

    +

    722 if self.raw_header["ndim"] == 9: 

    +

    723 self.has_rigid_road_surface = True 

    +

    724 self.has_reduced_rigid_body_data = True 

    +

    725 if ndim not in (2, 3): 

    +

    726 raise RuntimeError(f"Invalid header entry ndim: {self.raw_header['ndim']}") 

    +

    727 

    +

    728 self.n_nodes = self.raw_header["numnp"] 

    +

    729 self.legacy_code_type = self.raw_header["icode"] 

    +

    730 self.n_global_vars = self.raw_header["nglbv"] 

    +

    731 

    +

    732 # it 

    +

    733 # - mass scaling 

    +

    734 # - node temperature 

    +

    735 # - node heat flux 

    +

    736 if get_digit(self.raw_header["it"], 1) == 1: 

    +

    737 self.has_node_mass_scaling = True 

    +

    738 it_first_digit = get_digit(self.raw_header["it"], 0) 

    +

    739 if it_first_digit == 1: 

    +

    740 self.has_node_temperatures = True 

    +

    741 elif it_first_digit == 2: 

    +

    742 self.has_node_temperatures = True 

    +

    743 self.has_node_heat_flux = True 

    +

    744 elif it_first_digit == 3: 

    +

    745 self.has_node_temperatures = True 

    +

    746 self.has_node_heat_flux = True 

    +

    747 self.has_node_temperature_layers = True 

    +

    748 

    +

    749 # iu iv ia 

    +

    750 self.has_node_displacement = self.raw_header["iu"] != 0 

    +

    751 self.has_node_velocity = self.raw_header["iv"] != 0 

    +

    752 self.has_node_acceleration = self.raw_header["ia"] != 0 

    +

    753 

    +

    754 # nel8 

    +

    755 self.n_solids = abs(self.raw_header["nel8"]) 

    +

    756 if self.raw_header["nel8"] < 0: 

    +

    757 self.has_solid_2_extra_nodes = True 

    +

    758 

    +

    759 # nummat8 

    +

    760 self.n_solid_materials = self.raw_header["nummat8"] 

    +

    761 

    +

    762 # numds 

    +

    763 self.has_shell_four_inplane_gauss_points = self.raw_header["numds"] < 0 

    +

    764 

    +

    765 # numst 

    +

    766 self.unused_numst = self.raw_header["numst"] 

    +

    767 

    +

    768 # nv3d 

    +

    769 self.n_solid_vars = self.raw_header["nv3d"] 

    +

    770 

    +

    771 # nel2 

    +

    772 self.n_beams = self.raw_header["nel2"] 

    +

    773 

    +

    774 # nummat2 

    +

    775 self.n_beam_materials = self.raw_header["nummat2"] 

    +

    776 

    +

    777 # nv1d 

    +

    778 self.n_beam_vars = self.raw_header["nv1d"] 

    +

    779 

    +

    780 # nel4 

    +

    781 self.n_shells = self.raw_header["nel4"] 

    +

    782 

    +

    783 # nummat4 

    +

    784 self.n_shell_materials = self.raw_header["nummat4"] 

    +

    785 

    +

    786 # nv2d 

    +

    787 self.n_shell_vars = self.raw_header["nv2d"] 

    +

    788 

    +

    789 # neiph 

    +

    790 self.n_solid_history_vars = self.raw_header["neiph"] 

    +

    791 

    +

    792 # neips 

    +

    793 self.n_shell_tshell_history_vars = self.raw_header["neips"] 

    +

    794 

    +

    795 # maxint 

    +

    796 maxint = self.raw_header["maxint"] 

    +

    797 if maxint > 0: 

    +

    798 self.n_shell_tshell_layers = maxint 

    +

    799 elif maxint <= -10000: 

    +

    800 self.has_element_deletion_data = True 

    +

    801 self.n_shell_tshell_layers = abs(maxint) - 10000 

    +

    802 elif maxint < 0: 

    +

    803 self.has_node_deletion_data = True 

    +

    804 self.n_shell_tshell_layers = abs(maxint) 

    +

    805 

    +

    806 # nmsph 

    +

    807 self.n_sph_nodes = self.raw_header["nmsph"] 

    +

    808 

    +

    809 # ngpsph 

    +

    810 self.n_sph_materials = self.raw_header["ngpsph"] 

    +

    811 

    +

    812 # narbs 

    +

    813 self.has_numbering_section = self.raw_header["narbs"] != 0 

    +

    814 self.n_numbering_section_words = self.raw_header["narbs"] 

    +

    815 

    +

    816 # nelt 

    +

    817 self.n_thick_shells = self.raw_header["nelt"] 

    +

    818 

    +

    819 # nummatth 

    +

    820 self.n_thick_shell_materials = self.raw_header["nummatt"] 

    +

    821 

    +

    822 # nv3dt 

    +

    823 self.n_thick_shell_vars = self.raw_header["nv3dt"] 

    +

    824 

    +

    825 # ioshl1 

    +

    826 if self.raw_header["ioshl1"] == 1000: 

    +

    827 self.has_shell_tshell_stress = True 

    +

    828 self.has_solid_stress = True 

    +

    829 elif self.raw_header["ioshl1"] == 999: 

    +

    830 self.has_solid_stress = True 

    +

    831 

    +

    832 # ioshl2 

    +

    833 if self.raw_header["ioshl2"] == 1000: 

    +

    834 self.has_shell_tshell_pstrain = True 

    +

    835 self.has_solid_pstrain = True 

    +

    836 elif self.raw_header["ioshl2"] == 999: 

    +

    837 self.has_solid_pstrain = True 

    +

    838 

    +

    839 # ioshl3 

    +

    840 self.has_shell_forces = self.raw_header["ioshl3"] == 1000 

    +

    841 

    +

    842 # ioshl4 

    +

    843 self.has_shell_extra_variables = self.raw_header["ioshl4"] == 1000 

    +

    844 

    +

    845 # ialemat 

    +

    846 self.n_ale_materials = self.raw_header["ialemat"] 

    +

    847 

    +

    848 # ncfdv1 

    +

    849 ncfdv1 = self.raw_header["ncfdv1"] 

    +

    850 if ncfdv1 == 67108864: 

    +

    851 self.has_multi_solver_data = True 

    +

    852 elif ncfdv1 != 0: 

    +

    853 self.has_cfd_data = True 

    +

    854 

    +

    855 # ncfdv2 

    +

    856 # unused 

    +

    857 

    +

    858 # nadapt 

    +

    859 self.n_adapted_element_pairs = self.raw_header["nadapt"] 

    +

    860 

    +

    861 # nmmat 

    +

    862 self.n_parts = self.raw_header["nmmat"] 

    +

    863 

    +

    864 # numfluid 

    +

    865 self.n_ale_fluid_groups = self.raw_header["numfluid"] 

    +

    866 

    +

    867 # inn 

    +

    868 self.has_invariant_numbering = self.raw_header["inn"] != 0 

    +

    869 

    +

    870 # nepfg 

    +

    871 npefg = self.raw_header["npefg"] 

    +

    872 self.n_airbags = npefg % 1000 

    +

    873 self.has_airbag_n_chambers = npefg // 1000 == 4 

    +

    874 

    +

    875 # nel48 

    +

    876 self.n_shells_8_nodes = self.raw_header["nel48"] 

    +

    877 

    +

    878 # idtdt 

    +

    879 self.has_node_temperature_gradient = get_digit(self.raw_header["idtdt"], 0) == 1 

    +

    880 self.has_node_residual_forces = get_digit(self.raw_header["idtdt"], 1) == 1 

    +

    881 self.has_node_residual_moments = self.has_node_residual_forces 

    +

    882 self.has_solid_shell_plastic_strain_tensor = get_digit(self.raw_header["idtdt"], 2) == 1 

    +

    883 self.has_solid_shell_thermal_strain_tensor = get_digit(self.raw_header["idtdt"], 3) == 1 

    +

    884 if self.raw_header["idtdt"] > 100: 

    +

    885 self.has_element_strain = get_digit(self.raw_header["idtdt"], 4) == 1 

    +

    886 else: 

    +

    887 # took a 1000 years to figure this out ... 

    +

    888 # Warning: 4 gaussian points are not considered 

    +

    889 if self.n_shell_vars > 0: 

    +

    890 if ( 

    +

    891 self.n_shell_vars 

    +

    892 - self.n_shell_tshell_layers 

    +

    893 * ( 

    +

    894 6 * self.has_shell_tshell_stress 

    +

    895 + self.has_shell_tshell_pstrain 

    +

    896 + self.n_shell_tshell_history_vars 

    +

    897 ) 

    +

    898 - 8 * self.has_shell_forces 

    +

    899 - 4 * self.has_shell_extra_variables 

    +

    900 ) > 1: 

    +

    901 self.has_element_strain = True 

    +

    902 # else: 

    +

    903 # self.has_element_strain = False 

    +

    904 elif self.n_thick_shell_vars > 0: 

    +

    905 if ( 

    +

    906 self.n_thick_shell_vars 

    +

    907 - self.n_shell_tshell_layers 

    +

    908 * ( 

    +

    909 6 * self.has_shell_tshell_stress 

    +

    910 + self.has_shell_tshell_pstrain 

    +

    911 + self.n_shell_tshell_history_vars 

    +

    912 ) 

    +

    913 ) > 1: 

    +

    914 self.has_element_strain = True 

    +

    915 # else: 

    +

    916 # self.has_element_strain = False 

    +

    917 # else: 

    +

    918 # self.has_element_strain = False 

    +

    919 

    +

    920 # internal energy 

    +

    921 # shell_vars_behind_layers = (self.n_shell_vars - 

    +

    922 # (self.n_shell_tshell_layers * ( 

    +

    923 # 6 * self.has_shell_tshell_stress + 

    +

    924 # self.has_shell_tshell_pstrain + 

    +

    925 # self.n_shell_tshell_history_vars) + 

    +

    926 # 8 * self.has_shell_forces 

    +

    927 # + 4 * self.has_shell_extra_variables)) 

    +

    928 

    +

    929 # if not self.has_element_strain: 

    +

    930 # if shell_vars_behind_layers > 1 and shell_vars_behind_layers < 6: 

    +

    931 # self.has_shell_internal_energy = True 

    +

    932 # else: 

    +

    933 # self.has_shell_internal_energy = False 

    +

    934 # elif self.has_element_strain: 

    +

    935 # if shell_vars_behind_layers > 12: 

    +

    936 # self.has_shell_internal_energy = True 

    +

    937 # else: 

    +

    938 # self.has_shell_internal_energy = False 

    +

    939 

    +

    940 # nel20 

    +

    941 if "nel20" in self.raw_header: 

    +

    942 self.n_solids_20_node_hexas = self.raw_header["nel20"] 

    +

    943 

    +

    944 # nt3d 

    +

    945 if "nt3d" in self.raw_header: 

    +

    946 self.n_solid_thermal_vars = self.raw_header["nt3d"] 

    +

    947 

    +

    948 # nel27 

    +

    949 if "nel27" in self.raw_header: 

    +

    950 self.n_solids_27_node_hexas = self.raw_header["nel27"] 

    +

    951 

    +

    952 # neipb 

    +

    953 if "neipb" in self.raw_header: 

    +

    954 self.n_beam_history_vars = self.raw_header["neipb"] 

    +

    955 

    +

    956 # nel21p 

    +

    957 if "nel21p" in self.raw_header: 

    +

    958 self.n_solids_21_node_pentas = self.raw_header["nel21p"] 

    +

    959 

    +

    960 # nel15t 

    +

    961 if "nel15t" in self.raw_header: 

    +

    962 self.n_solids_15_node_tetras = self.raw_header["nel15t"] 

    +

    963 

    +

    964 # soleng 

    +

    965 if "soleng" in self.raw_header: 

    +

    966 self.has_solid_internal_energy_density = self.raw_header["soleng"] 

    +

    967 

    +

    968 # nel20t 

    +

    969 if "nel20t" in self.raw_header: 

    +

    970 self.n_solids_20_node_tetras = self.raw_header["nel20t"] 

    +

    971 

    +

    972 # nel40p 

    +

    973 if "nel40p" in self.raw_header: 

    +

    974 self.n_solids_40_node_pentas = self.raw_header["nel40p"] 

    +

    975 

    +

    976 # nel64 

    +

    977 if "nel64" in self.raw_header: 

    +

    978 self.n_solids_64_node_hexas = self.raw_header["nel64"] 

    +

    979 

    +

    980 # quadr 

    +

    981 if "quadr" in self.raw_header: 

    +

    982 quadr = self.raw_header["quadr"] 

    +

    983 if quadr == 1: 

    +

    984 self.quadratic_elems_has_full_connectivity = True 

    +

    985 elif quadr == 2: 

    +

    986 self.quadratic_elems_has_full_connectivity = True 

    +

    987 self.quadratic_elems_has_data_at_integration_points = True 

    +

    988 

    +

    989 # cubic 

    +

    990 if "cubic" in self.raw_header: 

    +

    991 self.has_cubic_solids = self.raw_header["cubic"] != 0 

    +

    992 

    +

    993 # tsheng 

    +

    994 if "tsheng" in self.raw_header: 

    +

    995 self.has_thick_shell_energy_density = self.raw_header["tsheng"] != 0 

    +

    996 

    +

    997 # nbranch 

    +

    998 if "nbranch" in self.raw_header: 

    +

    999 self.n_post_branches = self.raw_header["nbranch"] 

    +

    1000 

    +

    1001 # penout 

    +

    1002 if "penout" in self.raw_header: 

    +

    1003 penout = self.raw_header["penout"] 

    +

    1004 if penout == 1: 

    +

    1005 self.has_node_max_contact_penetration_absolute = True 

    +

    1006 if penout == 2: 

    +

    1007 self.has_node_max_contact_penetration_absolute = True 

    +

    1008 self.has_node_max_contact_penetration_relative = True 

    +

    1009 

    +

    1010 # engout 

    +

    1011 if "engout" in self.raw_header: 

    +

    1012 self.has_node_contact_energy_density = self.raw_header["engout"] == 1 

    +

    1013 

    +

    1014 return self 

    +

    1015 

    +

    1016 @property 

    +

    1017 def has_femzip_indicator(self) -> bool: 

    +

    1018 """If the femzip indicator can be found in the header 

    +

    1019 

    +

    1020 Notes 

    +

    1021 ----- 

    +

    1022 Only use on raw files. 

    +

    1023 

    +

    1024 If the header displays a femzip indicator then the file 

    +

    1025 is femzipped. If you load the femzip file as such then 

    +

    1026 this indicator will not be set, since femzip itself 

    +

    1027 corrects the indicator again. 

    +

    1028 """ 

    +

    1029 if "nmmat" in self.raw_header: 

    +

    1030 return self.raw_header["nmmat"] == 76_893_465 

    +

    1031 return False 

    +

    1032 

    +

    1033 @property 

    +

    1034 def n_rigid_wall_vars(self) -> int: 

    +

    1035 """number of rigid wall vars 

    +

    1036 

    +

    1037 Notes 

    +

    1038 ----- 

    +

    1039 Depends on lsdyna version. 

    +

    1040 """ 

    +

    1041 return 4 if self.version >= 971 else 1 

    +

    1042 

    +

    1043 @property 

    +

    1044 def n_solid_layers(self) -> int: 

    +

    1045 """number of solid layers 

    +

    1046 

    +

    1047 Returns 

    +

    1048 ------- 

    +

    1049 n_solid_layers: int 

    +

    1050 """ 

    +

    1051 n_solid_base_vars = ( 

    +

    1052 6 * self.has_solid_stress + self.has_solid_pstrain + self.n_solid_history_vars 

    +

    1053 ) 

    +

    1054 

    +

    1055 return 8 if self.n_solid_vars // max(n_solid_base_vars, 1) >= 8 else 1 

    +

    1056 

    +

    1057 def read_words(self, bb: BinaryBuffer, words_to_read: dict, storage_dict: dict = None): 

    +

    1058 """Read several words described by a dict 

    +

    1059 

    +

    1060 Parameters 

    +

    1061 ---------- 

    +

    1062 bb: BinaryBuffer 

    +

    1063 words_to_read: dict 

    +

    1064 this dict describes the words to be read. One entry 

    +

    1065 must be a tuple of len two (byte position and dtype) 

    +

    1066 storage_dict: dict 

    +

    1067 in this dict the read words will be saved 

    +

    1068 

    +

    1069 Returns 

    +

    1070 ------- 

    +

    1071 storage_dict: dict 

    +

    1072 the storage dict given as arg or a new dict if none was given 

    +

    1073 """ 

    +

    1074 

    +

    1075 if storage_dict is None: 

    +

    1076 storage_dict = {} 

    +

    1077 

    +

    1078 for name, data in words_to_read.items(): 

    +

    1079 

    +

    1080 # check buffer length 

    +

    1081 if data[0] >= len(bb): 

    +

    1082 continue 

    +

    1083 

    +

    1084 # read data 

    +

    1085 if data[1] == self.itype: 

    +

    1086 storage_dict[name] = int(bb.read_number(data[0], data[1])) 

    +

    1087 elif data[1] == self.ftype: 

    +

    1088 storage_dict[name] = float(bb.read_number(data[0], data[1])) 

    +

    1089 elif data[1] == str: 

    +

    1090 try: 

    +

    1091 storage_dict[name] = bb.read_text(data[0], data[2]) 

    +

    1092 except UnicodeDecodeError: 

    +

    1093 storage_dict[name] = "" 

    +

    1094 

    +

    1095 else: 

    +

    1096 raise RuntimeError(f"Encountered unknown dtype {str(data[1])} during reading.") 

    +

    1097 

    +

    1098 return storage_dict 

    +

    1099 

    +

    1100 @staticmethod 

    +

    1101 def _determine_file_settings( 

    +

    1102 bb: Union[BinaryBuffer, None] = None 

    +

    1103 ) -> Tuple[int, Union[np.int32, np.int64], Union[np.float32, np.float64]]: 

    +

    1104 """Determine the precision of the file 

    +

    1105 

    +

    1106 Parameters 

    +

    1107 ---------- 

    +

    1108 bb: Union[BinaryBuffer, None] 

    +

    1109 binary buffer from the file 

    +

    1110 

    +

    1111 Returns 

    +

    1112 ------- 

    +

    1113 wordsize: int 

    +

    1114 size of each word in bytes 

    +

    1115 itype: np.dtype 

    +

    1116 type of integers 

    +

    1117 ftype: np.dtype 

    +

    1118 type of floats 

    +

    1119 """ 

    +

    1120 

    +

    1121 LOGGER.debug("_determine_file_settings") 

    +

    1122 

    +

    1123 word_size = 4 

    +

    1124 itype = np.int32 

    +

    1125 ftype = np.float32 

    +

    1126 

    +

    1127 # test file type flag (1=d3plot, 5=d3part, 11=d3eigv) 

    +

    1128 

    +

    1129 if isinstance(bb, BinaryBuffer): 

    +

    1130 

    +

    1131 # single precision 

    +

    1132 value = bb.read_number(44, np.int32) 

    +

    1133 if value > 1000: 

    +

    1134 value -= 1000 

    +

    1135 if value in ( 

    +

    1136 D3plotFiletype.D3PLOT.value, 

    +

    1137 D3plotFiletype.D3PART.value, 

    +

    1138 D3plotFiletype.D3EIGV.value, 

    +

    1139 ): 

    +

    1140 word_size = 4 

    +

    1141 itype = np.int32 

    +

    1142 ftype = np.float32 

    +

    1143 

    +

    1144 LOGGER.debug("wordsize=%d itype=%s ftype=%s", word_size, itype, ftype) 

    +

    1145 LOGGER.debug("_determine_file_settings end") 

    +

    1146 

    +

    1147 return word_size, itype, ftype 

    +

    1148 

    +

    1149 # double precision 

    +

    1150 value = bb.read_number(88, np.int64) 

    +

    1151 if value > 1000: 

    +

    1152 value -= 1000 

    +

    1153 if value in ( 

    +

    1154 D3plotFiletype.D3PLOT.value, 

    +

    1155 D3plotFiletype.D3PART.value, 

    +

    1156 D3plotFiletype.D3EIGV.value, 

    +

    1157 ): 

    +

    1158 word_size = 8 

    +

    1159 itype = np.int64 

    +

    1160 ftype = np.float64 

    +

    1161 

    +

    1162 LOGGER.debug("wordsize=%d itype=%s ftype=%s", word_size, itype, ftype) 

    +

    1163 LOGGER.debug("_determine_file_settings end") 

    +

    1164 

    +

    1165 return word_size, itype, ftype 

    +

    1166 

    +

    1167 raise RuntimeError(f"Unknown file type '{value}'.") 

    +

    1168 

    +

    1169 LOGGER.debug("wordsize=%d itype=%s ftype=%s", word_size, itype, ftype) 

    +

    1170 LOGGER.debug("_determine_file_settings end") 

    +

    1171 

    +

    1172 return word_size, itype, ftype 

    +

    1173 

    +

    1174 def compare(self, other: "D3plotHeader") -> Dict[str, Tuple[Any, Any]]: 

    +

    1175 """Compare two headers and get the differences 

    +

    1176 

    +

    1177 Parameters 

    +

    1178 ---------- 

    +

    1179 other: D3plotHeader 

    +

    1180 other d3plot header instance 

    +

    1181 

    +

    1182 Returns 

    +

    1183 ------- 

    +

    1184 differences: Dict[str, Tuple[Any, Any]] 

    +

    1185 The different entries of both headers in a dict 

    +

    1186 """ 

    +

    1187 assert isinstance(other, D3plotHeader) 

    +

    1188 

    +

    1189 differences = {} 

    +

    1190 names = {*self.raw_header.keys(), *other.raw_header.keys()} 

    +

    1191 for name in names: 

    +

    1192 value1 = self.raw_header[name] if name in self.raw_header else "missing" 

    +

    1193 value2 = other.raw_header[name] if name in self.raw_header else "missing" 

    +

    1194 if value1 != value2: 

    +

    1195 differences[name] = (value1, value2) 

    +

    1196 

    +

    1197 return differences 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_d3plot_py.html b/coverage/d_233c5ceebba6ed8d_d3plot_py.html new file mode 100644 index 0000000..bb41d40 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_d3plot_py.html @@ -0,0 +1,9876 @@ + + + + + Coverage for lasso/dyna/d3plot.py: 50% + + + + + +
    +
    +

    + Coverage for lasso/dyna/d3plot.py: + 50% +

    + +

    + 3907 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +

    1import ctypes 

    +

    2from dataclasses import dataclass 

    +

    3import logging 

    +

    4import mmap 

    +

    5import os 

    +

    6import pprint 

    +

    7import re 

    +

    8import struct 

    +

    9import tempfile 

    +

    10import traceback 

    +

    11import typing 

    +

    12import webbrowser 

    +

    13from typing import Any, BinaryIO, Dict, Iterable, List, Set, Tuple, Union 

    +

    14 

    +

    15import numpy as np 

    +

    16 

    +

    17from ..femzip.femzip_api import FemzipAPI, FemzipBufferInfo, FemzipVariableCategory 

    +

    18from ..io.binary_buffer import BinaryBuffer 

    +

    19from ..io.files import open_file_or_filepath 

    +

    20from ..logging import get_logger 

    +

    21from ..plotting import plot_shell_mesh 

    +

    22from .array_type import ArrayType 

    +

    23from .d3plot_header import D3plotFiletype, D3plotHeader 

    +

    24from .femzip_mapper import FemzipMapper, filter_femzip_variables 

    +

    25from .filter_type import FilterType 

    +

    26 

    +

    27# pylint: disable = too-many-lines 

    +

    28 

    +

    29FORTRAN_OFFSET = 1 

    +

    30LOGGER = get_logger(__name__) 

    +

    31 

    +

    32 

    +

    33def _check_ndim(d3plot, array_dim_names: Dict[str, List[str]]): 

    +

    34 """Checks if the specified array is fine in terms of ndim 

    +

    35 

    +

    36 Parameters 

    +

    37 ---------- 

    +

    38 d3plot: D3plot 

    +

    39 d3plot holding arrays 

    +

    40 array_dim_names: Dict[str, List[str]] 

    +

    41 """ 

    +

    42 

    +

    43 for type_name, dim_names in array_dim_names.items(): 

    +

    44 if type_name in d3plot.arrays: 

    +

    45 array = d3plot.arrays[type_name] 

    +

    46 if array.ndim != len(dim_names): 

    +

    47 msg = "Array {0} must have {1} instead of {2} dimensions: ({3})" 

    +

    48 dim_names_text = ", ".join(dim_names) 

    +

    49 raise ValueError(msg.format(type_name, len(dim_names), array.ndim, dim_names_text)) 

    +

    50 

    +

    51 

    +

    52def _check_array_occurrence( 

    +

    53 d3plot, array_names: List[str], required_array_names: List[str] 

    +

    54) -> bool: 

    +

    55 """Check if an array exists, if all depending on it exist too 

    +

    56 

    +

    57 Parameters 

    +

    58 ---------- 

    +

    59 array_names: List[str] 

    +

    60 list of base arrays 

    +

    61 required_array_names: List[str] 

    +

    62 list of array names which would be required 

    +

    63 

    +

    64 Returns 

    +

    65 ------- 

    +

    66 exists: bool 

    +

    67 if the arrays exist or not 

    +

    68 

    +

    69 Raises 

    +

    70 ------ 

    +

    71 ValueError 

    +

    72 If a required array is not present 

    +

    73 """ 

    +

    74 

    +

    75 if any(name in d3plot.arrays for name in array_names): 

    +

    76 if not all(name in d3plot.arrays for name in required_array_names): 

    +

    77 msg = "The arrays '{0}' require setting also the arrays '{1}'" 

    +

    78 raise ValueError(msg.format(", ".join(array_names), ", ".join(required_array_names))) 

    +

    79 return True 

    +

    80 return False 

    +

    81 

    +

    82 

    +

    83def _negative_to_positive_state_indexes(indexes: Set[int], n_entries) -> Set[int]: 

    +

    84 """Convert negative indexes of an iterable to positive ones 

    +

    85 

    +

    86 Parameters 

    +

    87 ---------- 

    +

    88 indexes: Set[int] 

    +

    89 indexes to check and convert 

    +

    90 n_entries: int 

    +

    91 total number of entries 

    +

    92 

    +

    93 Returns 

    +

    94 ------- 

    +

    95 new_entries: Set[int] 

    +

    96 the positive indexes 

    +

    97 """ 

    +

    98 

    +

    99 new_entries: Set[int] = set() 

    +

    100 for _, index in enumerate(indexes): 

    +

    101 new_index = index + n_entries if index < 0 else index 

    +

    102 if new_index >= n_entries: 

    +

    103 err_msg = "State '{0}' exceeds the maximum number of states of '{1}'" 

    +

    104 raise ValueError(err_msg.format(index, n_entries)) 

    +

    105 new_entries.add(new_index) 

    +

    106 return new_entries 

    +

    107 

    +

    108 

    +

    109# pylint: disable = too-many-instance-attributes 

    +

    110class D3plotWriterSettings: 

    +

    111 """Settings class for d3plot writing""" 

    +

    112 

    +

    113 def __init__(self, d3plot: Any, block_size_bytes: int, single_file: bool): 

    +

    114 

    +

    115 # check the writing types 

    +

    116 if d3plot.header.itype == np.int32: 

    +

    117 self.itype = "<i" 

    +

    118 elif d3plot.header.itype == np.int64: 

    +

    119 self.itype = "<q" 

    +

    120 else: 

    +

    121 msg = "Invalid type for integers: {0}. np.int32 or np.int64 is required." 

    +

    122 raise RuntimeError(msg.format(d3plot.itype)) 

    +

    123 

    +

    124 if d3plot.header.ftype == np.float32: 

    +

    125 self.ftype = "<f" 

    +

    126 elif d3plot.header.ftype == np.float64: 

    +

    127 self.ftype = "<d" 

    +

    128 else: 

    +

    129 msg = "Invalid type for floats: {0}. np.float32 or np.float64 is required." 

    +

    130 raise RuntimeError(msg.format(d3plot.ftype)) 

    +

    131 

    +

    132 assert isinstance(d3plot, D3plot) 

    +

    133 self.d3plot = d3plot 

    +

    134 self._header = {} 

    +

    135 self.block_size_bytes = block_size_bytes 

    +

    136 self.mattyp = 0 

    +

    137 self.single_file = single_file 

    +

    138 self.mdlopt = 0 

    +

    139 self.n_shell_layers = 0 

    +

    140 self.n_rigid_shells = 0 

    +

    141 self.unique_beam_part_indexes = np.empty(0, dtype=self.itype) 

    +

    142 self.unique_shell_part_indexes = np.empty(0, dtype=self.itype) 

    +

    143 self.unique_solid_part_indexes = np.empty(0, dtype=self.itype) 

    +

    144 self.unique_tshell_part_indexes = np.empty(0, dtype=self.itype) 

    +

    145 self._str_codec = "utf-8" 

    +

    146 self.has_node_temperature_gradient = False 

    +

    147 self.has_node_residual_forces = False 

    +

    148 self.has_node_residual_moments = False 

    +

    149 self.has_plastic_strain_tensor = False 

    +

    150 self.has_thermal_strain_tensor = False 

    +

    151 self.n_solid_layers = 1 

    +

    152 

    +

    153 self._allowed_int_types = (np.int8, np.int16, np.int32, np.int64, int) 

    +

    154 self._allowed_float_types = (np.float32, np.float64, float) 

    +

    155 

    +

    156 @property 

    +

    157 def wordsize(self): 

    +

    158 """Get the wordsize to use for the d3plot 

    +

    159 

    +

    160 Returns 

    +

    161 ------- 

    +

    162 worsize : int 

    +

    163 D3plot wordsize 

    +

    164 """ 

    +

    165 return self.d3plot.header.wordsize 

    +

    166 

    +

    167 @property 

    +

    168 def header(self): 

    +

    169 """Dictionary holding all d3plot header information 

    +

    170 

    +

    171 Notes 

    +

    172 ----- 

    +

    173 The header is being build from the data stored in the d3plot. 

    +

    174 """ 

    +

    175 return self._header 

    +

    176 

    +

    177 @header.setter 

    +

    178 def set_header(self, new_header: dict): 

    +

    179 assert isinstance(new_header, dict) 

    +

    180 self._header = new_header 

    +

    181 

    +

    182 # pylint: disable = too-many-branches, too-many-statements, too-many-locals 

    +

    183 def build_header(self): 

    +

    184 """Build the new d3plot header""" 

    +

    185 

    +

    186 new_header = {} 

    +

    187 

    +

    188 # TITLE 

    +

    189 new_header["title"] = self.d3plot.header.title 

    +

    190 # RUNTIME 

    +

    191 new_header["runtime"] = self.d3plot.header.runtime 

    +

    192 # FILETYPE 

    +

    193 new_header["filetype"] = self.d3plot.header.filetype.value 

    +

    194 # SOURCE VERSION 

    +

    195 new_header["source_version"] = self.d3plot.header.source_version 

    +

    196 # RELEASE VERSION 

    +

    197 new_header["release_version"] = self.d3plot.header.release_version 

    +

    198 # SOURCE VERSION 

    +

    199 new_header["version"] = self.d3plot.header.version 

    +

    200 

    +

    201 # NDIM 

    +

    202 

    +

    203 # check for rigid body data 

    +

    204 has_rigid_body_data = False 

    +

    205 has_reduced_rigid_body_data = False 

    +

    206 if ( 

    +

    207 ArrayType.rigid_body_coordinates in self.d3plot.arrays 

    +

    208 or ArrayType.rigid_body_rotation_matrix in self.d3plot.arrays 

    +

    209 ): 

    +

    210 has_rigid_body_data = True 

    +

    211 has_reduced_rigid_body_data = True 

    +

    212 if ( 

    +

    213 ArrayType.rigid_body_velocity in self.d3plot.arrays 

    +

    214 or ArrayType.rigid_body_rot_velocity in self.d3plot.arrays 

    +

    215 or ArrayType.rigid_body_acceleration in self.d3plot.arrays 

    +

    216 or ArrayType.rigid_body_rot_acceleration in self.d3plot.arrays 

    +

    217 ): 

    +

    218 has_reduced_rigid_body_data = False 

    +

    219 

    +

    220 # check for rigid road 

    +

    221 required_arrays = [ 

    +

    222 ArrayType.rigid_road_node_ids, 

    +

    223 ArrayType.rigid_road_node_coordinates, 

    +

    224 ArrayType.rigid_road_ids, 

    +

    225 ArrayType.rigid_road_segment_node_ids, 

    +

    226 ArrayType.rigid_road_segment_road_id, 

    +

    227 ] 

    +

    228 _check_array_occurrence( 

    +

    229 self.d3plot, array_names=required_arrays, required_array_names=required_arrays 

    +

    230 ) 

    +

    231 has_rigid_road = ArrayType.rigid_road_node_ids in self.d3plot.arrays 

    +

    232 

    +

    233 # check for mattyp shit 

    +

    234 # self.mattyp = 0 

    +

    235 # if not is_d3part and ArrayType.part_material_type in self.d3plot.arrays: 

    +

    236 # self.mattyp = 1 

    +

    237 # elif is_d3part and ArrayType.part_material_type in self.d3plot.arrays: 

    +

    238 # # 

    +

    239 # self.mattyp = 0 

    +

    240 

    +

    241 # check for mattyp 

    +

    242 is_d3part = self.d3plot.header.filetype == D3plotFiletype.D3PART 

    +

    243 

    +

    244 self.mattyp = 0 

    +

    245 if not is_d3part and ArrayType.part_material_type in self.d3plot.arrays: 

    +

    246 self.mattyp = 1 

    +

    247 

    +

    248 # rigid shells 

    +

    249 if ArrayType.element_shell_part_indexes in self.d3plot.arrays: 

    +

    250 part_mattyp = self.d3plot.arrays[ArrayType.part_material_type] 

    +

    251 shell_part_indexes = self.d3plot.arrays[ArrayType.element_shell_part_indexes] 

    +

    252 self.n_rigid_shells = (part_mattyp[shell_part_indexes] == 20).sum() 

    +

    253 elif is_d3part: 

    +

    254 self.mattyp = 0 

    +

    255 

    +

    256 # set ndim finally 

    +

    257 # 

    +

    258 # This also confuses me from the manual ... 

    +

    259 # It doesn't specify ndim clearly and only gives ranges. 

    +

    260 # 

    +

    261 # - has rigid body: rigid body data (movement etc.) 

    +

    262 # - rigid road: rigid road data 

    +

    263 # - mattyp: array with material types for each part 

    +

    264 # 

    +

    265 # Table: 

    +

    266 # |----------------|--------------------|------------|---------|----------| 

    +

    267 # | has_rigid_body | reduced rigid body | rigid road | mattyp | ndim | 

    +

    268 # |----------------|--------------------|------------|---------|----------| 

    +

    269 # | False | False | False | 0 | 4 | 

    +

    270 # | False | False | False | 1 | 5 | 

    +

    271 # | False (?) | False | True | 0 | 6 | 

    +

    272 # | False | False | True | 1 | 7 | 

    +

    273 # | True | False | False | 0 | 8 | 

    +

    274 # | True | True | True | 0 | 9 | 

    +

    275 # |----------------|--------------------|------------|---------|----------| 

    +

    276 # 

    +

    277 # uncertainties: mattyp 0 or 1 ?!?!? 

    +

    278 if ( 

    +

    279 not has_rigid_body_data 

    +

    280 and not has_reduced_rigid_body_data 

    +

    281 and not has_rigid_road 

    +

    282 and self.mattyp == 0 

    +

    283 ): 

    +

    284 new_header["ndim"] = 4 

    +

    285 elif ( 

    +

    286 not has_rigid_body_data 

    +

    287 and not has_reduced_rigid_body_data 

    +

    288 and not has_rigid_road 

    +

    289 and self.mattyp == 1 

    +

    290 ): 

    +

    291 new_header["ndim"] = 5 

    +

    292 elif ( 

    +

    293 not has_rigid_body_data 

    +

    294 and not has_reduced_rigid_body_data 

    +

    295 and has_rigid_road 

    +

    296 and self.mattyp == 0 

    +

    297 ): 

    +

    298 new_header["ndim"] = 6 

    +

    299 elif ( 

    +

    300 not has_rigid_body_data 

    +

    301 and not has_reduced_rigid_body_data 

    +

    302 and has_rigid_road 

    +

    303 and self.mattyp == 1 

    +

    304 ): 

    +

    305 new_header["ndim"] = 7 

    +

    306 elif ( 

    +

    307 has_rigid_body_data 

    +

    308 and not has_reduced_rigid_body_data 

    +

    309 and not has_rigid_road 

    +

    310 and self.mattyp == 0 

    +

    311 ): 

    +

    312 new_header["ndim"] = 8 

    +

    313 elif ( 

    +

    314 has_rigid_body_data 

    +

    315 and has_reduced_rigid_body_data 

    +

    316 and has_rigid_road 

    +

    317 and self.mattyp == 0 

    +

    318 ): 

    +

    319 new_header["ndim"] = 9 

    +

    320 else: 

    +

    321 raise RuntimeError("Cannot determine haeder variable ndim.") 

    +

    322 

    +

    323 # NUMNP 

    +

    324 new_header["numnp"] = ( 

    +

    325 self.d3plot.arrays[ArrayType.node_coordinates].shape[0] 

    +

    326 if ArrayType.node_coordinates in self.d3plot.arrays 

    +

    327 else 0 

    +

    328 ) 

    +

    329 

    +

    330 # ICODE 

    +

    331 new_header["icode"] = self.d3plot.header.legacy_code_type 

    +

    332 

    +

    333 # IT aka temperatures 

    +

    334 _check_array_occurrence( 

    +

    335 self.d3plot, 

    +

    336 array_names=[ArrayType.node_heat_flux], 

    +

    337 required_array_names=[ArrayType.node_temperature], 

    +

    338 ) 

    +

    339 

    +

    340 it_temp = 0 

    +

    341 if ArrayType.node_mass_scaling in self.d3plot.arrays: 

    +

    342 it_temp += 10 

    +

    343 

    +

    344 if ( 

    +

    345 ArrayType.node_temperature in self.d3plot.arrays 

    +

    346 and ArrayType.node_heat_flux not in self.d3plot.arrays 

    +

    347 ): 

    +

    348 it_temp += 1 

    +

    349 elif ( 

    +

    350 ArrayType.node_temperature in self.d3plot.arrays 

    +

    351 and ArrayType.node_heat_flux in self.d3plot.arrays 

    +

    352 ): 

    +

    353 

    +

    354 node_temp_shape = self.d3plot.arrays[ArrayType.node_temperature].shape 

    +

    355 if node_temp_shape.ndim == 2: 

    +

    356 it_temp += 2 

    +

    357 elif node_temp_shape.ndim == 3: 

    +

    358 it_temp += 3 

    +

    359 else: 

    +

    360 msg = "{1} is supposed to have either 2 or 3 dims and not '{0}'" 

    +

    361 raise RuntimeError(msg.format(node_temp_shape.ndim, ArrayType.node_temperature)) 

    +

    362 else: 

    +

    363 # caught by _check_array_occurrence 

    +

    364 pass 

    +

    365 new_header["it"] = it_temp 

    +

    366 

    +

    367 # IU - disp field indicator 

    +

    368 new_header["iu"] = 1 if ArrayType.node_displacement in self.d3plot.arrays else 0 

    +

    369 

    +

    370 # IV - velicoty field indicator 

    +

    371 new_header["iv"] = 1 if ArrayType.node_velocity in self.d3plot.arrays else 0 

    +

    372 

    +

    373 # IA - velicoty field indicator 

    +

    374 new_header["ia"] = 1 if ArrayType.node_acceleration in self.d3plot.arrays else 0 

    +

    375 

    +

    376 # NEL8 - solid count 

    +

    377 n_solids = ( 

    +

    378 self.d3plot.arrays[ArrayType.element_solid_node_indexes].shape[0] 

    +

    379 if ArrayType.element_solid_node_indexes in self.d3plot.arrays 

    +

    380 else 0 

    +

    381 ) 

    +

    382 new_header["nel8"] = n_solids 

    +

    383 

    +

    384 # helper var to track max material index across all element types 

    +

    385 # this is required to allocate the part array later 

    +

    386 # new_header["nmmat"] = 0 

    +

    387 

    +

    388 # NUMMAT8 - solid material count 

    +

    389 required_arrays = [ 

    +

    390 ArrayType.element_solid_node_indexes, 

    +

    391 ArrayType.element_solid_part_indexes, 

    +

    392 ] 

    +

    393 _check_array_occurrence( 

    +

    394 self.d3plot, 

    +

    395 array_names=required_arrays, 

    +

    396 required_array_names=required_arrays, 

    +

    397 ) 

    +

    398 if ArrayType.element_solid_part_indexes in self.d3plot.arrays: 

    +

    399 part_indexes = self.d3plot.arrays[ArrayType.element_solid_part_indexes] 

    +

    400 unique_part_indexes = np.unique(part_indexes) 

    +

    401 self.unique_solid_part_indexes = unique_part_indexes 

    +

    402 new_header["nummat8"] = len(unique_part_indexes) 

    +

    403 

    +

    404 # max_index = unique_part_indexes.max() + 1 \ 

    +

    405 # if len(part_indexes) else 0 

    +

    406 # new_header["nmmat"] = max(new_header["nmmat"], 

    +

    407 # max_index) 

    +

    408 else: 

    +

    409 new_header["nummat8"] = 0 

    +

    410 

    +

    411 # NUMDS 

    +

    412 new_header["numds"] = self.d3plot.header.has_shell_four_inplane_gauss_points 

    +

    413 

    +

    414 # NUMST 

    +

    415 new_header["numst"] = self.d3plot.header.unused_numst 

    +

    416 

    +

    417 # NV3D - number of solid vars 

    +

    418 # NEIPH - number of solid history vars 

    +

    419 n_solid_layers = self.d3plot.check_array_dims( 

    +

    420 { 

    +

    421 ArrayType.element_solid_stress: 2, 

    +

    422 ArrayType.element_solid_effective_plastic_strain: 2, 

    +

    423 ArrayType.element_solid_history_variables: 2, 

    +

    424 ArrayType.element_solid_plastic_strain_tensor: 2, 

    +

    425 ArrayType.element_solid_thermal_strain_tensor: 2, 

    +

    426 }, 

    +

    427 "n_solid_layers", 

    +

    428 ) 

    +

    429 n_solid_layers = 1 if n_solid_layers < 1 else n_solid_layers 

    +

    430 self.n_solid_layers = n_solid_layers 

    +

    431 if n_solid_layers not in (1, 8): 

    +

    432 err_msg = "Solids must have either 1 or 8 integration layers not {0}." 

    +

    433 raise ValueError(err_msg.format(self.n_solid_layers)) 

    +

    434 

    +

    435 n_solid_hist_vars, _ = self.count_array_state_var( 

    +

    436 array_type=ArrayType.element_solid_history_variables, 

    +

    437 dimension_names=["n_timesteps", "n_solids", "n_solid_layers", "n_history_vars"], 

    +

    438 has_layers=True, 

    +

    439 n_layers=n_solid_layers, 

    +

    440 ) 

    +

    441 n_solid_hist_vars = n_solid_hist_vars // n_solid_layers 

    +

    442 

    +

    443 if ArrayType.element_solid_strain in self.d3plot.arrays: 

    +

    444 n_solid_hist_vars += 6 

    +

    445 # It is uncertain if this is counted as history var 

    +

    446 if ArrayType.element_solid_plastic_strain_tensor in self.d3plot.arrays: 

    +

    447 n_solid_hist_vars += 6 

    +

    448 # It is uncertain if this is counted as history var 

    +

    449 if ArrayType.element_solid_thermal_strain_tensor in self.d3plot.arrays: 

    +

    450 n_solid_hist_vars += 6 

    +

    451 n_solid_vars = (7 + n_solid_hist_vars) * n_solid_layers 

    +

    452 new_header["neiph"] = ( 

    +

    453 n_solid_hist_vars if n_solids != 0 else self.d3plot.header.n_solid_history_vars 

    +

    454 ) 

    +

    455 new_header["nv3d"] = n_solid_vars if n_solids != 0 else self.d3plot.header.n_solid_vars 

    +

    456 

    +

    457 # NEL2 - beam count 

    +

    458 new_header["nel2"] = ( 

    +

    459 self.d3plot.arrays[ArrayType.element_beam_node_indexes].shape[0] 

    +

    460 if ArrayType.element_beam_node_indexes in self.d3plot.arrays 

    +

    461 else 0 

    +

    462 ) 

    +

    463 

    +

    464 # NUMMAT2 - beam material count 

    +

    465 required_arrays = [ 

    +

    466 ArrayType.element_beam_node_indexes, 

    +

    467 ArrayType.element_beam_part_indexes, 

    +

    468 ] 

    +

    469 _check_array_occurrence( 

    +

    470 self.d3plot, 

    +

    471 array_names=required_arrays, 

    +

    472 required_array_names=required_arrays, 

    +

    473 ) 

    +

    474 if ArrayType.element_beam_part_indexes in self.d3plot.arrays: 

    +

    475 part_indexes = self.d3plot.arrays[ArrayType.element_beam_part_indexes] 

    +

    476 unique_part_indexes = np.unique(part_indexes) 

    +

    477 new_header["nummat2"] = len(unique_part_indexes) 

    +

    478 

    +

    479 self.unique_beam_part_indexes = unique_part_indexes 

    +

    480 

    +

    481 # max_index = unique_part_indexes.max() + 1 \ 

    +

    482 # if len(unique_part_indexes) else 0 

    +

    483 # new_header["nmmat"] = max(new_header["nmmat"], 

    +

    484 # max_index) 

    +

    485 else: 

    +

    486 new_header["nummat2"] = 0 

    +

    487 

    +

    488 # NEIPB - beam history vars per integration point 

    +

    489 array_dims = { 

    +

    490 ArrayType.element_beam_shear_stress: 2, 

    +

    491 ArrayType.element_beam_axial_stress: 2, 

    +

    492 ArrayType.element_beam_plastic_strain: 2, 

    +

    493 ArrayType.element_beam_axial_strain: 2, 

    +

    494 ArrayType.element_beam_history_vars: 2, 

    +

    495 } 

    +

    496 n_beam_layers = self.d3plot.check_array_dims(array_dims, "n_beam_layers") 

    +

    497 new_header["beamip"] = n_beam_layers 

    +

    498 

    +

    499 new_header["neipb"] = 0 

    +

    500 if ArrayType.element_beam_history_vars in self.d3plot.arrays: 

    +

    501 array = self.d3plot.arrays[ArrayType.element_beam_history_vars] 

    +

    502 if array.ndim != 4: 

    +

    503 msg = ( 

    +

    504 "Array '{0}' was expected to have 4 dimensions " 

    +

    505 "(n_timesteps, n_beams, n_modes (3+n_beam_layers), " 

    +

    506 "n_beam_history_vars)." 

    +

    507 ) 

    +

    508 raise ValueError(msg.format(ArrayType.element_beam_history_vars)) 

    +

    509 if array.shape[3] < 3: 

    +

    510 msg = ( 

    +

    511 "Array '{0}' dimension 3 must have have at least three" 

    +

    512 " entries (beam layers: average, min, max)" 

    +

    513 ) 

    +

    514 raise ValueError(msg.format(ArrayType.element_beam_history_vars)) 

    +

    515 if array.shape[3] != 3 + n_beam_layers: 

    +

    516 msg = "Array '{0}' dimension 3 must have size (3+n_beam_layers). {1} != (3+{2})" 

    +

    517 raise ValueError(msg.format(ArrayType.element_beam_history_vars)) 

    +

    518 new_header["neipb"] = array.shape[3] 

    +

    519 

    +

    520 # NV1D - beam variable count 

    +

    521 new_header["nv1d"] = ( 

    +

    522 6 + 5 * new_header["beamip"] + new_header["neipb"] * (3 + new_header["beamip"]) 

    +

    523 ) 

    +

    524 

    +

    525 # NEL4 - number of shells 

    +

    526 n_shells = ( 

    +

    527 self.d3plot.arrays[ArrayType.element_shell_node_indexes].shape[0] 

    +

    528 if ArrayType.element_shell_node_indexes in self.d3plot.arrays 

    +

    529 else 0 

    +

    530 ) 

    +

    531 new_header["nel4"] = n_shells 

    +

    532 

    +

    533 # NUMMAT4 - shell material count 

    +

    534 required_arrays = [ 

    +

    535 ArrayType.element_shell_node_indexes, 

    +

    536 ArrayType.element_shell_part_indexes, 

    +

    537 ] 

    +

    538 _check_array_occurrence( 

    +

    539 self.d3plot, 

    +

    540 array_names=required_arrays, 

    +

    541 required_array_names=required_arrays, 

    +

    542 ) 

    +

    543 if ArrayType.element_shell_part_indexes in self.d3plot.arrays: 

    +

    544 part_indexes = self.d3plot.arrays[ArrayType.element_shell_part_indexes] 

    +

    545 unique_part_indexes = np.unique(part_indexes) 

    +

    546 new_header["nummat4"] = len(unique_part_indexes) 

    +

    547 

    +

    548 self.unique_shell_part_indexes = unique_part_indexes 

    +

    549 

    +

    550 # max_index = unique_part_indexes.max() + 1 \ 

    +

    551 # if len(unique_part_indexes) else 0 

    +

    552 # new_header["nmmat"] = max(new_header["nmmat"], 

    +

    553 # max_index) 

    +

    554 else: 

    +

    555 new_header["nummat4"] = 0 

    +

    556 

    +

    557 # NEIPS -shell history variable count 

    +

    558 n_shell_layers = 0 

    +

    559 if ( 

    +

    560 ArrayType.element_shell_history_vars in self.d3plot.arrays 

    +

    561 or ArrayType.element_tshell_history_variables in self.d3plot.arrays 

    +

    562 ): 

    +

    563 

    +

    564 n_shell_history_vars, n_shell_layers = self.count_array_state_var( 

    +

    565 array_type=ArrayType.element_shell_history_vars, 

    +

    566 dimension_names=["n_timesteps", "n_shells", "n_shell_layers", "n_history_vars"], 

    +

    567 has_layers=True, 

    +

    568 n_layers=n_shell_layers, 

    +

    569 ) 

    +

    570 n_tshell_history_vars, n_tshell_layers = self.count_array_state_var( 

    +

    571 array_type=ArrayType.element_tshell_history_variables, 

    +

    572 dimension_names=["n_timesteps", "n_tshells", "n_shell_layers", "n_history_vars"], 

    +

    573 has_layers=True, 

    +

    574 n_layers=n_shell_layers, 

    +

    575 ) 

    +

    576 

    +

    577 if n_shell_layers != n_tshell_layers: 

    +

    578 msg = ( 

    +

    579 "Shells and thick shells must have the same amount " 

    +

    580 "of integration layers: {0} != {1}" 

    +

    581 ) 

    +

    582 raise RuntimeError(msg.format(n_shell_layers, n_tshell_layers)) 

    +

    583 

    +

    584 # we are tolerant here and simply add zero padding for the other 

    +

    585 # field later on 

    +

    586 new_header["neips"] = max( 

    +

    587 n_tshell_history_vars // n_tshell_layers, n_shell_history_vars // n_shell_layers 

    +

    588 ) 

    +

    589 else: 

    +

    590 new_header["neips"] = 0 

    +

    591 

    +

    592 array_dims = { 

    +

    593 ArrayType.element_shell_stress: 2, 

    +

    594 ArrayType.element_shell_effective_plastic_strain: 2, 

    +

    595 ArrayType.element_shell_history_vars: 2, 

    +

    596 ArrayType.element_tshell_stress: 2, 

    +

    597 ArrayType.element_tshell_effective_plastic_strain: 2, 

    +

    598 ArrayType.element_tshell_history_variables: 2, 

    +

    599 } 

    +

    600 n_shell_layers = self.d3plot.check_array_dims(array_dims, "n_shell_layers") 

    +

    601 self.n_shell_layers = n_shell_layers 

    +

    602 

    +

    603 # NELTH - number of thick shell elements 

    +

    604 n_thick_shells = ( 

    +

    605 self.d3plot.arrays[ArrayType.element_tshell_node_indexes].shape[0] 

    +

    606 if ArrayType.element_tshell_node_indexes in self.d3plot.arrays 

    +

    607 else 0 

    +

    608 ) 

    +

    609 new_header["nelth"] = n_thick_shells 

    +

    610 

    +

    611 # IOSHL1 - shell & solid stress flag 

    +

    612 if ( 

    +

    613 ArrayType.element_shell_stress in self.d3plot.arrays 

    +

    614 or ArrayType.element_tshell_stress in self.d3plot.arrays 

    +

    615 ): 

    +

    616 new_header["ioshl1"] = 1000 

    +

    617 else: 

    +

    618 # if either stress or pstrain is written for solids 

    +

    619 # the whole block of 7 basic variables is always written 

    +

    620 # to the file 

    +

    621 if ( 

    +

    622 ArrayType.element_solid_stress in self.d3plot.arrays 

    +

    623 or ArrayType.element_solid_effective_plastic_strain in self.d3plot.arrays 

    +

    624 ): 

    +

    625 new_header["ioshl1"] = 999 

    +

    626 else: 

    +

    627 new_header["ioshl1"] = 0 

    +

    628 

    +

    629 if n_shells == 0 and n_thick_shells == 0 and n_solids == 0: 

    +

    630 new_header["ioshl1"] = ( 

    +

    631 self.d3plot.header.raw_header["ioshl1"] 

    +

    632 if "ioshl1" in self.d3plot.header.raw_header 

    +

    633 else 0 

    +

    634 ) 

    +

    635 

    +

    636 if n_shells == 0 and n_thick_shells == 0 and n_solids != 0: 

    +

    637 if ( 

    +

    638 "ioshl1" in self.d3plot.header.raw_header 

    +

    639 and self.d3plot.header.raw_header["ioshl1"] == 1000 

    +

    640 ): 

    +

    641 new_header["ioshl1"] = 1000 

    +

    642 

    +

    643 # IOSHL2 - shell & solid pstrain flag 

    +

    644 if ( 

    +

    645 ArrayType.element_shell_effective_plastic_strain in self.d3plot.arrays 

    +

    646 or ArrayType.element_tshell_effective_plastic_strain in self.d3plot.arrays 

    +

    647 ): 

    +

    648 new_header["ioshl2"] = 1000 

    +

    649 else: 

    +

    650 if ArrayType.element_solid_effective_plastic_strain in self.d3plot.arrays: 

    +

    651 new_header["ioshl2"] = 999 

    +

    652 else: 

    +

    653 new_header["ioshl2"] = 0 

    +

    654 

    +

    655 if n_shells == 0 and n_thick_shells == 0 and n_solids == 0: 

    +

    656 new_header["ioshl2"] = ( 

    +

    657 self.d3plot.header.raw_header["ioshl2"] 

    +

    658 if "ioshl2" in self.d3plot.header.raw_header 

    +

    659 else 0 

    +

    660 ) 

    +

    661 

    +

    662 if n_shells == 0 and n_thick_shells == 0 and n_solids != 0: 

    +

    663 if ( 

    +

    664 "ioshl2" in self.d3plot.header.raw_header 

    +

    665 and self.d3plot.header.raw_header["ioshl2"] == 1000 

    +

    666 ): 

    +

    667 new_header["ioshl2"] = 1000 

    +

    668 

    +

    669 # IOSHL3 - shell forces flag 

    +

    670 if ( 

    +

    671 ArrayType.element_shell_shear_force in self.d3plot.arrays 

    +

    672 or ArrayType.element_shell_bending_moment in self.d3plot.arrays 

    +

    673 or ArrayType.element_shell_normal_force in self.d3plot.arrays 

    +

    674 ): 

    +

    675 new_header["ioshl3"] = 1000 

    +

    676 else: 

    +

    677 # See https://github.com/open-lasso-python/lasso-python/issues/39 

    +

    678 if ( 

    +

    679 ArrayType.element_shell_thickness in self.d3plot.arrays 

    +

    680 or ArrayType.element_shell_internal_energy in self.d3plot.arrays 

    +

    681 ): 

    +

    682 new_header["ioshl3"] = 999 

    +

    683 else: 

    +

    684 new_header["ioshl3"] = 0 

    +

    685 

    +

    686 if n_shells == 0: 

    +

    687 new_header["ioshl3"] = ( 

    +

    688 self.d3plot.header.raw_header["ioshl3"] 

    +

    689 if "ioshl3" in self.d3plot.header.raw_header 

    +

    690 else 0 

    +

    691 ) 

    +

    692 

    +

    693 # IOSHL4 - shell energy+2 unknown+thickness flag 

    +

    694 if ( 

    +

    695 ArrayType.element_shell_thickness in self.d3plot.arrays 

    +

    696 or ArrayType.element_shell_unknown_variables in self.d3plot.arrays 

    +

    697 or ArrayType.element_shell_internal_energy in self.d3plot.arrays 

    +

    698 ): 

    +

    699 new_header["ioshl4"] = 1000 

    +

    700 else: 

    +

    701 # new_header["ioshl4"] = 999 

    +

    702 new_header["ioshl4"] = 0 

    +

    703 

    +

    704 if n_shells == 0: 

    +

    705 new_header["ioshl4"] = ( 

    +

    706 self.d3plot.header.raw_header["ioshl4"] 

    +

    707 if "ioshl4" in self.d3plot.header.raw_header 

    +

    708 else 0 

    +

    709 ) 

    +

    710 

    +

    711 # IDTDT - Flags for various data in the database 

    +

    712 new_header["idtdt"] = 0 

    +

    713 istrn = 0 

    +

    714 if ( 

    +

    715 ArrayType.element_shell_strain in self.d3plot.arrays 

    +

    716 or ArrayType.element_solid_strain in self.d3plot.arrays 

    +

    717 or ArrayType.element_tshell_strain in self.d3plot.arrays 

    +

    718 ): 

    +

    719 # new_header["idtdt"] = 10000 

    +

    720 istrn = 1 

    +

    721 new_header["istrn"] = istrn 

    +

    722 

    +

    723 if ArrayType.node_temperature_gradient in self.d3plot.arrays: 

    +

    724 new_header["idtdt"] += 1 

    +

    725 self.has_node_temperature_gradient = True 

    +

    726 if ( 

    +

    727 ArrayType.node_residual_forces in self.d3plot.arrays 

    +

    728 or ArrayType.node_residual_moments in self.d3plot.arrays 

    +

    729 ): 

    +

    730 new_header["idtdt"] += 10 

    +

    731 self.has_node_residual_forces = True 

    +

    732 self.has_node_residual_moments = True 

    +

    733 if ( 

    +

    734 ArrayType.element_shell_plastic_strain_tensor in self.d3plot.arrays 

    +

    735 or ArrayType.element_solid_plastic_strain_tensor in self.d3plot.arrays 

    +

    736 ): 

    +

    737 new_header["idtdt"] += 100 

    +

    738 self.has_plastic_strain_tensor = True 

    +

    739 if ( 

    +

    740 ArrayType.element_shell_thermal_strain_tensor in self.d3plot.arrays 

    +

    741 or ArrayType.element_solid_thermal_strain_tensor in self.d3plot.arrays 

    +

    742 ): 

    +

    743 new_header["idtdt"] += 1000 

    +

    744 self.has_thermal_strain_tensor = True 

    +

    745 if new_header["idtdt"] > 100 and new_header["istrn"]: 

    +

    746 new_header["idtdt"] += 10000 

    +

    747 

    +

    748 # info of element deletion is encoded into maxint ... 

    +

    749 element_deletion_arrays = [ 

    +

    750 ArrayType.element_beam_is_alive, 

    +

    751 ArrayType.element_shell_is_alive, 

    +

    752 ArrayType.element_tshell_is_alive, 

    +

    753 ArrayType.element_solid_is_alive, 

    +

    754 ] 

    +

    755 mdlopt = 0 

    +

    756 if any(name in self.d3plot.arrays for name in element_deletion_arrays): 

    +

    757 mdlopt = 2 

    +

    758 elif ArrayType.node_is_alive in self.d3plot.arrays: 

    +

    759 mdlopt = 1 

    +

    760 self.mdlopt = mdlopt 

    +

    761 

    +

    762 # MAXINT - shell integration layer count 

    +

    763 array_dims = { 

    +

    764 ArrayType.element_shell_stress: 2, 

    +

    765 ArrayType.element_shell_effective_plastic_strain: 2, 

    +

    766 ArrayType.element_shell_history_vars: 2, 

    +

    767 ArrayType.element_tshell_stress: 2, 

    +

    768 ArrayType.element_tshell_effective_plastic_strain: 2, 

    +

    769 } 

    +

    770 n_shell_layers = self.d3plot.check_array_dims(array_dims, "n_layers") 

    +

    771 

    +

    772 # beauty fix: take old shell layers if none exist 

    +

    773 if n_shell_layers == 0: 

    +

    774 n_shell_layers = self.d3plot.header.n_shell_tshell_layers 

    +

    775 

    +

    776 if mdlopt == 0: 

    +

    777 new_header["maxint"] = n_shell_layers 

    +

    778 elif mdlopt == 1: 

    +

    779 new_header["maxint"] = -n_shell_layers 

    +

    780 elif mdlopt == 2: 

    +

    781 new_header["maxint"] = -(n_shell_layers + 10000) 

    +

    782 

    +

    783 # NV2D - shell variable count 

    +

    784 has_shell_stress = new_header["ioshl1"] == 1000 

    +

    785 has_shell_pstrain = new_header["ioshl2"] == 1000 

    +

    786 has_shell_forces = new_header["ioshl3"] == 1000 

    +

    787 has_shell_other = new_header["ioshl4"] == 1000 

    +

    788 new_header["nv2d"] = ( 

    +

    789 n_shell_layers * (6 * has_shell_stress + has_shell_pstrain + new_header["neips"]) 

    +

    790 + 8 * has_shell_forces 

    +

    791 + 4 * has_shell_other 

    +

    792 + 12 * istrn 

    +

    793 + n_shell_layers * self.has_plastic_strain_tensor * 6 

    +

    794 + self.has_thermal_strain_tensor * 6 

    +

    795 ) 

    +

    796 

    +

    797 # NMSPH - number of sph nodes 

    +

    798 new_header["nmsph"] = ( 

    +

    799 len(self.d3plot.arrays[ArrayType.sph_node_indexes]) 

    +

    800 if ArrayType.sph_node_indexes in self.d3plot.arrays 

    +

    801 else 0 

    +

    802 ) 

    +

    803 

    +

    804 # NGPSPH - number of sph materials 

    +

    805 new_header["ngpsph"] = ( 

    +

    806 len(np.unique(self.d3plot.arrays[ArrayType.sph_node_material_index])) 

    +

    807 if ArrayType.sph_node_material_index in self.d3plot.arrays 

    +

    808 else 0 

    +

    809 ) 

    +

    810 

    +

    811 # NUMMATT - thick shell material count 

    +

    812 required_arrays = [ 

    +

    813 ArrayType.element_tshell_node_indexes, 

    +

    814 ArrayType.element_tshell_part_indexes, 

    +

    815 ] 

    +

    816 _check_array_occurrence( 

    +

    817 self.d3plot, 

    +

    818 array_names=required_arrays, 

    +

    819 required_array_names=required_arrays, 

    +

    820 ) 

    +

    821 if ArrayType.element_tshell_part_indexes in self.d3plot.arrays: 

    +

    822 part_indexes = self.d3plot.arrays[ArrayType.element_tshell_part_indexes] 

    +

    823 unique_part_indexes = np.unique(part_indexes) 

    +

    824 new_header["nummatt"] = len(unique_part_indexes) 

    +

    825 

    +

    826 self.unique_tshell_part_indexes = unique_part_indexes 

    +

    827 

    +

    828 # max_index = unique_part_indexes.max() + 1 \ 

    +

    829 # if len(part_indexes) else 0 

    +

    830 # new_header["nmmat"] = max(new_header["nmmat"], 

    +

    831 # max_index) 

    +

    832 else: 

    +

    833 new_header["nummatt"] = 0 

    +

    834 

    +

    835 # NV3DT 

    +

    836 new_header["nv3dt"] = ( 

    +

    837 n_shell_layers * (6 * has_shell_stress + has_shell_pstrain + new_header["neips"]) 

    +

    838 + 12 * istrn 

    +

    839 ) 

    +

    840 

    +

    841 # IALEMAT - number of ALE materials 

    +

    842 new_header["ialemat"] = ( 

    +

    843 len(self.d3plot.arrays[ArrayType.ale_material_ids]) 

    +

    844 if ArrayType.ale_material_ids in self.d3plot.arrays 

    +

    845 else 0 

    +

    846 ) 

    +

    847 # NCFDV1 

    +

    848 new_header["ncfdv1"] = 0 

    +

    849 

    +

    850 # NCFDV2 

    +

    851 new_header["ncfdv2"] = 0 

    +

    852 

    +

    853 # NADAPT - number of adapted element to parent pairs ?!? 

    +

    854 new_header["ncfdv2"] = 0 

    +

    855 

    +

    856 # NUMRBS (written to numbering header) 

    +

    857 if ArrayType.rigid_body_coordinates in self.d3plot.arrays: 

    +

    858 array = self.d3plot.arrays[ArrayType.rigid_body_coordinates] 

    +

    859 if array.ndim != 3: 

    +

    860 msg = "Array '{0}' was expected to have {1} dimensions ({2})." 

    +

    861 raise ValueError( 

    +

    862 msg.format( 

    +

    863 ArrayType.rigid_wall_force, 

    +

    864 3, 

    +

    865 ",".join(["n_timesteps", "n_rigid_bodies", "x_y_z"]), 

    +

    866 ) 

    +

    867 ) 

    +

    868 new_header["numrbs"] = array.shape[1] 

    +

    869 else: 

    +

    870 new_header["numrbs"] = 0 

    +

    871 

    +

    872 # NMMAT - material count (very complicated stuff ...) 

    +

    873 tmp_nmmat = ( 

    +

    874 new_header["nummat2"] 

    +

    875 + new_header["nummat4"] 

    +

    876 + new_header["nummat8"] 

    +

    877 + new_header["nummatt"] 

    +

    878 + new_header["numrbs"] 

    +

    879 ) 

    +

    880 if ( 

    +

    881 ArrayType.part_ids in self.d3plot.arrays 

    +

    882 or ArrayType.part_internal_energy in self.d3plot.arrays 

    +

    883 or ArrayType.part_kinetic_energy in self.d3plot.arrays 

    +

    884 or ArrayType.part_mass in self.d3plot.arrays 

    +

    885 or ArrayType.part_velocity in self.d3plot.arrays 

    +

    886 ): 

    +

    887 

    +

    888 tmp_nmmat2 = self.d3plot.check_array_dims( 

    +

    889 { 

    +

    890 ArrayType.part_ids: 0, 

    +

    891 ArrayType.part_internal_energy: 1, 

    +

    892 ArrayType.part_kinetic_energy: 1, 

    +

    893 ArrayType.part_mass: 1, 

    +

    894 ArrayType.part_velocity: 1, 

    +

    895 }, 

    +

    896 "n_parts", 

    +

    897 ) 

    +

    898 

    +

    899 new_header["nmmat"] = tmp_nmmat2 

    +

    900 

    +

    901 # FIX 

    +

    902 # ... 

    +

    903 if new_header["nmmat"] > tmp_nmmat: 

    +

    904 new_header["numrbs"] = ( 

    +

    905 new_header["nmmat"] 

    +

    906 - new_header["nummat2"] 

    +

    907 - new_header["nummat4"] 

    +

    908 - new_header["nummat8"] 

    +

    909 - new_header["nummatt"] 

    +

    910 ) 

    +

    911 else: 

    +

    912 new_header["nmmat"] = tmp_nmmat 

    +

    913 

    +

    914 # NARBS - words for arbitrary numbering of everything 

    +

    915 # requires nmmat thus it was placed here 

    +

    916 new_header["narbs"] = ( 

    +

    917 new_header["numnp"] 

    +

    918 + new_header["nel8"] 

    +

    919 + new_header["nel2"] 

    +

    920 + new_header["nel4"] 

    +

    921 + new_header["nelth"] 

    +

    922 + 3 * new_header["nmmat"] 

    +

    923 ) 

    +

    924 # narbs header data 

    +

    925 if ArrayType.part_ids in self.d3plot.arrays: 

    +

    926 new_header["narbs"] += 16 

    +

    927 else: 

    +

    928 new_header["narbs"] += 10 

    +

    929 

    +

    930 # NGLBV - number of global variables 

    +

    931 n_rigid_wall_vars = 0 

    +

    932 n_rigid_walls = 0 

    +

    933 if ArrayType.rigid_wall_force in self.d3plot.arrays: 

    +

    934 n_rigid_wall_vars = 1 

    +

    935 array = self.d3plot.arrays[ArrayType.rigid_wall_force] 

    +

    936 if array.ndim != 2: 

    +

    937 msg = "Array '{0}' was expected to have {1} dimensions ({2})." 

    +

    938 raise ValueError( 

    +

    939 msg.format( 

    +

    940 ArrayType.rigid_wall_force, 2, ",".join(["n_timesteps", "n_rigid_walls"]) 

    +

    941 ) 

    +

    942 ) 

    +

    943 n_rigid_walls = array.shape[1] 

    +

    944 if ArrayType.rigid_wall_position in self.d3plot.arrays: 

    +

    945 n_rigid_wall_vars = 4 

    +

    946 array = self.d3plot.arrays[ArrayType.rigid_wall_position] 

    +

    947 if array.ndim != 3: 

    +

    948 msg = "Array '{0}' was expected to have {1} dimensions ({2})." 

    +

    949 raise ValueError( 

    +

    950 msg.format( 

    +

    951 ArrayType.rigid_wall_position, 

    +

    952 3, 

    +

    953 ",".join(["n_timesteps", "n_rigid_walls", "x_y_z"]), 

    +

    954 ) 

    +

    955 ) 

    +

    956 n_rigid_walls = array.shape[1] 

    +

    957 

    +

    958 new_header["n_rigid_walls"] = n_rigid_walls 

    +

    959 new_header["n_rigid_wall_vars"] = n_rigid_wall_vars 

    +

    960 n_global_variables = 0 

    +

    961 if ArrayType.global_kinetic_energy in self.d3plot.arrays: 

    +

    962 n_global_variables = 1 

    +

    963 if ArrayType.global_internal_energy in self.d3plot.arrays: 

    +

    964 n_global_variables = 2 

    +

    965 if ArrayType.global_total_energy in self.d3plot.arrays: 

    +

    966 n_global_variables = 3 

    +

    967 if ArrayType.global_velocity in self.d3plot.arrays: 

    +

    968 n_global_variables = 6 

    +

    969 if ArrayType.part_internal_energy in self.d3plot.arrays: 

    +

    970 n_global_variables = 6 + 1 * new_header["nmmat"] 

    +

    971 if ArrayType.part_kinetic_energy in self.d3plot.arrays: 

    +

    972 n_global_variables = 6 + 2 * new_header["nmmat"] 

    +

    973 if ArrayType.part_velocity in self.d3plot.arrays: 

    +

    974 n_global_variables = 6 + 5 * new_header["nmmat"] 

    +

    975 if ArrayType.part_mass in self.d3plot.arrays: 

    +

    976 n_global_variables = 6 + 6 * new_header["nmmat"] 

    +

    977 if ArrayType.part_hourglass_energy in self.d3plot.arrays: 

    +

    978 n_global_variables = 6 + 7 * new_header["nmmat"] 

    +

    979 if n_rigid_wall_vars * n_rigid_walls != 0: 

    +

    980 n_global_variables = 6 + 7 * new_header["nmmat"] + n_rigid_wall_vars * n_rigid_walls 

    +

    981 new_header["nglbv"] = n_global_variables 

    +

    982 

    +

    983 # NUMFLUID - total number of ALE fluid groups 

    +

    984 new_header["numfluid"] = 0 

    +

    985 

    +

    986 # INN - Invariant node numbering fore shell and solid elements 

    +

    987 if self.d3plot.header.has_invariant_numbering: 

    +

    988 if "inn" in self.d3plot.header.raw_header and self.d3plot.header.raw_header["inn"] != 0: 

    +

    989 new_header["inn"] = self.d3plot.header.raw_header["inn"] 

    +

    990 else: 

    +

    991 new_header["inn"] = int(self.d3plot.header.has_invariant_numbering) 

    +

    992 else: 

    +

    993 new_header["inn"] = 0 

    +

    994 

    +

    995 # NPEFG 

    +

    996 airbag_arrays = [ 

    +

    997 ArrayType.airbags_first_particle_id, 

    +

    998 ArrayType.airbags_n_particles, 

    +

    999 ArrayType.airbags_ids, 

    +

    1000 ArrayType.airbags_n_gas_mixtures, 

    +

    1001 ArrayType.airbags_n_chambers, 

    +

    1002 ArrayType.airbag_n_active_particles, 

    +

    1003 ArrayType.airbag_bag_volume, 

    +

    1004 ArrayType.airbag_particle_gas_id, 

    +

    1005 ArrayType.airbag_particle_chamber_id, 

    +

    1006 ArrayType.airbag_particle_leakage, 

    +

    1007 ArrayType.airbag_particle_mass, 

    +

    1008 ArrayType.airbag_particle_radius, 

    +

    1009 ArrayType.airbag_particle_spin_energy, 

    +

    1010 ArrayType.airbag_particle_translation_energy, 

    +

    1011 ArrayType.airbag_particle_nearest_segment_distance, 

    +

    1012 ArrayType.airbag_particle_position, 

    +

    1013 ArrayType.airbag_particle_velocity, 

    +

    1014 ] 

    +

    1015 subver = 3 if any(name in self.d3plot.arrays for name in airbag_arrays) else 0 

    +

    1016 

    +

    1017 # subver overwrite 

    +

    1018 if self.d3plot.header.n_airbags: 

    +

    1019 # pylint: disable = protected-access 

    +

    1020 subver = self.d3plot._airbag_info.subver 

    +

    1021 

    +

    1022 n_partgas = ( 

    +

    1023 len(self.d3plot.arrays[ArrayType.airbags_ids]) 

    +

    1024 if ArrayType.airbags_ids in self.d3plot.arrays 

    +

    1025 else 0 

    +

    1026 ) 

    +

    1027 

    +

    1028 new_header["npefg"] = 1000 * subver + n_partgas 

    +

    1029 

    +

    1030 # NEL48 - extra nodes for 8 node shell elements 

    +

    1031 required_arrays = [ 

    +

    1032 ArrayType.element_shell_node8_element_index, 

    +

    1033 ArrayType.element_shell_node8_extra_node_indexes, 

    +

    1034 ] 

    +

    1035 _check_array_occurrence( 

    +

    1036 self.d3plot, 

    +

    1037 array_names=required_arrays, 

    +

    1038 required_array_names=required_arrays, 

    +

    1039 ) 

    +

    1040 new_header["nel48"] = ( 

    +

    1041 len(self.d3plot.arrays[ArrayType.element_shell_node8_element_index]) 

    +

    1042 if ArrayType.element_shell_node8_element_index in self.d3plot.arrays 

    +

    1043 else 0 

    +

    1044 ) 

    +

    1045 

    +

    1046 # NEL20 - 20 nodes solid elements 

    +

    1047 required_arrays = [ 

    +

    1048 ArrayType.element_solid_node20_element_index, 

    +

    1049 ArrayType.element_solid_node20_extra_node_indexes, 

    +

    1050 ] 

    +

    1051 _check_array_occurrence( 

    +

    1052 self.d3plot, 

    +

    1053 array_names=required_arrays, 

    +

    1054 required_array_names=required_arrays, 

    +

    1055 ) 

    +

    1056 if ArrayType.element_solid_node20_element_index in self.d3plot.arrays: 

    +

    1057 new_header["nel20"] = len( 

    +

    1058 self.d3plot.arrays[ArrayType.element_solid_node20_element_index] 

    +

    1059 ) 

    +

    1060 else: 

    +

    1061 new_header["nel20"] = 0 

    +

    1062 

    +

    1063 # NT3D - thermal solid data 

    +

    1064 if ArrayType.element_solid_thermal_data in self.d3plot.arrays: 

    +

    1065 new_header["nt3d"] = len(self.d3plot.arrays[ArrayType.element_solid_thermal_data]) 

    +

    1066 else: 

    +

    1067 new_header["nt3d"] = 0 

    +

    1068 

    +

    1069 # NEL27 - 27 node solid elements 

    +

    1070 required_arrays = [ 

    +

    1071 ArrayType.element_solid_node27_element_index, 

    +

    1072 ArrayType.element_solid_node27_extra_node_indexes, 

    +

    1073 ] 

    +

    1074 _check_array_occurrence( 

    +

    1075 self.d3plot, 

    +

    1076 array_names=required_arrays, 

    +

    1077 required_array_names=required_arrays, 

    +

    1078 ) 

    +

    1079 if ArrayType.element_solid_node27_element_index in self.d3plot.arrays: 

    +

    1080 new_header["nel27"] = len( 

    +

    1081 self.d3plot.arrays[ArrayType.element_solid_node27_element_index] 

    +

    1082 ) 

    +

    1083 else: 

    +

    1084 new_header["nel27"] = 0 

    +

    1085 

    +

    1086 # EXTRA - extra header variables 

    +

    1087 # set only if any value is non-zero 

    +

    1088 extra_hdr_variables = ["nel20", "nt3d", "nel27", "neipb"] 

    +

    1089 if any(new_header[name] for name in extra_hdr_variables): 

    +

    1090 new_header["extra"] = 64 

    +

    1091 else: 

    +

    1092 new_header["extra"] = 0 

    +

    1093 

    +

    1094 # CHECKS 

    +

    1095 

    +

    1096 # unique part indexes all ok 

    +

    1097 for part_index in self.unique_beam_part_indexes: 

    +

    1098 if part_index >= new_header["nmmat"]: 

    +

    1099 msg = "{0} part index {1} is larger than number of materials {2}" 

    +

    1100 raise ValueError(msg.format("beam", part_index, new_header["nmmat"])) 

    +

    1101 for part_index in self.unique_shell_part_indexes: 

    +

    1102 if part_index >= new_header["nmmat"]: 

    +

    1103 msg = "{0} part index {1} is larger than number of materials {2}" 

    +

    1104 raise ValueError(msg.format("shell", part_index, new_header["nmmat"])) 

    +

    1105 for part_index in self.unique_solid_part_indexes: 

    +

    1106 if part_index >= new_header["nmmat"]: 

    +

    1107 msg = "{0} part index {1} is larger than number of materials {2}" 

    +

    1108 raise ValueError(msg.format("solid", part_index, new_header["nmmat"])) 

    +

    1109 for part_index in self.unique_tshell_part_indexes: 

    +

    1110 if part_index >= new_header["nmmat"]: 

    +

    1111 msg = "{0} part index {1} is larger than number of materials {2}" 

    +

    1112 raise ValueError(msg.format("tshell", part_index, new_header["nmmat"])) 

    +

    1113 

    +

    1114 # new header 

    +

    1115 self._header = new_header 

    +

    1116 

    +

    1117 # pylint: disable = too-many-return-statements 

    +

    1118 def pack(self, value: Any, size=None, dtype_hint=None) -> bytes: 

    +

    1119 """Pack a python value according to its settings 

    +

    1120 

    +

    1121 Parameters 

    +

    1122 ---------- 

    +

    1123 value: Any 

    +

    1124 integer, float or string type value 

    +

    1125 size: int 

    +

    1126 size in bytes 

    +

    1127 dtype_hint: `np.integer` or `np.floating` (default: None) 

    +

    1128 dtype hint for numpy arrays (prevens wrong casting) 

    +

    1129 

    +

    1130 Returns 

    +

    1131 ------- 

    +

    1132 bytes: bytes 

    +

    1133 value packed in bytes 

    +

    1134 

    +

    1135 Raises 

    +

    1136 ------ 

    +

    1137 RuntimeError 

    +

    1138 If the type cannot be deserialized for being unknown. 

    +

    1139 """ 

    +

    1140 

    +

    1141 assert dtype_hint in (None, np.integer, np.floating) 

    +

    1142 

    +

    1143 # INT 

    +

    1144 if isinstance(value, self._allowed_int_types): 

    +

    1145 return struct.pack(self.itype, value) 

    +

    1146 # FLOAT 

    +

    1147 if isinstance(value, self._allowed_float_types): 

    +

    1148 return struct.pack(self.ftype, value) 

    +

    1149 # BYTES 

    +

    1150 if isinstance(value, bytes): 

    +

    1151 if size and len(value) > size: 

    +

    1152 return value[:size] 

    +

    1153 return value 

    +

    1154 # BYTEARRAY 

    +

    1155 if isinstance(value, bytearray): 

    +

    1156 if size and len(value) > size: 

    +

    1157 return bytes(value[:size]) 

    +

    1158 return bytes(value) 

    +

    1159 # STRING 

    +

    1160 if isinstance(value, str): 

    +

    1161 if size: 

    +

    1162 fmt = "{0:" + str(size) + "}" 

    +

    1163 return fmt.format(value).encode(self._str_codec) 

    +

    1164 

    +

    1165 return value.encode(self._str_codec) 

    +

    1166 # ARRAY 

    +

    1167 if isinstance(value, np.ndarray): 

    +

    1168 

    +

    1169 if (value.dtype != self.ftype and dtype_hint == np.floating) or ( 

    +

    1170 value.dtype != self.itype and dtype_hint == np.integer 

    +

    1171 ): 

    +

    1172 

    +

    1173 # we need typehint 

    +

    1174 if dtype_hint is None: 

    +

    1175 msg = "Please specify a dtype_hint (np.floating, np.integer)." 

    +

    1176 raise ValueError(msg) 

    +

    1177 

    +

    1178 # determine new dtype 

    +

    1179 new_dtype = self.itype if dtype_hint == np.integer else self.ftype 

    +

    1180 

    +

    1181 # log conversion 

    +

    1182 msg = "Converting array from %s to %s" 

    +

    1183 LOGGER.info(msg, value.dtype, new_dtype) 

    +

    1184 

    +

    1185 # warn if convert between int and float (possible bugs) 

    +

    1186 if not np.issubdtype(value.dtype, dtype_hint): 

    +

    1187 LOGGER.warning(msg, value.dtype, new_dtype) 

    +

    1188 

    +

    1189 value = value.astype(new_dtype) 

    +

    1190 

    +

    1191 return value.tobytes() 

    +

    1192 

    +

    1193 msg = "Cannot deserialize type '%s' of value '%s' for writing." 

    +

    1194 raise RuntimeError(msg, type(value), value) 

    +

    1195 

    +

    1196 def count_array_state_var( 

    +

    1197 self, array_type: str, dimension_names: List[str], has_layers: bool, n_layers: int = 0 

    +

    1198 ) -> Tuple[int, int]: 

    +

    1199 """This functions checks and updates the variable count for certain types of arrays 

    +

    1200 

    +

    1201 Parameters 

    +

    1202 ---------- 

    +

    1203 array_type: str 

    +

    1204 name of the shell layer array 

    +

    1205 dimension_names: List[str] 

    +

    1206 names of the array dimensions 

    +

    1207 has_layers: bool 

    +

    1208 if the array has integration layers 

    +

    1209 n_layers: int 

    +

    1210 number of (previous) shell layers, if unknown set to 0 

    +

    1211 

    +

    1212 Returns 

    +

    1213 ------- 

    +

    1214 n_vars: int 

    +

    1215 variable count 

    +

    1216 n_layers: int 

    +

    1217 number of layers 

    +

    1218 

    +

    1219 Raises 

    +

    1220 ------ 

    +

    1221 ValueError 

    +

    1222 If the dimensions of the array were invalid or an inconsistent 

    +

    1223 number of integration layers was detected. 

    +

    1224 """ 

    +

    1225 

    +

    1226 n_vars = 0 

    +

    1227 

    +

    1228 if array_type in self.d3plot.arrays: 

    +

    1229 array = self.d3plot.arrays[array_type] 

    +

    1230 

    +

    1231 if array.ndim != len(dimension_names): 

    +

    1232 msg = "Array '{0}' was expected to have {1} dimensions ({2})." 

    +

    1233 raise ValueError( 

    +

    1234 msg.format(array_type, len(dimension_names), ", ".join(dimension_names)) 

    +

    1235 ) 

    +

    1236 

    +

    1237 if has_layers: 

    +

    1238 if n_layers == 0: 

    +

    1239 n_layers = array.shape[2] 

    +

    1240 else: 

    +

    1241 if n_layers != array.shape[2]: 

    +

    1242 msg = ( 

    +

    1243 "Array '{0}' has '{1}' integration layers" 

    +

    1244 " but another array used '{2}'." 

    +

    1245 ) 

    +

    1246 raise ValueError(msg.format(array_type, array.shape[2], n_layers)) 

    +

    1247 

    +

    1248 # last dimension is collapsed 

    +

    1249 if array.ndim == 3: 

    +

    1250 n_vars = 1 * n_layers 

    +

    1251 else: 

    +

    1252 n_vars = array.shape[3] * n_layers 

    +

    1253 

    +

    1254 # no layers 

    +

    1255 else: 

    +

    1256 

    +

    1257 # last dimension is collapsed 

    +

    1258 if array.ndim == 2: 

    +

    1259 n_vars = 1 

    +

    1260 else: 

    +

    1261 n_vars = array.shape[2] 

    +

    1262 

    +

    1263 return n_vars, n_layers 

    +

    1264 

    +

    1265 

    +

    1266@dataclass 

    +

    1267class MemoryInfo: 

    +

    1268 """MemoryInfo contains info about memory regions in files""" 

    +

    1269 

    +

    1270 start: int = 0 

    +

    1271 length: int = 0 

    +

    1272 filepath: str = "" 

    +

    1273 n_states: int = 0 

    +

    1274 filesize: int = 0 

    +

    1275 use_mmap: bool = False 

    +

    1276 

    +

    1277 

    +

    1278class FemzipInfo: 

    +

    1279 """FemzipInfo contains information and wrappers for the femzip api""" 

    +

    1280 

    +

    1281 api: FemzipAPI 

    +

    1282 n_states: int = 0 

    +

    1283 buffer_info: FemzipBufferInfo 

    +

    1284 use_femzip: bool = False 

    +

    1285 

    +

    1286 def __init__(self, filepath: str = ""): 

    +

    1287 self.api = FemzipAPI() 

    +

    1288 self.buffer_info = FemzipBufferInfo() 

    +

    1289 

    +

    1290 if filepath: 

    +

    1291 tmp_header = D3plotHeader().load_file(filepath) 

    +

    1292 self.use_femzip = tmp_header.has_femzip_indicator 

    +

    1293 

    +

    1294 if self.use_femzip: 

    +

    1295 # there is a lot to go wrong 

    +

    1296 try: 

    +

    1297 self.buffer_info = self.api.get_buffer_info(filepath) 

    +

    1298 # loading femzip api failed 

    +

    1299 except Exception as err: 

    +

    1300 raise RuntimeError(f"Failed to use Femzip: {err}") from err 

    +

    1301 

    +

    1302 

    +

    1303class MaterialSectionInfo: 

    +

    1304 """MaterialSectionInfo contains vars from the material section""" 

    +

    1305 

    +

    1306 n_rigid_shells: int = 0 

    +

    1307 

    +

    1308 

    +

    1309class SphSectionInfo: 

    +

    1310 """SphSectionInfo contains vars from the sph geometry section""" 

    +

    1311 

    +

    1312 n_sph_array_length: int = 11 

    +

    1313 n_sph_vars: int = 0 

    +

    1314 has_influence_radius: bool = False 

    +

    1315 has_particle_pressure: bool = False 

    +

    1316 has_stresses: bool = False 

    +

    1317 has_plastic_strain: bool = False 

    +

    1318 has_material_density: bool = False 

    +

    1319 has_internal_energy: bool = False 

    +

    1320 has_n_affecting_neighbors: bool = False 

    +

    1321 has_strain_and_strainrate: bool = False 

    +

    1322 has_true_strains: bool = False 

    +

    1323 has_mass: bool = False 

    +

    1324 n_sph_history_vars: int = 0 

    +

    1325 

    +

    1326 

    +

    1327class AirbagInfo: 

    +

    1328 """AirbagInfo contains vars used to describe the sph geometry section""" 

    +

    1329 

    +

    1330 n_geometric_variables: int = 0 

    +

    1331 n_airbag_state_variables: int = 0 

    +

    1332 n_particle_state_variables: int = 0 

    +

    1333 n_particles: int = 0 

    +

    1334 n_airbags: int = 0 

    +

    1335 # ? 

    +

    1336 subver: int = 0 

    +

    1337 n_chambers: int = 0 

    +

    1338 

    +

    1339 def get_n_variables(self) -> int: 

    +

    1340 """Get the number of airbag variables 

    +

    1341 

    +

    1342 Returns 

    +

    1343 ------- 

    +

    1344 n_airbag_vars: int 

    +

    1345 number of airbag vars 

    +

    1346 """ 

    +

    1347 return ( 

    +

    1348 self.n_geometric_variables 

    +

    1349 + self.n_particle_state_variables 

    +

    1350 + self.n_airbag_state_variables 

    +

    1351 ) 

    +

    1352 

    +

    1353 

    +

    1354class NumberingInfo: 

    +

    1355 """NumberingInfo contains vars from the part numbering section (ids)""" 

    +

    1356 

    +

    1357 # the value(s) of ptr is initialized 

    +

    1358 # as 1 since we need to make it 

    +

    1359 # negative if part_ids are written 

    +

    1360 # to file and 0 cannot do that ... 

    +

    1361 # This is ok for self-made D3plots 

    +

    1362 # since these fields are unused anyway 

    +

    1363 ptr_node_ids: int = 1 

    +

    1364 has_material_ids: bool = False 

    +

    1365 ptr_solid_ids: int = 1 

    +

    1366 ptr_beam_ids: int = 1 

    +

    1367 ptr_shell_ids: int = 1 

    +

    1368 ptr_thick_shell_ids: int = 1 

    +

    1369 n_nodes: int = 0 

    +

    1370 n_solids: int = 0 

    +

    1371 n_beams: int = 0 

    +

    1372 n_shells: int = 0 

    +

    1373 n_thick_shells: int = 0 

    +

    1374 ptr_material_ids: int = 1 

    +

    1375 ptr_material_ids_defined_order: int = 1 

    +

    1376 ptr_material_ids_crossref: int = 1 

    +

    1377 n_parts: int = 0 

    +

    1378 n_parts2: int = 0 

    +

    1379 n_rigid_bodies: int = 0 

    +

    1380 

    +

    1381 

    +

    1382@dataclass 

    +

    1383class RigidBodyMetadata: 

    +

    1384 """RigidBodyMetadata contains vars from the rigid body metadata section. 

    +

    1385 This section comes before the individual rigid body data. 

    +

    1386 """ 

    +

    1387 

    +

    1388 internal_number: int 

    +

    1389 n_nodes: int 

    +

    1390 node_indexes: np.ndarray 

    +

    1391 n_active_nodes: int 

    +

    1392 active_node_indexes: np.ndarray 

    +

    1393 

    +

    1394 

    +

    1395class RigidBodyInfo: 

    +

    1396 """RigidBodyMetadata contains vars for the individual rigid bodies""" 

    +

    1397 

    +

    1398 rigid_body_metadata_list: Iterable[RigidBodyMetadata] 

    +

    1399 n_rigid_bodies: int = 0 

    +

    1400 

    +

    1401 def __init__( 

    +

    1402 self, rigid_body_metadata_list: Iterable[RigidBodyMetadata], n_rigid_bodies: int = 0 

    +

    1403 ): 

    +

    1404 self.rigid_body_metadata_list = rigid_body_metadata_list 

    +

    1405 self.n_rigid_bodies = n_rigid_bodies 

    +

    1406 

    +

    1407 

    +

    1408class RigidRoadInfo: 

    +

    1409 """RigidRoadInfo contains metadata for the description of rigid roads""" 

    +

    1410 

    +

    1411 n_nodes: int = 0 

    +

    1412 n_road_segments: int = 0 

    +

    1413 n_roads: int = 0 

    +

    1414 # ? 

    +

    1415 motion: int = 0 

    +

    1416 

    +

    1417 def __init__( 

    +

    1418 self, n_nodes: int = 0, n_road_segments: int = 0, n_roads: int = 0, motion: int = 0 

    +

    1419 ): 

    +

    1420 self.n_nodes = n_nodes 

    +

    1421 self.n_road_segments = n_road_segments 

    +

    1422 self.n_roads = n_roads 

    +

    1423 self.motion = motion 

    +

    1424 

    +

    1425 

    +

    1426class StateInfo: 

    +

    1427 """StateInfo holds metadata for states which is currently solely the timestep. 

    +

    1428 We all had bigger plans in life ... 

    +

    1429 """ 

    +

    1430 

    +

    1431 n_timesteps: int = 0 

    +

    1432 

    +

    1433 def __init__(self, n_timesteps: int = 0): 

    +

    1434 self.n_timesteps = n_timesteps 

    +

    1435 

    +

    1436 

    +

    1437class D3plot: 

    +

    1438 """Class used to read LS-Dyna d3plots""" 

    +

    1439 

    +

    1440 _header: D3plotHeader 

    +

    1441 _femzip_info: FemzipInfo 

    +

    1442 _material_section_info: MaterialSectionInfo 

    +

    1443 _sph_info: SphSectionInfo 

    +

    1444 _airbag_info: AirbagInfo 

    +

    1445 _numbering_info: NumberingInfo 

    +

    1446 _rigid_body_info: RigidBodyInfo 

    +

    1447 _rigid_road_info: RigidRoadInfo 

    +

    1448 _buffer: Union[BinaryBuffer, None] = None 

    +

    1449 

    +

    1450 # we all love secret settings 

    +

    1451 use_advanced_femzip_api: bool = False 

    +

    1452 

    +

    1453 # This amount of args is needed 

    +

    1454 # pylint: disable = too-many-arguments, too-many-statements, unused-argument 

    +

    1455 def __init__( 

    +

    1456 self, 

    +

    1457 filepath: str = None, 

    +

    1458 use_femzip: Union[bool, None] = None, 

    +

    1459 n_files_to_load_at_once: Union[int, None] = None, 

    +

    1460 state_array_filter: Union[List[str], None] = None, 

    +

    1461 state_filter: Union[None, Set[int]] = None, 

    +

    1462 buffered_reading: bool = False, 

    +

    1463 ): 

    +

    1464 """Constructor for a D3plot 

    +

    1465 

    +

    1466 Parameters 

    +

    1467 ---------- 

    +

    1468 filepath: str 

    +

    1469 path to a d3plot file 

    +

    1470 use_femzip: bool 

    +

    1471 Not used anymore. 

    +

    1472 n_files_to_load_at_once: int 

    +

    1473 *DEPRECATED* not used anymore, use `buffered_reading` 

    +

    1474 state_array_filter: Union[List[str], None] 

    +

    1475 names of arrays which will be the only ones loaded from state data 

    +

    1476 state_filter: Union[None, Set[int]] 

    +

    1477 which states to load. Negative indexes count backwards. 

    +

    1478 buffered_reading: bool 

    +

    1479 whether to pull only a single state into memory during reading 

    +

    1480 

    +

    1481 Examples 

    +

    1482 -------- 

    +

    1483 >>> from lasso.dyna import D3plot, ArrayType 

    +

    1484 >>> # open and read everything 

    +

    1485 >>> d3plot = D3plot("path/to/d3plot") 

    +

    1486 

    +

    1487 >>> # only read node displacement 

    +

    1488 >>> d3plot = D3plot("path/to/d3plot", state_array_filter=["node_displacement"]) 

    +

    1489 >>> # or with nicer syntax 

    +

    1490 >>> d3plot = D3plot("path/to/d3plot", state_array_filter=[ArrayType.node_displacement]) 

    +

    1491 

    +

    1492 >>> # only load first and last state 

    +

    1493 >>> d3plot = D3plot("path/to/d3plot", state_filter={0, -1}) 

    +

    1494 

    +

    1495 >>> # our computer lacks RAM so lets extract a specific array 

    +

    1496 >>> # but only keep one state at a time in memory 

    +

    1497 >>> d3plot = D3plot("path/to/d3plot", 

    +

    1498 >>> state_array_filter=[ArrayType.node_displacement], 

    +

    1499 >>> buffered_reading=True) 

    +

    1500 

    +

    1501 Notes 

    +

    1502 ----- 

    +

    1503 If dyna wrote multiple files for several states, 

    +

    1504 only give the path to the first file. 

    +

    1505 """ 

    +

    1506 super().__init__() 

    +

    1507 

    +

    1508 LOGGER.debug("-------- D 3 P L O T --------") 

    +

    1509 

    +

    1510 self._arrays = {} 

    +

    1511 self._header = D3plotHeader() 

    +

    1512 self._femzip_info = FemzipInfo(filepath=filepath if filepath is not None else "") 

    +

    1513 self._material_section_info = MaterialSectionInfo() 

    +

    1514 self._sph_info = SphSectionInfo() 

    +

    1515 self._airbag_info = AirbagInfo() 

    +

    1516 self._numbering_info = NumberingInfo() 

    +

    1517 self._rigid_body_info = RigidBodyInfo(rigid_body_metadata_list=tuple()) 

    +

    1518 self._rigid_road_info = RigidRoadInfo() 

    +

    1519 self._state_info = StateInfo() 

    +

    1520 

    +

    1521 # which states to load 

    +

    1522 self.state_filter = state_filter 

    +

    1523 

    +

    1524 # how many files to load into memory at once 

    +

    1525 if n_files_to_load_at_once is not None: 

    +

    1526 warn_msg = "D3plot argument '{0}' is deprecated. Please use '{1}=True'." 

    +

    1527 raise DeprecationWarning(warn_msg.format("n_files_to_load_at_once", "buffered_reading")) 

    +

    1528 self.buffered_reading = buffered_reading or (state_filter is not None and any(state_filter)) 

    +

    1529 

    +

    1530 # arrays to filter out 

    +

    1531 self.state_array_filter = state_array_filter 

    +

    1532 

    +

    1533 # load memory accordingly 

    +

    1534 # no femzip 

    +

    1535 if filepath and not self._femzip_info.use_femzip: 

    +

    1536 self._buffer = BinaryBuffer(filepath) 

    +

    1537 self.bb_states = None 

    +

    1538 # femzip 

    +

    1539 elif filepath and self._femzip_info.use_femzip: 

    +

    1540 self._buffer = self._read_femzip_geometry(filepath) 

    +

    1541 # we need to reload the header 

    +

    1542 self._header = D3plotHeader().load_file(self._buffer) 

    +

    1543 self.bb_states = None 

    +

    1544 # no data to load basically 

    +

    1545 else: 

    +

    1546 self._buffer = None 

    +

    1547 self.bb_states = None 

    +

    1548 

    +

    1549 self.geometry_section_size = 0 

    +

    1550 

    +

    1551 # read header 

    +

    1552 self._read_header() 

    +

    1553 

    +

    1554 # read geometry 

    +

    1555 self._parse_geometry() 

    +

    1556 

    +

    1557 # read state data 

    +

    1558 

    +

    1559 # try advanced femzip api 

    +

    1560 if ( 

    +

    1561 filepath 

    +

    1562 and self._femzip_info.use_femzip 

    +

    1563 and self.use_advanced_femzip_api 

    +

    1564 and self._femzip_info.api.has_femunziplib_license() 

    +

    1565 ): 

    +

    1566 

    +

    1567 LOGGER.debug("Advanced FEMZIP-API used") 

    +

    1568 try: 

    +

    1569 self._read_states_femzip_advanced( 

    +

    1570 filepath, 

    +

    1571 ) 

    +

    1572 except Exception: 

    +

    1573 trace = traceback.format_exc() 

    +

    1574 warn_msg = ( 

    +

    1575 "Error when using advanced Femzip API, " 

    +

    1576 "falling back to normal but slower Femzip API.\n%s" 

    +

    1577 ) 

    +

    1578 LOGGER.warning(warn_msg, trace) 

    +

    1579 

    +

    1580 # since we had a crash, we need to reload the file 

    +

    1581 # to be sure we don't crash again 

    +

    1582 self._femzip_info.api.close_current_file() 

    +

    1583 self._femzip_info.api.read_geometry(filepath, self._femzip_info.buffer_info, False) 

    +

    1584 # try normal femzip api 

    +

    1585 self._read_states(filepath) 

    +

    1586 finally: 

    +

    1587 self._femzip_info.api.close_current_file() 

    +

    1588 

    +

    1589 # normal state reading (femzip and non-femzip) 

    +

    1590 elif filepath: 

    +

    1591 self._read_states(filepath) 

    +

    1592 if self._femzip_info.use_femzip: 

    +

    1593 self._femzip_info.api.close_current_file() 

    +

    1594 else: 

    +

    1595 # no filepath = nothing to do 

    +

    1596 pass 

    +

    1597 

    +

    1598 def _read_femzip_geometry(self, filepath: str) -> BinaryBuffer: 

    +

    1599 """Read the geometry from femzip 

    +

    1600 

    +

    1601 Parameters 

    +

    1602 ---------- 

    +

    1603 filepath: str 

    +

    1604 path to the femzpi file 

    +

    1605 

    +

    1606 Returns 

    +

    1607 ------- 

    +

    1608 bb: BinaryBuffer 

    +

    1609 memory of the geometry section 

    +

    1610 """ 

    +

    1611 

    +

    1612 buffer_geo = self._femzip_info.api.read_geometry( 

    +

    1613 filepath, buffer_info=self._femzip_info.buffer_info, close_file=False 

    +

    1614 ) 

    +

    1615 

    +

    1616 # save 

    +

    1617 buffer = BinaryBuffer() 

    +

    1618 buffer.filepath_ = filepath 

    +

    1619 buffer.memoryview = buffer_geo.cast("B") 

    +

    1620 

    +

    1621 return buffer 

    +

    1622 

    +

    1623 @property 

    +

    1624 def n_timesteps(self) -> int: 

    +

    1625 """Number of timesteps loaded""" 

    +

    1626 return self._state_info.n_timesteps 

    +

    1627 

    +

    1628 @property 

    +

    1629 def arrays(self) -> dict: 

    +

    1630 """Dictionary holding all d3plot arrays 

    +

    1631 

    +

    1632 Notes 

    +

    1633 ----- 

    +

    1634 The corresponding keys of the dictionary can 

    +

    1635 also be found in `lasso.dyna.ArrayTypes`, which 

    +

    1636 helps with IDE integration and code safety. 

    +

    1637 

    +

    1638 Examples 

    +

    1639 -------- 

    +

    1640 >>> d3plot = D3plot("some/path/to/d3plot") 

    +

    1641 >>> d3plot.arrays.keys() 

    +

    1642 dict_keys(['irbtyp', 'node_coordinates', ...]) 

    +

    1643 >>> # The following is good coding practice 

    +

    1644 >>> import lasso.dyna.ArrayTypes.ArrayTypes as atypes 

    +

    1645 >>> d3plot.arrays[atypes.node_displacmeent].shape 

    +

    1646 """ 

    +

    1647 return self._arrays 

    +

    1648 

    +

    1649 @arrays.setter 

    +

    1650 def arrays(self, array_dict: dict): 

    +

    1651 assert isinstance(array_dict, dict) 

    +

    1652 self._arrays = array_dict 

    +

    1653 

    +

    1654 @property 

    +

    1655 def header(self) -> D3plotHeader: 

    +

    1656 """Instance holding all d3plot header information 

    +

    1657 

    +

    1658 Returns 

    +

    1659 ------- 

    +

    1660 header: D3plotHeader 

    +

    1661 header of the d3plot 

    +

    1662 

    +

    1663 Notes 

    +

    1664 ----- 

    +

    1665 The header contains a lot of information such as number 

    +

    1666 of elements, etc. 

    +

    1667 

    +

    1668 Examples 

    +

    1669 -------- 

    +

    1670 >>> d3plot = D3plot("some/path/to/d3plot") 

    +

    1671 >>> # number of shells 

    +

    1672 >>> d3plot.header.n_shells 

    +

    1673 85624 

    +

    1674 """ 

    +

    1675 return self._header 

    +

    1676 

    +

    1677 @staticmethod 

    +

    1678 def _is_end_of_file_marker( 

    +

    1679 buffer: BinaryBuffer, position: int, ftype: Union[np.float32, np.float64] 

    +

    1680 ) -> bool: 

    +

    1681 """Check for the dyna eof marker at a certain position 

    +

    1682 

    +

    1683 Parameters 

    +

    1684 ---------- 

    +

    1685 bb: BinaryBuffer 

    +

    1686 buffer holding memory 

    +

    1687 position: int 

    +

    1688 position in the buffer 

    +

    1689 ftype: Union[np.float32, np.float64] 

    +

    1690 floating point type 

    +

    1691 

    +

    1692 Returns 

    +

    1693 ------- 

    +

    1694 is_end_marker: bool 

    +

    1695 if at the position is an end marker 

    +

    1696 

    +

    1697 Notes 

    +

    1698 ----- 

    +

    1699 The end of file marker is represented by a floating point 

    +

    1700 number with the value -999999 (single precision hex: F02374C9, 

    +

    1701 double precision hex: 000000007E842EC1). 

    +

    1702 """ 

    +

    1703 

    +

    1704 if ftype not in (np.float32, np.float64): 

    +

    1705 err_msg = "Floating point type '{0}' is not a floating point type." 

    +

    1706 raise ValueError(err_msg.format(ftype)) 

    +

    1707 

    +

    1708 return buffer.read_number(position, ftype) == ftype(-999999) 

    +

    1709 

    +

    1710 def _correct_file_offset(self): 

    +

    1711 """Correct the position in the bytes 

    +

    1712 

    +

    1713 Notes 

    +

    1714 ----- 

    +

    1715 LS-Dyna writes its files zero padded at a size of 

    +

    1716 512 words in block size. There might be a lot of 

    +

    1717 unused trailing data in the rear we need to skip 

    +

    1718 in order to get to the next useful data block. 

    +

    1719 """ 

    +

    1720 

    +

    1721 if not self._buffer: 

    +

    1722 return 

    +

    1723 

    +

    1724 block_count = len(self._buffer) // (512 * self.header.wordsize) 

    +

    1725 

    +

    1726 # Warning! 

    +

    1727 # Resets the block count! 

    +

    1728 self.geometry_section_size = (block_count + 1) * 512 * self.header.wordsize 

    +

    1729 

    +

    1730 @property 

    +

    1731 def _n_parts(self) -> int: 

    +

    1732 """Get the number of parts contained in the d3plot 

    +

    1733 

    +

    1734 Returns 

    +

    1735 ------- 

    +

    1736 n_parts: int 

    +

    1737 number of total parts 

    +

    1738 """ 

    +

    1739 

    +

    1740 n_parts = ( 

    +

    1741 self.header.n_solid_materials 

    +

    1742 + self.header.n_beam_materials 

    +

    1743 + self.header.n_shell_materials 

    +

    1744 + self.header.n_thick_shell_materials 

    +

    1745 + self._numbering_info.n_rigid_bodies 

    +

    1746 ) 

    +

    1747 

    +

    1748 return n_parts 

    +

    1749 

    +

    1750 @property 

    +

    1751 def _n_rigid_walls(self) -> int: 

    +

    1752 """Get the number of rigid walls in the d3plot 

    +

    1753 

    +

    1754 Returns 

    +

    1755 ------- 

    +

    1756 n_rigid_walls: int 

    +

    1757 number of rigid walls 

    +

    1758 """ 

    +

    1759 

    +

    1760 # there have been cases that there are less than in the specs 

    +

    1761 # indicated global vars. That breaks this computation, thus we 

    +

    1762 # use max at the end. 

    +

    1763 previous_global_vars = 6 + 7 * self._n_parts 

    +

    1764 n_rigid_wall_vars = self.header.n_rigid_wall_vars 

    +

    1765 n_rigid_walls = (self.header.n_global_vars - previous_global_vars) // n_rigid_wall_vars 

    +

    1766 

    +

    1767 # if n_rigid_walls < 0: 

    +

    1768 # err_msg = "The computed number of rigid walls is negative ('{0}')." 

    +

    1769 # raise RuntimeError(err_msg.format(n_rigid_walls)) 

    +

    1770 

    +

    1771 return max(n_rigid_walls, 0) 

    +

    1772 

    +

    1773 # pylint: disable = unused-argument, too-many-locals 

    +

    1774 def _read_d3plot_file_generator( 

    +

    1775 self, buffered_reading: bool, state_filter: Union[None, Set[int]] 

    +

    1776 ) -> typing.Any: 

    +

    1777 """Generator function for reading bare d3plot files 

    +

    1778 

    +

    1779 Parameters 

    +

    1780 ---------- 

    +

    1781 buffered_reading: bool 

    +

    1782 whether to read one state at a time 

    +

    1783 state_filter: Union[None, Set[int]] 

    +

    1784 which states to filter out 

    +

    1785 

    +

    1786 Yields 

    +

    1787 ------ 

    +

    1788 buffer: BinaryBuffer 

    +

    1789 buffer for each file 

    +

    1790 n_states: int 

    +

    1791 number of states from second yield on 

    +

    1792 """ 

    +

    1793 

    +

    1794 # (1) STATES 

    +

    1795 # This is dangerous. The following routine requires data from 

    +

    1796 # several sections in the geometry part calling this too early crashes 

    +

    1797 bytes_per_state = self._compute_n_bytes_per_state() 

    +

    1798 file_infos = self._collect_file_infos(bytes_per_state) 

    +

    1799 

    +

    1800 # some status 

    +

    1801 n_files = len(file_infos) 

    +

    1802 n_states = sum(map(lambda file_info: file_info.n_states, file_infos)) 

    +

    1803 LOGGER.debug("n_files found: %d", n_files) 

    +

    1804 LOGGER.debug("n_states estimated: %d", n_states) 

    +

    1805 

    +

    1806 # convert negative state indexes into positive ones 

    +

    1807 if state_filter is not None: 

    +

    1808 state_filter = _negative_to_positive_state_indexes(state_filter, n_states) 

    +

    1809 

    +

    1810 # if using buffered reading, we load one state at a time 

    +

    1811 # into memory 

    +

    1812 if buffered_reading: 

    +

    1813 file_infos_tmp: List[MemoryInfo] = [] 

    +

    1814 n_previous_states = 0 

    +

    1815 for minfo in file_infos: 

    +

    1816 for i_file_state in range(minfo.n_states): 

    +

    1817 i_global_state = n_previous_states + i_file_state 

    +

    1818 

    +

    1819 # do we need to skip this one 

    +

    1820 if state_filter and i_global_state not in state_filter: 

    +

    1821 continue 

    +

    1822 

    +

    1823 file_infos_tmp.append( 

    +

    1824 MemoryInfo( 

    +

    1825 start=minfo.start + i_file_state * bytes_per_state, 

    +

    1826 length=bytes_per_state, 

    +

    1827 filepath=minfo.filepath, 

    +

    1828 n_states=1, 

    +

    1829 filesize=minfo.filesize, 

    +

    1830 use_mmap=minfo.n_states != 1, 

    +

    1831 ) 

    +

    1832 ) 

    +

    1833 

    +

    1834 n_previous_states += minfo.n_states 

    +

    1835 file_infos = file_infos_tmp 

    +

    1836 

    +

    1837 LOGGER.debug("buffers: %s", pprint.pformat([info.__dict__ for info in file_infos])) 

    +

    1838 

    +

    1839 # number of states and if buffered reading is used 

    +

    1840 n_states_selected = sum(map(lambda file_info: file_info.n_states, file_infos)) 

    +

    1841 yield n_states_selected 

    +

    1842 

    +

    1843 sub_file_infos = [file_infos] if not buffered_reading else [[info] for info in file_infos] 

    +

    1844 for sub_file_info_list in sub_file_infos: 

    +

    1845 buffer, n_states = D3plot._read_file_from_memory_info(sub_file_info_list) 

    +

    1846 yield buffer, n_states 

    +

    1847 

    +

    1848 def _read_femzip_file_generator( 

    +

    1849 self, buffered_reading: bool, state_filter: Union[None, Set[int]] 

    +

    1850 ) -> typing.Any: 

    +

    1851 """Generator function for reading femzipped d3plot files 

    +

    1852 

    +

    1853 Parameters 

    +

    1854 ---------- 

    +

    1855 buffered_reading: bool 

    +

    1856 load state by state 

    +

    1857 state_filter: Union[None, Set[int]] 

    +

    1858 which states to filter out 

    +

    1859 

    +

    1860 Yields 

    +

    1861 ------ 

    +

    1862 buffer: BinaryBuffer 

    +

    1863 binary buffer of a file 

    +

    1864 n_states: int 

    +

    1865 from second yield on, number of states for buffers 

    +

    1866 """ 

    +

    1867 

    +

    1868 femzip_api = self._femzip_info.api 

    +

    1869 

    +

    1870 # (1) STATES 

    +

    1871 # number of states and if buffered reading is used 

    +

    1872 buffer_info = self._femzip_info.buffer_info 

    +

    1873 n_timesteps: int = buffer_info.n_timesteps 

    +

    1874 

    +

    1875 # convert negative filter indexes 

    +

    1876 state_filter_parsed: Set[int] = set() 

    +

    1877 if state_filter is not None: 

    +

    1878 state_filter_parsed = _negative_to_positive_state_indexes(state_filter, n_timesteps) 

    +

    1879 n_states_to_load = len(state_filter) 

    +

    1880 else: 

    +

    1881 n_states_to_load = n_timesteps 

    +

    1882 state_filter_parsed = set(range(n_timesteps)) 

    +

    1883 

    +

    1884 yield n_states_to_load 

    +

    1885 

    +

    1886 n_files_to_load_at_once = n_timesteps if not buffered_reading else 1 

    +

    1887 # pylint: disable = invalid-name 

    +

    1888 BufferStateType = ctypes.c_float * (buffer_info.size_state * n_files_to_load_at_once) 

    +

    1889 buffer_state = BufferStateType() 

    +

    1890 

    +

    1891 buffer = BinaryBuffer() 

    +

    1892 buffer.memoryview = memoryview(buffer_state) 

    +

    1893 

    +

    1894 # do the thing 

    +

    1895 i_timesteps_read = 0 

    +

    1896 max_timestep = max(state_filter_parsed) if state_filter_parsed else 0 

    +

    1897 for i_timestep in range(n_timesteps): 

    +

    1898 

    +

    1899 # buffer offset 

    +

    1900 buffer_current_state = buffer.memoryview[i_timesteps_read * buffer_info.size_state :] 

    +

    1901 

    +

    1902 # read state 

    +

    1903 femzip_api.read_single_state(i_timestep, buffer_info, state_buffer=buffer_current_state) 

    +

    1904 

    +

    1905 if i_timestep in state_filter_parsed: 

    +

    1906 i_timesteps_read += 1 

    +

    1907 

    +

    1908 # Note: 

    +

    1909 # the buffer is re-used here! This saves memory BUT 

    +

    1910 # if memory is not copied we overwrite the same again and again 

    +

    1911 # This is ok for buffered reading thus indirectly safe 

    +

    1912 # since elsewhere the arrays get copied but keep it in mind! 

    +

    1913 if i_timesteps_read != 0 and i_timesteps_read % n_files_to_load_at_once == 0: 

    +

    1914 yield buffer, i_timesteps_read 

    +

    1915 i_timesteps_read = 0 

    +

    1916 

    +

    1917 # stop in case we have everything we needed 

    +

    1918 if i_timestep >= max_timestep: 

    +

    1919 if i_timesteps_read != 0: 

    +

    1920 yield buffer, i_timesteps_read 

    +

    1921 break 

    +

    1922 

    +

    1923 # do the thing 

    +

    1924 femzip_api.close_current_file() 

    +

    1925 

    +

    1926 def _read_states_femzip_advanced(self, filepath: str) -> None: 

    +

    1927 """Read d3plot variables with advanced femzip API 

    +

    1928 

    +

    1929 Parameters 

    +

    1930 ---------- 

    +

    1931 filepath: str 

    +

    1932 path to the femzipped d3plot 

    +

    1933 """ 

    +

    1934 

    +

    1935 # convert filter 

    +

    1936 d3plot_array_filter = set(self.state_array_filter) if self.state_array_filter else None 

    +

    1937 

    +

    1938 # what vars are inside? 

    +

    1939 api = self._femzip_info.api 

    +

    1940 file_metadata = api.get_file_metadata(filepath) 

    +

    1941 

    +

    1942 if file_metadata.number_of_timesteps <= 0: 

    +

    1943 return 

    +

    1944 

    +

    1945 # filter femzip vars according to requested d3plot vars 

    +

    1946 file_metadata_filtered = filter_femzip_variables( 

    +

    1947 file_metadata, 

    +

    1948 d3plot_array_filter, 

    +

    1949 ) 

    +

    1950 

    +

    1951 # read femzip arrays 

    +

    1952 result_arrays = api.read_variables( 

    +

    1953 file_metadata=file_metadata_filtered, 

    +

    1954 n_parts=self.header.n_parts, 

    +

    1955 n_rigid_walls=self._n_rigid_walls, 

    +

    1956 n_rigid_wall_vars=self.header.n_rigid_wall_vars, 

    +

    1957 n_airbag_particles=self._airbag_info.n_particles, 

    +

    1958 n_airbags=self._airbag_info.n_airbags, 

    +

    1959 state_filter=self.state_filter, 

    +

    1960 ) 

    +

    1961 

    +

    1962 # special case arrays which need extra parsing 

    +

    1963 keys_to_remove = [] 

    +

    1964 for (fz_index, fz_name, fz_cat), array in result_arrays.items(): 

    +

    1965 

    +

    1966 # global vars 

    +

    1967 if fz_cat == FemzipVariableCategory.GLOBAL: 

    +

    1968 keys_to_remove.append((fz_index, fz_name, fz_cat)) 

    +

    1969 self._read_states_globals( 

    +

    1970 state_data=array, 

    +

    1971 var_index=0, 

    +

    1972 array_dict=self.arrays, 

    +

    1973 ) 

    +

    1974 

    +

    1975 # parts and rigid walls 

    +

    1976 elif fz_cat == FemzipVariableCategory.PART: 

    +

    1977 keys_to_remove.append((fz_index, fz_name, fz_cat)) 

    +

    1978 

    +

    1979 var_index = self._read_states_parts( 

    +

    1980 state_data=array, var_index=0, array_dict=self.arrays 

    +

    1981 ) 

    +

    1982 

    +

    1983 self._read_states_rigid_walls( 

    +

    1984 state_data=array, var_index=var_index, array_dict=self.arrays 

    +

    1985 ) 

    +

    1986 

    +

    1987 for key in keys_to_remove: 

    +

    1988 del result_arrays[key] 

    +

    1989 

    +

    1990 # transfer arrays 

    +

    1991 mapper = FemzipMapper() 

    +

    1992 mapper.map(result_arrays) 

    +

    1993 

    +

    1994 # save arrays 

    +

    1995 for plt_name, arr in mapper.d3plot_arrays.items(): 

    +

    1996 

    +

    1997 # femzip sometimes stores strain in solid history vars 

    +

    1998 # but also sometimes separately 

    +

    1999 if ( 

    +

    2000 plt_name == ArrayType.element_solid_history_variables 

    +

    2001 and self.header.has_element_strain 

    +

    2002 and ArrayType.element_solid_strain not in mapper.d3plot_arrays 

    +

    2003 ): 

    +

    2004 self.arrays[ArrayType.element_solid_strain] = arr[:, :, :, :6] 

    +

    2005 tmp_array = arr[:, :, :, 6:] 

    +

    2006 if all(tmp_array.shape): 

    +

    2007 self.arrays[plt_name] = tmp_array 

    +

    2008 else: 

    +

    2009 self.arrays[plt_name] = arr 

    +

    2010 

    +

    2011 # ELEMENT DELETION 

    +

    2012 # 

    +

    2013 # somehow element deletion info is extra ... 

    +

    2014 # buffer_info 

    +

    2015 buffer_info = self._femzip_info.buffer_info 

    +

    2016 deletion_array = api.read_state_deletion_info( 

    +

    2017 buffer_info=buffer_info, state_filter=self.state_filter 

    +

    2018 ) 

    +

    2019 self._read_states_is_alive(state_data=deletion_array, var_index=0, array_dict=self.arrays) 

    +

    2020 

    +

    2021 # TIMESTEPS 

    +

    2022 timestep_array = np.array( 

    +

    2023 [buffer_info.timesteps[i_timestep] for i_timestep in range(buffer_info.n_timesteps)], 

    +

    2024 dtype=self.header.ftype, 

    +

    2025 ) 

    +

    2026 self.arrays[ArrayType.global_timesteps] = timestep_array 

    +

    2027 

    +

    2028 def _read_header(self): 

    +

    2029 """Read the d3plot header""" 

    +

    2030 

    +

    2031 LOGGER.debug("-------- H E A D E R --------") 

    +

    2032 

    +

    2033 if self._buffer: 

    +

    2034 self._header.load_file(self._buffer) 

    +

    2035 

    +

    2036 self.geometry_section_size = self._header.n_header_bytes 

    +

    2037 

    +

    2038 def _parse_geometry(self): 

    +

    2039 """Read the d3plot geometry""" 

    +

    2040 

    +

    2041 LOGGER.debug("------ G E O M E T R Y ------") 

    +

    2042 

    +

    2043 # read material section 

    +

    2044 self._read_material_section() 

    +

    2045 

    +

    2046 # read fluid material data 

    +

    2047 self._read_fluid_material_data() 

    +

    2048 

    +

    2049 # SPH element data flags 

    +

    2050 self._read_sph_element_data_flags() 

    +

    2051 

    +

    2052 # Particle Data 

    +

    2053 self._read_particle_data() 

    +

    2054 

    +

    2055 # Geometry Data 

    +

    2056 self._read_geometry_data() 

    +

    2057 

    +

    2058 # User Material, Node, Blabla IDs 

    +

    2059 self._read_user_ids() 

    +

    2060 

    +

    2061 # Rigid Body Description 

    +

    2062 self._read_rigid_body_description() 

    +

    2063 

    +

    2064 # Adapted Element Parent List 

    +

    2065 # manual says not implemented 

    +

    2066 

    +

    2067 # Smooth Particle Hydrodynamcis Node and Material list 

    +

    2068 self._read_sph_node_and_material_list() 

    +

    2069 

    +

    2070 # Particle Geometry Data 

    +

    2071 self._read_particle_geometry_data() 

    +

    2072 

    +

    2073 # Rigid Road Surface Data 

    +

    2074 self._read_rigid_road_surface() 

    +

    2075 

    +

    2076 # Connectivity for weirdo elements 

    +

    2077 # 10 Node Tetra 

    +

    2078 # 8 Node Shell 

    +

    2079 # 20 Node Solid 

    +

    2080 # 27 Node Solid 

    +

    2081 self._read_extra_node_connectivity() 

    +

    2082 

    +

    2083 # Header Part & Contact Interface Titles 

    +

    2084 # this is a class method since it is also needed elsewhere 

    +

    2085 self.geometry_section_size = self._read_header_part_contact_interface_titles( 

    +

    2086 self.header, 

    +

    2087 self._buffer, 

    +

    2088 self.geometry_section_size, # type: ignore 

    +

    2089 self.arrays, 

    +

    2090 ) 

    +

    2091 

    +

    2092 # Extra Data Types (for multi solver output) 

    +

    2093 # ... not supported 

    +

    2094 

    +

    2095 def _read_material_section(self): 

    +

    2096 """This function reads the material type section""" 

    +

    2097 

    +

    2098 if not self._buffer: 

    +

    2099 return 

    +

    2100 

    +

    2101 if not self.header.has_material_type_section: 

    +

    2102 return 

    +

    2103 

    +

    2104 LOGGER.debug("_read_material_section start at byte %d", self.geometry_section_size) 

    +

    2105 

    +

    2106 position = self.geometry_section_size 

    +

    2107 

    +

    2108 # failsafe 

    +

    2109 original_position = self.geometry_section_size 

    +

    2110 blocksize = (2 + self.header.n_parts) * self.header.wordsize 

    +

    2111 

    +

    2112 try: 

    +

    2113 

    +

    2114 # Material Type Data 

    +

    2115 # 

    +

    2116 # "This data is required because those shell elements 

    +

    2117 # that are in a rigid body have no element data output 

    +

    2118 # in the state data section." 

    +

    2119 # 

    +

    2120 # "The normal length of the shell element state data is: 

    +

    2121 # NEL4 * NV2D, when the MATTYP flag is set the length is: 

    +

    2122 # (NEL4 – NUMRBE) * NV2D. When reading the shell element data, 

    +

    2123 # the material number must be checked against IRBRTYP list to 

    +

    2124 # find the element’s material type. If the type = 20, then 

    +

    2125 # all the values for the element to zero." (Manual 03.2016) 

    +

    2126 

    +

    2127 self._material_section_info.n_rigid_shells = int( 

    +

    2128 self._buffer.read_number(position, self._header.itype) 

    +

    2129 ) # type: ignore 

    +

    2130 position += self.header.wordsize 

    +

    2131 

    +

    2132 test_nummat = self._buffer.read_number(position, self._header.itype) 

    +

    2133 position += self.header.wordsize 

    +

    2134 

    +

    2135 if test_nummat != self.header.n_parts: 

    +

    2136 raise RuntimeError( 

    +

    2137 "nmmat (header) != nmmat (material type data): " 

    +

    2138 f"{self.header.n_parts} != {test_nummat}", 

    +

    2139 ) 

    +

    2140 

    +

    2141 self.arrays[ArrayType.part_material_type] = self._buffer.read_ndarray( 

    +

    2142 position, self.header.n_parts * self.header.wordsize, 1, self.header.itype 

    +

    2143 ) 

    +

    2144 position += self.header.n_parts * self.header.wordsize 

    +

    2145 

    +

    2146 except Exception: 

    +

    2147 # print info 

    +

    2148 trb_msg = traceback.format_exc() 

    +

    2149 LOGGER.warning("A failure in %s was caught:\n%s", "_read_material_section", trb_msg) 

    +

    2150 

    +

    2151 # fix position 

    +

    2152 position = original_position + blocksize 

    +

    2153 

    +

    2154 self.geometry_section_size = position 

    +

    2155 LOGGER.debug("_read_material_section end at byte %d", self.geometry_section_size) 

    +

    2156 

    +

    2157 def _read_fluid_material_data(self): 

    +

    2158 """Read the fluid material data""" 

    +

    2159 

    +

    2160 if not self._buffer: 

    +

    2161 return 

    +

    2162 

    +

    2163 if self.header.n_ale_materials == 0: 

    +

    2164 return 

    +

    2165 

    +

    2166 LOGGER.debug("_read_fluid_material_data start at byte %d", self.geometry_section_size) 

    +

    2167 

    +

    2168 position = self.geometry_section_size 

    +

    2169 

    +

    2170 # safety 

    +

    2171 original_position = position 

    +

    2172 blocksize = self.header.n_ale_materials * self.header.wordsize 

    +

    2173 

    +

    2174 try: 

    +

    2175 # Fluid Material Data 

    +

    2176 array_length = self.header.n_ale_materials * self.header.wordsize 

    +

    2177 self.arrays[ArrayType.ale_material_ids] = self._buffer.read_ndarray( 

    +

    2178 position, array_length, 1, self.header.itype 

    +

    2179 ) # type: ignore 

    +

    2180 position += array_length 

    +

    2181 

    +

    2182 except Exception: 

    +

    2183 

    +

    2184 # print info 

    +

    2185 trb_msg = traceback.format_exc() 

    +

    2186 msg = "A failure in %s was caught:\n%s" 

    +

    2187 LOGGER.warning(msg, "_read_fluid_material_data", trb_msg) 

    +

    2188 

    +

    2189 # fix position 

    +

    2190 position = original_position + blocksize 

    +

    2191 

    +

    2192 # remember position 

    +

    2193 self.geometry_section_size = position 

    +

    2194 LOGGER.debug("_read_fluid_material_data end at byte %d", self.geometry_section_size) 

    +

    2195 

    +

    2196 def _read_sph_element_data_flags(self): 

    +

    2197 """Read the sph element data flags""" 

    +

    2198 

    +

    2199 if not self._buffer: 

    +

    2200 return 

    +

    2201 

    +

    2202 if not self.header.n_sph_nodes: 

    +

    2203 return 

    +

    2204 

    +

    2205 LOGGER.debug("_read_sph_element_data_flags start at byte %d", self.geometry_section_size) 

    +

    2206 

    +

    2207 position = self.geometry_section_size 

    +

    2208 

    +

    2209 sph_element_data_words = { 

    +

    2210 "isphfg1": (position, self._header.itype), 

    +

    2211 "isphfg2": (position + 1 * self.header.wordsize, self._header.itype), 

    +

    2212 "isphfg3": (position + 2 * self.header.wordsize, self._header.itype), 

    +

    2213 "isphfg4": (position + 3 * self.header.wordsize, self._header.itype), 

    +

    2214 "isphfg5": (position + 4 * self.header.wordsize, self._header.itype), 

    +

    2215 "isphfg6": (position + 5 * self.header.wordsize, self._header.itype), 

    +

    2216 "isphfg7": (position + 6 * self.header.wordsize, self._header.itype), 

    +

    2217 "isphfg8": (position + 7 * self.header.wordsize, self._header.itype), 

    +

    2218 "isphfg9": (position + 8 * self.header.wordsize, self._header.itype), 

    +

    2219 "isphfg10": (position + 9 * self.header.wordsize, self._header.itype), 

    +

    2220 "isphfg11": (position + 10 * self.header.wordsize, self._header.itype), 

    +

    2221 } 

    +

    2222 

    +

    2223 sph_header_data = self.header.read_words(self._buffer, sph_element_data_words) 

    +

    2224 

    +

    2225 self._sph_info.n_sph_array_length = sph_header_data["isphfg1"] 

    +

    2226 self._sph_info.has_influence_radius = sph_header_data["isphfg2"] != 0 

    +

    2227 self._sph_info.has_particle_pressure = sph_header_data["isphfg3"] != 0 

    +

    2228 self._sph_info.has_stresses = sph_header_data["isphfg4"] != 0 

    +

    2229 self._sph_info.has_plastic_strain = sph_header_data["isphfg5"] != 0 

    +

    2230 self._sph_info.has_material_density = sph_header_data["isphfg6"] != 0 

    +

    2231 self._sph_info.has_internal_energy = sph_header_data["isphfg7"] != 0 

    +

    2232 self._sph_info.has_n_affecting_neighbors = sph_header_data["isphfg8"] != 0 

    +

    2233 self._sph_info.has_strain_and_strainrate = sph_header_data["isphfg9"] != 0 

    +

    2234 self._sph_info.has_true_strains = sph_header_data["isphfg9"] < 0 

    +

    2235 self._sph_info.has_mass = sph_header_data["isphfg10"] != 0 

    +

    2236 self._sph_info.n_sph_history_vars = sph_header_data["isphfg11"] 

    +

    2237 

    +

    2238 if self._sph_info.n_sph_array_length != 11: 

    +

    2239 msg = ( 

    +

    2240 "Detected inconsistency: " 

    +

    2241 f"isphfg = {self._sph_info.n_sph_array_length} but must be 11." 

    +

    2242 ) 

    +

    2243 raise RuntimeError(msg) 

    +

    2244 

    +

    2245 self._sph_info.n_sph_vars = ( 

    +

    2246 sph_header_data["isphfg2"] 

    +

    2247 + sph_header_data["isphfg3"] 

    +

    2248 + sph_header_data["isphfg4"] 

    +

    2249 + sph_header_data["isphfg5"] 

    +

    2250 + sph_header_data["isphfg6"] 

    +

    2251 + sph_header_data["isphfg7"] 

    +

    2252 + sph_header_data["isphfg8"] 

    +

    2253 + abs(sph_header_data["isphfg9"]) 

    +

    2254 + sph_header_data["isphfg10"] 

    +

    2255 + sph_header_data["isphfg11"] 

    +

    2256 + 1 

    +

    2257 ) # material number 

    +

    2258 

    +

    2259 self.geometry_section_size += sph_header_data["isphfg1"] * self.header.wordsize 

    +

    2260 LOGGER.debug("_read_sph_element_data_flags end at byte %d", self.geometry_section_size) 

    +

    2261 

    +

    2262 def _read_particle_data(self): 

    +

    2263 """Read the geometry section for particle data (airbags)""" 

    +

    2264 

    +

    2265 if not self._buffer: 

    +

    2266 return 

    +

    2267 

    +

    2268 if "npefg" not in self.header.raw_header: 

    +

    2269 return 

    +

    2270 npefg = self.header.raw_header["npefg"] 

    +

    2271 

    +

    2272 # let's stick to the manual, too lazy to decypther this test 

    +

    2273 if npefg <= 0 or npefg > 10000000: 

    +

    2274 return 

    +

    2275 

    +

    2276 LOGGER.debug("_read_particle_data start at byte %d", self.geometry_section_size) 

    +

    2277 

    +

    2278 position = self.geometry_section_size 

    +

    2279 

    +

    2280 airbag_header = { 

    +

    2281 # number of airbags 

    +

    2282 "npartgas": npefg % 1000, 

    +

    2283 # ? 

    +

    2284 "subver": npefg // 1000, 

    +

    2285 } 

    +

    2286 

    +

    2287 particle_geometry_data_words = { 

    +

    2288 # number of geometry variables 

    +

    2289 "ngeom": (position, self._header.itype), 

    +

    2290 # number of state variables 

    +

    2291 "nvar": (position + 1 * self.header.wordsize, self._header.itype), 

    +

    2292 # number of particles 

    +

    2293 "npart": (position + 2 * self.header.wordsize, self._header.itype), 

    +

    2294 # number of state geometry variables 

    +

    2295 "nstgeom": (position + 3 * self.header.wordsize, self._header.itype), 

    +

    2296 } 

    +

    2297 

    +

    2298 self.header.read_words(self._buffer, particle_geometry_data_words, airbag_header) 

    +

    2299 position += 4 * self.header.wordsize 

    +

    2300 

    +

    2301 # transfer to info object 

    +

    2302 self._airbag_info.n_airbags = npefg % 1000 

    +

    2303 self._airbag_info.subver = npefg // 1000 

    +

    2304 self._airbag_info.n_geometric_variables = airbag_header["ngeom"] 

    +

    2305 self._airbag_info.n_particle_state_variables = airbag_header["nvar"] 

    +

    2306 self._airbag_info.n_particles = airbag_header["npart"] 

    +

    2307 self._airbag_info.n_airbag_state_variables = airbag_header["nstgeom"] 

    +

    2308 

    +

    2309 if self._airbag_info.subver == 4: 

    +

    2310 # number of chambers 

    +

    2311 self._airbag_info.n_chambers = self._buffer.read_number(position, self._header.itype) 

    +

    2312 position += self.header.wordsize 

    +

    2313 

    +

    2314 n_airbag_variables = self._airbag_info.get_n_variables() 

    +

    2315 

    +

    2316 # safety 

    +

    2317 # from here on the code may fail 

    +

    2318 original_position = position 

    +

    2319 blocksize = 9 * n_airbag_variables * self.header.wordsize 

    +

    2320 

    +

    2321 try: 

    +

    2322 # variable typecodes 

    +

    2323 self.arrays[ArrayType.airbag_variable_types] = self._buffer.read_ndarray( 

    +

    2324 position, n_airbag_variables * self.header.wordsize, 1, self._header.itype 

    +

    2325 ) 

    +

    2326 position += n_airbag_variables * self.header.wordsize 

    +

    2327 

    +

    2328 # airbag variable names 

    +

    2329 # every word is an ascii char 

    +

    2330 airbag_variable_names = [] 

    +

    2331 var_width = 8 

    +

    2332 

    +

    2333 for i_variable in range(n_airbag_variables): 

    +

    2334 name = self._buffer.read_text( 

    +

    2335 position + (i_variable * var_width) * self.header.wordsize, 

    +

    2336 var_width * self.header.wordsize, 

    +

    2337 ) 

    +

    2338 airbag_variable_names.append(name[:: self.header.wordsize]) 

    +

    2339 

    +

    2340 self.arrays[ArrayType.airbag_variable_names] = airbag_variable_names 

    +

    2341 position += n_airbag_variables * var_width * self.header.wordsize 

    +

    2342 

    +

    2343 except Exception: 

    +

    2344 

    +

    2345 # print info 

    +

    2346 trb_msg = traceback.format_exc() 

    +

    2347 msg = "A failure in %s was caught:\n%s" 

    +

    2348 LOGGER.warning(msg, "_read_particle_data", trb_msg) 

    +

    2349 

    +

    2350 # fix position 

    +

    2351 position = original_position + blocksize 

    +

    2352 

    +

    2353 # update position marker 

    +

    2354 self.geometry_section_size = position 

    +

    2355 LOGGER.debug("_read_particle_data start at byte %d", self.geometry_section_size) 

    +

    2356 

    +

    2357 # pylint: disable = too-many-branches 

    +

    2358 def _read_geometry_data(self): 

    +

    2359 """Read the data from the geometry section""" 

    +

    2360 

    +

    2361 if not self._buffer: 

    +

    2362 return 

    +

    2363 

    +

    2364 LOGGER.debug("_read_geometry_data start at byte %d", self.geometry_section_size) 

    +

    2365 

    +

    2366 # not sure but I think never used by LS-Dyna 

    +

    2367 # anyway needs to be detected in the header and not here, 

    +

    2368 # though it is mentioned in this section of the database manual 

    +

    2369 # 

    +

    2370 # is_packed = True if self.header['ndim'] == 3 else False 

    +

    2371 # if is_packed: 

    +

    2372 # raise RuntimeError("Can not deal with packed "\ 

    +

    2373 # "geometry data (ndim == {}).".format(self.header['ndim'])) 

    +

    2374 

    +

    2375 position = self.geometry_section_size 

    +

    2376 

    +

    2377 # node coords 

    +

    2378 n_nodes = self.header.n_nodes 

    +

    2379 n_dimensions = self.header.n_dimensions 

    +

    2380 section_word_length = n_dimensions * n_nodes 

    +

    2381 try: 

    +

    2382 node_coordinates = self._buffer.read_ndarray( 

    +

    2383 position, section_word_length * self.header.wordsize, 1, self.header.ftype 

    +

    2384 ).reshape((n_nodes, n_dimensions)) 

    +

    2385 self.arrays[ArrayType.node_coordinates] = node_coordinates 

    +

    2386 except Exception: 

    +

    2387 trb_msg = traceback.format_exc() 

    +

    2388 msg = "A failure in %d was caught:\n%s" 

    +

    2389 LOGGER.warning(msg, "_read_geometry_data, node_coordinates", trb_msg) 

    +

    2390 finally: 

    +

    2391 position += section_word_length * self.header.wordsize 

    +

    2392 

    +

    2393 # solid data 

    +

    2394 n_solids = self.header.n_solids 

    +

    2395 section_word_length = 9 * n_solids 

    +

    2396 try: 

    +

    2397 elem_solid_data = self._buffer.read_ndarray( 

    +

    2398 position, section_word_length * self.header.wordsize, 1, self._header.itype 

    +

    2399 ).reshape((n_solids, 9)) 

    +

    2400 solid_connectivity = elem_solid_data[:, :8] 

    +

    2401 solid_part_indexes = elem_solid_data[:, 8] 

    +

    2402 self.arrays[ArrayType.element_solid_node_indexes] = solid_connectivity - FORTRAN_OFFSET 

    +

    2403 self.arrays[ArrayType.element_solid_part_indexes] = solid_part_indexes - FORTRAN_OFFSET 

    +

    2404 except Exception: 

    +

    2405 trb_msg = traceback.format_exc() 

    +

    2406 msg = "A failure in %s was caught:\n%s" 

    +

    2407 LOGGER.warning(msg, "_read_geometry_data, solids_geometry", trb_msg) 

    +

    2408 finally: 

    +

    2409 position += section_word_length * self.header.wordsize 

    +

    2410 

    +

    2411 # ten node solids extra nodes 

    +

    2412 if self.header.has_solid_2_extra_nodes: 

    +

    2413 section_word_length = 2 * n_solids 

    +

    2414 try: 

    +

    2415 self.arrays[ 

    +

    2416 ArrayType.element_solid_extra_nodes 

    +

    2417 ] = elem_solid_data = self._buffer.read_ndarray( 

    +

    2418 position, section_word_length * self.header.wordsize, 1, self._header.itype 

    +

    2419 ).reshape( 

    +

    2420 (n_solids, 2) 

    +

    2421 ) 

    +

    2422 except Exception: 

    +

    2423 trb_msg = traceback.format_exc() 

    +

    2424 msg = "A failure in %s was caught:\n%s" 

    +

    2425 LOGGER.warning(msg, "_read_geometry_data, ten_node_solids", trb_msg) 

    +

    2426 finally: 

    +

    2427 position += section_word_length * self.header.wordsize 

    +

    2428 

    +

    2429 # 8 node thick shells 

    +

    2430 n_thick_shells = self.header.n_thick_shells 

    +

    2431 section_word_length = 9 * n_thick_shells 

    +

    2432 try: 

    +

    2433 elem_tshell_data = self._buffer.read_ndarray( 

    +

    2434 position, section_word_length * self.header.wordsize, 1, self._header.itype 

    +

    2435 ).reshape((self.header.n_thick_shells, 9)) 

    +

    2436 self.arrays[ArrayType.element_tshell_node_indexes] = ( 

    +

    2437 elem_tshell_data[:, :8] - FORTRAN_OFFSET 

    +

    2438 ) 

    +

    2439 self.arrays[ArrayType.element_tshell_part_indexes] = ( 

    +

    2440 elem_tshell_data[:, 8] - FORTRAN_OFFSET 

    +

    2441 ) 

    +

    2442 except Exception: 

    +

    2443 trb_msg = traceback.format_exc() 

    +

    2444 msg = "A failure in %s was caught:\n%s" 

    +

    2445 LOGGER.warning(msg, "_read_geometry_data, tshells_geometry", trb_msg) 

    +

    2446 finally: 

    +

    2447 position += section_word_length * self.header.wordsize 

    +

    2448 

    +

    2449 # beams 

    +

    2450 n_beams = self.header.n_beams 

    +

    2451 section_word_length = 6 * n_beams 

    +

    2452 try: 

    +

    2453 elem_beam_data = self._buffer.read_ndarray( 

    +

    2454 position, section_word_length * self.header.wordsize, 1, self._header.itype 

    +

    2455 ).reshape((n_beams, 6)) 

    +

    2456 self.arrays[ArrayType.element_beam_part_indexes] = elem_beam_data[:, 5] - FORTRAN_OFFSET 

    +

    2457 self.arrays[ArrayType.element_beam_node_indexes] = ( 

    +

    2458 elem_beam_data[:, :5] - FORTRAN_OFFSET 

    +

    2459 ) 

    +

    2460 except Exception: 

    +

    2461 trb_msg = traceback.format_exc() 

    +

    2462 msg = "A failure in %s was caught:\n%s" 

    +

    2463 LOGGER.warning(msg, "_read_geometry_data, beams_geometry", trb_msg) 

    +

    2464 finally: 

    +

    2465 position += section_word_length * self.header.wordsize 

    +

    2466 

    +

    2467 # shells 

    +

    2468 n_shells = self.header.n_shells 

    +

    2469 section_word_length = 5 * n_shells 

    +

    2470 try: 

    +

    2471 elem_shell_data = self._buffer.read_ndarray( 

    +

    2472 position, section_word_length * self.header.wordsize, 1, self._header.itype 

    +

    2473 ).reshape((self.header.n_shells, 5)) 

    +

    2474 self.arrays[ArrayType.element_shell_node_indexes] = ( 

    +

    2475 elem_shell_data[:, :4] - FORTRAN_OFFSET 

    +

    2476 ) 

    +

    2477 self.arrays[ArrayType.element_shell_part_indexes] = ( 

    +

    2478 elem_shell_data[:, 4] - FORTRAN_OFFSET 

    +

    2479 ) 

    +

    2480 except Exception: 

    +

    2481 trb_msg = traceback.format_exc() 

    +

    2482 msg = "A failure in %s was caught:\n%s" 

    +

    2483 LOGGER.warning(msg, "_read_geometry_data, shells_geometry", trb_msg) 

    +

    2484 finally: 

    +

    2485 position += section_word_length * self.header.wordsize 

    +

    2486 

    +

    2487 # update word position 

    +

    2488 self.geometry_section_size = position 

    +

    2489 

    +

    2490 LOGGER.debug("_read_geometry_data end at byte %d", self.geometry_section_size) 

    +

    2491 

    +

    2492 def _read_user_ids(self): 

    +

    2493 

    +

    2494 if not self._buffer: 

    +

    2495 return 

    +

    2496 

    +

    2497 if not self.header.has_numbering_section: 

    +

    2498 self.arrays[ArrayType.node_ids] = np.arange( 

    +

    2499 FORTRAN_OFFSET, self.header.n_nodes + FORTRAN_OFFSET, dtype=self.header.itype 

    +

    2500 ) 

    +

    2501 self.arrays[ArrayType.element_solid_ids] = np.arange( 

    +

    2502 FORTRAN_OFFSET, self.header.n_solids + FORTRAN_OFFSET, dtype=self.header.itype 

    +

    2503 ) 

    +

    2504 self.arrays[ArrayType.element_beam_ids] = np.arange( 

    +

    2505 FORTRAN_OFFSET, self.header.n_beams + FORTRAN_OFFSET, dtype=self.header.itype 

    +

    2506 ) 

    +

    2507 self.arrays[ArrayType.element_shell_ids] = np.arange( 

    +

    2508 FORTRAN_OFFSET, self.header.n_shells + FORTRAN_OFFSET, dtype=self.header.itype 

    +

    2509 ) 

    +

    2510 self.arrays[ArrayType.element_tshell_ids] = np.arange( 

    +

    2511 FORTRAN_OFFSET, self.header.n_thick_shells + FORTRAN_OFFSET, dtype=self.header.itype 

    +

    2512 ) 

    +

    2513 self.arrays[ArrayType.part_ids] = np.arange( 

    +

    2514 FORTRAN_OFFSET, self.header.n_parts + FORTRAN_OFFSET, dtype=self.header.itype 

    +

    2515 ) 

    +

    2516 return 

    +

    2517 

    +

    2518 LOGGER.debug("_read_user_ids start at byte %d", self.geometry_section_size) 

    +

    2519 

    +

    2520 position = self.geometry_section_size 

    +

    2521 

    +

    2522 # safety 

    +

    2523 original_position = position 

    +

    2524 blocksize = self.header.raw_header["narbs"] * self.header.wordsize 

    +

    2525 

    +

    2526 try: 

    +

    2527 numbering_words = { 

    +

    2528 "nsort": (position, self._header.itype), 

    +

    2529 "nsrh": (position + 1 * self.header.wordsize, self._header.itype), 

    +

    2530 "nsrb": (position + 2 * self.header.wordsize, self._header.itype), 

    +

    2531 "nsrs": (position + 3 * self.header.wordsize, self._header.itype), 

    +

    2532 "nsrt": (position + 4 * self.header.wordsize, self._header.itype), 

    +

    2533 "nsortd": (position + 5 * self.header.wordsize, self._header.itype), 

    +

    2534 "nsrhd": (position + 6 * self.header.wordsize, self._header.itype), 

    +

    2535 "nsrbd": (position + 7 * self.header.wordsize, self._header.itype), 

    +

    2536 "nsrsd": (position + 8 * self.header.wordsize, self._header.itype), 

    +

    2537 "nsrtd": (position + 9 * self.header.wordsize, self._header.itype), 

    +

    2538 } 

    +

    2539 

    +

    2540 extra_numbering_words = { 

    +

    2541 "nsrma": (position + 10 * self.header.wordsize, self._header.itype), 

    +

    2542 "nsrmu": (position + 11 * self.header.wordsize, self._header.itype), 

    +

    2543 "nsrmp": (position + 12 * self.header.wordsize, self._header.itype), 

    +

    2544 "nsrtm": (position + 13 * self.header.wordsize, self._header.itype), 

    +

    2545 "numrbs": (position + 14 * self.header.wordsize, self._header.itype), 

    +

    2546 "nmmat": (position + 15 * self.header.wordsize, self._header.itype), 

    +

    2547 } 

    +

    2548 

    +

    2549 numbering_header = self.header.read_words(self._buffer, numbering_words) 

    +

    2550 position += len(numbering_words) * self.header.wordsize 

    +

    2551 

    +

    2552 # let's make life easier 

    +

    2553 info = self._numbering_info 

    +

    2554 

    +

    2555 # transfer first bunch 

    +

    2556 info.ptr_node_ids = abs(numbering_header["nsort"]) 

    +

    2557 info.has_material_ids = numbering_header["nsort"] < 0 

    +

    2558 info.ptr_solid_ids = numbering_header["nsrh"] 

    +

    2559 info.ptr_beam_ids = numbering_header["nsrb"] 

    +

    2560 info.ptr_shell_ids = numbering_header["nsrs"] 

    +

    2561 info.ptr_thick_shell_ids = numbering_header["nsrt"] 

    +

    2562 info.n_nodes = numbering_header["nsortd"] 

    +

    2563 info.n_solids = numbering_header["nsrhd"] 

    +

    2564 info.n_beams = numbering_header["nsrbd"] 

    +

    2565 info.n_shells = numbering_header["nsrsd"] 

    +

    2566 info.n_thick_shells = numbering_header["nsrtd"] 

    +

    2567 

    +

    2568 if info.has_material_ids: 

    +

    2569 

    +

    2570 # read extra header 

    +

    2571 self.header.read_words(self._buffer, extra_numbering_words, numbering_header) 

    +

    2572 position += len(extra_numbering_words) * self.header.wordsize 

    +

    2573 

    +

    2574 # transfer more 

    +

    2575 info.ptr_material_ids = numbering_header["nsrma"] 

    +

    2576 info.ptr_material_ids_defined_order = numbering_header["nsrmu"] 

    +

    2577 info.ptr_material_ids_crossref = numbering_header["nsrmp"] 

    +

    2578 info.n_parts = numbering_header["nsrtm"] 

    +

    2579 info.n_rigid_bodies = numbering_header["numrbs"] 

    +

    2580 info.n_parts2 = numbering_header["nmmat"] 

    +

    2581 else: 

    +

    2582 info.n_parts = self.header.n_parts 

    +

    2583 

    +

    2584 # let's do a quick check 

    +

    2585 n_words_computed = ( 

    +

    2586 len(numbering_header) 

    +

    2587 + info.n_nodes 

    +

    2588 + info.n_shells 

    +

    2589 + info.n_beams 

    +

    2590 + info.n_solids 

    +

    2591 + info.n_thick_shells 

    +

    2592 + info.n_parts * 3 

    +

    2593 ) 

    +

    2594 if n_words_computed != self.header.n_numbering_section_words: 

    +

    2595 warn_msg = ( 

    +

    2596 "ID section: The computed word count does " 

    +

    2597 "not match the header word count: %d != %d." 

    +

    2598 " The ID arrays might contain errors." 

    +

    2599 ) 

    +

    2600 LOGGER.warning(warn_msg, n_words_computed, self.header.n_numbering_section_words) 

    +

    2601 # node ids 

    +

    2602 array_length = info.n_nodes * self.header.wordsize 

    +

    2603 self.arrays[ArrayType.node_ids] = self._buffer.read_ndarray( 

    +

    2604 position, array_length, 1, self._header.itype 

    +

    2605 ) 

    +

    2606 position += array_length 

    +

    2607 # solid ids 

    +

    2608 array_length = info.n_solids * self.header.wordsize 

    +

    2609 self.arrays[ArrayType.element_solid_ids] = self._buffer.read_ndarray( 

    +

    2610 position, array_length, 1, self._header.itype 

    +

    2611 ) 

    +

    2612 position += array_length 

    +

    2613 # beam ids 

    +

    2614 array_length = info.n_beams * self.header.wordsize 

    +

    2615 self.arrays[ArrayType.element_beam_ids] = self._buffer.read_ndarray( 

    +

    2616 position, array_length, 1, self._header.itype 

    +

    2617 ) 

    +

    2618 position += array_length 

    +

    2619 # shell ids 

    +

    2620 array_length = info.n_shells * self.header.wordsize 

    +

    2621 self.arrays[ArrayType.element_shell_ids] = self._buffer.read_ndarray( 

    +

    2622 position, array_length, 1, self._header.itype 

    +

    2623 ) 

    +

    2624 position += array_length 

    +

    2625 # tshell ids 

    +

    2626 array_length = info.n_thick_shells * self.header.wordsize 

    +

    2627 self.arrays[ArrayType.element_tshell_ids] = self._buffer.read_ndarray( 

    +

    2628 position, array_length, 1, self._header.itype 

    +

    2629 ) 

    +

    2630 position += array_length 

    +

    2631 

    +

    2632 # part ids 

    +

    2633 # 

    +

    2634 # this makes no sense but materials are output three times at this section 

    +

    2635 # but the length of the array (nmmat) is only output if nsort < 0. In 

    +

    2636 # the other case the length is unknown ... 

    +

    2637 # 

    +

    2638 # Bugfix: 

    +

    2639 # The material arrays (three times) are always output, even if nsort < 0 

    +

    2640 # which means they are not used. Quite confusing, especially since nmmat 

    +

    2641 # is output in the main header and numbering header. 

    +

    2642 # 

    +

    2643 if "nmmat" in numbering_header: 

    +

    2644 

    +

    2645 if info.n_parts != self.header.n_parts: 

    +

    2646 err_msg = ( 

    +

    2647 "nmmat in the file header (%d) and in the " 

    +

    2648 "numbering header (%d) are inconsistent." 

    +

    2649 ) 

    +

    2650 raise RuntimeError(err_msg, self.header.n_parts, info.n_parts) 

    +

    2651 

    +

    2652 array_length = info.n_parts * self.header.wordsize 

    +

    2653 

    +

    2654 self.arrays[ArrayType.part_ids] = self._buffer.read_ndarray( 

    +

    2655 position, info.n_parts * self.header.wordsize, 1, self._header.itype 

    +

    2656 ) 

    +

    2657 position += info.n_parts * self.header.wordsize 

    +

    2658 

    +

    2659 self.arrays[ArrayType.part_ids_unordered] = self._buffer.read_ndarray( 

    +

    2660 position, info.n_parts * self.header.wordsize, 1, self._header.itype 

    +

    2661 ) 

    +

    2662 position += info.n_parts * self.header.wordsize 

    +

    2663 

    +

    2664 self.arrays[ArrayType.part_ids_cross_references] = self._buffer.read_ndarray( 

    +

    2665 position, info.n_parts * self.header.wordsize, 1, self._header.itype 

    +

    2666 ) 

    +

    2667 position += info.n_parts * self.header.wordsize 

    +

    2668 

    +

    2669 else: 

    +

    2670 position += 3 * self.header.n_parts * self.header.wordsize 

    +

    2671 

    +

    2672 except Exception: 

    +

    2673 # print info 

    +

    2674 trb_msg = traceback.format_exc() 

    +

    2675 msg = "A failure in %s was caught:\n%s" 

    +

    2676 LOGGER.warning(msg, "_read_user_ids", trb_msg) 

    +

    2677 

    +

    2678 # fix position 

    +

    2679 position = original_position + blocksize 

    +

    2680 

    +

    2681 # update position 

    +

    2682 self.geometry_section_size = position 

    +

    2683 LOGGER.debug("_read_user_ids end at byte %d", self.geometry_section_size) 

    +

    2684 

    +

    2685 def _read_rigid_body_description(self): 

    +

    2686 """Read the rigid body description section""" 

    +

    2687 

    +

    2688 if not self._buffer: 

    +

    2689 return 

    +

    2690 

    +

    2691 if not self.header.has_rigid_body_data: 

    +

    2692 return 

    +

    2693 

    +

    2694 LOGGER.debug("_read_rigid_body_description start at byte %d", self.geometry_section_size) 

    +

    2695 

    +

    2696 position = self.geometry_section_size 

    +

    2697 

    +

    2698 rigid_body_description_header = { 

    +

    2699 "nrigid": self._buffer.read_number(position, self._header.itype) 

    +

    2700 } 

    +

    2701 position += self.header.wordsize 

    +

    2702 

    +

    2703 info = self._rigid_body_info 

    +

    2704 info.n_rigid_bodies = rigid_body_description_header["nrigid"] 

    +

    2705 

    +

    2706 rigid_bodies: List[RigidBodyMetadata] = [] 

    +

    2707 for _ in range(info.n_rigid_bodies): 

    +

    2708 rigid_body_info = { 

    +

    2709 # rigid body part internal number 

    +

    2710 "mrigid": self._buffer.read_number(position, self._header.itype), 

    +

    2711 # number of nodes in rigid body 

    +

    2712 "numnodr": self._buffer.read_number( 

    +

    2713 position + self.header.wordsize, self._header.itype 

    +

    2714 ), 

    +

    2715 } 

    +

    2716 position += 2 * self.header.wordsize 

    +

    2717 

    +

    2718 # internal node number of rigid body 

    +

    2719 array_length = rigid_body_info["numnodr"] * self.header.wordsize 

    +

    2720 rigid_body_info["noder"] = self._buffer.read_ndarray( 

    +

    2721 position, array_length, 1, self._header.itype 

    +

    2722 ) 

    +

    2723 position += array_length 

    +

    2724 

    +

    2725 # number of active (non-rigid) nodes 

    +

    2726 rigid_body_info["numnoda"] = self._buffer.read_number(position, self._header.itype) 

    +

    2727 position += self.header.wordsize 

    +

    2728 

    +

    2729 # internal node numbers of active nodes 

    +

    2730 array_length = rigid_body_info["numnoda"] * self.header.wordsize 

    +

    2731 rigid_body_info["nodea"] = self._buffer.read_ndarray( 

    +

    2732 position, array_length, 1, self._header.itype 

    +

    2733 ) 

    +

    2734 position += array_length 

    +

    2735 

    +

    2736 # transfer props 

    +

    2737 body_metadata = RigidBodyMetadata( 

    +

    2738 internal_number=rigid_body_info["mrigid"], 

    +

    2739 n_nodes=rigid_body_info["numnodr"], 

    +

    2740 node_indexes=rigid_body_info["noder"], 

    +

    2741 n_active_nodes=rigid_body_info["numnoda"], 

    +

    2742 active_node_indexes=rigid_body_info["nodea"], 

    +

    2743 ) 

    +

    2744 

    +

    2745 # append to list 

    +

    2746 rigid_bodies.append(body_metadata) 

    +

    2747 

    +

    2748 # save rigid body info to header 

    +

    2749 info.rigid_body_metadata_list = rigid_bodies 

    +

    2750 

    +

    2751 # save arrays 

    +

    2752 rigid_body_n_nodes = [] 

    +

    2753 rigid_body_part_indexes = [] 

    +

    2754 rigid_body_n_active_nodes = [] 

    +

    2755 rigid_body_node_indexes_list = [] 

    +

    2756 rigid_body_active_node_indexes_list = [] 

    +

    2757 for rigid_body_info in rigid_bodies: 

    +

    2758 rigid_body_part_indexes.append(rigid_body_info.internal_number) 

    +

    2759 rigid_body_n_nodes.append(rigid_body_info.n_nodes) 

    +

    2760 rigid_body_node_indexes_list.append(rigid_body_info.node_indexes - FORTRAN_OFFSET) 

    +

    2761 rigid_body_n_active_nodes.append(rigid_body_info.n_active_nodes) 

    +

    2762 rigid_body_active_node_indexes_list.append( 

    +

    2763 rigid_body_info.active_node_indexes - FORTRAN_OFFSET 

    +

    2764 ) 

    +

    2765 

    +

    2766 self.arrays[ArrayType.rigid_body_part_indexes] = ( 

    +

    2767 np.array(rigid_body_part_indexes, dtype=self._header.itype) - FORTRAN_OFFSET 

    +

    2768 ) 

    +

    2769 self.arrays[ArrayType.rigid_body_n_nodes] = np.array( 

    +

    2770 rigid_body_n_nodes, dtype=self._header.itype 

    +

    2771 ) 

    +

    2772 self.arrays[ArrayType.rigid_body_n_active_nodes] = np.array( 

    +

    2773 rigid_body_n_active_nodes, dtype=self._header.itype 

    +

    2774 ) 

    +

    2775 self.arrays[ArrayType.rigid_body_node_indexes_list] = rigid_body_node_indexes_list 

    +

    2776 self.arrays[ 

    +

    2777 ArrayType.rigid_body_active_node_indexes_list 

    +

    2778 ] = rigid_body_active_node_indexes_list 

    +

    2779 

    +

    2780 # update position 

    +

    2781 self.geometry_section_size = position 

    +

    2782 LOGGER.debug("_read_rigid_body_description end at byte %d", self.geometry_section_size) 

    +

    2783 

    +

    2784 def _read_sph_node_and_material_list(self): 

    +

    2785 """Read SPH node and material list""" 

    +

    2786 

    +

    2787 if not self._buffer: 

    +

    2788 return 

    +

    2789 

    +

    2790 if self.header.n_sph_nodes <= 0: 

    +

    2791 return 

    +

    2792 

    +

    2793 LOGGER.debug( 

    +

    2794 "_read_sph_node_and_material_list start at byte %d", self.geometry_section_size 

    +

    2795 ) 

    +

    2796 

    +

    2797 position = self.geometry_section_size 

    +

    2798 

    +

    2799 array_length = self.header.n_sph_nodes * self.header.wordsize * 2 

    +

    2800 try: 

    +

    2801 # read info array 

    +

    2802 sph_node_matlist = self._buffer.read_ndarray( 

    +

    2803 position, array_length, 1, self._header.itype 

    +

    2804 ).reshape((self.header.n_sph_nodes, 2)) 

    +

    2805 

    +

    2806 # save array 

    +

    2807 self.arrays[ArrayType.sph_node_indexes] = sph_node_matlist[:, 0] - FORTRAN_OFFSET 

    +

    2808 self.arrays[ArrayType.sph_node_material_index] = sph_node_matlist[:, 1] - FORTRAN_OFFSET 

    +

    2809 

    +

    2810 except Exception: 

    +

    2811 # print info 

    +

    2812 trb_msg = traceback.format_exc() 

    +

    2813 msg = "A failure in %s was caught:\n%s" 

    +

    2814 LOGGER.warning(msg, "_read_sph_node_and_material_list", trb_msg) 

    +

    2815 

    +

    2816 finally: 

    +

    2817 # update position 

    +

    2818 self.geometry_section_size += array_length 

    +

    2819 

    +

    2820 LOGGER.debug("_read_sph_node_and_material_list end at byte %d", self.geometry_section_size) 

    +

    2821 

    +

    2822 def _read_particle_geometry_data(self): 

    +

    2823 """Read the particle geometry data""" 

    +

    2824 

    +

    2825 if not self._buffer: 

    +

    2826 return 

    +

    2827 

    +

    2828 if "npefg" not in self.header.raw_header: 

    +

    2829 return 

    +

    2830 

    +

    2831 if self.header.raw_header["npefg"] <= 0: 

    +

    2832 return 

    +

    2833 

    +

    2834 LOGGER.debug("_read_particle_geometry_data start at byte %d", self.geometry_section_size) 

    +

    2835 

    +

    2836 info = self._airbag_info 

    +

    2837 

    +

    2838 position = self.geometry_section_size 

    +

    2839 

    +

    2840 # size of geometry section checking 

    +

    2841 ngeom = info.n_geometric_variables 

    +

    2842 if ngeom not in [4, 5]: 

    +

    2843 raise RuntimeError("variable ngeom in the airbag header must be 4 or 5.") 

    +

    2844 

    +

    2845 original_position = position 

    +

    2846 blocksize = info.n_airbags * ngeom * self.header.wordsize 

    +

    2847 try: 

    +

    2848 

    +

    2849 # extract geometry as a single array 

    +

    2850 array_length = blocksize 

    +

    2851 particle_geom_data = self._buffer.read_ndarray( 

    +

    2852 position, array_length, 1, self._header.itype 

    +

    2853 ).reshape((info.n_airbags, ngeom)) 

    +

    2854 position += array_length 

    +

    2855 

    +

    2856 # store arrays 

    +

    2857 self.arrays[ArrayType.airbags_first_particle_id] = particle_geom_data[:, 0] 

    +

    2858 self.arrays[ArrayType.airbags_n_particles] = particle_geom_data[:, 1] 

    +

    2859 self.arrays[ArrayType.airbags_ids] = particle_geom_data[:, 2] 

    +

    2860 self.arrays[ArrayType.airbags_n_gas_mixtures] = particle_geom_data[:, 3] 

    +

    2861 if ngeom == 5: 

    +

    2862 self.arrays[ArrayType.airbags_n_chambers] = particle_geom_data[:, 4] 

    +

    2863 

    +

    2864 except Exception: 

    +

    2865 # print info 

    +

    2866 trb_msg = traceback.format_exc() 

    +

    2867 msg = "A failure in %d was caught:\n%s" 

    +

    2868 LOGGER.warning(msg, "_read_particle_geometry_data", trb_msg) 

    +

    2869 

    +

    2870 # fix position 

    +

    2871 position = original_position + blocksize 

    +

    2872 

    +

    2873 # update position 

    +

    2874 self.geometry_section_size = position 

    +

    2875 

    +

    2876 LOGGER.debug("_read_particle_geometry_data end at byte %d", self.geometry_section_size) 

    +

    2877 

    +

    2878 def _read_rigid_road_surface(self): 

    +

    2879 """Read rigid road surface data""" 

    +

    2880 

    +

    2881 if not self._buffer: 

    +

    2882 return 

    +

    2883 

    +

    2884 if not self.header.has_rigid_road_surface: 

    +

    2885 return 

    +

    2886 

    +

    2887 LOGGER.debug("_read_rigid_road_surface start at byte %d", self.geometry_section_size) 

    +

    2888 

    +

    2889 position = self.geometry_section_size 

    +

    2890 

    +

    2891 # read header 

    +

    2892 rigid_road_surface_words = { 

    +

    2893 "nnode": (position, self._header.itype), 

    +

    2894 "nseg": (position + 1 * self.header.wordsize, self._header.itype), 

    +

    2895 "nsurf": (position + 2 * self.header.wordsize, self._header.itype), 

    +

    2896 "motion": (position + 3 * self.header.wordsize, self._header.itype), 

    +

    2897 } 

    +

    2898 

    +

    2899 rigid_road_header = self.header.read_words(self._buffer, rigid_road_surface_words) 

    +

    2900 position += 4 * self.header.wordsize 

    +

    2901 

    +

    2902 self._rigid_road_info = RigidRoadInfo( 

    +

    2903 n_nodes=rigid_road_header["nnode"], 

    +

    2904 n_roads=rigid_road_header["nsurf"], 

    +

    2905 n_road_segments=rigid_road_header["nseg"], 

    +

    2906 motion=rigid_road_header["motion"], 

    +

    2907 ) 

    +

    2908 info = self._rigid_road_info 

    +

    2909 

    +

    2910 # node ids 

    +

    2911 array_length = info.n_nodes * self.header.wordsize 

    +

    2912 rigid_road_node_ids = self._buffer.read_ndarray( 

    +

    2913 position, array_length, 1, self._header.itype 

    +

    2914 ) 

    +

    2915 self.arrays[ArrayType.rigid_road_node_ids] = rigid_road_node_ids 

    +

    2916 position += array_length 

    +

    2917 

    +

    2918 # node xyz 

    +

    2919 array_length = info.n_nodes * 3 * self.header.wordsize 

    +

    2920 rigid_road_node_coords = self._buffer.read_ndarray( 

    +

    2921 position, array_length, 1, self.header.ftype 

    +

    2922 ).reshape((info.n_nodes, 3)) 

    +

    2923 self.arrays[ArrayType.rigid_road_node_coordinates] = rigid_road_node_coords 

    +

    2924 position += array_length 

    +

    2925 

    +

    2926 # read road segments 

    +

    2927 # Warning: must be copied 

    +

    2928 rigid_road_ids = np.empty(info.n_roads, dtype=self._header.itype) 

    +

    2929 rigid_road_nsegments = np.empty(info.n_roads, dtype=self._header.itype) 

    +

    2930 rigid_road_segment_node_ids = [] 

    +

    2931 

    +

    2932 # this array is created since the array database requires 

    +

    2933 # constant sized arrays, and we dump all segments into one 

    +

    2934 # array. In order to distinguish which segment 

    +

    2935 # belongs to which road, this new array keeps track of it 

    +

    2936 rigid_road_segment_road_id = [] 

    +

    2937 

    +

    2938 # n_total_segments = 0 

    +

    2939 for i_surf in range(info.n_roads): 

    +

    2940 # surface id 

    +

    2941 surf_id = self._buffer.read_number(position, self._header.itype) # type: ignore 

    +

    2942 position += self.header.wordsize 

    +

    2943 rigid_road_ids[i_surf] = surf_id 

    +

    2944 

    +

    2945 # number of segments of surface 

    +

    2946 surf_nseg = self._buffer.read_number( 

    +

    2947 position + 1 * self.header.wordsize, self._header.itype 

    +

    2948 ) # type: ignore 

    +

    2949 position += self.header.wordsize 

    +

    2950 rigid_road_nsegments[i_surf] = surf_nseg 

    +

    2951 

    +

    2952 # count total segments 

    +

    2953 # n_total_segments += surf_nseg 

    +

    2954 

    +

    2955 # node ids of surface segments 

    +

    2956 array_length = 4 * surf_nseg * self.header.wordsize 

    +

    2957 surf_segm_node_ids = self._buffer.read_ndarray( 

    +

    2958 position, # type: ignore 

    +

    2959 array_length, # type: ignore 

    +

    2960 1, 

    +

    2961 self._header.itype, 

    +

    2962 ).reshape((surf_nseg, 4)) 

    +

    2963 position += array_length 

    +

    2964 rigid_road_segment_node_ids.append(surf_segm_node_ids) 

    +

    2965 

    +

    2966 # remember road id for segments 

    +

    2967 rigid_road_segment_road_id += [surf_id] * surf_nseg 

    +

    2968 

    +

    2969 # save arrays 

    +

    2970 self.arrays[ArrayType.rigid_road_ids] = rigid_road_ids 

    +

    2971 self.arrays[ArrayType.rigid_road_n_segments] = rigid_road_nsegments 

    +

    2972 self.arrays[ArrayType.rigid_road_segment_node_ids] = np.concatenate( 

    +

    2973 rigid_road_segment_node_ids 

    +

    2974 ) 

    +

    2975 self.arrays[ArrayType.rigid_road_segment_road_id] = np.asarray(rigid_road_segment_road_id) 

    +

    2976 

    +

    2977 # update position 

    +

    2978 self.geometry_section_size = position 

    +

    2979 LOGGER.debug("_read_rigid_road_surface end at byte %d", self.geometry_section_size) 

    +

    2980 

    +

    2981 # pylint: disable = too-many-branches 

    +

    2982 def _read_extra_node_connectivity(self): 

    +

    2983 """Read the extra node data for creepy elements""" 

    +

    2984 

    +

    2985 if not self._buffer: 

    +

    2986 return 

    +

    2987 

    +

    2988 LOGGER.debug("_read_extra_node_connectivity start at byte %d", self.geometry_section_size) 

    +

    2989 

    +

    2990 position = self.geometry_section_size 

    +

    2991 

    +

    2992 # extra 2 node connectivity for 10 node tetrahedron elements 

    +

    2993 if self.header.has_solid_2_extra_nodes: 

    +

    2994 array_length = 2 * self.header.n_solids * self.header.wordsize 

    +

    2995 try: 

    +

    2996 array = self._buffer.read_ndarray( 

    +

    2997 position, array_length, 1, self._header.itype 

    +

    2998 ).reshape((self.header.n_solids, 2)) 

    +

    2999 self.arrays[ArrayType.element_solid_node10_extra_node_indexes] = ( 

    +

    3000 array - FORTRAN_OFFSET 

    +

    3001 ) 

    +

    3002 except Exception: 

    +

    3003 trb_msg = traceback.format_exc() 

    +

    3004 msg = "A failure in %s was caught:\n%s" 

    +

    3005 LOGGER.warning(msg, "_read_extra_node_connectivity, solid10", trb_msg) 

    +

    3006 finally: 

    +

    3007 position += array_length 

    +

    3008 

    +

    3009 # 8 node shell elements 

    +

    3010 if self.header.n_shells_8_nodes > 0: 

    +

    3011 array_length = 5 * self.header.n_shells_8_nodes * self.header.wordsize 

    +

    3012 try: 

    +

    3013 array = self._buffer.read_ndarray( 

    +

    3014 position, array_length, 1, self._header.itype 

    +

    3015 ).reshape((self.header.n_shells_8_nodes, 5)) 

    +

    3016 self.arrays[ArrayType.element_shell_node8_element_index] = ( 

    +

    3017 array[:, 0] - FORTRAN_OFFSET 

    +

    3018 ) 

    +

    3019 self.arrays[ArrayType.element_shell_node8_extra_node_indexes] = ( 

    +

    3020 array[:, 1:] - FORTRAN_OFFSET 

    +

    3021 ) 

    +

    3022 except Exception: 

    +

    3023 trb_msg = traceback.format_exc() 

    +

    3024 msg = "A failure in %s was caught:\n%s" 

    +

    3025 LOGGER.warning(msg, "_read_extra_node_connectivity, shell8", trb_msg) 

    +

    3026 finally: 

    +

    3027 position += array_length 

    +

    3028 

    +

    3029 # 20 node solid elements 

    +

    3030 if self.header.n_solids_20_node_hexas > 0: 

    +

    3031 array_length = 13 * self.header.n_solids_20_node_hexas * self.header.wordsize 

    +

    3032 try: 

    +

    3033 array = self._buffer.read_ndarray( 

    +

    3034 position, array_length, 1, self._header.itype 

    +

    3035 ).reshape((self.header.n_solids_20_node_hexas, 13)) 

    +

    3036 self.arrays[ArrayType.element_solid_node20_element_index] = ( 

    +

    3037 array[:, 0] - FORTRAN_OFFSET 

    +

    3038 ) 

    +

    3039 self.arrays[ArrayType.element_solid_node20_extra_node_indexes] = ( 

    +

    3040 array[:, 1:] - FORTRAN_OFFSET 

    +

    3041 ) 

    +

    3042 except Exception: 

    +

    3043 trb_msg = traceback.format_exc() 

    +

    3044 msg = "A failure in %s was caught:\n%s" 

    +

    3045 LOGGER.warning(msg, "_read_extra_node_connectivity, solid20", trb_msg) 

    +

    3046 finally: 

    +

    3047 position += array_length 

    +

    3048 

    +

    3049 # 27 node solid hexas 

    +

    3050 if ( 

    +

    3051 self.header.n_solids_27_node_hexas > 0 

    +

    3052 and self.header.quadratic_elems_has_full_connectivity 

    +

    3053 ): 

    +

    3054 array_length = 28 * self.header.n_solids_27_node_hexas * self.header.wordsize 

    +

    3055 try: 

    +

    3056 array = self._buffer.read_ndarray( 

    +

    3057 position, array_length, 1, self._header.itype 

    +

    3058 ).reshape((self.header.n_solids_27_node_hexas, 28)) 

    +

    3059 self.arrays[ArrayType.element_solid_node27_element_index] = ( 

    +

    3060 array[:, 0] - FORTRAN_OFFSET 

    +

    3061 ) 

    +

    3062 self.arrays[ArrayType.element_solid_node27_extra_node_indexes] = ( 

    +

    3063 array[:, 1:] - FORTRAN_OFFSET 

    +

    3064 ) 

    +

    3065 except Exception: 

    +

    3066 trb_msg = traceback.format_exc() 

    +

    3067 msg = "A failure in %s was caught:\n%s" 

    +

    3068 LOGGER.warning(msg, "_read_extra_node_connectivity, solid27", trb_msg) 

    +

    3069 finally: 

    +

    3070 position += array_length 

    +

    3071 

    +

    3072 # 21 node solid pentas 

    +

    3073 if ( 

    +

    3074 self.header.n_solids_21_node_pentas > 0 

    +

    3075 and self.header.quadratic_elems_has_full_connectivity 

    +

    3076 ): 

    +

    3077 array_length = 22 * self.header.n_solids_21_node_pentas * self.header.wordsize 

    +

    3078 try: 

    +

    3079 array = self._buffer.read_ndarray( 

    +

    3080 position, array_length, 1, self._header.itype 

    +

    3081 ).reshape((self.header.n_solids_21_node_pentas, 22)) 

    +

    3082 self.arrays[ArrayType.element_solid_node21_penta_element_index] = ( 

    +

    3083 array[:, 0] - FORTRAN_OFFSET 

    +

    3084 ) 

    +

    3085 self.arrays[ArrayType.element_solid_node21_penta_extra_node_indexes] = ( 

    +

    3086 array[:, 1:] - FORTRAN_OFFSET 

    +

    3087 ) 

    +

    3088 except Exception: 

    +

    3089 trb_msg = traceback.format_exc() 

    +

    3090 msg = "A failure in %s was caught:\n%s" 

    +

    3091 LOGGER.warning(msg, "_read_extra_node_connectivity, solid21p", trb_msg) 

    +

    3092 finally: 

    +

    3093 position += array_length 

    +

    3094 

    +

    3095 # 15 node solid tetras 

    +

    3096 if ( 

    +

    3097 self.header.n_solids_15_node_tetras > 0 

    +

    3098 and self.header.quadratic_elems_has_full_connectivity 

    +

    3099 ): 

    +

    3100 # manual says 8 but this seems odd 

    +

    3101 array_length = 8 * self.header.n_solids_15_node_tetras * self.header.wordsize 

    +

    3102 try: 

    +

    3103 array = self._buffer.read_ndarray( 

    +

    3104 position, array_length, 1, self._header.itype 

    +

    3105 ).reshape((self.header.n_solids_15_node_tetras, 8)) 

    +

    3106 self.arrays[ArrayType.element_solid_node15_tetras_element_index] = ( 

    +

    3107 array[:, 0] - FORTRAN_OFFSET 

    +

    3108 ) 

    +

    3109 self.arrays[ArrayType.element_solid_node15_tetras_extra_node_indexes] = ( 

    +

    3110 array[:, 1:] - FORTRAN_OFFSET 

    +

    3111 ) 

    +

    3112 except Exception: 

    +

    3113 trb_msg = traceback.format_exc() 

    +

    3114 msg = "A failure in %s was caught:\n%s" 

    +

    3115 LOGGER.warning(msg, "_read_extra_node_connectivity, solid15t", trb_msg) 

    +

    3116 finally: 

    +

    3117 position += array_length 

    +

    3118 

    +

    3119 # 20 node solid tetras 

    +

    3120 if self.header.n_solids_20_node_tetras > 0 and self.header.has_cubic_solids: 

    +

    3121 array_length = 21 * self.header.n_solids_20_node_tetras * self.header.wordsize 

    +

    3122 try: 

    +

    3123 array = self._buffer.read_ndarray( 

    +

    3124 position, array_length, 1, self._header.itype 

    +

    3125 ).reshape((self.header.n_solids_20_node_tetras, 21)) 

    +

    3126 self.arrays[ArrayType.element_solid_node20_tetras_element_index] = ( 

    +

    3127 array[:, 0] - FORTRAN_OFFSET 

    +

    3128 ) 

    +

    3129 self.arrays[ArrayType.element_solid_node20_tetras_extra_node_indexes] = ( 

    +

    3130 array[:, 1:] - FORTRAN_OFFSET 

    +

    3131 ) 

    +

    3132 except Exception: 

    +

    3133 trb_msg = traceback.format_exc() 

    +

    3134 msg = "A failure in %s was caught:\n%s" 

    +

    3135 LOGGER.warning(msg, "_read_extra_node_connectivity, solid20t", trb_msg) 

    +

    3136 finally: 

    +

    3137 position += array_length 

    +

    3138 

    +

    3139 # 40 node solid tetras 

    +

    3140 if self.header.n_solids_40_node_pentas > 0 and self.header.has_cubic_solids: 

    +

    3141 array_length = 41 * self.header.n_solids_40_node_pentas * self.header.wordsize 

    +

    3142 try: 

    +

    3143 array = self._buffer.read_ndarray( 

    +

    3144 position, array_length, 1, self._header.itype 

    +

    3145 ).reshape((self.header.n_solids_40_node_pentas, 41)) 

    +

    3146 self.arrays[ArrayType.element_solid_node40_pentas_element_index] = ( 

    +

    3147 array[:, 0] - FORTRAN_OFFSET 

    +

    3148 ) 

    +

    3149 self.arrays[ArrayType.element_solid_node40_pentas_extra_node_indexes] = ( 

    +

    3150 array[:, 1:] - FORTRAN_OFFSET 

    +

    3151 ) 

    +

    3152 except Exception: 

    +

    3153 trb_msg = traceback.format_exc() 

    +

    3154 msg = "A failure in %s was caught:\n%s" 

    +

    3155 LOGGER.warning(msg, "_read_extra_node_connectivity, solid40t", trb_msg) 

    +

    3156 finally: 

    +

    3157 position += array_length 

    +

    3158 

    +

    3159 # 64 node solid tetras 

    +

    3160 if self.header.n_solids_64_node_hexas > 0 and self.header.has_cubic_solids: 

    +

    3161 array_length = 65 * self.header.n_solids_64_node_hexas * self.header.wordsize 

    +

    3162 try: 

    +

    3163 array = self._buffer.read_ndarray( 

    +

    3164 position, array_length, 1, self._header.itype 

    +

    3165 ).reshape((self.header.n_solids_64_node_hexas, 65)) 

    +

    3166 self.arrays[ArrayType.element_solid_node64_hexas_element_index] = ( 

    +

    3167 array[:, 0] - FORTRAN_OFFSET 

    +

    3168 ) 

    +

    3169 self.arrays[ArrayType.element_solid_node64_hexas_extra_node_indexes] = ( 

    +

    3170 array[:, 1:] - FORTRAN_OFFSET 

    +

    3171 ) 

    +

    3172 except Exception: 

    +

    3173 trb_msg = traceback.format_exc() 

    +

    3174 msg = "A failure in %s was caught:\n%s" 

    +

    3175 LOGGER.warning(msg, "_read_extra_node_connectivity, solid64t", trb_msg) 

    +

    3176 finally: 

    +

    3177 position += array_length 

    +

    3178 

    +

    3179 # update position 

    +

    3180 self.geometry_section_size = position 

    +

    3181 

    +

    3182 LOGGER.debug("_read_extra_node_connectivity end at byte %d", self.geometry_section_size) 

    +

    3183 

    +

    3184 # pylint: disable = too-many-branches 

    +

    3185 @classmethod 

    +

    3186 def _read_header_part_contact_interface_titles( 

    +

    3187 cls, 

    +

    3188 header: D3plotHeader, 

    +

    3189 buffer: Union[BinaryBuffer, None], 

    +

    3190 geometry_section_size: int, 

    +

    3191 arrays: dict, 

    +

    3192 ) -> int: 

    +

    3193 """Read the header for the parts, contacts and interfaces 

    +

    3194 

    +

    3195 Parameters 

    +

    3196 ---------- 

    +

    3197 header: D3plotHeader 

    +

    3198 d3plot header 

    +

    3199 bb: BinaryBuffer 

    +

    3200 buffer holding geometry 

    +

    3201 geometry_section_size: int 

    +

    3202 size of the geometry section until now 

    +

    3203 arrays: dict 

    +

    3204 dictionary holding arrays and where arrays will be saved into 

    +

    3205 

    +

    3206 Returns 

    +

    3207 ------- 

    +

    3208 geometry_section_size: int 

    +

    3209 new size of the geometry section 

    +

    3210 """ 

    +

    3211 

    +

    3212 if not buffer: 

    +

    3213 return geometry_section_size 

    +

    3214 

    +

    3215 if header.filetype not in ( 

    +

    3216 D3plotFiletype.D3PLOT, 

    +

    3217 D3plotFiletype.D3PART, 

    +

    3218 D3plotFiletype.INTFOR, 

    +

    3219 ): 

    +

    3220 return geometry_section_size 

    +

    3221 

    +

    3222 LOGGER.debug( 

    +

    3223 "_read_header_part_contact_interface_titles start at byte %d", geometry_section_size 

    +

    3224 ) 

    +

    3225 

    +

    3226 position = geometry_section_size 

    +

    3227 

    +

    3228 # Security 

    +

    3229 # 

    +

    3230 # we try to read the titles ahead. If dyna writes multiple files 

    +

    3231 # then the first file is geometry only thus failing here has no 

    +

    3232 # impact on further state reading. 

    +

    3233 # If though states are compressed into the first file then we are 

    +

    3234 # in trouble here even when catching here. 

    +

    3235 try: 

    +

    3236 # there is only output if there is an eof marker 

    +

    3237 # at least I think I fixed such a bug in the past 

    +

    3238 if not cls._is_end_of_file_marker(buffer, position, header.ftype): 

    +

    3239 return geometry_section_size 

    +

    3240 

    +

    3241 position += header.wordsize 

    +

    3242 

    +

    3243 # section have types here according to what is inside 

    +

    3244 ntypes = [] 

    +

    3245 

    +

    3246 # read first ntype 

    +

    3247 current_ntype = buffer.read_number(position, header.itype) 

    +

    3248 

    +

    3249 while current_ntype in [90000, 90001, 90002, 90020]: 

    +

    3250 

    +

    3251 # title output 

    +

    3252 if current_ntype == 90000: 

    +

    3253 

    +

    3254 ntypes.append(current_ntype) 

    +

    3255 position += header.wordsize 

    +

    3256 

    +

    3257 # Bugfix: 

    +

    3258 # the titles are always 18*4 bytes, even if the wordsize 

    +

    3259 # is 8 bytes for the entire file. 

    +

    3260 titles_wordsize = 4 

    +

    3261 

    +

    3262 array_length = 18 * titles_wordsize 

    +

    3263 header.title2 = buffer.read_text(position, array_length) 

    +

    3264 position += array_length 

    +

    3265 

    +

    3266 # some title output 

    +

    3267 elif current_ntype in [90001, 90002, 90020]: 

    +

    3268 

    +

    3269 ntypes.append(current_ntype) 

    +

    3270 position += header.wordsize 

    +

    3271 

    +

    3272 # number of parts 

    +

    3273 entry_count = buffer.read_number(position, header.itype) 

    +

    3274 position += header.wordsize 

    +

    3275 

    +

    3276 # Bugfix: 

    +

    3277 # the titles are always 18*4 bytes, even if the wordsize 

    +

    3278 # is 8 bytes for the entire file. 

    +

    3279 titles_wordsize = 4 

    +

    3280 

    +

    3281 # part ids and corresponding titles 

    +

    3282 array_type = np.dtype( 

    +

    3283 [("ids", header.itype), ("titles", "S" + str(18 * titles_wordsize))] 

    +

    3284 ) 

    +

    3285 array_length = (header.wordsize + 18 * titles_wordsize) * int(entry_count) 

    +

    3286 tmp_arrays = buffer.read_ndarray(position, array_length, 1, array_type) 

    +

    3287 position += array_length 

    +

    3288 

    +

    3289 # save stuff 

    +

    3290 if current_ntype == 90001: 

    +

    3291 arrays[ArrayType.part_titles_ids] = tmp_arrays["ids"] 

    +

    3292 arrays[ArrayType.part_titles] = tmp_arrays["titles"] 

    +

    3293 elif current_ntype == 90002: 

    +

    3294 arrays[ArrayType.contact_title_ids] = tmp_arrays["ids"] 

    +

    3295 arrays[ArrayType.contact_titles] = tmp_arrays["titles"] 

    +

    3296 elif current_ntype == 90020: 

    +

    3297 arrays["icfd_part_title_ids"] = tmp_arrays["ids"] 

    +

    3298 arrays["icfd_part_titles"] = tmp_arrays["titles"] 

    +

    3299 

    +

    3300 # d3prop 

    +

    3301 elif current_ntype == 90100: 

    +

    3302 

    +

    3303 ntypes.append(current_ntype) 

    +

    3304 position += header.wordsize 

    +

    3305 

    +

    3306 # number of keywords 

    +

    3307 nline = buffer.read_number(position, header.itype) 

    +

    3308 position += header.wordsize 

    +

    3309 

    +

    3310 # Bugfix: 

    +

    3311 # the titles are always 18*4 bytes, even if the wordsize 

    +

    3312 # is 8 bytes for the entire file. 

    +

    3313 titles_wordsize = 4 

    +

    3314 

    +

    3315 # keywords 

    +

    3316 array_length = 20 * titles_wordsize * int(nline) 

    +

    3317 d3prop_keywords = buffer.read_ndarray( 

    +

    3318 position, array_length, 1, np.dtype("S" + str(titles_wordsize * 20)) 

    +

    3319 ) 

    +

    3320 position += array_length 

    +

    3321 

    +

    3322 # save 

    +

    3323 arrays["d3prop_keywords"] = d3prop_keywords 

    +

    3324 

    +

    3325 # not sure whether there is an eof file here 

    +

    3326 # do not have a test file to check ... 

    +

    3327 if cls._is_end_of_file_marker(buffer, position, header.ftype): 

    +

    3328 position += header.wordsize 

    +

    3329 

    +

    3330 # next one 

    +

    3331 if buffer.size <= position: 

    +

    3332 break 

    +

    3333 current_ntype = buffer.read_number(position, header.itype) 

    +

    3334 

    +

    3335 header.n_types = tuple(ntypes) 

    +

    3336 

    +

    3337 except Exception: 

    +

    3338 trb_msg = traceback.format_exc() 

    +

    3339 msg = "A failure in %s was caught:\n%s" 

    +

    3340 LOGGER.warning(msg, "_read_header_part_contact_interface_titles", trb_msg) 

    +

    3341 

    +

    3342 # remember position 

    +

    3343 geometry_section_size = position 

    +

    3344 LOGGER.debug( 

    +

    3345 "_read_header_part_contact_interface_titles end at byte %d", geometry_section_size 

    +

    3346 ) 

    +

    3347 

    +

    3348 return geometry_section_size 

    +

    3349 

    +

    3350 @staticmethod 

    +

    3351 def _read_states_allocate_arrays( 

    +

    3352 header: D3plotHeader, 

    +

    3353 material_section_info: MaterialSectionInfo, 

    +

    3354 airbag_info: AirbagInfo, 

    +

    3355 rigid_road_info: RigidRoadInfo, 

    +

    3356 rigid_body_info: RigidBodyInfo, 

    +

    3357 n_states: int, 

    +

    3358 n_rigid_walls: int, 

    +

    3359 n_parts: int, 

    +

    3360 array_names: Union[Iterable[str], None], 

    +

    3361 array_dict: dict, 

    +

    3362 ) -> None: 

    +

    3363 """Allocate the state arrays 

    +

    3364 

    +

    3365 Parameters 

    +

    3366 ---------- 

    +

    3367 header: D3plotHeader 

    +

    3368 header of the d3plot 

    +

    3369 material_section_info: MaterialSectionInfo 

    +

    3370 info about the material section data 

    +

    3371 airbag_info: AirbagInfo 

    +

    3372 info for airbags 

    +

    3373 rigid_road_info: RigidRoadInfo 

    +

    3374 info for rigid roads 

    +

    3375 rigid_body_info: RigidBodyInfo 

    +

    3376 info for rigid bodies 

    +

    3377 n_states: int 

    +

    3378 number of states to allocate memory for 

    +

    3379 n_rigid_walls: int 

    +

    3380 number of rigid walls 

    +

    3381 n_parts: int 

    +

    3382 number of parts 

    +

    3383 array_names: Union[Iterable[str], None] 

    +

    3384 names of state arrays to allocate (all if None) 

    +

    3385 array_dict: dict 

    +

    3386 dictionary to allocate arrays into 

    +

    3387 """ 

    +

    3388 

    +

    3389 # (1) ARRAY SHAPES 

    +

    3390 # general 

    +

    3391 n_dim = header.n_dimensions 

    +

    3392 # nodes 

    +

    3393 n_nodes = header.n_nodes 

    +

    3394 # solids 

    +

    3395 n_solids = header.n_solids 

    +

    3396 n_solids_thermal_vars = header.n_solid_thermal_vars 

    +

    3397 n_solids_strain_vars = 6 * header.has_element_strain * (header.n_solid_history_vars >= 6) 

    +

    3398 n_solid_thermal_strain_vars = 6 * header.has_solid_shell_thermal_strain_tensor 

    +

    3399 n_solid_plastic_strain_vars = 6 * header.has_solid_shell_plastic_strain_tensor 

    +

    3400 n_solid_layers = header.n_solid_layers 

    +

    3401 n_solids_history_vars = ( 

    +

    3402 header.n_solid_history_vars 

    +

    3403 - n_solids_strain_vars 

    +

    3404 - n_solid_thermal_strain_vars 

    +

    3405 - n_solid_plastic_strain_vars 

    +

    3406 ) 

    +

    3407 # thick shells 

    +

    3408 n_tshells = header.n_thick_shells 

    +

    3409 n_tshells_history_vars = header.n_shell_tshell_history_vars 

    +

    3410 n_tshells_layers = header.n_shell_tshell_layers 

    +

    3411 # beams 

    +

    3412 n_beams = header.n_beams 

    +

    3413 n_beams_history_vars = header.n_beam_history_vars 

    +

    3414 n_beam_vars = header.n_beam_vars 

    +

    3415 n_beams_layers = max( 

    +

    3416 int((-3 * n_beams_history_vars + n_beam_vars - 6) / (n_beams_history_vars + 5)), 0 

    +

    3417 ) 

    +

    3418 # shells 

    +

    3419 n_shells = header.n_shells 

    +

    3420 n_shells_reduced = header.n_shells - material_section_info.n_rigid_shells 

    +

    3421 n_shell_layers = header.n_shell_tshell_layers 

    +

    3422 n_shell_history_vars = header.n_shell_tshell_history_vars 

    +

    3423 # sph 

    +

    3424 allocate_sph = header.n_sph_nodes != 0 

    +

    3425 n_sph_particles = header.n_sph_nodes if allocate_sph else 0 

    +

    3426 # airbags 

    +

    3427 allocate_airbags = header.n_airbags != 0 

    +

    3428 n_airbags = header.n_airbags if allocate_airbags else 0 

    +

    3429 n_airbag_particles = airbag_info.n_particles if allocate_airbags else 0 

    +

    3430 # rigid roads 

    +

    3431 allocate_rigid_roads = rigid_road_info.n_roads != 0 

    +

    3432 n_roads = rigid_road_info.n_roads if allocate_rigid_roads else 0 

    +

    3433 # rigid bodies 

    +

    3434 n_rigid_bodies = rigid_body_info.n_rigid_bodies 

    +

    3435 

    +

    3436 # dictionary to lookup array types 

    +

    3437 state_array_shapes = { 

    +

    3438 # global 

    +

    3439 ArrayType.global_timesteps: [n_states], 

    +

    3440 ArrayType.global_kinetic_energy: [n_states], 

    +

    3441 ArrayType.global_internal_energy: [n_states], 

    +

    3442 ArrayType.global_total_energy: [n_states], 

    +

    3443 ArrayType.global_velocity: [n_states, 3], 

    +

    3444 # parts 

    +

    3445 ArrayType.part_internal_energy: [n_states, n_parts], 

    +

    3446 ArrayType.part_kinetic_energy: [n_states, n_parts], 

    +

    3447 ArrayType.part_velocity: [n_states, n_parts, 3], 

    +

    3448 ArrayType.part_mass: [n_states, n_parts], 

    +

    3449 ArrayType.part_hourglass_energy: [n_states, n_parts], 

    +

    3450 # rigid wall 

    +

    3451 ArrayType.rigid_wall_force: [n_states, n_rigid_walls], 

    +

    3452 ArrayType.rigid_wall_position: [n_states, n_rigid_walls, 3], 

    +

    3453 # nodes 

    +

    3454 ArrayType.node_temperature: [n_states, n_nodes, 3] 

    +

    3455 if header.has_node_temperature_layers 

    +

    3456 else [n_states, n_nodes], 

    +

    3457 ArrayType.node_heat_flux: [n_states, n_nodes, 3], 

    +

    3458 ArrayType.node_mass_scaling: [n_states, n_nodes], 

    +

    3459 ArrayType.node_displacement: [n_states, n_nodes, n_dim], 

    +

    3460 ArrayType.node_velocity: [n_states, n_nodes, n_dim], 

    +

    3461 ArrayType.node_acceleration: [n_states, n_nodes, n_dim], 

    +

    3462 ArrayType.node_temperature_gradient: [n_states, n_nodes], 

    +

    3463 ArrayType.node_residual_forces: [n_states, n_nodes, 3], 

    +

    3464 ArrayType.node_residual_moments: [n_states, n_nodes, 3], 

    +

    3465 # solids 

    +

    3466 ArrayType.element_solid_thermal_data: [n_states, n_solids, n_solids_thermal_vars], 

    +

    3467 ArrayType.element_solid_stress: [n_states, n_solids, n_solid_layers, 6], 

    +

    3468 ArrayType.element_solid_effective_plastic_strain: [n_states, n_solids, n_solid_layers], 

    +

    3469 ArrayType.element_solid_history_variables: [ 

    +

    3470 n_states, 

    +

    3471 n_solids, 

    +

    3472 n_solid_layers, 

    +

    3473 n_solids_history_vars, 

    +

    3474 ], 

    +

    3475 ArrayType.element_solid_strain: [n_states, n_solids, n_solid_layers, 6], 

    +

    3476 ArrayType.element_solid_is_alive: [n_states, n_solids], 

    +

    3477 ArrayType.element_solid_plastic_strain_tensor: [n_states, n_solids, n_solid_layers, 6], 

    +

    3478 ArrayType.element_solid_thermal_strain_tensor: [n_states, n_solids, n_solid_layers, 6], 

    +

    3479 # thick shells 

    +

    3480 ArrayType.element_tshell_stress: [n_states, n_tshells, n_tshells_layers, 6], 

    +

    3481 ArrayType.element_tshell_effective_plastic_strain: [ 

    +

    3482 n_states, 

    +

    3483 n_tshells, 

    +

    3484 n_tshells_layers, 

    +

    3485 ], 

    +

    3486 ArrayType.element_tshell_history_variables: [ 

    +

    3487 n_states, 

    +

    3488 n_tshells, 

    +

    3489 n_tshells_layers, 

    +

    3490 n_tshells_history_vars, 

    +

    3491 ], 

    +

    3492 ArrayType.element_tshell_strain: [n_states, n_tshells, 2, 6], 

    +

    3493 ArrayType.element_tshell_is_alive: [n_states, n_tshells], 

    +

    3494 # beams 

    +

    3495 ArrayType.element_beam_axial_force: [n_states, n_beams], 

    +

    3496 ArrayType.element_beam_shear_force: [n_states, n_beams, 2], 

    +

    3497 ArrayType.element_beam_bending_moment: [n_states, n_beams, 2], 

    +

    3498 ArrayType.element_beam_torsion_moment: [n_states, n_beams], 

    +

    3499 ArrayType.element_beam_shear_stress: [n_states, n_beams, n_beams_layers, 2], 

    +

    3500 ArrayType.element_beam_axial_stress: [n_states, n_beams, n_beams_layers], 

    +

    3501 ArrayType.element_beam_plastic_strain: [n_states, n_beams, n_beams_layers], 

    +

    3502 ArrayType.element_beam_axial_strain: [n_states, n_beams, n_beams_layers], 

    +

    3503 ArrayType.element_beam_history_vars: [ 

    +

    3504 n_states, 

    +

    3505 n_beams, 

    +

    3506 n_beams_layers + 3, 

    +

    3507 n_beams_history_vars, 

    +

    3508 ], 

    +

    3509 ArrayType.element_beam_is_alive: [n_states, n_beams], 

    +

    3510 # shells 

    +

    3511 ArrayType.element_shell_stress: [n_states, n_shells_reduced, n_shell_layers, 6], 

    +

    3512 ArrayType.element_shell_effective_plastic_strain: [ 

    +

    3513 n_states, 

    +

    3514 n_shells_reduced, 

    +

    3515 n_shell_layers, 

    +

    3516 ], 

    +

    3517 ArrayType.element_shell_history_vars: [ 

    +

    3518 n_states, 

    +

    3519 n_shells_reduced, 

    +

    3520 n_shell_layers, 

    +

    3521 n_shell_history_vars, 

    +

    3522 ], 

    +

    3523 ArrayType.element_shell_bending_moment: [n_states, n_shells_reduced, 3], 

    +

    3524 ArrayType.element_shell_shear_force: [n_states, n_shells_reduced, 2], 

    +

    3525 ArrayType.element_shell_normal_force: [n_states, n_shells_reduced, 3], 

    +

    3526 ArrayType.element_shell_thickness: [n_states, n_shells_reduced], 

    +

    3527 ArrayType.element_shell_unknown_variables: [n_states, n_shells_reduced, 2], 

    +

    3528 ArrayType.element_shell_internal_energy: [n_states, n_shells_reduced], 

    +

    3529 ArrayType.element_shell_strain: [n_states, n_shells_reduced, 2, 6], 

    +

    3530 ArrayType.element_shell_thermal_strain_tensor: [n_states, n_shells_reduced, 6], 

    +

    3531 ArrayType.element_shell_plastic_strain_tensor: [ 

    +

    3532 n_states, 

    +

    3533 n_shells_reduced, 

    +

    3534 n_shell_layers, 

    +

    3535 6, 

    +

    3536 ], 

    +

    3537 ArrayType.element_shell_is_alive: [n_states, n_shells], 

    +

    3538 # sph 

    +

    3539 ArrayType.sph_deletion: [n_states, n_sph_particles], 

    +

    3540 ArrayType.sph_radius: [n_states, n_sph_particles], 

    +

    3541 ArrayType.sph_pressure: [n_states, n_sph_particles], 

    +

    3542 ArrayType.sph_stress: [n_states, n_sph_particles, 6], 

    +

    3543 ArrayType.sph_effective_plastic_strain: [n_states, n_sph_particles], 

    +

    3544 ArrayType.sph_density: [n_states, n_sph_particles], 

    +

    3545 ArrayType.sph_internal_energy: [n_states, n_sph_particles], 

    +

    3546 ArrayType.sph_n_neighbors: [n_states, n_sph_particles], 

    +

    3547 ArrayType.sph_strain: [n_states, n_sph_particles, 6], 

    +

    3548 ArrayType.sph_mass: [n_states, n_sph_particles], 

    +

    3549 # airbag 

    +

    3550 ArrayType.airbag_n_active_particles: [n_states, n_airbags], 

    +

    3551 ArrayType.airbag_bag_volume: [n_states, n_airbags], 

    +

    3552 ArrayType.airbag_particle_gas_id: [n_states, n_airbag_particles], 

    +

    3553 ArrayType.airbag_particle_chamber_id: [n_states, n_airbag_particles], 

    +

    3554 ArrayType.airbag_particle_leakage: [n_states, n_airbag_particles], 

    +

    3555 ArrayType.airbag_particle_mass: [n_states, n_airbag_particles], 

    +

    3556 ArrayType.airbag_particle_radius: [n_states, n_airbag_particles], 

    +

    3557 ArrayType.airbag_particle_spin_energy: [n_states, n_airbag_particles], 

    +

    3558 ArrayType.airbag_particle_translation_energy: [n_states, n_airbag_particles], 

    +

    3559 ArrayType.airbag_particle_nearest_segment_distance: [n_states, n_airbag_particles], 

    +

    3560 ArrayType.airbag_particle_position: [n_states, n_airbag_particles, 3], 

    +

    3561 ArrayType.airbag_particle_velocity: [n_states, n_airbag_particles, 3], 

    +

    3562 # rigid road 

    +

    3563 ArrayType.rigid_road_displacement: [n_states, n_roads, 3], 

    +

    3564 ArrayType.rigid_road_velocity: [n_states, n_roads, 3], 

    +

    3565 # rigid body 

    +

    3566 ArrayType.rigid_body_coordinates: [n_states, n_rigid_bodies, 3], 

    +

    3567 ArrayType.rigid_body_rotation_matrix: [n_states, n_rigid_bodies, 9], 

    +

    3568 ArrayType.rigid_body_velocity: [n_states, n_rigid_bodies, 3], 

    +

    3569 ArrayType.rigid_body_rot_velocity: [n_states, n_rigid_bodies, 3], 

    +

    3570 ArrayType.rigid_body_acceleration: [n_states, n_rigid_bodies, 3], 

    +

    3571 ArrayType.rigid_body_rot_acceleration: [n_states, n_rigid_bodies, 3], 

    +

    3572 } 

    +

    3573 

    +

    3574 # only allocate available arrays 

    +

    3575 if array_names is None: 

    +

    3576 array_names = ArrayType.get_state_array_names() 

    +

    3577 

    +

    3578 # BUGFIX 

    +

    3579 # These arrays are actually integer types, all other state arrays 

    +

    3580 # are floats 

    +

    3581 int_state_arrays = [ 

    +

    3582 ArrayType.airbag_n_active_particles, 

    +

    3583 ArrayType.airbag_particle_gas_id, 

    +

    3584 ArrayType.airbag_particle_chamber_id, 

    +

    3585 ArrayType.airbag_particle_leakage, 

    +

    3586 ] 

    +

    3587 

    +

    3588 # (2) ALLOCATE ARRAYS 

    +

    3589 # this looper allocates the arrays specified by the user. 

    +

    3590 for array_name in array_names: 

    +

    3591 

    +

    3592 array_dtype = header.ftype if array_name not in int_state_arrays else header.itype 

    +

    3593 

    +

    3594 if array_name in state_array_shapes: 

    +

    3595 array_dict[array_name] = np.empty(state_array_shapes[array_name], dtype=array_dtype) 

    +

    3596 else: 

    +

    3597 raise ValueError( 

    +

    3598 f"Array '{array_name}' is not a state array. " 

    +

    3599 f"Please try one of: {list(state_array_shapes.keys())}", 

    +

    3600 ) 

    +

    3601 

    +

    3602 @staticmethod 

    +

    3603 def _read_states_transfer_memory( 

    +

    3604 i_state: int, buffer_array_dict: dict, master_array_dict: dict 

    +

    3605 ): 

    +

    3606 """Transfers the memory from smaller buffer arrays with only a few 

    +

    3607 timesteps into the major one 

    +

    3608 

    +

    3609 Parameters 

    +

    3610 ---------- 

    +

    3611 i_state: int 

    +

    3612 current state index 

    +

    3613 buffer_array_dict: dict 

    +

    3614 dict with arrays of only a few timesteps 

    +

    3615 master_array_dict: dict 

    +

    3616 dict with the parent master arrays 

    +

    3617 

    +

    3618 Notes 

    +

    3619 ----- 

    +

    3620 If an array in the master dict is not found in the buffer dict 

    +

    3621 then this array is set to `None`. 

    +

    3622 """ 

    +

    3623 

    +

    3624 state_array_names = ArrayType.get_state_array_names() 

    +

    3625 

    +

    3626 arrays_to_delete = [] 

    +

    3627 for array_name, array in master_array_dict.items(): 

    +

    3628 

    +

    3629 # copy memory to big array 

    +

    3630 if array_name in buffer_array_dict: 

    +

    3631 buffer_array = buffer_array_dict[array_name] 

    +

    3632 n_states_buffer_array = buffer_array.shape[0] 

    +

    3633 array[i_state : i_state + n_states_buffer_array] = buffer_array 

    +

    3634 else: 

    +

    3635 # remove unnecesary state arrays (not geometry arrays!) 

    +

    3636 # we "could" deal with this in the allocate function 

    +

    3637 # by not allocating them but this would replicate code 

    +

    3638 # in the reading functions 

    +

    3639 if array_name in state_array_names: 

    +

    3640 arrays_to_delete.append(array_name) 

    +

    3641 

    +

    3642 for array_name in arrays_to_delete: 

    +

    3643 del master_array_dict[array_name] 

    +

    3644 

    +

    3645 def _compute_n_bytes_per_state(self) -> int: 

    +

    3646 """Computes the number of bytes for every state 

    +

    3647 

    +

    3648 Returns 

    +

    3649 ------- 

    +

    3650 n_bytes_per_state: int 

    +

    3651 number of bytes of every state 

    +

    3652 """ 

    +

    3653 

    +

    3654 if not self.header: 

    +

    3655 return 0 

    +

    3656 

    +

    3657 # timestep 

    +

    3658 timestep_offset = 1 * self.header.wordsize 

    +

    3659 # global vars 

    +

    3660 global_vars_offset = self.header.n_global_vars * self.header.wordsize 

    +

    3661 # node vars 

    +

    3662 n_node_vars = ( 

    +

    3663 self.header.has_node_displacement 

    +

    3664 + self.header.has_node_velocity 

    +

    3665 + self.header.has_node_acceleration 

    +

    3666 ) * self.header.n_dimensions 

    +

    3667 

    +

    3668 if self.header.has_node_temperatures: 

    +

    3669 n_node_vars += 1 

    +

    3670 if self.header.has_node_temperature_layers: 

    +

    3671 n_node_vars += 2 

    +

    3672 if self.header.has_node_heat_flux: 

    +

    3673 n_node_vars += 3 

    +

    3674 if self.header.has_node_mass_scaling: 

    +

    3675 n_node_vars += 1 

    +

    3676 if self.header.has_node_temperature_gradient: 

    +

    3677 n_node_vars += 1 

    +

    3678 if self.header.has_node_residual_forces: 

    +

    3679 n_node_vars += 3 

    +

    3680 if self.header.has_node_residual_moments: 

    +

    3681 n_node_vars += 3 

    +

    3682 

    +

    3683 node_data_offset = n_node_vars * self.header.n_nodes * self.header.wordsize 

    +

    3684 # thermal shit 

    +

    3685 therm_data_offset = ( 

    +

    3686 self.header.n_solid_thermal_vars * self.header.n_solids * self.header.wordsize 

    +

    3687 ) 

    +

    3688 # solids 

    +

    3689 solid_offset = self.header.n_solids * self.header.n_solid_vars * self.header.wordsize 

    +

    3690 # tshells 

    +

    3691 tshell_offset = ( 

    +

    3692 self.header.n_thick_shells * self.header.n_thick_shell_vars * self.header.wordsize 

    +

    3693 ) 

    +

    3694 # beams 

    +

    3695 beam_offset = self.header.n_beams * self.header.n_beam_vars * self.header.wordsize 

    +

    3696 # shells 

    +

    3697 shell_offset = ( 

    +

    3698 (self.header.n_shells - self._material_section_info.n_rigid_shells) 

    +

    3699 * self.header.n_shell_vars 

    +

    3700 * self.header.wordsize 

    +

    3701 ) 

    +

    3702 # Manual 

    +

    3703 # "NOTE: This CFDDATA is no longer output by ls-dyna." 

    +

    3704 cfd_data_offset = 0 

    +

    3705 # sph 

    +

    3706 sph_offset = self.header.n_sph_nodes * self._sph_info.n_sph_vars * self.header.wordsize 

    +

    3707 # deleted nodes and elems ... or nothing 

    +

    3708 elem_deletion_offset = 0 

    +

    3709 if self.header.has_node_deletion_data: 

    +

    3710 elem_deletion_offset = self.header.n_nodes * self.header.wordsize 

    +

    3711 elif self.header.has_element_deletion_data: 

    +

    3712 elem_deletion_offset = ( 

    +

    3713 self.header.n_beams 

    +

    3714 + self.header.n_shells 

    +

    3715 + self.header.n_solids 

    +

    3716 + self.header.n_thick_shells 

    +

    3717 ) * self.header.wordsize 

    +

    3718 # airbag particle offset 

    +

    3719 if self._airbag_info.n_airbags: 

    +

    3720 particle_state_offset = ( 

    +

    3721 self._airbag_info.n_airbags * self._airbag_info.n_airbag_state_variables 

    +

    3722 + self._airbag_info.n_particles * self._airbag_info.n_particle_state_variables 

    +

    3723 ) * self.header.wordsize 

    +

    3724 else: 

    +

    3725 particle_state_offset = 0 

    +

    3726 # rigid road stuff whoever uses this 

    +

    3727 road_surface_offset = self._rigid_road_info.n_roads * 6 * self.header.wordsize 

    +

    3728 # rigid body motion data 

    +

    3729 if self.header.has_rigid_body_data: 

    +

    3730 n_rigids = self._rigid_body_info.n_rigid_bodies 

    +

    3731 n_rigid_vars = 12 if self.header.has_reduced_rigid_body_data else 24 

    +

    3732 rigid_body_motion_offset = n_rigids * n_rigid_vars * self.header.wordsize 

    +

    3733 else: 

    +

    3734 rigid_body_motion_offset = 0 

    +

    3735 # ... not supported 

    +

    3736 extra_data_offset = 0 

    +

    3737 

    +

    3738 n_bytes_per_state = ( 

    +

    3739 timestep_offset 

    +

    3740 + global_vars_offset 

    +

    3741 + node_data_offset 

    +

    3742 + therm_data_offset 

    +

    3743 + solid_offset 

    +

    3744 + tshell_offset 

    +

    3745 + beam_offset 

    +

    3746 + shell_offset 

    +

    3747 + cfd_data_offset 

    +

    3748 + sph_offset 

    +

    3749 + elem_deletion_offset 

    +

    3750 + particle_state_offset 

    +

    3751 + road_surface_offset 

    +

    3752 + rigid_body_motion_offset 

    +

    3753 + extra_data_offset 

    +

    3754 ) 

    +

    3755 return n_bytes_per_state 

    +

    3756 

    +

    3757 def _read_states(self, filepath: str): 

    +

    3758 """Read the states from the d3plot 

    +

    3759 

    +

    3760 Parameters 

    +

    3761 ---------- 

    +

    3762 filepath: str 

    +

    3763 path to the d3plot 

    +

    3764 """ 

    +

    3765 

    +

    3766 if not self._buffer or not filepath: 

    +

    3767 self._state_info.n_timesteps = 0 

    +

    3768 return 

    +

    3769 

    +

    3770 LOGGER.debug("-------- S T A T E S --------") 

    +

    3771 LOGGER.debug("_read_states with geom offset %d", self.geometry_section_size) 

    +

    3772 

    +

    3773 # (0) OFFSETS 

    +

    3774 bytes_per_state = self._compute_n_bytes_per_state() 

    +

    3775 LOGGER.debug("bytes_per_state: %d", bytes_per_state) 

    +

    3776 

    +

    3777 # load the memory from the files 

    +

    3778 if self._femzip_info.use_femzip: 

    +

    3779 bytes_per_state += 1 * self.header.wordsize 

    +

    3780 self.bb_generator = self._read_femzip_file_generator( 

    +

    3781 self.buffered_reading, self.state_filter 

    +

    3782 ) 

    +

    3783 else: 

    +

    3784 self.bb_generator = self._read_d3plot_file_generator( 

    +

    3785 self.buffered_reading, self.state_filter 

    +

    3786 ) 

    +

    3787 

    +

    3788 # (1) READ STATE DATA 

    +

    3789 n_states = next(self.bb_generator) 

    +

    3790 

    +

    3791 # determine whether to transfer arrays 

    +

    3792 if not self.buffered_reading: 

    +

    3793 transfer_arrays = False 

    +

    3794 else: 

    +

    3795 transfer_arrays = True 

    +

    3796 if self.state_filter is not None and any(self.state_filter): 

    +

    3797 transfer_arrays = True 

    +

    3798 if self.state_array_filter: 

    +

    3799 transfer_arrays = True 

    +

    3800 

    +

    3801 # arrays need to be preallocated if we transfer them 

    +

    3802 if transfer_arrays: 

    +

    3803 self._read_states_allocate_arrays( 

    +

    3804 self.header, 

    +

    3805 self._material_section_info, 

    +

    3806 self._airbag_info, 

    +

    3807 self._rigid_road_info, 

    +

    3808 self._rigid_body_info, 

    +

    3809 n_states, 

    +

    3810 self._n_rigid_walls, 

    +

    3811 self._n_parts, 

    +

    3812 self.state_array_filter, 

    +

    3813 self.arrays, 

    +

    3814 ) 

    +

    3815 

    +

    3816 i_state = 0 

    +

    3817 for bb_states, n_states in self.bb_generator: 

    +

    3818 

    +

    3819 # dictionary to store the temporary, partial arrays 

    +

    3820 # if we do not transfer any arrays we store them directly 

    +

    3821 # in the classes main dict 

    +

    3822 array_dict = {} if transfer_arrays else self.arrays 

    +

    3823 

    +

    3824 # sometimes there is just a geometry in the file 

    +

    3825 if n_states == 0: 

    +

    3826 continue 

    +

    3827 

    +

    3828 # state data as array 

    +

    3829 array_length = int(n_states) * int(bytes_per_state) 

    +

    3830 state_data = bb_states.read_ndarray(0, array_length, 1, self.header.ftype) 

    +

    3831 state_data = state_data.reshape((n_states, -1)) 

    +

    3832 

    +

    3833 var_index = 0 

    +

    3834 

    +

    3835 # global state header 

    +

    3836 var_index = self._read_states_global_section(state_data, var_index, array_dict) 

    +

    3837 

    +

    3838 # node data 

    +

    3839 var_index = self._read_states_nodes(state_data, var_index, array_dict) 

    +

    3840 

    +

    3841 # thermal solid data 

    +

    3842 var_index = self._read_states_solids_thermal(state_data, var_index, array_dict) 

    +

    3843 

    +

    3844 # cfddata was originally here 

    +

    3845 

    +

    3846 # solids 

    +

    3847 var_index = self._read_states_solids(state_data, var_index, array_dict) 

    +

    3848 

    +

    3849 # tshells 

    +

    3850 var_index = self._read_states_tshell(state_data, var_index, array_dict) 

    +

    3851 

    +

    3852 # beams 

    +

    3853 var_index = self._read_states_beams(state_data, var_index, array_dict) 

    +

    3854 

    +

    3855 # shells 

    +

    3856 var_index = self._read_states_shell(state_data, var_index, array_dict) 

    +

    3857 

    +

    3858 # element and node deletion info 

    +

    3859 var_index = self._read_states_is_alive(state_data, var_index, array_dict) 

    +

    3860 

    +

    3861 # sph 

    +

    3862 var_index = self._read_states_sph(state_data, var_index, array_dict) 

    +

    3863 

    +

    3864 # airbag particle data 

    +

    3865 var_index = self._read_states_airbags(state_data, var_index, array_dict) 

    +

    3866 

    +

    3867 # road surface data 

    +

    3868 var_index = self._read_states_road_surfaces(state_data, var_index, array_dict) 

    +

    3869 

    +

    3870 # rigid body motion 

    +

    3871 var_index = self._read_states_rigid_body_motion(state_data, var_index, array_dict) 

    +

    3872 

    +

    3873 # transfer memory 

    +

    3874 if transfer_arrays: 

    +

    3875 self._read_states_transfer_memory(i_state, array_dict, self.arrays) 

    +

    3876 

    +

    3877 # increment state counter 

    +

    3878 i_state += n_states 

    +

    3879 self._state_info.n_timesteps = i_state 

    +

    3880 

    +

    3881 if transfer_arrays: 

    +

    3882 self._buffer = None 

    +

    3883 self.bb_states = None 

    +

    3884 

    +

    3885 def _read_states_global_section( 

    +

    3886 self, state_data: np.ndarray, var_index: int, array_dict: dict 

    +

    3887 ) -> int: 

    +

    3888 """Read the global vars for the state 

    +

    3889 

    +

    3890 Parameters 

    +

    3891 ---------- 

    +

    3892 state_data: np.ndarray 

    +

    3893 array with entire state data 

    +

    3894 var_index: int 

    +

    3895 variable index in the state data array 

    +

    3896 array_dict: dict 

    +

    3897 dictionary to store the loaded arrays in 

    +

    3898 

    +

    3899 Returns 

    +

    3900 ------- 

    +

    3901 var_index: int 

    +

    3902 updated variable index after reading the section 

    +

    3903 """ 

    +

    3904 

    +

    3905 LOGGER.debug("_read_states_global_section start at var_index %d", var_index) 

    +

    3906 

    +

    3907 # we wrap globals, parts and rigid walls into a single try 

    +

    3908 # catch block since in the header the global section is 

    +

    3909 # defined by those three. If we fail in any of those we can 

    +

    3910 # only heal by skipping all together and jumping forward 

    +

    3911 original_var_index = var_index 

    +

    3912 try: 

    +

    3913 # timestep 

    +

    3914 array_dict[ArrayType.global_timesteps] = state_data[:, var_index] 

    +

    3915 var_index += 1 

    +

    3916 

    +

    3917 # global stuff 

    +

    3918 var_index = self._read_states_globals(state_data, var_index, array_dict) 

    +

    3919 

    +

    3920 # parts 

    +

    3921 var_index = self._read_states_parts(state_data, var_index, array_dict) 

    +

    3922 

    +

    3923 # rigid walls 

    +

    3924 var_index = self._read_states_rigid_walls(state_data, var_index, array_dict) 

    +

    3925 

    +

    3926 except Exception: 

    +

    3927 # print 

    +

    3928 trb_msg = traceback.format_exc() 

    +

    3929 msg = "A failure in %s was caught:\n%s" 

    +

    3930 LOGGER.warning(msg, "_read_states_global_section", trb_msg) 

    +

    3931 finally: 

    +

    3932 timestep_var_size = 1 

    +

    3933 var_index = original_var_index + self.header.n_global_vars + timestep_var_size 

    +

    3934 

    +

    3935 LOGGER.debug("_read_states_global_section end at var_index %d", var_index) 

    +

    3936 

    +

    3937 return var_index 

    +

    3938 

    +

    3939 def _read_states_globals(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    3940 """Read the part data in the state section 

    +

    3941 

    +

    3942 Parameters 

    +

    3943 ---------- 

    +

    3944 state_data: np.ndarray 

    +

    3945 array with entire state data 

    +

    3946 var_index: int 

    +

    3947 variable index in the state data array 

    +

    3948 array_dict: dict 

    +

    3949 dictionary to store the loaded arrays in 

    +

    3950 

    +

    3951 Returns 

    +

    3952 ------- 

    +

    3953 var_index: int 

    +

    3954 updated variable index after reading the section 

    +

    3955 """ 

    +

    3956 

    +

    3957 n_global_vars = self.header.n_global_vars 

    +

    3958 

    +

    3959 # global stuff 

    +

    3960 i_global_var = 0 

    +

    3961 if i_global_var < n_global_vars: 

    +

    3962 array_dict[ArrayType.global_kinetic_energy] = state_data[:, var_index + i_global_var] 

    +

    3963 i_global_var += 1 

    +

    3964 if i_global_var < n_global_vars: 

    +

    3965 array_dict[ArrayType.global_internal_energy] = state_data[:, var_index + i_global_var] 

    +

    3966 i_global_var += 1 

    +

    3967 if i_global_var < n_global_vars: 

    +

    3968 array_dict[ArrayType.global_total_energy] = state_data[:, var_index + i_global_var] 

    +

    3969 i_global_var += 1 

    +

    3970 if i_global_var + 3 <= n_global_vars: 

    +

    3971 array_dict[ArrayType.global_velocity] = state_data[ 

    +

    3972 :, var_index + i_global_var : var_index + i_global_var + 3 

    +

    3973 ] 

    +

    3974 i_global_var += 3 

    +

    3975 

    +

    3976 return var_index + i_global_var 

    +

    3977 

    +

    3978 def _read_states_parts(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    3979 """Read the part data in the state section 

    +

    3980 

    +

    3981 Parameters 

    +

    3982 ---------- 

    +

    3983 state_data: np.ndarray 

    +

    3984 array with entire state data 

    +

    3985 var_index: int 

    +

    3986 variable index in the state data array 

    +

    3987 array_dict: dict 

    +

    3988 dictionary to store the loaded arrays in 

    +

    3989 

    +

    3990 Returns 

    +

    3991 ------- 

    +

    3992 var_index: int 

    +

    3993 updated variable index after reading the section 

    +

    3994 """ 

    +

    3995 

    +

    3996 n_states = state_data.shape[0] 

    +

    3997 timestep_word = 1 

    +

    3998 n_global_vars = self.header.n_global_vars + timestep_word 

    +

    3999 

    +

    4000 # part infos 

    +

    4001 # n_parts = self._n_parts 

    +

    4002 n_parts = self.header.n_parts 

    +

    4003 

    +

    4004 # part internal energy 

    +

    4005 if var_index + n_parts <= n_global_vars: 

    +

    4006 array_dict[ArrayType.part_internal_energy] = state_data[ 

    +

    4007 :, var_index : var_index + n_parts 

    +

    4008 ] 

    +

    4009 var_index += n_parts 

    +

    4010 

    +

    4011 # part kinetic energy 

    +

    4012 if var_index + n_parts <= n_global_vars: 

    +

    4013 array_dict[ArrayType.part_kinetic_energy] = state_data[ 

    +

    4014 :, var_index : var_index + n_parts 

    +

    4015 ] 

    +

    4016 var_index += n_parts 

    +

    4017 

    +

    4018 # part velocity 

    +

    4019 if var_index + 3 * n_parts <= n_global_vars: 

    +

    4020 array_dict[ArrayType.part_velocity] = state_data[ 

    +

    4021 :, var_index : var_index + 3 * n_parts 

    +

    4022 ].reshape((n_states, n_parts, 3)) 

    +

    4023 var_index += 3 * n_parts 

    +

    4024 

    +

    4025 # part mass 

    +

    4026 if var_index + n_parts <= n_global_vars: 

    +

    4027 array_dict[ArrayType.part_mass] = state_data[:, var_index : var_index + n_parts] 

    +

    4028 var_index += n_parts 

    +

    4029 

    +

    4030 # part hourglass energy 

    +

    4031 if var_index + n_parts <= n_global_vars: 

    +

    4032 array_dict[ArrayType.part_hourglass_energy] = state_data[ 

    +

    4033 :, var_index : var_index + n_parts 

    +

    4034 ] 

    +

    4035 var_index += n_parts 

    +

    4036 

    +

    4037 return var_index 

    +

    4038 

    +

    4039 def _read_states_rigid_walls( 

    +

    4040 self, state_data: np.ndarray, var_index: int, array_dict: dict 

    +

    4041 ) -> int: 

    +

    4042 """Read the rigid wall data in the state section 

    +

    4043 

    +

    4044 Parameters 

    +

    4045 ---------- 

    +

    4046 state_data: np.ndarray 

    +

    4047 array with entire state data 

    +

    4048 var_index: int 

    +

    4049 variable index in the state data array 

    +

    4050 array_dict: dict 

    +

    4051 dictionary to store the loaded arrays in 

    +

    4052 

    +

    4053 Returns 

    +

    4054 ------- 

    +

    4055 var_index: int 

    +

    4056 updated variable index after reading the section 

    +

    4057 """ 

    +

    4058 

    +

    4059 n_states = state_data.shape[0] 

    +

    4060 

    +

    4061 i_global_var = 6 + 7 * self.header.n_parts 

    +

    4062 n_global_vars = self.header.n_global_vars 

    +

    4063 

    +

    4064 # rigid walls 

    +

    4065 previous_global_vars = i_global_var 

    +

    4066 n_rigid_wall_vars = 4 if self.header.version >= 971 else 1 

    +

    4067 # +1 is timestep which is not considered a global var ... seriously 

    +

    4068 n_rigid_walls = self._n_rigid_walls 

    +

    4069 if n_global_vars >= previous_global_vars + n_rigid_walls * n_rigid_wall_vars: 

    +

    4070 if ( 

    +

    4071 previous_global_vars + n_rigid_walls * n_rigid_wall_vars 

    +

    4072 != self.header.n_global_vars 

    +

    4073 ): 

    +

    4074 LOGGER.warning("Bug while reading global data for rigid walls. Skipping this data.") 

    +

    4075 var_index += self.header.n_global_vars - previous_global_vars 

    +

    4076 else: 

    +

    4077 

    +

    4078 # rigid wall force 

    +

    4079 if n_rigid_walls * n_rigid_wall_vars != 0: 

    +

    4080 array_dict[ArrayType.rigid_wall_force] = state_data[ 

    +

    4081 :, var_index : var_index + n_rigid_walls 

    +

    4082 ] 

    +

    4083 var_index += n_rigid_walls 

    +

    4084 

    +

    4085 # rigid wall position 

    +

    4086 if n_rigid_wall_vars > 1: 

    +

    4087 array_dict[ArrayType.rigid_wall_position] = state_data[ 

    +

    4088 :, var_index : var_index + 3 * n_rigid_walls 

    +

    4089 ].reshape(n_states, n_rigid_walls, 3) 

    +

    4090 var_index += 3 * n_rigid_walls 

    +

    4091 

    +

    4092 return var_index 

    +

    4093 

    +

    4094 def _read_states_nodes(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    4095 """Read the node data in the state section 

    +

    4096 

    +

    4097 Parameters 

    +

    4098 ---------- 

    +

    4099 state_data: np.ndarray 

    +

    4100 array with entire state data 

    +

    4101 var_index: int 

    +

    4102 variable index in the state data array 

    +

    4103 array_dict: dict 

    +

    4104 dictionary to store the loaded arrays in 

    +

    4105 

    +

    4106 Returns 

    +

    4107 ------- 

    +

    4108 var_index: int 

    +

    4109 updated variable index after reading the section 

    +

    4110 """ 

    +

    4111 

    +

    4112 if self.header.n_nodes <= 0: 

    +

    4113 return var_index 

    +

    4114 

    +

    4115 LOGGER.debug("_read_states_nodes start at var_index %d", var_index) 

    +

    4116 

    +

    4117 n_dim = self.header.n_dimensions 

    +

    4118 n_states = state_data.shape[0] 

    +

    4119 n_nodes = self.header.n_nodes 

    +

    4120 

    +

    4121 # displacement 

    +

    4122 if self.header.has_node_displacement: 

    +

    4123 try: 

    +

    4124 tmp_array = state_data[:, var_index : var_index + n_dim * n_nodes].reshape( 

    +

    4125 (n_states, n_nodes, n_dim) 

    +

    4126 ) 

    +

    4127 array_dict[ArrayType.node_displacement] = tmp_array 

    +

    4128 except Exception: 

    +

    4129 trb_msg = traceback.format_exc() 

    +

    4130 msg = "A failure in %s was caught:\n%s" 

    +

    4131 LOGGER.warning(msg, "_read_states_nodes, node_displacement", trb_msg) 

    +

    4132 finally: 

    +

    4133 var_index += n_dim * n_nodes 

    +

    4134 

    +

    4135 # temperatures 

    +

    4136 if self.header.has_node_temperatures: 

    +

    4137 

    +

    4138 # only node temperatures 

    +

    4139 if not self.header.has_node_temperature_layers: 

    +

    4140 try: 

    +

    4141 array_dict[ArrayType.node_temperature] = state_data[ 

    +

    4142 :, var_index : var_index + n_nodes 

    +

    4143 ] 

    +

    4144 except Exception: 

    +

    4145 trb_msg = traceback.format_exc() 

    +

    4146 msg = "A failure in %s was caught:\n%s" 

    +

    4147 LOGGER.warning(msg, "_read_states_nodes, node_temperatures", trb_msg) 

    +

    4148 finally: 

    +

    4149 var_index += n_nodes 

    +

    4150 # node temperature layers 

    +

    4151 else: 

    +

    4152 try: 

    +

    4153 tmp_array = state_data[:, var_index : var_index + 3 * n_nodes].reshape( 

    +

    4154 (n_states, n_nodes, 3) 

    +

    4155 ) 

    +

    4156 array_dict[ArrayType.node_temperature] = tmp_array 

    +

    4157 except Exception: 

    +

    4158 trb_msg = traceback.format_exc() 

    +

    4159 msg = "A failure in %s was caught:\n%s" 

    +

    4160 LOGGER.warning(msg, "_read_states_nodes, node_temperatures_layers", trb_msg) 

    +

    4161 finally: 

    +

    4162 var_index += 3 * n_nodes 

    +

    4163 

    +

    4164 # node heat flux 

    +

    4165 if self.header.has_node_heat_flux: 

    +

    4166 try: 

    +

    4167 tmp_array = state_data[:, var_index : var_index + 3 * n_nodes].reshape( 

    +

    4168 (n_states, n_nodes, 3) 

    +

    4169 ) 

    +

    4170 array_dict[ArrayType.node_heat_flux] = tmp_array 

    +

    4171 except Exception: 

    +

    4172 trb_msg = traceback.format_exc() 

    +

    4173 msg = "A failure in %s was caught:\n%s" 

    +

    4174 LOGGER.warning(msg, "_read_states_nodes, node_heat_flux", trb_msg) 

    +

    4175 finally: 

    +

    4176 var_index += 3 * n_nodes 

    +

    4177 

    +

    4178 # mass scaling 

    +

    4179 if self.header.has_node_mass_scaling: 

    +

    4180 try: 

    +

    4181 array_dict[ArrayType.node_mass_scaling] = state_data[ 

    +

    4182 :, var_index : var_index + n_nodes 

    +

    4183 ] 

    +

    4184 except Exception: 

    +

    4185 trb_msg = traceback.format_exc() 

    +

    4186 msg = "A failure in %s was caught:\n%s" 

    +

    4187 LOGGER.warning(msg, "_read_states_nodes, node_mass_scaling", trb_msg) 

    +

    4188 finally: 

    +

    4189 var_index += n_nodes 

    +

    4190 

    +

    4191 # node temperature gradient 

    +

    4192 # Unclear: verify (could also be between temperature and node heat flux) 

    +

    4193 if self.header.has_node_temperature_gradient: 

    +

    4194 try: 

    +

    4195 array_dict[ArrayType.node_temperature_gradient] = state_data[ 

    +

    4196 :, var_index : var_index + n_nodes 

    +

    4197 ] 

    +

    4198 except Exception: 

    +

    4199 trb_msg = traceback.format_exc() 

    +

    4200 msg = "A failure in %s was caught:\n%s" 

    +

    4201 LOGGER.warning(msg, "_read_states_nodes, node_temperature_gradient", trb_msg) 

    +

    4202 finally: 

    +

    4203 var_index += n_nodes 

    +

    4204 

    +

    4205 # node residual forces and moments 

    +

    4206 # Unclear: verify (see before, according to docs this is after previous) 

    +

    4207 if self.header.has_node_residual_forces: 

    +

    4208 try: 

    +

    4209 array_dict[ArrayType.node_residual_forces] = state_data[ 

    +

    4210 :, var_index : var_index + 3 * n_nodes 

    +

    4211 ].reshape((n_states, n_nodes, 3)) 

    +

    4212 except Exception: 

    +

    4213 trb_msg = traceback.format_exc() 

    +

    4214 msg = "A failure in %s was caught:\n%s" 

    +

    4215 LOGGER.warning(msg, "_read_states_nodes, node_residual_forces", trb_msg) 

    +

    4216 finally: 

    +

    4217 var_index += n_nodes * 3 

    +

    4218 

    +

    4219 if self.header.has_node_residual_moments: 

    +

    4220 try: 

    +

    4221 array_dict[ArrayType.node_residual_moments] = state_data[ 

    +

    4222 :, var_index : var_index + 3 * n_nodes 

    +

    4223 ].reshape((n_states, n_nodes, 3)) 

    +

    4224 except Exception: 

    +

    4225 trb_msg = traceback.format_exc() 

    +

    4226 msg = "A failure in %s was caught:\n%s" 

    +

    4227 LOGGER.warning(msg, "_read_states_nodes, node_residual_moments", trb_msg) 

    +

    4228 finally: 

    +

    4229 var_index += n_nodes * 3 

    +

    4230 

    +

    4231 # velocity 

    +

    4232 if self.header.has_node_velocity: 

    +

    4233 try: 

    +

    4234 tmp_array = state_data[:, var_index : var_index + n_dim * n_nodes].reshape( 

    +

    4235 (n_states, n_nodes, n_dim) 

    +

    4236 ) 

    +

    4237 array_dict[ArrayType.node_velocity] = tmp_array 

    +

    4238 except Exception: 

    +

    4239 trb_msg = traceback.format_exc() 

    +

    4240 msg = "A failure in %s was caught:\n%s" 

    +

    4241 LOGGER.warning(msg, "_read_states_nodes, node_velocity", trb_msg) 

    +

    4242 finally: 

    +

    4243 var_index += n_dim * n_nodes 

    +

    4244 

    +

    4245 # acceleration 

    +

    4246 if self.header.has_node_acceleration: 

    +

    4247 try: 

    +

    4248 tmp_array = state_data[:, var_index : var_index + n_dim * n_nodes].reshape( 

    +

    4249 (n_states, n_nodes, n_dim) 

    +

    4250 ) 

    +

    4251 array_dict[ArrayType.node_acceleration] = tmp_array 

    +

    4252 except Exception: 

    +

    4253 trb_msg = traceback.format_exc() 

    +

    4254 msg = "A failure in %s was caught:\n%s" 

    +

    4255 LOGGER.warning(msg, "_read_states_nodes, node_acceleration", trb_msg) 

    +

    4256 finally: 

    +

    4257 var_index += n_dim * n_nodes 

    +

    4258 

    +

    4259 LOGGER.debug("_read_states_nodes end at var_index %d", var_index) 

    +

    4260 

    +

    4261 return var_index 

    +

    4262 

    +

    4263 def _read_states_solids_thermal( 

    +

    4264 self, state_data: np.ndarray, var_index: int, array_dict: dict 

    +

    4265 ) -> int: 

    +

    4266 """Read the thermal data for solids 

    +

    4267 

    +

    4268 Parameters 

    +

    4269 ---------- 

    +

    4270 state_data: np.ndarray 

    +

    4271 array with entire state data 

    +

    4272 var_index: int 

    +

    4273 variable index in the state data array 

    +

    4274 array_dict: dict 

    +

    4275 dictionary to store the loaded arrays in 

    +

    4276 

    +

    4277 Returns 

    +

    4278 ------- 

    +

    4279 var_index: int 

    +

    4280 updated variable index after reading the section 

    +

    4281 """ 

    +

    4282 

    +

    4283 if self.header.n_solid_thermal_vars <= 0: 

    +

    4284 return var_index 

    +

    4285 

    +

    4286 LOGGER.debug("_read_states_solids_thermal start at var_index %d", var_index) 

    +

    4287 

    +

    4288 n_states = state_data.shape[0] 

    +

    4289 n_solids = self.header.n_solids 

    +

    4290 n_thermal_vars = self.header.n_solid_thermal_vars 

    +

    4291 

    +

    4292 try: 

    +

    4293 tmp_array = state_data[:, var_index : var_index + n_solids * n_thermal_vars] 

    +

    4294 array_dict[ArrayType.element_solid_thermal_data] = tmp_array.reshape( 

    +

    4295 (n_states, n_solids, n_thermal_vars) 

    +

    4296 ) 

    +

    4297 except Exception: 

    +

    4298 trb_msg = traceback.format_exc() 

    +

    4299 msg = "A failure in %s was caught:\n%s" 

    +

    4300 LOGGER.warning(msg, "_read_states_solids_thermal", trb_msg) 

    +

    4301 finally: 

    +

    4302 var_index += n_thermal_vars * n_solids 

    +

    4303 

    +

    4304 LOGGER.debug("_read_states_solids_thermal end at var_index %d", var_index) 

    +

    4305 

    +

    4306 return var_index 

    +

    4307 

    +

    4308 def _read_states_solids(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    4309 """Read the state data of the solid elements 

    +

    4310 

    +

    4311 Parameters 

    +

    4312 ---------- 

    +

    4313 state_data: np.ndarray 

    +

    4314 array with entire state data 

    +

    4315 var_index: int 

    +

    4316 variable index in the state data array 

    +

    4317 array_dict: dict 

    +

    4318 dictionary to store the loaded arrays in 

    +

    4319 

    +

    4320 Returns 

    +

    4321 ------- 

    +

    4322 var_index: int 

    +

    4323 updated variable index after reading the section 

    +

    4324 """ 

    +

    4325 

    +

    4326 if self.header.n_solids <= 0 or self.header.n_solid_vars <= 0: 

    +

    4327 return var_index 

    +

    4328 

    +

    4329 LOGGER.debug("_read_states_solids start at var_index %d", var_index) 

    +

    4330 

    +

    4331 n_solid_vars = self.header.n_solid_vars 

    +

    4332 n_solids = self.header.n_solids 

    +

    4333 n_states = state_data.shape[0] 

    +

    4334 n_strain_vars = 6 * self.header.has_element_strain 

    +

    4335 n_history_vars = self.header.n_solid_history_vars 

    +

    4336 n_solid_layers = self.header.n_solid_layers 

    +

    4337 

    +

    4338 # double safety here, if either the formatting of the solid state data 

    +

    4339 # or individual arrays fails then we catch it 

    +

    4340 try: 

    +

    4341 # this is a sanity check if the manual was understood correctly 

    +

    4342 # 

    +

    4343 # NOTE due to plotcompress we disable this check, it can delete 

    +

    4344 # variables so that stress or pstrain might be missing despite 

    +

    4345 # being always present in the file spec 

    +

    4346 # 

    +

    4347 # n_solid_vars2 = (7 + 

    +

    4348 # n_history_vars) 

    +

    4349 

    +

    4350 # if n_solid_vars2 != n_solid_vars: 

    +

    4351 # msg = "n_solid_vars != n_solid_vars_computed: {} != {}."\ 

    +

    4352 # + " Solid variables might be wrong." 

    +

    4353 # LOGGER.warning(msg.format(n_solid_vars, n_solid_vars2)) 

    +

    4354 

    +

    4355 solid_state_data = state_data[ 

    +

    4356 :, var_index : var_index + n_solid_vars * n_solids 

    +

    4357 ].reshape((n_states, n_solids, n_solid_layers, n_solid_vars // n_solid_layers)) 

    +

    4358 

    +

    4359 i_solid_var = 0 

    +

    4360 

    +

    4361 # stress 

    +

    4362 try: 

    +

    4363 if self.header.has_solid_stress: 

    +

    4364 array_dict[ArrayType.element_solid_stress] = solid_state_data[:, :, :, :6] 

    +

    4365 except Exception: 

    +

    4366 trb_msg = traceback.format_exc() 

    +

    4367 msg = "A failure in %s was caught:\n%s" 

    +

    4368 LOGGER.warning(msg, "_read_states_solids, stress", trb_msg) 

    +

    4369 finally: 

    +

    4370 i_solid_var += 6 * self.header.has_solid_stress 

    +

    4371 

    +

    4372 # effective plastic strain 

    +

    4373 try: 

    +

    4374 # in case plotcompress deleted stresses but pstrain exists 

    +

    4375 if self.header.has_solid_pstrain: 

    +

    4376 array_dict[ArrayType.element_solid_effective_plastic_strain] = solid_state_data[ 

    +

    4377 :, :, :, i_solid_var 

    +

    4378 ].reshape((n_states, n_solids, n_solid_layers)) 

    +

    4379 except Exception: 

    +

    4380 trb_msg = traceback.format_exc() 

    +

    4381 msg = "A failure in %s was caught:\n%s" 

    +

    4382 LOGGER.warning(msg, "_read_states_solids, eff_plastic_strain", trb_msg) 

    +

    4383 finally: 

    +

    4384 i_solid_var += 1 * self.header.has_solid_pstrain 

    +

    4385 

    +

    4386 # history vars 

    +

    4387 if n_history_vars: 

    +

    4388 try: 

    +

    4389 array_dict[ArrayType.element_solid_history_variables] = solid_state_data[ 

    +

    4390 :, :, :, i_solid_var : i_solid_var + n_history_vars 

    +

    4391 ] 

    +

    4392 except Exception: 

    +

    4393 trb_msg = traceback.format_exc() 

    +

    4394 msg = "A failure in %s was caught:\n%s" 

    +

    4395 LOGGER.warning(msg, "_read_states_solids, history_variables", trb_msg) 

    +

    4396 finally: 

    +

    4397 i_solid_var += n_history_vars 

    +

    4398 

    +

    4399 # strain 

    +

    4400 # they are the last 6 entries of the history vars 

    +

    4401 if n_strain_vars: 

    +

    4402 try: 

    +

    4403 array_dict[ArrayType.element_solid_strain] = array_dict[ 

    +

    4404 ArrayType.element_solid_history_variables 

    +

    4405 ][:, :, :, -n_strain_vars:] 

    +

    4406 

    +

    4407 array_dict[ArrayType.element_solid_history_variables] = array_dict[ 

    +

    4408 ArrayType.element_solid_history_variables 

    +

    4409 ][:, :, :, :-n_strain_vars] 

    +

    4410 

    +

    4411 if not all(array_dict[ArrayType.element_solid_history_variables].shape): 

    +

    4412 del array_dict[ArrayType.element_solid_history_variables] 

    +

    4413 except Exception: 

    +

    4414 trb_msg = traceback.format_exc() 

    +

    4415 msg = "A failure in %s was caught:\n%s" 

    +

    4416 LOGGER.warning(msg, "_read_states_solids, strain", trb_msg) 

    +

    4417 

    +

    4418 # plastic strain tensor 

    +

    4419 if self.header.has_solid_shell_plastic_strain_tensor: 

    +

    4420 try: 

    +

    4421 array_dict[ArrayType.element_solid_plastic_strain_tensor] = solid_state_data[ 

    +

    4422 :, :, :, i_solid_var : i_solid_var + 6 

    +

    4423 ] 

    +

    4424 except Exception: 

    +

    4425 trb_msg = traceback.format_exc() 

    +

    4426 msg = "A failure in %s was caught:\n%s" 

    +

    4427 LOGGER.warning( 

    +

    4428 msg, "_read_states_solids, element_solid_plastic_strain_tensor", trb_msg 

    +

    4429 ) 

    +

    4430 finally: 

    +

    4431 i_solid_var += 6 

    +

    4432 

    +

    4433 # thermal strain tensor 

    +

    4434 if self.header.has_solid_shell_thermal_strain_tensor: 

    +

    4435 try: 

    +

    4436 array_dict[ArrayType.element_solid_thermal_strain_tensor] = solid_state_data[ 

    +

    4437 :, :, i_solid_var : i_solid_var + 6 

    +

    4438 ] 

    +

    4439 except Exception: 

    +

    4440 trb_msg = traceback.format_exc() 

    +

    4441 msg = "A failure in %s was caught:\n%s" 

    +

    4442 LOGGER.warning( 

    +

    4443 msg, "_read_states_solids, element_solid_thermal_strain_tensor", trb_msg 

    +

    4444 ) 

    +

    4445 finally: 

    +

    4446 i_solid_var += 6 

    +

    4447 

    +

    4448 # catch formatting in solid_state_datra 

    +

    4449 except Exception: 

    +

    4450 trb_msg = traceback.format_exc() 

    +

    4451 msg = "A failure in %s was caught:\n%s" 

    +

    4452 LOGGER.warning(msg, "_read_states_solids, solid_state_data", trb_msg) 

    +

    4453 # always increment variable count 

    +

    4454 finally: 

    +

    4455 var_index += n_solids * n_solid_vars 

    +

    4456 

    +

    4457 LOGGER.debug("_read_states_solids end at var_index %d", var_index) 

    +

    4458 

    +

    4459 return var_index 

    +

    4460 

    +

    4461 def _read_states_tshell(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    4462 """Read the state data for thick shell elements 

    +

    4463 

    +

    4464 Parameters 

    +

    4465 ---------- 

    +

    4466 state_data: np.ndarray 

    +

    4467 array with entire state data 

    +

    4468 var_index: int 

    +

    4469 variable index in the state data array 

    +

    4470 array_dict: dict 

    +

    4471 dictionary to store the loaded arrays in 

    +

    4472 

    +

    4473 Returns 

    +

    4474 ------- 

    +

    4475 var_index: int 

    +

    4476 updated variable index after reading the section 

    +

    4477 """ 

    +

    4478 

    +

    4479 if self.header.n_thick_shells <= 0 or self.header.n_thick_shell_vars <= 0: 

    +

    4480 return var_index 

    +

    4481 

    +

    4482 LOGGER.debug("_read_states_tshell start at var_index %d", var_index) 

    +

    4483 

    +

    4484 n_states = state_data.shape[0] 

    +

    4485 n_tshells = self.header.n_thick_shells 

    +

    4486 n_history_vars = self.header.n_shell_tshell_history_vars 

    +

    4487 n_layers = self.header.n_shell_tshell_layers 

    +

    4488 n_layer_vars = n_layers * ( 

    +

    4489 6 * self.header.has_shell_tshell_stress 

    +

    4490 + self.header.has_shell_tshell_pstrain 

    +

    4491 + n_history_vars 

    +

    4492 ) 

    +

    4493 n_strain_vars = 12 * self.header.has_element_strain 

    +

    4494 n_thsell_vars = self.header.n_thick_shell_vars 

    +

    4495 has_stress = self.header.has_shell_tshell_stress 

    +

    4496 has_pstrain = self.header.has_shell_tshell_pstrain 

    +

    4497 

    +

    4498 try: 

    +

    4499 # this is a sanity check if the manual was understood correctly 

    +

    4500 n_tshell_vars2 = n_layer_vars + n_strain_vars 

    +

    4501 

    +

    4502 if n_tshell_vars2 != n_thsell_vars: 

    +

    4503 msg = ( 

    +

    4504 "n_tshell_vars != n_tshell_vars_computed: %d != %d." 

    +

    4505 " Thick shell variables might be wrong." 

    +

    4506 ) 

    +

    4507 LOGGER.warning(msg, n_thsell_vars, n_tshell_vars2) 

    +

    4508 

    +

    4509 # thick shell element data 

    +

    4510 tshell_data = state_data[:, var_index : var_index + n_thsell_vars * n_tshells] 

    +

    4511 tshell_data = tshell_data.reshape((n_states, n_tshells, n_thsell_vars)) 

    +

    4512 

    +

    4513 # extract layer data 

    +

    4514 tshell_layer_data = tshell_data[:, :, slice(0, n_layer_vars)] 

    +

    4515 tshell_layer_data = tshell_layer_data.reshape((n_states, n_tshells, n_layers, -1)) 

    +

    4516 tshell_nonlayer_data = tshell_data[:, :, n_layer_vars:] 

    +

    4517 

    +

    4518 # STRESS 

    +

    4519 i_tshell_layer_var = 0 

    +

    4520 if has_stress: 

    +

    4521 try: 

    +

    4522 array_dict[ArrayType.element_tshell_stress] = tshell_layer_data[ 

    +

    4523 :, :, :, i_tshell_layer_var : i_tshell_layer_var + 6 

    +

    4524 ].reshape((n_states, n_tshells, n_layers, 6)) 

    +

    4525 except Exception: 

    +

    4526 trb_msg = traceback.format_exc() 

    +

    4527 msg = "A failure in %d was caught:\n%s" 

    +

    4528 LOGGER.warning(msg, "_read_states_tshell, stress", trb_msg) 

    +

    4529 finally: 

    +

    4530 i_tshell_layer_var += 6 

    +

    4531 

    +

    4532 # PSTRAIN 

    +

    4533 if has_pstrain: 

    +

    4534 try: 

    +

    4535 array_dict[ 

    +

    4536 ArrayType.element_tshell_effective_plastic_strain 

    +

    4537 ] = tshell_layer_data[:, :, :, i_tshell_layer_var].reshape( 

    +

    4538 (n_states, n_tshells, n_layers) 

    +

    4539 ) 

    +

    4540 except Exception: 

    +

    4541 trb_msg = traceback.format_exc() 

    +

    4542 msg = "A failure in %s was caught:\n%s" 

    +

    4543 LOGGER.warning(msg, "_read_states_tshell, eff_plastic_strain", trb_msg) 

    +

    4544 finally: 

    +

    4545 i_tshell_layer_var += 1 

    +

    4546 

    +

    4547 # HISTORY VARS 

    +

    4548 if n_history_vars: 

    +

    4549 try: 

    +

    4550 array_dict[ArrayType.element_tshell_history_variables] = tshell_layer_data[ 

    +

    4551 :, :, :, i_tshell_layer_var : i_tshell_layer_var + n_history_vars 

    +

    4552 ].reshape((n_states, n_tshells, n_layers, n_history_vars)) 

    +

    4553 except Exception: 

    +

    4554 trb_msg = traceback.format_exc() 

    +

    4555 msg = "A failure in %s was caught:\n%s" 

    +

    4556 LOGGER.warning(msg, "_read_states_tshell, history_variables", trb_msg) 

    +

    4557 

    +

    4558 # STRAIN (only non layer data for tshells) 

    +

    4559 if n_strain_vars: 

    +

    4560 try: 

    +

    4561 tshell_nonlayer_data = tshell_nonlayer_data[:, :, :n_strain_vars] 

    +

    4562 array_dict[ArrayType.element_tshell_strain] = tshell_nonlayer_data.reshape( 

    +

    4563 (n_states, n_tshells, 2, 6) 

    +

    4564 ) 

    +

    4565 except Exception: 

    +

    4566 trb_msg = traceback.format_exc() 

    +

    4567 msg = "A failure in %s was caught:\n%s" 

    +

    4568 LOGGER.warning(msg, "_read_states_tshell, strain", trb_msg) 

    +

    4569 

    +

    4570 except Exception: 

    +

    4571 trb_msg = traceback.format_exc() 

    +

    4572 msg = "A failure in %s was caught:\n%s" 

    +

    4573 LOGGER.warning(msg, "_read_states_tshell, tshell_data", trb_msg) 

    +

    4574 finally: 

    +

    4575 var_index += n_thsell_vars * n_tshells 

    +

    4576 

    +

    4577 LOGGER.debug("_read_states_tshell end at var_index %d", var_index) 

    +

    4578 

    +

    4579 return var_index 

    +

    4580 

    +

    4581 def _read_states_beams(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    4582 """Read the state data for beams 

    +

    4583 

    +

    4584 Parameters 

    +

    4585 ---------- 

    +

    4586 state_data: np.ndarray 

    +

    4587 array with entire state data 

    +

    4588 var_index: int 

    +

    4589 variable index in the state data array 

    +

    4590 array_dict: dict 

    +

    4591 dictionary to store the loaded arrays in 

    +

    4592 

    +

    4593 Returns 

    +

    4594 ------- 

    +

    4595 var_index: int 

    +

    4596 updated variable index after reading the section 

    +

    4597 """ 

    +

    4598 

    +

    4599 if self.header.n_beams <= 0 or self.header.n_beam_vars <= 0: 

    +

    4600 return var_index 

    +

    4601 

    +

    4602 LOGGER.debug("_read_states_beams start at var_index %d", var_index) 

    +

    4603 

    +

    4604 # usual beam vars 

    +

    4605 # pylint: disable = invalid-name 

    +

    4606 N_BEAM_BASIC_VARS = 6 

    +

    4607 # beam intergration point vars 

    +

    4608 # pylint: disable = invalid-name 

    +

    4609 N_BEAM_IP_VARS = 5 

    +

    4610 

    +

    4611 n_states = state_data.shape[0] 

    +

    4612 n_beams = self.header.n_beams 

    +

    4613 n_history_vars = self.header.n_beam_history_vars 

    +

    4614 n_beam_vars = self.header.n_beam_vars 

    +

    4615 n_layers = int( 

    +

    4616 (-3 * n_history_vars + n_beam_vars - N_BEAM_BASIC_VARS) 

    +

    4617 / (n_history_vars + N_BEAM_IP_VARS) 

    +

    4618 ) 

    +

    4619 # n_layer_vars = 6 + N_BEAM_IP_VARS * n_layers 

    +

    4620 n_layer_vars = N_BEAM_IP_VARS * n_layers 

    +

    4621 

    +

    4622 try: 

    +

    4623 # beam element data 

    +

    4624 beam_data = state_data[:, var_index : var_index + n_beam_vars * n_beams] 

    +

    4625 beam_data = beam_data.reshape((n_states, n_beams, n_beam_vars)) 

    +

    4626 

    +

    4627 # extract layer data 

    +

    4628 beam_nonlayer_data = beam_data[:, :, :N_BEAM_BASIC_VARS] 

    +

    4629 beam_layer_data = beam_data[:, :, N_BEAM_BASIC_VARS : N_BEAM_BASIC_VARS + n_layer_vars] 

    +

    4630 beam_layer_data = beam_layer_data.reshape((n_states, n_beams, n_layers, N_BEAM_IP_VARS)) 

    +

    4631 

    +

    4632 # axial force 

    +

    4633 try: 

    +

    4634 array_dict[ArrayType.element_beam_axial_force] = beam_nonlayer_data[ 

    +

    4635 :, :, 0 

    +

    4636 ].reshape((n_states, n_beams)) 

    +

    4637 except Exception: 

    +

    4638 trb_msg = traceback.format_exc() 

    +

    4639 msg = "A failure in %s was caught:\n%s" 

    +

    4640 LOGGER.warning(msg, "_read_states_beams, axial_force", trb_msg) 

    +

    4641 

    +

    4642 # shear force 

    +

    4643 try: 

    +

    4644 array_dict[ArrayType.element_beam_shear_force] = beam_nonlayer_data[ 

    +

    4645 :, :, 1:3 

    +

    4646 ].reshape((n_states, n_beams, 2)) 

    +

    4647 except Exception: 

    +

    4648 trb_msg = traceback.format_exc() 

    +

    4649 msg = "A failure in %s was caught:\n%s" 

    +

    4650 LOGGER.warning(msg, "_read_states_beams, shear_force", trb_msg) 

    +

    4651 

    +

    4652 # bending moment 

    +

    4653 try: 

    +

    4654 array_dict[ArrayType.element_beam_bending_moment] = beam_nonlayer_data[ 

    +

    4655 :, :, 3:5 

    +

    4656 ].reshape((n_states, n_beams, 2)) 

    +

    4657 except Exception: 

    +

    4658 trb_msg = traceback.format_exc() 

    +

    4659 msg = "A failure in %s was caught:\n%s" 

    +

    4660 LOGGER.warning(msg, "_read_states_beams, bending_moment", trb_msg) 

    +

    4661 

    +

    4662 # torsion moment 

    +

    4663 try: 

    +

    4664 array_dict[ArrayType.element_beam_torsion_moment] = beam_nonlayer_data[ 

    +

    4665 :, :, 5 

    +

    4666 ].reshape((n_states, n_beams)) 

    +

    4667 except Exception: 

    +

    4668 trb_msg = traceback.format_exc() 

    +

    4669 msg = "A failure in %s was caught:\n%s" 

    +

    4670 LOGGER.warning(msg, "_read_states_beams, torsion_moment", trb_msg) 

    +

    4671 

    +

    4672 if n_layers: 

    +

    4673 

    +

    4674 # BUGFIX? 

    +

    4675 # According to the database manual the first 

    +

    4676 # two layer vars are the shear stress and then 

    +

    4677 # axial stress. Tests with FEMZIP and META though 

    +

    4678 # suggests that axial stress comes first. 

    +

    4679 

    +

    4680 # axial stress 

    +

    4681 try: 

    +

    4682 array_dict[ArrayType.element_beam_axial_stress] = beam_layer_data[:, :, :, 0] 

    +

    4683 except Exception: 

    +

    4684 trb_msg = traceback.format_exc() 

    +

    4685 msg = "A failure in %s was caught:\n%s" 

    +

    4686 LOGGER.warning(msg, "_read_states_beams, axial_stress", trb_msg) 

    +

    4687 

    +

    4688 # shear stress 

    +

    4689 try: 

    +

    4690 array_dict[ArrayType.element_beam_shear_stress] = beam_layer_data[:, :, :, 1:3] 

    +

    4691 except Exception: 

    +

    4692 trb_msg = traceback.format_exc() 

    +

    4693 msg = "A failure in %s was caught:\n%s" 

    +

    4694 LOGGER.warning(msg, "_read_states_beams, shear_stress", trb_msg) 

    +

    4695 

    +

    4696 # eff. plastic strain 

    +

    4697 try: 

    +

    4698 array_dict[ArrayType.element_beam_plastic_strain] = beam_layer_data[:, :, :, 3] 

    +

    4699 except Exception: 

    +

    4700 trb_msg = traceback.format_exc() 

    +

    4701 msg = "A failure in %s was caught:\n%s" 

    +

    4702 LOGGER.warning(msg, "_read_states_beams, eff_plastic_strain", trb_msg) 

    +

    4703 

    +

    4704 # axial strain 

    +

    4705 try: 

    +

    4706 array_dict[ArrayType.element_beam_axial_strain] = beam_layer_data[:, :, :, 4] 

    +

    4707 except Exception: 

    +

    4708 trb_msg = traceback.format_exc() 

    +

    4709 msg = "A failure in %s was caught:\n%s" 

    +

    4710 LOGGER.warning(msg, "_read_states_beams, axial_strain", trb_msg) 

    +

    4711 

    +

    4712 # history vars 

    +

    4713 if n_history_vars: 

    +

    4714 try: 

    +

    4715 array_dict[ArrayType.element_beam_history_vars] = beam_data[ 

    +

    4716 :, :, 6 + n_layer_vars : 

    +

    4717 ].reshape((n_states, n_beams, 3 + n_layers, n_history_vars)) 

    +

    4718 except Exception: 

    +

    4719 trb_msg = traceback.format_exc() 

    +

    4720 msg = "A failure in %s was caught:\n%s" 

    +

    4721 LOGGER.warning(msg, "_read_states_beams, history_variables", trb_msg) 

    +

    4722 

    +

    4723 # failure of formatting beam state data 

    +

    4724 except Exception: 

    +

    4725 trb_msg = traceback.format_exc() 

    +

    4726 msg = "A failure in %s was caught:\n%s" 

    +

    4727 LOGGER.warning(msg, "_read_states_beams, beam_state_data", trb_msg) 

    +

    4728 # always increment variable index 

    +

    4729 finally: 

    +

    4730 var_index += n_beams * n_beam_vars 

    +

    4731 

    +

    4732 LOGGER.debug("_read_states_beams end at var_index %d", var_index) 

    +

    4733 

    +

    4734 return var_index 

    +

    4735 

    +

    4736 def _read_states_shell(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    4737 """Read the state data for shell elements 

    +

    4738 

    +

    4739 Parameters 

    +

    4740 ---------- 

    +

    4741 state_data: np.ndarray 

    +

    4742 array with entire state data 

    +

    4743 var_index: int 

    +

    4744 variable index in the state data array 

    +

    4745 array_dict: dict 

    +

    4746 dictionary to store the loaded arrays in 

    +

    4747 

    +

    4748 Returns 

    +

    4749 ------- 

    +

    4750 var_index: int 

    +

    4751 updated variable index after reading the section 

    +

    4752 """ 

    +

    4753 

    +

    4754 # bugfix 

    +

    4755 # 

    +

    4756 # Interestingly, dyna seems to write result values for rigid shells in 

    +

    4757 # the d3part file, but not in the d3plot. Of course this is not 

    +

    4758 # documented ... 

    +

    4759 n_reduced_shells = ( 

    +

    4760 self.header.n_shells 

    +

    4761 if self.header.filetype == D3plotFiletype.D3PART 

    +

    4762 else self.header.n_shells - self._material_section_info.n_rigid_shells 

    +

    4763 ) 

    +

    4764 

    +

    4765 if self.header.n_shell_vars <= 0 or n_reduced_shells <= 0: 

    +

    4766 return var_index 

    +

    4767 

    +

    4768 LOGGER.debug("_read_states_shell start at var_index %d", var_index) 

    +

    4769 

    +

    4770 n_states = state_data.shape[0] 

    +

    4771 n_shells = n_reduced_shells 

    +

    4772 n_shell_vars = self.header.n_shell_vars 

    +

    4773 

    +

    4774 # what is in the file? 

    +

    4775 n_layers = self.header.n_shell_tshell_layers 

    +

    4776 n_history_vars = self.header.n_shell_tshell_history_vars 

    +

    4777 n_stress_vars = 6 * self.header.has_shell_tshell_stress 

    +

    4778 n_pstrain_vars = 1 * self.header.has_shell_tshell_pstrain 

    +

    4779 n_force_variables = 8 * self.header.has_shell_forces 

    +

    4780 n_extra_variables = 4 * self.header.has_shell_extra_variables 

    +

    4781 n_strain_vars = 12 * self.header.has_element_strain 

    +

    4782 n_plastic_strain_tensor = 6 * n_layers * self.header.has_solid_shell_plastic_strain_tensor 

    +

    4783 n_thermal_strain_tensor = 6 * self.header.has_solid_shell_thermal_strain_tensor 

    +

    4784 

    +

    4785 try: 

    +

    4786 # this is a sanity check if the manual was understood correctly 

    +

    4787 n_shell_vars2 = ( 

    +

    4788 n_layers * (n_stress_vars + n_pstrain_vars + n_history_vars) 

    +

    4789 + n_force_variables 

    +

    4790 + n_extra_variables 

    +

    4791 + n_strain_vars 

    +

    4792 + n_plastic_strain_tensor 

    +

    4793 + n_thermal_strain_tensor 

    +

    4794 ) 

    +

    4795 

    +

    4796 if n_shell_vars != n_shell_vars2: 

    +

    4797 msg = ( 

    +

    4798 "n_shell_vars != n_shell_vars_computed: %d != %d." 

    +

    4799 " Shell variables might be wrong." 

    +

    4800 ) 

    +

    4801 LOGGER.warning(msg, n_shell_vars, n_shell_vars2) 

    +

    4802 

    +

    4803 n_layer_vars = n_layers * (n_stress_vars + n_pstrain_vars + n_history_vars) 

    +

    4804 

    +

    4805 # shell element data 

    +

    4806 shell_data = state_data[:, var_index : var_index + n_shell_vars * n_shells] 

    +

    4807 shell_data = shell_data.reshape((n_states, n_shells, n_shell_vars)) 

    +

    4808 

    +

    4809 # extract layer data 

    +

    4810 shell_layer_data = shell_data[:, :, :n_layer_vars] 

    +

    4811 shell_layer_data = shell_layer_data.reshape((n_states, n_shells, n_layers, -1)) 

    +

    4812 shell_nonlayer_data = shell_data[:, :, n_layer_vars:] 

    +

    4813 

    +

    4814 # save layer stuff 

    +

    4815 # STRESS 

    +

    4816 layer_var_index = 0 

    +

    4817 if n_stress_vars: 

    +

    4818 try: 

    +

    4819 array_dict[ArrayType.element_shell_stress] = shell_layer_data[ 

    +

    4820 :, :, :, :n_stress_vars 

    +

    4821 ].reshape((n_states, n_shells, n_layers, n_stress_vars)) 

    +

    4822 except Exception: 

    +

    4823 trb_msg = traceback.format_exc() 

    +

    4824 msg = "A failure in %s was caught:\n%s" 

    +

    4825 LOGGER.warning(msg, "_read_states_shells, stress", trb_msg) 

    +

    4826 finally: 

    +

    4827 layer_var_index += n_stress_vars 

    +

    4828 

    +

    4829 # PSTRAIN 

    +

    4830 if n_pstrain_vars: 

    +

    4831 try: 

    +

    4832 array_dict[ArrayType.element_shell_effective_plastic_strain] = shell_layer_data[ 

    +

    4833 :, :, :, layer_var_index 

    +

    4834 ].reshape((n_states, n_shells, n_layers)) 

    +

    4835 except Exception: 

    +

    4836 trb_msg = traceback.format_exc() 

    +

    4837 msg = "A failure in %s was caught:\n%s" 

    +

    4838 LOGGER.warning(msg, "_read_states_shells, stress", trb_msg) 

    +

    4839 finally: 

    +

    4840 layer_var_index += 1 

    +

    4841 

    +

    4842 # HISTORY VARIABLES 

    +

    4843 if n_history_vars: 

    +

    4844 try: 

    +

    4845 array_dict[ArrayType.element_shell_history_vars] = shell_layer_data[ 

    +

    4846 :, :, :, layer_var_index : layer_var_index + n_history_vars 

    +

    4847 ].reshape((n_states, n_shells, n_layers, n_history_vars)) 

    +

    4848 except Exception: 

    +

    4849 trb_msg = traceback.format_exc() 

    +

    4850 msg = "A failure in %s was caught:\n%s" 

    +

    4851 LOGGER.warning(msg, "_read_states_shells, history_variables", trb_msg) 

    +

    4852 finally: 

    +

    4853 layer_var_index += n_history_vars 

    +

    4854 

    +

    4855 # save nonlayer stuff 

    +

    4856 # forces 

    +

    4857 nonlayer_var_index = 0 

    +

    4858 if n_force_variables: 

    +

    4859 try: 

    +

    4860 array_dict[ArrayType.element_shell_bending_moment] = shell_nonlayer_data[ 

    +

    4861 :, :, 0:3 

    +

    4862 ].reshape((n_states, n_shells, 3)) 

    +

    4863 array_dict[ArrayType.element_shell_shear_force] = shell_nonlayer_data[ 

    +

    4864 :, :, 3:5 

    +

    4865 ].reshape((n_states, n_shells, 2)) 

    +

    4866 array_dict[ArrayType.element_shell_normal_force] = shell_nonlayer_data[ 

    +

    4867 :, :, 5:8 

    +

    4868 ].reshape((n_states, n_shells, 3)) 

    +

    4869 except Exception: 

    +

    4870 trb_msg = traceback.format_exc() 

    +

    4871 msg = "A failure in %s was caught:\n%s" 

    +

    4872 LOGGER.warning(msg, "_read_states_shells, forces", trb_msg) 

    +

    4873 finally: 

    +

    4874 nonlayer_var_index += n_force_variables 

    +

    4875 

    +

    4876 # weird stuff 

    +

    4877 if n_extra_variables: 

    +

    4878 try: 

    +

    4879 array_dict[ArrayType.element_shell_thickness] = shell_nonlayer_data[ 

    +

    4880 :, :, nonlayer_var_index 

    +

    4881 ].reshape((n_states, n_shells)) 

    +

    4882 array_dict[ArrayType.element_shell_unknown_variables] = shell_nonlayer_data[ 

    +

    4883 :, :, nonlayer_var_index + 1 : nonlayer_var_index + 3 

    +

    4884 ].reshape((n_states, n_shells, 2)) 

    +

    4885 except Exception: 

    +

    4886 trb_msg = traceback.format_exc() 

    +

    4887 msg = "A failure in %s was caught:\n%s" 

    +

    4888 LOGGER.warning(msg, "_read_states_shells, history_variables", trb_msg) 

    +

    4889 finally: 

    +

    4890 nonlayer_var_index += 3 

    +

    4891 

    +

    4892 # strain present 

    +

    4893 if n_strain_vars: 

    +

    4894 try: 

    +

    4895 shell_strain = shell_nonlayer_data[ 

    +

    4896 :, :, nonlayer_var_index : nonlayer_var_index + n_strain_vars 

    +

    4897 ] 

    +

    4898 array_dict[ArrayType.element_shell_strain] = shell_strain.reshape( 

    +

    4899 (n_states, n_shells, 2, 6) 

    +

    4900 ) 

    +

    4901 except Exception: 

    +

    4902 trb_msg = traceback.format_exc() 

    +

    4903 msg = "A failure in %s was caught:\n%s" 

    +

    4904 LOGGER.warning(msg, "_read_states_shells, strain", trb_msg) 

    +

    4905 finally: 

    +

    4906 nonlayer_var_index += n_strain_vars 

    +

    4907 

    +

    4908 # internal energy is behind strain if strain is written 

    +

    4909 if self.header.has_shell_extra_variables: 

    +

    4910 try: 

    +

    4911 array_dict[ArrayType.element_shell_internal_energy] = shell_nonlayer_data[ 

    +

    4912 :, :, nonlayer_var_index 

    +

    4913 ].reshape((n_states, n_shells)) 

    +

    4914 except Exception: 

    +

    4915 trb_msg = traceback.format_exc() 

    +

    4916 msg = "A failure in %s was caught:\n%s" 

    +

    4917 LOGGER.warning(msg, "_read_states_shells, internal_energy", trb_msg) 

    +

    4918 

    +

    4919 # PLASTIC STRAIN TENSOR 

    +

    4920 if n_plastic_strain_tensor: 

    +

    4921 try: 

    +

    4922 pstrain_tensor = shell_nonlayer_data[ 

    +

    4923 :, :, nonlayer_var_index : nonlayer_var_index + n_plastic_strain_tensor 

    +

    4924 ] 

    +

    4925 array_dict[ 

    +

    4926 ArrayType.element_shell_plastic_strain_tensor 

    +

    4927 ] = pstrain_tensor.reshape((n_states, n_shells, n_layers, 6)) 

    +

    4928 except Exception: 

    +

    4929 trb_msg = traceback.format_exc() 

    +

    4930 msg = "A failure in %s was caught:\n%s" 

    +

    4931 LOGGER.warning( 

    +

    4932 msg, "_read_states_shells, element_shell_plastic_strain_tensor", trb_msg 

    +

    4933 ) 

    +

    4934 finally: 

    +

    4935 nonlayer_var_index += n_plastic_strain_tensor 

    +

    4936 

    +

    4937 # THERMAL STRAIN TENSOR 

    +

    4938 if n_thermal_strain_tensor: 

    +

    4939 try: 

    +

    4940 thermal_tensor = shell_nonlayer_data[ 

    +

    4941 :, :, nonlayer_var_index : nonlayer_var_index + n_thermal_strain_tensor 

    +

    4942 ] 

    +

    4943 array_dict[ 

    +

    4944 ArrayType.element_shell_thermal_strain_tensor 

    +

    4945 ] = thermal_tensor.reshape((n_states, n_shells, 6)) 

    +

    4946 except Exception: 

    +

    4947 trb_msg = traceback.format_exc() 

    +

    4948 msg = "A failure in %s was caught:\n%s" 

    +

    4949 LOGGER.warning( 

    +

    4950 msg, "_read_states_shells, element_shell_thermal_strain_tensor", trb_msg 

    +

    4951 ) 

    +

    4952 finally: 

    +

    4953 nonlayer_var_index += n_thermal_strain_tensor 

    +

    4954 

    +

    4955 # error in formatting shell state data 

    +

    4956 except Exception: 

    +

    4957 trb_msg = traceback.format_exc() 

    +

    4958 msg = "A failure in %s was caught:\n%s" 

    +

    4959 LOGGER.warning(msg, "_read_states_shell, shell_state_data", trb_msg) 

    +

    4960 

    +

    4961 # always increment variable index 

    +

    4962 finally: 

    +

    4963 var_index += n_shell_vars * n_shells 

    +

    4964 

    +

    4965 LOGGER.debug("_read_states_shell end at var_index %d", var_index) 

    +

    4966 

    +

    4967 return var_index 

    +

    4968 

    +

    4969 def _read_states_is_alive( 

    +

    4970 self, state_data: np.ndarray, var_index: int, array_dict: dict 

    +

    4971 ) -> int: 

    +

    4972 """Read deletion info for nodes, elements, etc 

    +

    4973 

    +

    4974 Parameters 

    +

    4975 ---------- 

    +

    4976 state_data: np.ndarray 

    +

    4977 array with entire state data 

    +

    4978 var_index: int 

    +

    4979 variable index in the state data array 

    +

    4980 array_dict: dict 

    +

    4981 dictionary to store the loaded arrays in 

    +

    4982 

    +

    4983 Returns 

    +

    4984 ------- 

    +

    4985 var_index: int 

    +

    4986 updated variable index after reading the section 

    +

    4987 """ 

    +

    4988 

    +

    4989 if not self.header.has_node_deletion_data and not self.header.has_element_deletion_data: 

    +

    4990 return var_index 

    +

    4991 

    +

    4992 LOGGER.debug("_read_states_is_alive start at var_index %s", var_index) 

    +

    4993 

    +

    4994 n_states = state_data.shape[0] 

    +

    4995 

    +

    4996 # NODES 

    +

    4997 if self.header.has_node_deletion_data: 

    +

    4998 n_nodes = self.header.n_nodes 

    +

    4999 

    +

    5000 if n_nodes > 0: 

    +

    5001 try: 

    +

    5002 array_dict[ArrayType.node_is_alive] = state_data[ 

    +

    5003 :, var_index : var_index + n_nodes 

    +

    5004 ] 

    +

    5005 except Exception: 

    +

    5006 trb_msg = traceback.format_exc() 

    +

    5007 msg = "A failure in %s was caught:\n%s" 

    +

    5008 LOGGER.warning(msg, "_read_states_is_alive, nodes", trb_msg) 

    +

    5009 finally: 

    +

    5010 var_index += n_nodes 

    +

    5011 

    +

    5012 # element deletion info 

    +

    5013 elif self.header.has_element_deletion_data: 

    +

    5014 n_solids = self.header.n_solids 

    +

    5015 n_tshells = self.header.n_thick_shells 

    +

    5016 n_shells = self.header.n_shells 

    +

    5017 n_beams = self.header.n_beams 

    +

    5018 # n_elems = n_solids + n_tshells + n_shells + n_beams 

    +

    5019 

    +

    5020 # SOLIDS 

    +

    5021 if n_solids > 0: 

    +

    5022 try: 

    +

    5023 array_dict[ArrayType.element_solid_is_alive] = state_data[ 

    +

    5024 :, var_index : var_index + n_solids 

    +

    5025 ].reshape((n_states, n_solids)) 

    +

    5026 except Exception: 

    +

    5027 trb_msg = traceback.format_exc() 

    +

    5028 msg = "A failure in %s was caught:\n%s" 

    +

    5029 LOGGER.warning(msg, "_read_states_is_alive, solids", trb_msg) 

    +

    5030 finally: 

    +

    5031 var_index += n_solids 

    +

    5032 

    +

    5033 # TSHELLS 

    +

    5034 if n_tshells > 0: 

    +

    5035 try: 

    +

    5036 array_dict[ArrayType.element_tshell_is_alive] = state_data[ 

    +

    5037 :, var_index : var_index + n_tshells 

    +

    5038 ].reshape((n_states, n_tshells)) 

    +

    5039 except Exception: 

    +

    5040 trb_msg = traceback.format_exc() 

    +

    5041 msg = "A failure in %s was caught:\n%s" 

    +

    5042 LOGGER.warning(msg, "_read_states_is_alive, solids", trb_msg) 

    +

    5043 finally: 

    +

    5044 var_index += n_tshells 

    +

    5045 

    +

    5046 # SHELLS 

    +

    5047 if n_shells > 0: 

    +

    5048 try: 

    +

    5049 array_dict[ArrayType.element_shell_is_alive] = state_data[ 

    +

    5050 :, var_index : var_index + n_shells 

    +

    5051 ].reshape((n_states, n_shells)) 

    +

    5052 except Exception: 

    +

    5053 trb_msg = traceback.format_exc() 

    +

    5054 msg = "A failure in %s was caught:\n%s" 

    +

    5055 LOGGER.warning(msg, "_read_states_is_alive, shells", trb_msg) 

    +

    5056 finally: 

    +

    5057 var_index += n_shells 

    +

    5058 

    +

    5059 # BEAMS 

    +

    5060 if n_beams > 0: 

    +

    5061 try: 

    +

    5062 array_dict[ArrayType.element_beam_is_alive] = state_data[ 

    +

    5063 :, var_index : var_index + n_beams 

    +

    5064 ].reshape((n_states, n_beams)) 

    +

    5065 except Exception: 

    +

    5066 trb_msg = traceback.format_exc() 

    +

    5067 msg = "A failure in %s was caught:\n%s" 

    +

    5068 LOGGER.warning(msg, "_read_states_is_alive, beams", trb_msg) 

    +

    5069 finally: 

    +

    5070 var_index += n_beams 

    +

    5071 

    +

    5072 LOGGER.debug("_read_states_is_alive end at var_index %d", var_index) 

    +

    5073 

    +

    5074 return var_index 

    +

    5075 

    +

    5076 def _read_states_sph(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    5077 """Read the sph state data 

    +

    5078 

    +

    5079 Parameters 

    +

    5080 ---------- 

    +

    5081 state_data: np.ndarray 

    +

    5082 array with entire state data 

    +

    5083 var_index: int 

    +

    5084 variable index in the state data array 

    +

    5085 array_dict: dict 

    +

    5086 dictionary to store the loaded arrays in 

    +

    5087 

    +

    5088 Returns 

    +

    5089 ------- 

    +

    5090 var_index: int 

    +

    5091 updated variable index after reading the section 

    +

    5092 """ 

    +

    5093 

    +

    5094 if self.header.n_sph_nodes <= 0: 

    +

    5095 return var_index 

    +

    5096 

    +

    5097 LOGGER.debug("_read_states_sph start at var_index %d", var_index) 

    +

    5098 

    +

    5099 info = self._sph_info 

    +

    5100 n_states = state_data.shape[0] 

    +

    5101 n_particles = self.header.n_sph_nodes 

    +

    5102 n_variables = info.n_sph_vars 

    +

    5103 

    +

    5104 # extract data 

    +

    5105 try: 

    +

    5106 sph_data = state_data[:, var_index : var_index + n_particles * n_variables] 

    +

    5107 

    +

    5108 i_var = 1 

    +

    5109 

    +

    5110 # deletion 

    +

    5111 try: 

    +

    5112 array_dict[ArrayType.sph_deletion] = sph_data[:, 0] < 0 

    +

    5113 except Exception: 

    +

    5114 trb_msg = traceback.format_exc() 

    +

    5115 msg = "A failure in %s was caught:\n%s" 

    +

    5116 LOGGER.warning(msg, "_read_states_sph, deletion", trb_msg) 

    +

    5117 

    +

    5118 # particle radius 

    +

    5119 if info.has_influence_radius: 

    +

    5120 try: 

    +

    5121 array_dict[ArrayType.sph_radius] = sph_data[:, i_var] 

    +

    5122 except Exception: 

    +

    5123 trb_msg = traceback.format_exc() 

    +

    5124 msg = "A failure in %s was caught:\n%s" 

    +

    5125 LOGGER.warning(msg, "_read_states_sph, radius", trb_msg) 

    +

    5126 finally: 

    +

    5127 i_var += 1 

    +

    5128 

    +

    5129 # pressure 

    +

    5130 if info.has_particle_pressure: 

    +

    5131 try: 

    +

    5132 array_dict[ArrayType.sph_pressure] = sph_data[:, i_var] 

    +

    5133 except Exception: 

    +

    5134 trb_msg = traceback.format_exc() 

    +

    5135 msg = "A failure in %s was caught:\n%s" 

    +

    5136 LOGGER.warning(msg, "_read_states_sph, pressure", trb_msg) 

    +

    5137 finally: 

    +

    5138 i_var += 1 

    +

    5139 

    +

    5140 # stress 

    +

    5141 if info.has_stresses: 

    +

    5142 try: 

    +

    5143 array_dict[ArrayType.sph_stress] = sph_data[ 

    +

    5144 :, i_var : i_var + n_particles * 6 

    +

    5145 ].reshape((n_states, n_particles, 6)) 

    +

    5146 except Exception: 

    +

    5147 trb_msg = traceback.format_exc() 

    +

    5148 msg = "A failure in %s was caught:\n%s" 

    +

    5149 LOGGER.warning(msg, "_read_states_sph, pressure", trb_msg) 

    +

    5150 finally: 

    +

    5151 i_var += 6 * n_particles 

    +

    5152 

    +

    5153 # eff. plastic strain 

    +

    5154 if info.has_plastic_strain: 

    +

    5155 try: 

    +

    5156 array_dict[ArrayType.sph_effective_plastic_strain] = sph_data[:, i_var] 

    +

    5157 except Exception: 

    +

    5158 trb_msg = traceback.format_exc() 

    +

    5159 msg = "A failure in %s was caught:\n%s" 

    +

    5160 LOGGER.warning(msg, "_read_states_sph, eff_plastic_strain", trb_msg) 

    +

    5161 finally: 

    +

    5162 i_var += 1 

    +

    5163 

    +

    5164 # density 

    +

    5165 if info.has_material_density: 

    +

    5166 try: 

    +

    5167 array_dict[ArrayType.sph_density] = sph_data[:, i_var] 

    +

    5168 except Exception: 

    +

    5169 trb_msg = traceback.format_exc() 

    +

    5170 msg = "A failure in %s was caught:\n%s" 

    +

    5171 LOGGER.warning(msg, "_read_states_sph, density", trb_msg) 

    +

    5172 finally: 

    +

    5173 i_var += 1 

    +

    5174 

    +

    5175 # internal energy 

    +

    5176 if info.has_internal_energy: 

    +

    5177 try: 

    +

    5178 array_dict[ArrayType.sph_internal_energy] = sph_data[:, i_var] 

    +

    5179 except Exception: 

    +

    5180 trb_msg = traceback.format_exc() 

    +

    5181 msg = "A failure in %s was caught:\n%s" 

    +

    5182 LOGGER.warning(msg, "_read_states_sph, internal_energy", trb_msg) 

    +

    5183 finally: 

    +

    5184 i_var += 1 

    +

    5185 

    +

    5186 # number of neighbors 

    +

    5187 if info.has_n_affecting_neighbors: 

    +

    5188 try: 

    +

    5189 array_dict[ArrayType.sph_n_neighbors] = sph_data[:, i_var] 

    +

    5190 except Exception: 

    +

    5191 trb_msg = traceback.format_exc() 

    +

    5192 msg = "A failure in %s was caught:\n%s" 

    +

    5193 LOGGER.warning(msg, "_read_states_sph, n_neighbors", trb_msg) 

    +

    5194 finally: 

    +

    5195 i_var += 1 

    +

    5196 

    +

    5197 # strain and strainrate 

    +

    5198 if info.has_strain_and_strainrate: 

    +

    5199 

    +

    5200 try: 

    +

    5201 array_dict[ArrayType.sph_strain] = sph_data[ 

    +

    5202 :, i_var : i_var + n_particles * 6 

    +

    5203 ].reshape((n_states, n_particles, 6)) 

    +

    5204 except Exception: 

    +

    5205 trb_msg = traceback.format_exc() 

    +

    5206 msg = "A failure in %s was caught:\n%s" 

    +

    5207 LOGGER.warning(msg, "_read_states_sph, strain", trb_msg) 

    +

    5208 finally: 

    +

    5209 i_var += 6 * n_particles 

    +

    5210 

    +

    5211 try: 

    +

    5212 array_dict[ArrayType.sph_strainrate] = sph_data[ 

    +

    5213 :, i_var : i_var + n_particles * 6 

    +

    5214 ].reshape((n_states, n_particles, 6)) 

    +

    5215 except Exception: 

    +

    5216 trb_msg = traceback.format_exc() 

    +

    5217 msg = "A failure in %s was caught:\n%s" 

    +

    5218 LOGGER.warning(msg, "_read_states_sph, strainrate", trb_msg) 

    +

    5219 finally: 

    +

    5220 i_var += 6 * n_particles 

    +

    5221 

    +

    5222 # mass 

    +

    5223 if info.has_mass: 

    +

    5224 try: 

    +

    5225 array_dict[ArrayType.sph_mass] = sph_data[:, i_var] 

    +

    5226 except Exception: 

    +

    5227 trb_msg = traceback.format_exc() 

    +

    5228 msg = "A failure in %s was caught:\n%s" 

    +

    5229 LOGGER.warning(msg, "_read_states_sph, pressure", trb_msg) 

    +

    5230 finally: 

    +

    5231 i_var += 1 

    +

    5232 

    +

    5233 except Exception: 

    +

    5234 trb_msg = traceback.format_exc() 

    +

    5235 msg = "A failure in %s was caught:\n%s" 

    +

    5236 LOGGER.warning(msg, "_read_states_sph, sph_data", trb_msg) 

    +

    5237 finally: 

    +

    5238 var_index += n_particles * n_variables 

    +

    5239 

    +

    5240 LOGGER.debug("_read_states_sph end at var_index %d", var_index) 

    +

    5241 

    +

    5242 return var_index 

    +

    5243 

    +

    5244 def _read_states_airbags(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: 

    +

    5245 """Read the airbag state data 

    +

    5246 

    +

    5247 Parameters 

    +

    5248 ---------- 

    +

    5249 state_data: np.ndarray 

    +

    5250 array with entire state data 

    +

    5251 var_index: int 

    +

    5252 variable index in the state data array 

    +

    5253 array_dict: dict 

    +

    5254 dictionary to store the loaded arrays in 

    +

    5255 

    +

    5256 Returns 

    +

    5257 ------- 

    +

    5258 var_index: int 

    +

    5259 updated variable index after reading the section 

    +

    5260 """ 

    +

    5261 

    +

    5262 if self.header.n_airbags <= 0: 

    +

    5263 return var_index 

    +

    5264 

    +

    5265 LOGGER.debug("_read_states_airbags start at var_index %d", var_index) 

    +

    5266 

    +

    5267 n_states = state_data.shape[0] 

    +

    5268 info = self._airbag_info 

    +

    5269 n_airbag_geom_vars = info.n_geometric_variables 

    +

    5270 n_airbags = info.n_airbags 

    +

    5271 n_state_airbag_vars = info.n_airbag_state_variables 

    +

    5272 n_particles = info.n_particles 

    +

    5273 n_particle_vars = info.n_particle_state_variables 

    +

    5274 

    +

    5275 # Warning 

    +

    5276 # I am not sure if this is right ... 

    +

    5277 n_total_vars = n_airbags * n_state_airbag_vars + n_particles * n_particle_vars 

    +

    5278 

    +

    5279 try: 

    +

    5280 # types 

    +

    5281 # nlist = ngeom + nvar + nstgeom 

    +

    5282 airbag_var_types = self.arrays[ArrayType.airbag_variable_types] 

    +

    5283 airbag_var_names = self.arrays[ArrayType.airbag_variable_names] 

    +

    5284 # geom_var_types = airbag_var_types[:n_airbag_geom_vars] 

    +

    5285 particle_var_types = airbag_var_types[ 

    +

    5286 n_airbag_geom_vars : n_airbag_geom_vars + n_particle_vars 

    +

    5287 ] 

    +

    5288 particle_var_names = airbag_var_names[ 

    +

    5289 n_airbag_geom_vars : n_airbag_geom_vars + n_particle_vars 

    +

    5290 ] 

    +

    5291 

    +

    5292 airbag_state_var_types = airbag_var_types[n_airbag_geom_vars + n_particle_vars :] 

    +

    5293 airbag_state_var_names = airbag_var_names[n_airbag_geom_vars + n_particle_vars :] 

    +

    5294 

    +

    5295 # required for dynamic reading 

    +

    5296 def get_dtype(type_flag): 

    +

    5297 return self._header.itype if type_flag == 1 else self.header.ftype 

    +

    5298 

    +

    5299 # extract airbag data 

    +

    5300 airbag_state_data = state_data[:, var_index : var_index + n_total_vars] 

    +

    5301 

    +

    5302 # airbag data 

    +

    5303 airbag_data = airbag_state_data[:, : n_airbags * n_state_airbag_vars].reshape( 

    +

    5304 (n_states, n_airbags, n_state_airbag_vars) 

    +

    5305 ) 

    +

    5306 airbag_state_offset = n_airbags * n_state_airbag_vars 

    +

    5307 

    +

    5308 # particle data 

    +

    5309 particle_data = airbag_state_data[ 

    +

    5310 :, airbag_state_offset : airbag_state_offset + n_particles * n_particle_vars 

    +

    5311 ].reshape((n_states, n_particles, n_particle_vars)) 

    +

    5312 

    +

    5313 # save sh... 

    +

    5314 

    +

    5315 # airbag state vars 

    +

    5316 for i_airbag_state_var in range(n_state_airbag_vars): 

    +

    5317 var_name = airbag_state_var_names[i_airbag_state_var].strip() 

    +

    5318 var_type = airbag_state_var_types[i_airbag_state_var] 

    +

    5319 

    +

    5320 if var_name.startswith("Act Gas"): 

    +

    5321 try: 

    +

    5322 array_dict[ArrayType.airbag_n_active_particles] = airbag_data[ 

    +

    5323 :, :, i_airbag_state_var 

    +

    5324 ].view(get_dtype(var_type)) 

    +

    5325 except Exception: 

    +

    5326 trb_msg = traceback.format_exc() 

    +

    5327 msg = "A failure in %s was caught:\n%s" 

    +

    5328 LOGGER.warning( 

    +

    5329 msg, "_read_states_airbags, airbag_n_active_particles", trb_msg 

    +

    5330 ) 

    +

    5331 elif var_name.startswith("Bag Vol"): 

    +

    5332 try: 

    +

    5333 array_dict[ArrayType.airbag_bag_volume] = airbag_data[ 

    +

    5334 :, :, i_airbag_state_var 

    +

    5335 ].view(get_dtype(var_type)) 

    +

    5336 except Exception: 

    +

    5337 trb_msg = traceback.format_exc() 

    +

    5338 msg = "A failure in %s was caught:\n%s" 

    +

    5339 LOGGER.warning(msg, "_read_states_airbags, airbag_volume", trb_msg) 

    +

    5340 else: 

    +

    5341 warn_msg = "Unknown airbag state var: '%s'. Skipping it." 

    +

    5342 LOGGER.warning(warn_msg, var_name) 

    +

    5343 

    +

    5344 # particles yay 

    +

    5345 for i_particle_var in range(n_particle_vars): 

    +

    5346 var_type = particle_var_types[i_particle_var] 

    +

    5347 var_name = particle_var_names[i_particle_var].strip() 

    +

    5348 

    +

    5349 # particle gas id 

    +

    5350 if var_name.startswith("GasC ID"): 

    +

    5351 try: 

    +

    5352 array_dict[ArrayType.airbag_particle_gas_id] = particle_data[ 

    +

    5353 :, :, i_particle_var 

    +

    5354 ].view(get_dtype(var_type)) 

    +

    5355 except Exception: 

    +

    5356 trb_msg = traceback.format_exc() 

    +

    5357 msg = "A failure in %s %s was caught:\n%s" 

    +

    5358 LOGGER.warning( 

    +

    5359 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5360 ) 

    +

    5361 # particle chamber id 

    +

    5362 elif var_name.startswith("Cham ID"): 

    +

    5363 try: 

    +

    5364 array_dict[ArrayType.airbag_particle_chamber_id] = particle_data[ 

    +

    5365 :, :, i_particle_var 

    +

    5366 ].view(get_dtype(var_type)) 

    +

    5367 except Exception: 

    +

    5368 trb_msg = traceback.format_exc() 

    +

    5369 msg = "A failure in %s %s was caught:\n%s" 

    +

    5370 LOGGER.warning( 

    +

    5371 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5372 ) 

    +

    5373 # particle leakage 

    +

    5374 elif var_name.startswith("Leakage"): 

    +

    5375 try: 

    +

    5376 array_dict[ArrayType.airbag_particle_leakage] = particle_data[ 

    +

    5377 :, :, i_particle_var 

    +

    5378 ].view(get_dtype(var_type)) 

    +

    5379 except Exception: 

    +

    5380 trb_msg = traceback.format_exc() 

    +

    5381 msg = "A failure in %s %s was caught:\n%s" 

    +

    5382 LOGGER.warning( 

    +

    5383 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5384 ) 

    +

    5385 # particle mass 

    +

    5386 elif var_name.startswith("Mass"): 

    +

    5387 try: 

    +

    5388 array_dict[ArrayType.airbag_particle_mass] = particle_data[ 

    +

    5389 :, :, i_particle_var 

    +

    5390 ].view(get_dtype(var_type)) 

    +

    5391 except Exception: 

    +

    5392 trb_msg = traceback.format_exc() 

    +

    5393 msg = "A failure in %s %s was caught:\n%s" 

    +

    5394 LOGGER.warning( 

    +

    5395 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5396 ) 

    +

    5397 # particle radius 

    +

    5398 try: 

    +

    5399 array_dict[ArrayType.airbag_particle_radius] = particle_data[ 

    +

    5400 :, :, i_particle_var 

    +

    5401 ].view(get_dtype(var_type)) 

    +

    5402 except Exception: 

    +

    5403 trb_msg = traceback.format_exc() 

    +

    5404 msg = "A failure in %s %s was caught:\n%s" 

    +

    5405 LOGGER.warning( 

    +

    5406 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5407 ) 

    +

    5408 # particle spin energy 

    +

    5409 elif var_name.startswith("Spin En"): 

    +

    5410 try: 

    +

    5411 array_dict[ArrayType.airbag_particle_spin_energy] = particle_data[ 

    +

    5412 :, :, i_particle_var 

    +

    5413 ].view(get_dtype(var_type)) 

    +

    5414 except Exception: 

    +

    5415 trb_msg = traceback.format_exc() 

    +

    5416 msg = "A failure in %s %s was caught:\n%s" 

    +

    5417 LOGGER.warning( 

    +

    5418 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5419 ) 

    +

    5420 # particle translational energy 

    +

    5421 elif var_name.startswith("Tran En"): 

    +

    5422 try: 

    +

    5423 array_dict[ArrayType.airbag_particle_translation_energy] = particle_data[ 

    +

    5424 :, :, i_particle_var 

    +

    5425 ].view(get_dtype(var_type)) 

    +

    5426 except Exception: 

    +

    5427 trb_msg = traceback.format_exc() 

    +

    5428 msg = "A failure in %s %s was caught:\n%s" 

    +

    5429 LOGGER.warning( 

    +

    5430 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5431 ) 

    +

    5432 # particle segment distance 

    +

    5433 elif var_name.startswith("NS dist"): 

    +

    5434 try: 

    +

    5435 array_dict[ 

    +

    5436 ArrayType.airbag_particle_nearest_segment_distance 

    +

    5437 ] = particle_data[:, :, i_particle_var].view(get_dtype(var_type)) 

    +

    5438 except Exception: 

    +

    5439 trb_msg = traceback.format_exc() 

    +

    5440 msg = "A failure in %s %s was caught:\n%s" 

    +

    5441 LOGGER.warning( 

    +

    5442 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5443 ) 

    +

    5444 # particle position 

    +

    5445 elif var_name.startswith("Pos x"): 

    +

    5446 try: 

    +

    5447 particle_var_names_stripped = [ 

    +

    5448 entry.strip() for entry in particle_var_names 

    +

    5449 ] 

    +

    5450 i_particle_var_x = i_particle_var 

    +

    5451 i_particle_var_y = particle_var_names_stripped.index("Pos y") 

    +

    5452 i_particle_var_z = particle_var_names_stripped.index("Pos z") 

    +

    5453 

    +

    5454 array_dict[ArrayType.airbag_particle_position] = particle_data[ 

    +

    5455 :, :, (i_particle_var_x, i_particle_var_y, i_particle_var_z) 

    +

    5456 ].view(get_dtype(var_type)) 

    +

    5457 except Exception: 

    +

    5458 trb_msg = traceback.format_exc() 

    +

    5459 msg = "A failure in %s %s was caught:\n%s" 

    +

    5460 LOGGER.warning( 

    +

    5461 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5462 ) 

    +

    5463 elif var_name.startswith("Pos y"): 

    +

    5464 # handled in Pos x 

    +

    5465 pass 

    +

    5466 elif var_name.startswith("Pos z"): 

    +

    5467 # handled in Pos x 

    +

    5468 pass 

    +

    5469 # particle velocity 

    +

    5470 elif var_name.startswith("Vel x"): 

    +

    5471 try: 

    +

    5472 particle_var_names_stripped = [ 

    +

    5473 entry.strip() for entry in particle_var_names 

    +

    5474 ] 

    +

    5475 i_particle_var_x = i_particle_var 

    +

    5476 i_particle_var_y = particle_var_names_stripped.index("Vel y") 

    +

    5477 i_particle_var_z = particle_var_names_stripped.index("Vel z") 

    +

    5478 

    +

    5479 array_dict[ArrayType.airbag_particle_velocity] = particle_data[ 

    +

    5480 :, :, (i_particle_var_x, i_particle_var_y, i_particle_var_z) 

    +

    5481 ].view(get_dtype(var_type)) 

    +

    5482 except Exception: 

    +

    5483 trb_msg = traceback.format_exc() 

    +

    5484 msg = "A failure in %s %s was caught:\n%s" 

    +

    5485 LOGGER.warning( 

    +

    5486 msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg 

    +

    5487 ) 

    +

    5488 

    +

    5489 except Exception: 

    +

    5490 trb_msg = traceback.format_exc() 

    +

    5491 msg = "A failure in %s was caught:\n%s" 

    +

    5492 LOGGER.warning(msg, "_read_states_airbags, particle_data", trb_msg) 

    +

    5493 finally: 

    +

    5494 var_index += n_total_vars 

    +

    5495 

    +

    5496 LOGGER.debug("_read_states_airbags end at var_index %d", var_index) 

    +

    5497 

    +

    5498 return var_index 

    +

    5499 

    +

    5500 def _read_states_road_surfaces( 

    +

    5501 self, state_data: np.ndarray, var_index: int, array_dict: dict 

    +

    5502 ) -> int: 

    +

    5503 """Read the road surfaces state data for whoever wants this ... 

    +

    5504 

    +

    5505 Parameters 

    +

    5506 ---------- 

    +

    5507 state_data: np.ndarray 

    +

    5508 array with entire state data 

    +

    5509 var_index: int 

    +

    5510 variable index in the state data array 

    +

    5511 array_dict: dict 

    +

    5512 dictionary to store the loaded arrays in 

    +

    5513 

    +

    5514 Returns 

    +

    5515 ------- 

    +

    5516 var_index: int 

    +

    5517 updated variable index after reading the section 

    +

    5518 """ 

    +

    5519 

    +

    5520 if not self.header.has_rigid_road_surface: 

    +

    5521 return var_index 

    +

    5522 

    +

    5523 LOGGER.debug("_read_states_road_surfaces start at var_index %s", var_index) 

    +

    5524 

    +

    5525 n_states = state_data.shape[0] 

    +

    5526 info = self._rigid_road_info 

    +

    5527 n_roads = info.n_roads 

    +

    5528 

    +

    5529 try: 

    +

    5530 # read road data 

    +

    5531 road_data = state_data[:, var_index : var_index + 6 * n_roads].reshape( 

    +

    5532 (n_states, n_roads, 2, 3) 

    +

    5533 ) 

    +

    5534 

    +

    5535 # DISPLACEMENT 

    +

    5536 try: 

    +

    5537 array_dict[ArrayType.rigid_road_displacement] = road_data[:, :, 0, :] 

    +

    5538 except Exception: 

    +

    5539 trb_msg = traceback.format_exc() 

    +

    5540 msg = "A failure in %s was caught:\n%s" 

    +

    5541 LOGGER.warning(msg, "_read_states_road_surfaces, road_displacement", trb_msg) 

    +

    5542 

    +

    5543 # VELOCITY 

    +

    5544 try: 

    +

    5545 array_dict[ArrayType.rigid_road_velocity] = road_data[:, :, 1, :] 

    +

    5546 except Exception: 

    +

    5547 trb_msg = traceback.format_exc() 

    +

    5548 msg = "A failure in %s was caught:\n%s" 

    +

    5549 LOGGER.warning(msg, "_read_states_road_surfaces, road_velocity", trb_msg) 

    +

    5550 

    +

    5551 except Exception: 

    +

    5552 trb_msg = traceback.format_exc() 

    +

    5553 msg = "A failure in %s was caught:\n%s" 

    +

    5554 LOGGER.warning(msg, "_read_states_road_surfaces, road_data", trb_msg) 

    +

    5555 finally: 

    +

    5556 var_index += 6 * n_roads 

    +

    5557 

    +

    5558 LOGGER.debug("_read_states_road_surfaces end at var_index %d", var_index) 

    +

    5559 

    +

    5560 return var_index 

    +

    5561 

    +

    5562 def _read_states_rigid_body_motion( 

    +

    5563 self, state_data: np.ndarray, var_index: int, array_dict: dict 

    +

    5564 ) -> int: 

    +

    5565 """Read the road surfaces state data for whoever want this ... 

    +

    5566 

    +

    5567 Parameters 

    +

    5568 ---------- 

    +

    5569 state_data: np.ndarray 

    +

    5570 array with entire state data 

    +

    5571 var_index: int 

    +

    5572 variable index in the state data array 

    +

    5573 array_dict: dict 

    +

    5574 dictionary to store the loaded arrays in 

    +

    5575 

    +

    5576 Returns 

    +

    5577 ------- 

    +

    5578 var_index: int 

    +

    5579 updated variable index after reading the section 

    +

    5580 """ 

    +

    5581 

    +

    5582 if not self.header.has_rigid_body_data: 

    +

    5583 return var_index 

    +

    5584 

    +

    5585 LOGGER.debug("_read_states_rigid_body_motion start at var_index %d", var_index) 

    +

    5586 

    +

    5587 info = self._rigid_body_info 

    +

    5588 n_states = state_data.shape[0] 

    +

    5589 n_rigids = info.n_rigid_bodies 

    +

    5590 n_rigid_vars = 12 if self.header.has_reduced_rigid_body_data else 24 

    +

    5591 

    +

    5592 try: 

    +

    5593 # do the thing 

    +

    5594 rigid_body_data = state_data[ 

    +

    5595 :, var_index : var_index + n_rigids * n_rigid_vars 

    +

    5596 ].reshape((n_states, n_rigids, n_rigid_vars)) 

    +

    5597 

    +

    5598 # let the party begin 

    +

    5599 # rigid coordinates 

    +

    5600 try: 

    +

    5601 array_dict[ArrayType.rigid_body_coordinates] = rigid_body_data[:, :, :3] 

    +

    5602 except Exception: 

    +

    5603 trb_msg = traceback.format_exc() 

    +

    5604 msg = "A failure in %s was caught:\n%s" 

    +

    5605 LOGGER.warning(msg, "_read_states_rigid_body_motion, coordinates", trb_msg) 

    +

    5606 finally: 

    +

    5607 i_var = 3 

    +

    5608 

    +

    5609 # rotation matrix 

    +

    5610 try: 

    +

    5611 array_dict[ArrayType.rigid_body_rotation_matrix] = rigid_body_data[ 

    +

    5612 :, :, i_var : i_var + 9 

    +

    5613 ] 

    +

    5614 except Exception: 

    +

    5615 trb_msg = traceback.format_exc() 

    +

    5616 msg = "A failure in %s was caught:\n%s" 

    +

    5617 LOGGER.warning(msg, "_read_states_rigid_body_motion, rot_matrix", trb_msg) 

    +

    5618 finally: 

    +

    5619 i_var += 9 

    +

    5620 

    +

    5621 if self.header.has_reduced_rigid_body_data: 

    +

    5622 return var_index 

    +

    5623 

    +

    5624 # velocity pewpew 

    +

    5625 try: 

    +

    5626 array_dict[ArrayType.rigid_body_velocity] = rigid_body_data[:, :, i_var : i_var + 3] 

    +

    5627 except Exception: 

    +

    5628 trb_msg = traceback.format_exc() 

    +

    5629 msg = "A failure in %s was caught:\n%s" 

    +

    5630 LOGGER.warning(msg, "_read_states_rigid_body_motion, velocity", trb_msg) 

    +

    5631 finally: 

    +

    5632 i_var += 3 

    +

    5633 

    +

    5634 # rotational velocity 

    +

    5635 try: 

    +

    5636 array_dict[ArrayType.rigid_body_rot_velocity] = rigid_body_data[ 

    +

    5637 :, :, i_var : i_var + 3 

    +

    5638 ] 

    +

    5639 except Exception: 

    +

    5640 trb_msg = traceback.format_exc() 

    +

    5641 msg = "A failure in %s was caught:\n%s" 

    +

    5642 LOGGER.warning(msg, "_read_states_rigid_body_motion, rot_velocity", trb_msg) 

    +

    5643 finally: 

    +

    5644 i_var += 3 

    +

    5645 

    +

    5646 # acceleration 

    +

    5647 try: 

    +

    5648 array_dict[ArrayType.rigid_body_acceleration] = rigid_body_data[ 

    +

    5649 :, :, i_var : i_var + 3 

    +

    5650 ] 

    +

    5651 except Exception: 

    +

    5652 trb_msg = traceback.format_exc() 

    +

    5653 msg = "A failure in %s was caught:\n%s" 

    +

    5654 LOGGER.warning(msg, "_read_states_rigid_body_motion, acceleration", trb_msg) 

    +

    5655 finally: 

    +

    5656 i_var += 3 

    +

    5657 

    +

    5658 # rotational acceleration 

    +

    5659 try: 

    +

    5660 array_dict[ArrayType.rigid_body_rot_acceleration] = rigid_body_data[ 

    +

    5661 :, :, i_var : i_var + 3 

    +

    5662 ] 

    +

    5663 except Exception: 

    +

    5664 trb_msg = traceback.format_exc() 

    +

    5665 msg = "A failure in %s was caught:\n%s" 

    +

    5666 LOGGER.warning(msg, "_read_states_rigid_body_motion, rot_acceleration", trb_msg) 

    +

    5667 finally: 

    +

    5668 i_var += 3 

    +

    5669 

    +

    5670 except Exception: 

    +

    5671 trb_msg = traceback.format_exc() 

    +

    5672 msg = "A failure in %s was caught:\n%s" 

    +

    5673 LOGGER.warning(msg, "_read_states_rigid_body_motion, rigid_body_data", trb_msg) 

    +

    5674 

    +

    5675 finally: 

    +

    5676 var_index += n_rigids * n_rigid_vars 

    +

    5677 

    +

    5678 LOGGER.debug("_read_states_rigid_body_motion end at var_index %d", var_index) 

    +

    5679 

    +

    5680 return var_index 

    +

    5681 

    +

    5682 def _collect_file_infos(self, size_per_state: int) -> List[MemoryInfo]: 

    +

    5683 """This routine collects the memory and file info for the d3plot files 

    +

    5684 

    +

    5685 Parameters 

    +

    5686 ---------- 

    +

    5687 size_per_state: int 

    +

    5688 size of every state to be read 

    +

    5689 

    +

    5690 Returns 

    +

    5691 ------- 

    +

    5692 memory_infos: List[MemoryInfo] 

    +

    5693 memory infos about the states 

    +

    5694 

    +

    5695 Notes 

    +

    5696 ----- 

    +

    5697 State data is expected directly behind geometry data 

    +

    5698 Unfortunately data is spread across multiple files. 

    +

    5699 One file could contain geometry and state data but states 

    +

    5700 may also be littered accross several files. This would 

    +

    5701 not be an issue, if dyna would not always write in blocks 

    +

    5702 of 512 words of memory, leaving zero byte padding blocks 

    +

    5703 at the end of files. These need to be removed and/or taken 

    +

    5704 care of. 

    +

    5705 """ 

    +

    5706 

    +

    5707 if not self._buffer: 

    +

    5708 return [] 

    +

    5709 

    +

    5710 base_filepath = self.header.filepath 

    +

    5711 

    +

    5712 # bugfix 

    +

    5713 # If you encounter these int casts more often here this is why: 

    +

    5714 # Some ints around here are numpy.int32 which can overflow 

    +

    5715 # (sometimes there is a warning ... sometimes not ...) 

    +

    5716 # we cast to python ints in order to prevent overflow. 

    +

    5717 size_per_state = int(size_per_state) 

    +

    5718 

    +

    5719 # Info: 

    +

    5720 # 

    +

    5721 # We need to determine here how many states are in every file 

    +

    5722 # without really loading the file itself. For big files this is 

    +

    5723 # simply filesize // state_size. 

    +

    5724 # For files though with a smaller filesize this may cause issues 

    +

    5725 # e.g. 

    +

    5726 # filesize 2048 bytes (minimum filesize from dyna) 

    +

    5727 # geom_size 200 bytes 

    +

    5728 # state_size 200 bytes 

    +

    5729 # File contains: 

    +

    5730 # -> 1 state * state_size + geom_size = 400 bytes 

    +

    5731 # Wrong State Estimation: 

    +

    5732 # -> (filesize - geom_size) // state_size = 9 states != 1 state 

    +

    5733 # 

    +

    5734 # To avoid this wrong number of states when reading small files 

    +

    5735 # we need to search the end mark (here nonzero byte) from the rear 

    +

    5736 # of the file. 

    +

    5737 # This though needs the file to be loaded into memory. To make this 

    +

    5738 # very light, we simply memorymap a small fraction of the file starting 

    +

    5739 # from the rear until we have our nonzero byte. Since the end mark 

    +

    5740 # is usually in the first block loaded, there should not be any performance 

    +

    5741 # concerns, even with bigger files. 

    +

    5742 

    +

    5743 # query for state files 

    +

    5744 filepaths = D3plot._find_dyna_result_files(base_filepath) 

    +

    5745 

    +

    5746 # compute state data in first file 

    +

    5747 # search therefore the first non-zero byte from the rear 

    +

    5748 last_nonzero_byte_index = self._buffer.size 

    +

    5749 mview_inv_arr = np.asarray(self._buffer.memoryview[::-1]) 

    +

    5750 # pylint: disable = invalid-name 

    +

    5751 BLOCK_SIZE = 2048 

    +

    5752 for start in range(0, self._buffer.size, BLOCK_SIZE): 

    +

    5753 (nz_indexes,) = np.nonzero(mview_inv_arr[start : start + BLOCK_SIZE]) 

    +

    5754 if len(nz_indexes): 

    +

    5755 last_nonzero_byte_index = self._buffer.size - (start + nz_indexes[0]) 

    +

    5756 break 

    +

    5757 n_states_beyond_geom = ( 

    +

    5758 last_nonzero_byte_index - self.geometry_section_size 

    +

    5759 ) // size_per_state 

    +

    5760 

    +

    5761 # bugfix: if states are too big we can get a negative estimation 

    +

    5762 n_states_beyond_geom = max(0, n_states_beyond_geom) 

    +

    5763 

    +

    5764 # memory required later 

    +

    5765 memory_infos = [ 

    +

    5766 MemoryInfo( 

    +

    5767 start=self.geometry_section_size, # type: ignore 

    +

    5768 length=n_states_beyond_geom * size_per_state, # type: ignore 

    +

    5769 filepath=base_filepath, 

    +

    5770 n_states=n_states_beyond_geom, # type: ignore 

    +

    5771 filesize=self._buffer.size, 

    +

    5772 use_mmap=True, 

    +

    5773 ) 

    +

    5774 ] 

    +

    5775 

    +

    5776 # compute amount of state data in every further file 

    +

    5777 for filepath in filepaths: 

    +

    5778 filesize = os.path.getsize(filepath) 

    +

    5779 last_nonzero_byte_index = -1 

    +

    5780 

    +

    5781 n_blocks = filesize // mmap.ALLOCATIONGRANULARITY 

    +

    5782 rest_size = filesize % mmap.ALLOCATIONGRANULARITY 

    +

    5783 block_length = mmap.ALLOCATIONGRANULARITY 

    +

    5784 with open(filepath, "rb") as fp: 

    +

    5785 

    +

    5786 # search last rest block (page-aligned) 

    +

    5787 # page-aligned means the start must be 

    +

    5788 # a multiple of mmap.ALLOCATIONGRANULARITY 

    +

    5789 # otherwise we get an error on linux 

    +

    5790 if rest_size: 

    +

    5791 start = n_blocks * block_length 

    +

    5792 mview = memoryview( 

    +

    5793 mmap.mmap( 

    +

    5794 fp.fileno(), offset=start, length=rest_size, access=mmap.ACCESS_READ 

    +

    5795 ).read() 

    +

    5796 ) 

    +

    5797 (nz_indexes,) = np.nonzero(mview[::-1]) 

    +

    5798 if len(nz_indexes): 

    +

    5799 last_nonzero_byte_index = start + rest_size - nz_indexes[0] 

    +

    5800 

    +

    5801 # search in blocks from the reair 

    +

    5802 if last_nonzero_byte_index == -1: 

    +

    5803 for i_block in range(n_blocks - 1, -1, -1): 

    +

    5804 start = block_length * i_block 

    +

    5805 mview = memoryview( 

    +

    5806 mmap.mmap( 

    +

    5807 fp.fileno(), 

    +

    5808 offset=start, 

    +

    5809 length=block_length, 

    +

    5810 access=mmap.ACCESS_READ, 

    +

    5811 ).read() 

    +

    5812 ) 

    +

    5813 (nz_indexes,) = np.nonzero(mview[::-1]) 

    +

    5814 if len(nz_indexes): 

    +

    5815 index = block_length - nz_indexes[0] 

    +

    5816 last_nonzero_byte_index = start + index 

    +

    5817 break 

    +

    5818 

    +

    5819 if last_nonzero_byte_index == -1: 

    +

    5820 msg = "The file {0} seems to be missing it's endmark." 

    +

    5821 raise RuntimeError(msg.format(filepath)) 

    +

    5822 

    +

    5823 # BUGFIX 

    +

    5824 # In d3eigv it could be observed that there is not necessarily an end mark. 

    +

    5825 # As a consequence the last byte can indeed be zero. We control this by 

    +

    5826 # checking if the last nonzero byte was smaller than the state size which 

    +

    5827 # makes no sense. 

    +

    5828 if ( 

    +

    5829 self.header.filetype == D3plotFiletype.D3EIGV 

    +

    5830 and last_nonzero_byte_index < size_per_state <= filesize 

    +

    5831 ): 

    +

    5832 last_nonzero_byte_index = size_per_state 

    +

    5833 

    +

    5834 n_states_in_file = last_nonzero_byte_index // size_per_state 

    +

    5835 memory_infos.append( 

    +

    5836 MemoryInfo( 

    +

    5837 start=0, 

    +

    5838 length=size_per_state * (n_states_in_file), 

    +

    5839 filepath=filepath, 

    +

    5840 n_states=n_states_in_file, 

    +

    5841 filesize=filesize, 

    +

    5842 use_mmap=False, 

    +

    5843 ) 

    +

    5844 ) 

    +

    5845 

    +

    5846 return memory_infos 

    +

    5847 

    +

    5848 @staticmethod 

    +

    5849 def _read_file_from_memory_info( 

    +

    5850 memory_infos: Union[MemoryInfo, List[MemoryInfo]] 

    +

    5851 ) -> Tuple[BinaryBuffer, int]: 

    +

    5852 """Read files from a single or multiple memory infos 

    +

    5853 

    +

    5854 Parameters 

    +

    5855 ---------- 

    +

    5856 memory_infos: MemoryInfo or List[MemoryInfo] 

    +

    5857 memory infos for loading a file (see `D3plot._collect_file_infos`) 

    +

    5858 

    +

    5859 Returns 

    +

    5860 ------- 

    +

    5861 bb_states: BinaryBuffer 

    +

    5862 New binary buffer with all states perfectly linear in memory 

    +

    5863 n_states: int 

    +

    5864 Number of states to be expected 

    +

    5865 

    +

    5866 Notes 

    +

    5867 ----- 

    +

    5868 This routine in contrast to `D3plot._read_state_bytebuffer` is used 

    +

    5869 to load only a fraction of files into memory. 

    +

    5870 """ 

    +

    5871 

    +

    5872 # single file case 

    +

    5873 if isinstance(memory_infos, MemoryInfo): 

    +

    5874 memory_infos = [memory_infos] 

    +

    5875 

    +

    5876 # allocate memory 

    +

    5877 # bugfix: casting to int prevents int32 overflow for large files 

    +

    5878 memory_required = 0 

    +

    5879 for mem in memory_infos: 

    +

    5880 memory_required += int(mem.length) 

    +

    5881 mview = memoryview(bytearray(memory_required)) 

    +

    5882 

    +

    5883 # transfer memory for other files 

    +

    5884 n_states = 0 

    +

    5885 total_offset = 0 

    +

    5886 for minfo in memory_infos: 

    +

    5887 LOGGER.debug("opening: %s", minfo.filepath) 

    +

    5888 

    +

    5889 with open(minfo.filepath, "br") as fp: 

    +

    5890 # NOTE 

    +

    5891 # mmap is too slow but maybe there are faster 

    +

    5892 # ways to use mmap correctly 

    +

    5893 # if minfo.use_mmap: 

    +

    5894 

    +

    5895 # # memory mapping can only be done page aligned 

    +

    5896 # mmap_start = (minfo.start // mmap.ALLOCATIONGRANULARITY) * \ 

    +

    5897 # mmap.ALLOCATIONGRANULARITY 

    +

    5898 # mview_start = minfo.start - mmap_start 

    +

    5899 

    +

    5900 # end = minfo.start + minfo.length 

    +

    5901 # n_end_pages = (end // mmap.ALLOCATIONGRANULARITY + 

    +

    5902 # (end % mmap.ALLOCATIONGRANULARITY != 0)) 

    +

    5903 # mmap_length = n_end_pages * mmap.ALLOCATIONGRANULARITY - mmap_start 

    +

    5904 # if mmap_start + mmap_length > minfo.filesize: 

    +

    5905 # mmap_length = minfo.filesize - mmap_start 

    +

    5906 

    +

    5907 # with mmap.mmap(fp.fileno(), 

    +

    5908 # length=mmap_length, 

    +

    5909 # offset=mmap_start, 

    +

    5910 # access=mmap.ACCESS_READ) as mp: 

    +

    5911 # # mp.seek(mview_start) 

    +

    5912 # # mview[total_offset:total_offset + 

    +

    5913 # # minfo.length] = mp.read(minfo.length) 

    +

    5914 

    +

    5915 # mview[total_offset:total_offset + 

    +

    5916 # minfo.length] = mp[mview_start:mview_start + minfo.length] 

    +

    5917 

    +

    5918 # else: 

    +

    5919 fp.seek(minfo.start) 

    +

    5920 fp.readinto(mview[total_offset : total_offset + minfo.length]) # type: ignore 

    +

    5921 

    +

    5922 total_offset += minfo.length 

    +

    5923 n_states += minfo.n_states 

    +

    5924 

    +

    5925 # save 

    +

    5926 bb_states = BinaryBuffer() 

    +

    5927 bb_states.memoryview = mview 

    +

    5928 

    +

    5929 return bb_states, n_states 

    +

    5930 

    +

    5931 def _read_state_bytebuffer(self, size_per_state: int): 

    +

    5932 """This routine reads the data for state information 

    +

    5933 

    +

    5934 Parameters 

    +

    5935 ---------- 

    +

    5936 size_per_state: int 

    +

    5937 size of every state to be read 

    +

    5938 

    +

    5939 Returns 

    +

    5940 ------- 

    +

    5941 bb_states: BinaryBuffer 

    +

    5942 New binary buffer with all states perfectly linear in memory 

    +

    5943 n_states: int 

    +

    5944 Number of states to be expected 

    +

    5945 

    +

    5946 Notes 

    +

    5947 ----- 

    +

    5948 State data is expected directly behind geometry data 

    +

    5949 Unfortunately data is spread across multiple files. 

    +

    5950 One file could contain geometry and state data but states 

    +

    5951 may also be littered accross several files. This would 

    +

    5952 not be an issue, if dyna would not always write in blocks 

    +

    5953 of 512 words of memory, leaving zero byte padding blocks 

    +

    5954 at the end of files. These need to be removed and/or taken 

    +

    5955 care of. 

    +

    5956 """ 

    +

    5957 

    +

    5958 if not self._buffer: 

    +

    5959 return BinaryBuffer(), 0 

    +

    5960 

    +

    5961 memory_infos = self._collect_file_infos(size_per_state) 

    +

    5962 

    +

    5963 # allocate memory 

    +

    5964 # bugfix: casting to int prevents int32 overflow for large files 

    +

    5965 memory_required = 0 

    +

    5966 for mem in memory_infos: 

    +

    5967 memory_required += int(mem.length) 

    +

    5968 mview = memoryview(bytearray(memory_required)) 

    +

    5969 

    +

    5970 # transfer memory from first file 

    +

    5971 n_states = memory_infos[0].n_states 

    +

    5972 start = memory_infos[0].start 

    +

    5973 length = memory_infos[0].length 

    +

    5974 end = start + length 

    +

    5975 mview[:length] = self._buffer.memoryview[start:end] 

    +

    5976 

    +

    5977 # transfer memory for other files 

    +

    5978 total_offset = length 

    +

    5979 for minfo in memory_infos[1:]: 

    +

    5980 with open(minfo.filepath, "br") as fp: 

    +

    5981 fp.seek(minfo.start) 

    +

    5982 fp.readinto(mview[total_offset : total_offset + length]) # type: ignore 

    +

    5983 

    +

    5984 total_offset += length 

    +

    5985 n_states += minfo.n_states 

    +

    5986 

    +

    5987 # save 

    +

    5988 bb_states = BinaryBuffer() 

    +

    5989 bb_states.memoryview = mview 

    +

    5990 return bb_states, n_states 

    +

    5991 

    +

    5992 @staticmethod 

    +

    5993 def _find_dyna_result_files(filepath: str): 

    +

    5994 """Searches all dyna result files 

    +

    5995 

    +

    5996 Parameters 

    +

    5997 ---------- 

    +

    5998 filepath: str 

    +

    5999 path to the first basic d3plot file 

    +

    6000 

    +

    6001 Returns 

    +

    6002 ------- 

    +

    6003 filepaths: list of str 

    +

    6004 path to all dyna files 

    +

    6005 

    +

    6006 Notes 

    +

    6007 ----- 

    +

    6008 The dyna files usually follow a scheme to 

    +

    6009 simply have the base name and numbers appended 

    +

    6010 e.g. (d3plot, d3plot0001, d3plot0002, etc.) 

    +

    6011 """ 

    +

    6012 

    +

    6013 file_dir = os.path.dirname(filepath) 

    +

    6014 file_dir = file_dir if len(file_dir) != 0 else "." 

    +

    6015 file_basename = os.path.basename(filepath) 

    +

    6016 

    +

    6017 pattern = f"({file_basename})[0-9]+$" 

    +

    6018 reg = re.compile(pattern) 

    +

    6019 

    +

    6020 filepaths = [ 

    +

    6021 os.path.join(file_dir, path) 

    +

    6022 for path in os.listdir(file_dir) 

    +

    6023 if os.path.isfile(os.path.join(file_dir, path)) and reg.match(path) 

    +

    6024 ] 

    +

    6025 

    +

    6026 # alphasort files to handle d3plots with more than 100 files 

    +

    6027 # e.g. d3plot01, d3plot02, ..., d3plot100 

    +

    6028 def convert(text): 

    +

    6029 return int(text) if text.isdigit() else text.lower() 

    +

    6030 

    +

    6031 number_pattern = "([0-9]+)" 

    +

    6032 

    +

    6033 def alphanum_key(key): 

    +

    6034 return [convert(c) for c in re.split(number_pattern, key)] 

    +

    6035 

    +

    6036 return sorted(filepaths, key=alphanum_key) 

    +

    6037 

    +

    6038 def _determine_wordsize(self): 

    +

    6039 """Determine the precision of the file 

    +

    6040 

    +

    6041 Returns 

    +

    6042 ------- 

    +

    6043 wordsize: int 

    +

    6044 size of each word in bytes 

    +

    6045 """ 

    +

    6046 

    +

    6047 if not self._buffer: 

    +

    6048 return 4, np.int32, np.float32 

    +

    6049 

    +

    6050 # test file type flag (1=d3plot, 5=d3part, 11=d3eigv) 

    +

    6051 

    +

    6052 # single precision 

    +

    6053 value = self._buffer.read_number(44, np.int32) 

    +

    6054 if value > 1000: 

    +

    6055 value -= 1000 

    +

    6056 if value in (1, 5, 11): 

    +

    6057 return 4, np.int32, np.float32 

    +

    6058 

    +

    6059 # double precision 

    +

    6060 value = self._buffer.read_number(88, np.int64) 

    +

    6061 if value > 1000: 

    +

    6062 value -= 1000 

    +

    6063 if value in (1, 5, 11): 

    +

    6064 return 8, np.int64, np.float64 

    +

    6065 

    +

    6066 raise RuntimeError(f"Unknown file type '{value}'.") 

    +

    6067 

    +

    6068 def plot( 

    +

    6069 self, 

    +

    6070 i_timestep: int = 0, 

    +

    6071 field: Union[np.ndarray, None] = None, 

    +

    6072 is_element_field: bool = True, 

    +

    6073 fringe_limits: Union[Tuple[float, float], None] = None, 

    +

    6074 export_filepath: str = "", 

    +

    6075 ): 

    +

    6076 """Plot the d3plot geometry 

    +

    6077 

    +

    6078 Parameters 

    +

    6079 ---------- 

    +

    6080 i_timestep: int 

    +

    6081 timestep index to plot 

    +

    6082 field: Union[np.ndarray, None] 

    +

    6083 Array containing a field value for every element or node 

    +

    6084 is_element_field: bool 

    +

    6085 if the specified field is for elements or nodes 

    +

    6086 fringe_limits: Union[Tuple[float, float], None] 

    +

    6087 limits for the fringe bar. Set by default to min and max. 

    +

    6088 export_filepath: str 

    +

    6089 filepath to export the html to 

    +

    6090 

    +

    6091 Notes 

    +

    6092 ----- 

    +

    6093 Currently only shell elements can be plotted, since for 

    +

    6094 solids the surface needs extraction. 

    +

    6095 

    +

    6096 Examples 

    +

    6097 -------- 

    +

    6098 Plot deformation of last timestep. 

    +

    6099 

    +

    6100 >>> d3plot = D3plot("path/to/d3plot") 

    +

    6101 >>> d3plot.plot(-1) 

    +

    6102 >>> # get eff. plastic strain 

    +

    6103 >>> pstrain = d3plot.arrays[ArrayType.element_shell_effective_plastic_strain] 

    +

    6104 >>> pstrain.shape 

    +

    6105 (1, 4696, 3) 

    +

    6106 >>> # mean across all 3 integration points 

    +

    6107 >>> pstrain = pstrain.mean(axis=2) 

    +

    6108 >>> pstrain.shape 

    +

    6109 (1, 4696) 

    +

    6110 >>> # we only have 1 timestep here but let's take last one in general 

    +

    6111 >>> last_timestep = -1 

    +

    6112 >>> d3plot.plot(0, field=pstrain[last_timestep]) 

    +

    6113 >>> # we don't like the fringe, let's adjust 

    +

    6114 >>> d3plot.plot(0, field=pstrain[last_timestep], fringe_limits=(0, 0.3)) 

    +

    6115 """ 

    +

    6116 

    +

    6117 assert i_timestep < self._state_info.n_timesteps 

    +

    6118 assert ArrayType.node_displacement in self.arrays 

    +

    6119 if fringe_limits: 

    +

    6120 assert len(fringe_limits) == 2 

    +

    6121 

    +

    6122 # shell nodes 

    +

    6123 shell_node_indexes = self.arrays[ArrayType.element_shell_node_indexes] 

    +

    6124 

    +

    6125 # get node displacement 

    +

    6126 node_xyz = self.arrays[ArrayType.node_displacement][i_timestep, :, :] 

    +

    6127 

    +

    6128 # check for correct field size 

    +

    6129 if isinstance(field, np.ndarray): 

    +

    6130 assert field.ndim == 1 

    +

    6131 if is_element_field and len(shell_node_indexes) != len(field): # type: ignore 

    +

    6132 msg = "Element indexes and field have different len: {} != {}" 

    +

    6133 raise ValueError(msg.format(shell_node_indexes.shape, field.shape)) 

    +

    6134 if not is_element_field and len(node_xyz) != len(field): # type: ignore 

    +

    6135 msg = "Node field and coords have different len: {} != {}" 

    +

    6136 raise ValueError(msg.format(node_xyz.shape, field.shape)) 

    +

    6137 

    +

    6138 # create plot 

    +

    6139 _html = plot_shell_mesh( 

    +

    6140 node_coordinates=node_xyz, 

    +

    6141 shell_node_indexes=shell_node_indexes, 

    +

    6142 field=field, 

    +

    6143 is_element_field=is_element_field, 

    +

    6144 fringe_limits=fringe_limits, 

    +

    6145 ) 

    +

    6146 

    +

    6147 # store in a temporary file 

    +

    6148 tempdir = tempfile.gettempdir() 

    +

    6149 tempdir = os.path.join(tempdir, "lasso") 

    +

    6150 if not os.path.isdir(tempdir): 

    +

    6151 os.mkdir(tempdir) 

    +

    6152 

    +

    6153 for tmpfile in os.listdir(tempdir): 

    +

    6154 tmpfile = os.path.join(tempdir, tmpfile) 

    +

    6155 if os.path.isfile(tmpfile): 

    +

    6156 os.remove(tmpfile) 

    +

    6157 

    +

    6158 if export_filepath: 

    +

    6159 with open(export_filepath, "w", encoding="utf-8") as fp: 

    +

    6160 fp.write(_html) 

    +

    6161 else: 

    +

    6162 # create new temp file 

    +

    6163 with tempfile.NamedTemporaryFile( 

    +

    6164 dir=tempdir, suffix=".html", mode="w", delete=False 

    +

    6165 ) as fp: 

    +

    6166 fp.write(_html) 

    +

    6167 webbrowser.open(fp.name) 

    +

    6168 

    +

    6169 def write_d3plot( 

    +

    6170 self, filepath: Union[str, BinaryIO], block_size_bytes: int = 2048, single_file: bool = True 

    +

    6171 ): 

    +

    6172 """Write a d3plot file again 

    +

    6173 

    +

    6174 Parameters 

    +

    6175 ---------- 

    +

    6176 filepath: Union[str, BinaryIO] 

    +

    6177 filepath of the new d3plot file or an opened file handle 

    +

    6178 block_size_bytes: int 

    +

    6179 D3plots are originally written in byte-blocks causing zero-padding at the end of 

    +

    6180 files. This can be controlled by this parameter. Set to 0 for no padding. 

    +

    6181 single_file: bool 

    +

    6182 whether to write all states into a single file 

    +

    6183 

    +

    6184 Examples 

    +

    6185 -------- 

    +

    6186 Modify an existing d3plot: 

    +

    6187 

    +

    6188 >>> d3plot = D3plot("path/to/d3plot") 

    +

    6189 >>> hvars = d3plot.array[ArrayType.element_shell_history_vars] 

    +

    6190 >>> hvars.shape 

    +

    6191 (1, 4696, 3, 19) 

    +

    6192 >>> new_history_var = np.random.random((1, 4696, 3, 1)) 

    +

    6193 >>> new_hvars = np.concatenate([hvars, new_history_var], axis=3) 

    +

    6194 >>> d3plot.array[ArrayType.element_shell_history_vars] = new_hvars 

    +

    6195 >>> d3plot.write_d3plot("path/to/new/d3plot") 

    +

    6196 

    +

    6197 Write a new d3plot from scratch: 

    +

    6198 

    +

    6199 >>> d3plot = D3plot() 

    +

    6200 >>> d3plot.arrays[ArrayType.node_coordinates] = np.array([[0, 0, 0], 

    +

    6201 ... [1, 0, 0], 

    +

    6202 ... [0, 1, 0]]) 

    +

    6203 >>> d3plot.arrays[ArrayType.element_shell_node_indexes] = np.array([[0, 2, 1, 1]]) 

    +

    6204 >>> d3plot.arrays[ArrayType.element_shell_part_indexes] = np.array([0]) 

    +

    6205 >>> d3plot.arrays[ArrayType.node_displacement] = np.array([[[0, 0, 0], 

    +

    6206 ... [1, 0, 0], 

    +

    6207 ... [0, 1, 0]]]) 

    +

    6208 >>> d3plot.write_d3plot("yay.d3plot") 

    +

    6209 """ 

    +

    6210 

    +

    6211 # if there is a single buffer, write all in 

    +

    6212 if not isinstance(filepath, str): 

    +

    6213 single_file = True 

    +

    6214 

    +

    6215 # determine write settings 

    +

    6216 write_settings = D3plotWriterSettings(self, block_size_bytes, single_file) 

    +

    6217 write_settings.build_header() 

    +

    6218 

    +

    6219 # remove old files 

    +

    6220 if isinstance(filepath, str): 

    +

    6221 filepaths = D3plot._find_dyna_result_files(filepath) 

    +

    6222 for path in filepaths: 

    +

    6223 if os.path.isfile(path): 

    +

    6224 os.remove(path) 

    +

    6225 

    +

    6226 # write geometry file 

    +

    6227 with open_file_or_filepath(filepath, "wb") as fp: 

    +

    6228 

    +

    6229 n_bytes_written = 0 

    +

    6230 msg = "wrote {0} after {1}." 

    +

    6231 

    +

    6232 # header 

    +

    6233 n_bytes_written += self._write_header(fp, write_settings) 

    +

    6234 LOGGER.debug(msg, n_bytes_written, "_write_header") 

    +

    6235 

    +

    6236 # material section 

    +

    6237 n_bytes_written += self._write_geom_material_section(fp, write_settings) 

    +

    6238 LOGGER.debug(msg, n_bytes_written, "_write_geom_material_section") 

    +

    6239 

    +

    6240 # fluid material data 

    +

    6241 n_bytes_written += self._write_geom_fluid_material_header(fp, write_settings) 

    +

    6242 LOGGER.debug(msg, n_bytes_written, "_write_geom_fluid_material_header") 

    +

    6243 

    +

    6244 # SPH element data flags 

    +

    6245 n_bytes_written += self._write_geom_sph_element_data_flags(fp, write_settings) 

    +

    6246 LOGGER.debug(msg, n_bytes_written, "_write_geom_sph_element_data_flags") 

    +

    6247 

    +

    6248 # Particle Data 

    +

    6249 n_bytes_written += self._write_geom_particle_flags(fp, write_settings) 

    +

    6250 LOGGER.debug(msg, n_bytes_written, "_write_geom_particle_flags") 

    +

    6251 

    +

    6252 # Geometry Data 

    +

    6253 n_bytes_written += self._write_geometry(fp, write_settings) 

    +

    6254 LOGGER.debug(msg, n_bytes_written, "_write_geometry") 

    +

    6255 

    +

    6256 # User Material, Node, Blabla IDs 

    +

    6257 n_bytes_written += self._write_geom_user_ids(fp, write_settings) 

    +

    6258 LOGGER.debug(msg, n_bytes_written, "_write_geom_user_ids") 

    +

    6259 

    +

    6260 # Rigid Body Description 

    +

    6261 n_bytes_written += self._write_geom_rigid_body_description(fp, write_settings) 

    +

    6262 LOGGER.debug(msg, n_bytes_written, "_write_geom_rigid_body_description") 

    +

    6263 

    +

    6264 # Adapted Element Parent List 

    +

    6265 # not supported 

    +

    6266 

    +

    6267 # Smooth Particle Hydrodynamcis Node and Material list 

    +

    6268 n_bytes_written += self._write_geom_sph_node_and_materials(fp, write_settings) 

    +

    6269 LOGGER.debug(msg, n_bytes_written, "_write_geom_sph_node_and_materials") 

    +

    6270 

    +

    6271 # Particle Geometry Data 

    +

    6272 n_bytes_written += self._write_geom_particle_geometry_data(fp, write_settings) 

    +

    6273 LOGGER.debug(msg, n_bytes_written, "_write_geom_particle_geometry_data") 

    +

    6274 

    +

    6275 # Rigid Road Surface Data 

    +

    6276 n_bytes_written += self._write_geom_rigid_road_surface(fp, write_settings) 

    +

    6277 LOGGER.debug(msg, n_bytes_written, "_write_geom_rigid_road_surface") 

    +

    6278 

    +

    6279 # Connectivity for weirdo elements 

    +

    6280 # 10 Node Tetra 

    +

    6281 # 8 Node Shell 

    +

    6282 # 20 Node Solid 

    +

    6283 # 27 Node Solid 

    +

    6284 n_bytes_written += self._write_geom_extra_node_data(fp, write_settings) 

    +

    6285 LOGGER.debug(msg, n_bytes_written, "_write_geom_extra_node_data") 

    +

    6286 

    +

    6287 # end mark 

    +

    6288 n_bytes_written += fp.write(write_settings.pack(-999999.0)) 

    +

    6289 LOGGER.debug(msg, n_bytes_written, "_end_mark") 

    +

    6290 

    +

    6291 # Header Part & Contact Interface Titles 

    +

    6292 n_bytes_written_before_titles = n_bytes_written 

    +

    6293 n_bytes_written += self._write_header_part_contact_interface_titles(fp, write_settings) 

    +

    6294 LOGGER.debug(msg, n_bytes_written, "_write_header_part_contact_interface_titles") 

    +

    6295 

    +

    6296 if n_bytes_written_before_titles != n_bytes_written: 

    +

    6297 

    +

    6298 # we seal the file here with an endmark 

    +

    6299 n_bytes_written += fp.write(write_settings.pack(-999999.0)) 

    +

    6300 LOGGER.debug(msg, n_bytes_written, "_end_mark") 

    +

    6301 else: 

    +

    6302 pass 

    +

    6303 # we already set an end-mark before 

    +

    6304 # that is perfectly fine 

    +

    6305 

    +

    6306 # correct zero padding at the end 

    +

    6307 if block_size_bytes > 0: 

    +

    6308 zero_bytes = self._get_zero_byte_padding(n_bytes_written, block_size_bytes) 

    +

    6309 n_bytes_written += fp.write(zero_bytes) 

    +

    6310 LOGGER.debug(msg, n_bytes_written, "_zero_byte_padding") 

    +

    6311 

    +

    6312 msg = "Wrote {0} bytes to geometry file." 

    +

    6313 LOGGER.debug(msg, n_bytes_written) 

    +

    6314 

    +

    6315 # Extra Data Types (for multi solver output) 

    +

    6316 # not supported 

    +

    6317 

    +

    6318 # write states 

    +

    6319 self._write_states(filepath, write_settings) 

    +

    6320 

    +

    6321 def _write_header(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: 

    +

    6322 

    +

    6323 wordsize = settings.wordsize 

    +

    6324 

    +

    6325 header_words = { 

    +

    6326 "title": (0 * wordsize, 10 * wordsize), 

    +

    6327 "runtime": (10 * wordsize, wordsize), 

    +

    6328 "filetype": (11 * wordsize, wordsize), 

    +

    6329 "source_version": (12 * wordsize, wordsize), 

    +

    6330 "release_version": (13 * wordsize, wordsize), 

    +

    6331 "version": (14 * wordsize, wordsize), 

    +

    6332 "ndim": (15 * wordsize, wordsize), 

    +

    6333 "numnp": (16 * wordsize, wordsize), 

    +

    6334 "icode": (17 * wordsize, wordsize), 

    +

    6335 "nglbv": (18 * wordsize, wordsize), 

    +

    6336 "it": (19 * wordsize, wordsize), 

    +

    6337 "iu": (20 * wordsize, wordsize), 

    +

    6338 "iv": (21 * wordsize, wordsize), 

    +

    6339 "ia": (22 * wordsize, wordsize), 

    +

    6340 "nel8": (23 * wordsize, wordsize), 

    +

    6341 "nummat8": (24 * wordsize, wordsize), 

    +

    6342 "numds": (25 * wordsize, wordsize), 

    +

    6343 "numst": (26 * wordsize, wordsize), 

    +

    6344 "nv3d": (27 * wordsize, wordsize), 

    +

    6345 "nel2": (28 * wordsize, wordsize), 

    +

    6346 "nummat2": (29 * wordsize, wordsize), 

    +

    6347 "nv1d": (30 * wordsize, wordsize), 

    +

    6348 "nel4": (31 * wordsize, wordsize), 

    +

    6349 "nummat4": (32 * wordsize, wordsize), 

    +

    6350 "nv2d": (33 * wordsize, wordsize), 

    +

    6351 "neiph": (34 * wordsize, wordsize), 

    +

    6352 "neips": (35 * wordsize, wordsize), 

    +

    6353 "maxint": (36 * wordsize, wordsize), 

    +

    6354 "nmsph": (37 * wordsize, wordsize), 

    +

    6355 "ngpsph": (38 * wordsize, wordsize), 

    +

    6356 "narbs": (39 * wordsize, wordsize), 

    +

    6357 "nelth": (40 * wordsize, wordsize), 

    +

    6358 "nummatt": (41 * wordsize, wordsize), 

    +

    6359 "nv3dt": (42 * wordsize, wordsize), 

    +

    6360 "ioshl1": (43 * wordsize, wordsize), 

    +

    6361 "ioshl2": (44 * wordsize, wordsize), 

    +

    6362 "ioshl3": (45 * wordsize, wordsize), 

    +

    6363 "ioshl4": (46 * wordsize, wordsize), 

    +

    6364 "ialemat": (47 * wordsize, wordsize), 

    +

    6365 "ncfdv1": (48 * wordsize, wordsize), 

    +

    6366 "ncfdv2": (49 * wordsize, wordsize), 

    +

    6367 # "nadapt": (50*wordsize, wordsize), 

    +

    6368 "nmmat": (51 * wordsize, wordsize), 

    +

    6369 "numfluid": (52 * wordsize, wordsize), 

    +

    6370 "inn": (53 * wordsize, wordsize), 

    +

    6371 "npefg": (54 * wordsize, wordsize), 

    +

    6372 "nel48": (55 * wordsize, wordsize), 

    +

    6373 "idtdt": (56 * wordsize, wordsize), 

    +

    6374 "extra": (57 * wordsize, wordsize), 

    +

    6375 } 

    +

    6376 

    +

    6377 header_extra_words = { 

    +

    6378 "nel20": (64 * wordsize, wordsize), 

    +

    6379 "nt3d": (65 * wordsize, wordsize), 

    +

    6380 "nel27": (66 * wordsize, wordsize), 

    +

    6381 "neipb": (67 * wordsize, wordsize), 

    +

    6382 } 

    +

    6383 

    +

    6384 new_header = settings.header 

    +

    6385 

    +

    6386 barray = bytearray((64 + new_header["extra"]) * wordsize) 

    +

    6387 

    +

    6388 for name, (position, size) in header_words.items(): 

    +

    6389 barray[position : position + size] = settings.pack(new_header[name], size) 

    +

    6390 

    +

    6391 if new_header["extra"] > 0: 

    +

    6392 for name, (position, size) in header_extra_words.items(): 

    +

    6393 barray[position : position + size] = settings.pack(new_header[name], size) 

    +

    6394 

    +

    6395 n_bytes_written = fp.write(barray) 

    +

    6396 

    +

    6397 # check 

    +

    6398 n_bytes_expected = (64 + new_header["extra"]) * settings.wordsize 

    +

    6399 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6400 

    +

    6401 return n_bytes_written 

    +

    6402 

    +

    6403 def _write_geom_material_section( 

    +

    6404 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    6405 ) -> int: 

    +

    6406 

    +

    6407 if settings.mattyp <= 0: 

    +

    6408 return 0 

    +

    6409 

    +

    6410 _check_ndim(self, {ArrayType.part_material_type: ["n_parts"]}) 

    +

    6411 

    +

    6412 part_material_type_original = self.arrays[ArrayType.part_material_type] 

    +

    6413 # part_material_type = np.full(settings.header["nmmat"], -1, 

    +

    6414 # dtype=settings.itype) 

    +

    6415 

    +

    6416 # if ArrayType.element_solid_part_indexes in self.arrays: 

    +

    6417 # unique_part_indexes = settings.unique_solid_part_indexes 

    +

    6418 # part_material_type[unique_part_indexes] = \ 

    +

    6419 # part_material_type_original[unique_part_indexes] 

    +

    6420 # if ArrayType.element_beam_part_indexes in self.arrays: 

    +

    6421 # unique_part_indexes = settings.unique_beam_part_indexes 

    +

    6422 # part_material_type[unique_part_indexes] = \ 

    +

    6423 # part_material_type_original[unique_part_indexes] 

    +

    6424 # if ArrayType.element_shell_part_indexes in self.arrays: 

    +

    6425 # unique_part_indexes = settings.unique_shell_part_indexes 

    +

    6426 # part_material_type[unique_part_indexes] = \ 

    +

    6427 # part_material_type_original[unique_part_indexes] 

    +

    6428 # if ArrayType.element_tshell_part_indexes in self.arrays: 

    +

    6429 # unique_part_indexes = settings.unique_tshell_part_indexes 

    +

    6430 # part_material_type[unique_part_indexes] = \ 

    +

    6431 # part_material_type_original[unique_part_indexes] 

    +

    6432 

    +

    6433 numrbe = settings.n_rigid_shells 

    +

    6434 

    +

    6435 n_bytes_written = 0 

    +

    6436 n_bytes_written += fp.write(settings.pack(numrbe)) 

    +

    6437 n_bytes_written += fp.write(settings.pack(len(part_material_type_original))) 

    +

    6438 n_bytes_written += fp.write(settings.pack(part_material_type_original)) 

    +

    6439 

    +

    6440 # check 

    +

    6441 n_bytes_expected = (len(part_material_type_original) + 2) * settings.wordsize 

    +

    6442 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6443 

    +

    6444 return n_bytes_written 

    +

    6445 

    +

    6446 def _write_geom_fluid_material_header( 

    +

    6447 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    6448 ) -> int: 

    +

    6449 

    +

    6450 if settings.header["ialemat"] == 0: 

    +

    6451 return 0 

    +

    6452 

    +

    6453 _check_ndim(self, {ArrayType.ale_material_ids: ["n_ale_parts"]}) 

    +

    6454 

    +

    6455 array = self.arrays[ArrayType.ale_material_ids] 

    +

    6456 n_bytes_written = fp.write(settings.pack(array, dtype_hint=np.integer)) 

    +

    6457 

    +

    6458 # check 

    +

    6459 n_bytes_expected = settings.header["ialemat"] * settings.wordsize 

    +

    6460 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6461 

    +

    6462 return n_bytes_written 

    +

    6463 

    +

    6464 def _write_geom_sph_element_data_flags( 

    +

    6465 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    6466 ) -> int: 

    +

    6467 

    +

    6468 if settings.header["nmsph"] <= 0: 

    +

    6469 return 0 

    +

    6470 

    +

    6471 n_sph_var_count = 0 

    +

    6472 

    +

    6473 # radius 

    +

    6474 n_sph_radius_vars = 1 if ArrayType.sph_radius in self.arrays else 0 

    +

    6475 n_sph_var_count += n_sph_radius_vars 

    +

    6476 

    +

    6477 # pressure 

    +

    6478 n_sph_pressure_vars = 1 if ArrayType.sph_pressure in self.arrays else 0 

    +

    6479 n_sph_var_count += n_sph_pressure_vars 

    +

    6480 

    +

    6481 # stress 

    +

    6482 n_sph_stress_vars = 6 if ArrayType.sph_stress in self.arrays else 0 

    +

    6483 n_sph_var_count += n_sph_stress_vars 

    +

    6484 

    +

    6485 # eff pstrain 

    +

    6486 n_sph_eff_pstrain_vars = 1 if ArrayType.sph_effective_plastic_strain in self.arrays else 0 

    +

    6487 n_sph_var_count += n_sph_eff_pstrain_vars 

    +

    6488 

    +

    6489 # density 

    +

    6490 n_sph_density_vars = 1 if ArrayType.sph_density in self.arrays else 0 

    +

    6491 n_sph_var_count += n_sph_density_vars 

    +

    6492 

    +

    6493 # internal energy 

    +

    6494 n_sph_internal_energy_vars = 1 if ArrayType.sph_internal_energy in self.arrays else 0 

    +

    6495 n_sph_var_count += n_sph_internal_energy_vars 

    +

    6496 

    +

    6497 # n neighbors 

    +

    6498 n_sph_n_neighbors_vars = 1 if ArrayType.sph_n_neighbors in self.arrays else 0 

    +

    6499 n_sph_var_count += n_sph_n_neighbors_vars 

    +

    6500 

    +

    6501 # strains 

    +

    6502 n_sph_strain_vars = 6 if ArrayType.sph_strain in self.arrays else 0 

    +

    6503 n_sph_var_count += n_sph_strain_vars 

    +

    6504 

    +

    6505 # mass 

    +

    6506 n_sph_mass_vars = 1 if ArrayType.sph_mass in self.arrays else 0 

    +

    6507 n_sph_var_count += n_sph_mass_vars 

    +

    6508 

    +

    6509 # history vars 

    +

    6510 n_sph_history_vars = 0 

    +

    6511 if ArrayType.sph_history_vars in self.arrays: 

    +

    6512 n_sph_history_vars, _ = settings.count_array_state_var( 

    +

    6513 ArrayType.sph_history_vars, 

    +

    6514 ["n_timesteps", "n_sph_particles", "n_sph_history_vars"], 

    +

    6515 False, 

    +

    6516 ) 

    +

    6517 n_sph_var_count += n_sph_history_vars 

    +

    6518 

    +

    6519 # write 

    +

    6520 n_bytes_written = 0 

    +

    6521 n_bytes_written += fp.write(settings.pack(n_sph_var_count)) 

    +

    6522 n_bytes_written += fp.write(settings.pack(n_sph_radius_vars)) 

    +

    6523 n_bytes_written += fp.write(settings.pack(n_sph_pressure_vars)) 

    +

    6524 n_bytes_written += fp.write(settings.pack(n_sph_stress_vars)) 

    +

    6525 n_bytes_written += fp.write(settings.pack(n_sph_eff_pstrain_vars)) 

    +

    6526 n_bytes_written += fp.write(settings.pack(n_sph_density_vars)) 

    +

    6527 n_bytes_written += fp.write(settings.pack(n_sph_internal_energy_vars)) 

    +

    6528 n_bytes_written += fp.write(settings.pack(n_sph_n_neighbors_vars)) 

    +

    6529 n_bytes_written += fp.write(settings.pack(n_sph_strain_vars)) 

    +

    6530 n_bytes_written += fp.write(settings.pack(n_sph_mass_vars)) 

    +

    6531 n_bytes_written += fp.write(settings.pack(n_sph_history_vars)) 

    +

    6532 

    +

    6533 # check 

    +

    6534 n_bytes_expected = 11 * settings.wordsize 

    +

    6535 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6536 

    +

    6537 return n_bytes_written 

    +

    6538 

    +

    6539 def _write_geom_particle_flags(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: 

    +

    6540 

    +

    6541 npefg = settings.header["npefg"] 

    +

    6542 

    +

    6543 if npefg <= 0 or npefg > 10000000: 

    +

    6544 return 0 

    +

    6545 

    +

    6546 _check_ndim( 

    +

    6547 self, 

    +

    6548 { 

    +

    6549 ArrayType.airbags_n_particles: ["n_airbags"], 

    +

    6550 ArrayType.airbags_n_chambers: ["n_airbags"], 

    +

    6551 }, 

    +

    6552 ) 

    +

    6553 

    +

    6554 # n_airbags = npefg % 1000 

    +

    6555 subver = npefg // 1000 

    +

    6556 

    +

    6557 # airbag geometry var count 

    +

    6558 ngeom = 5 if ArrayType.airbags_n_chambers in self.arrays else 4 

    +

    6559 

    +

    6560 # state variable count 

    +

    6561 # see later 

    +

    6562 nvar = 14 

    +

    6563 

    +

    6564 # n particles 

    +

    6565 n_particles = 0 

    +

    6566 if ArrayType.airbags_n_particles in self.arrays: 

    +

    6567 n_particles = np.sum(self.arrays[ArrayType.airbags_n_particles]) 

    +

    6568 

    +

    6569 # airbag state var count 

    +

    6570 nstgeom = 2 

    +

    6571 

    +

    6572 # write 

    +

    6573 n_bytes_written = 0 

    +

    6574 n_bytes_written += fp.write(settings.pack(ngeom)) 

    +

    6575 n_bytes_written += fp.write(settings.pack(nvar)) 

    +

    6576 n_bytes_written += fp.write(settings.pack(n_particles)) 

    +

    6577 n_bytes_written += fp.write(settings.pack(nstgeom)) 

    +

    6578 if subver == 4: 

    +

    6579 # This was never validated 

    +

    6580 n_bytes_written += fp.write( 

    +

    6581 settings.pack(self.arrays[ArrayType.airbags_n_chambers].sum()) 

    +

    6582 ) 

    +

    6583 

    +

    6584 # check 

    +

    6585 n_bytes_expected = (5 if subver == 4 else 4) * settings.wordsize 

    +

    6586 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6587 

    +

    6588 # typecode for variables 

    +

    6589 # pylint: disable = invalid-name 

    +

    6590 INT_TC = 1 

    +

    6591 # pylint: disable = invalid-name 

    +

    6592 FLOAT_TC = 2 

    +

    6593 nlist_names_typecodes = [ 

    +

    6594 # airbag geometry data (ngeom) 

    +

    6595 ["Start N ", INT_TC], 

    +

    6596 ["Npart ", INT_TC], 

    +

    6597 ["Bag ID ", INT_TC], 

    +

    6598 ["NGasC ", INT_TC], 

    +

    6599 ["NCham ", INT_TC], 

    +

    6600 # state particle data (nvar) 

    +

    6601 ["GasC ID ", INT_TC], 

    +

    6602 ["Cham ID ", INT_TC], 

    +

    6603 ["Leakage ", INT_TC], 

    +

    6604 ["Pos x ", FLOAT_TC], 

    +

    6605 ["Pos y ", FLOAT_TC], 

    +

    6606 ["Pos z ", FLOAT_TC], 

    +

    6607 ["Vel x ", FLOAT_TC], 

    +

    6608 ["Vel y ", FLOAT_TC], 

    +

    6609 ["Vel z ", FLOAT_TC], 

    +

    6610 ["Mass ", FLOAT_TC], 

    +

    6611 ["Radius ", FLOAT_TC], 

    +

    6612 ["Spin En ", FLOAT_TC], 

    +

    6613 ["Tran En ", FLOAT_TC], 

    +

    6614 ["NS dist ", FLOAT_TC], 

    +

    6615 # airbag state vars (nstgeom) 

    +

    6616 ["Act Gas ", INT_TC], 

    +

    6617 ["Bag Vol ", FLOAT_TC], 

    +

    6618 ] 

    +

    6619 

    +

    6620 # airbag var typecodes 

    +

    6621 for _, typecode in nlist_names_typecodes: 

    +

    6622 n_bytes_written += fp.write(settings.pack(typecode)) 

    +

    6623 

    +

    6624 # airbag var names 

    +

    6625 # every word is an ascii char. So, we need to set 

    +

    6626 # only the first byte to the ascii char code 

    +

    6627 fmt_string = "{0:" + str(settings.wordsize) + "}" 

    +

    6628 for name, _ in nlist_names_typecodes: 

    +

    6629 name_formatted = fmt_string.format(name).encode("ascii") 

    +

    6630 for ch in name_formatted: 

    +

    6631 barray = bytearray(settings.wordsize) 

    +

    6632 barray[0] = ch 

    +

    6633 

    +

    6634 n_bytes_written += fp.write(settings.pack(barray, settings.wordsize)) 

    +

    6635 

    +

    6636 # check 

    +

    6637 n_bytes_expected += len(nlist_names_typecodes) * 9 * settings.wordsize 

    +

    6638 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6639 

    +

    6640 return n_bytes_written 

    +

    6641 

    +

    6642 def _write_geometry(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: 

    +

    6643 

    +

    6644 n_bytes_written = 0 

    +

    6645 

    +

    6646 # pre-checks 

    +

    6647 _check_ndim( 

    +

    6648 self, 

    +

    6649 { 

    +

    6650 ArrayType.node_coordinates: ["n_nodes", "x_y_z"], 

    +

    6651 ArrayType.element_solid_node_indexes: ["n_solids", "n_element_nodes"], 

    +

    6652 ArrayType.element_solid_part_indexes: ["n_solids"], 

    +

    6653 ArrayType.element_solid_extra_nodes: ["n_solids", "n_extra_nodes"], 

    +

    6654 ArrayType.element_tshell_node_indexes: ["n_tshells", "n_element_nodes"], 

    +

    6655 ArrayType.element_tshell_part_indexes: ["n_tshells"], 

    +

    6656 ArrayType.element_beam_node_indexes: ["n_beams", "n_element_nodes"], 

    +

    6657 ArrayType.element_beam_part_indexes: ["n_beams"], 

    +

    6658 ArrayType.element_shell_node_indexes: ["n_shells", "n_element_nodes"], 

    +

    6659 ArrayType.element_shell_part_indexes: ["n_shells"], 

    +

    6660 }, 

    +

    6661 ) 

    +

    6662 self.check_array_dims({ArrayType.node_coordinates: 1}, "x_y_z", 3) 

    +

    6663 

    +

    6664 array_dims = { 

    +

    6665 ArrayType.element_solid_node_indexes: 0, 

    +

    6666 ArrayType.element_solid_part_indexes: 0, 

    +

    6667 ArrayType.element_solid_extra_nodes: 0, 

    +

    6668 } 

    +

    6669 n_solids = self.check_array_dims(array_dims, "n_solids") 

    +

    6670 self.check_array_dims({ArrayType.element_solid_node_indexes: 1}, "n_element_nodes", 8) 

    +

    6671 self.check_array_dims({ArrayType.element_solid_extra_nodes: 1}, "n_extra_nodes", 2) 

    +

    6672 array_dims = { 

    +

    6673 ArrayType.element_tshell_node_indexes: 0, 

    +

    6674 ArrayType.element_tshell_part_indexes: 0, 

    +

    6675 } 

    +

    6676 self.check_array_dims(array_dims, "n_tshells") 

    +

    6677 self.check_array_dims({ArrayType.element_tshell_node_indexes: 1}, "n_element_nodes", 8) 

    +

    6678 array_dims = { 

    +

    6679 ArrayType.element_beam_node_indexes: 0, 

    +

    6680 ArrayType.element_beam_part_indexes: 0, 

    +

    6681 } 

    +

    6682 self.check_array_dims(array_dims, "n_beams") 

    +

    6683 self.check_array_dims({ArrayType.element_beam_node_indexes: 1}, "n_element_nodes", 5) 

    +

    6684 array_dims = { 

    +

    6685 ArrayType.element_shell_node_indexes: 0, 

    +

    6686 ArrayType.element_shell_part_indexes: 0, 

    +

    6687 } 

    +

    6688 self.check_array_dims(array_dims, "n_shells") 

    +

    6689 self.check_array_dims({ArrayType.element_shell_node_indexes: 1}, "n_element_nodes", 4) 

    +

    6690 

    +

    6691 # NODES 

    +

    6692 node_coordinates = ( 

    +

    6693 self.arrays[ArrayType.node_coordinates] 

    +

    6694 if ArrayType.node_coordinates in self.arrays 

    +

    6695 else np.zeros((0, settings.header["ndim"]), dtype=self.header.ftype) 

    +

    6696 ) 

    +

    6697 n_bytes_written += fp.write(settings.pack(node_coordinates, dtype_hint=np.floating)) 

    +

    6698 

    +

    6699 # SOLIDS 

    +

    6700 solid_node_indexes = ( 

    +

    6701 self.arrays[ArrayType.element_solid_node_indexes] + FORTRAN_OFFSET 

    +

    6702 if ArrayType.element_solid_node_indexes in self.arrays 

    +

    6703 else np.zeros((0, 8), dtype=self._header.itype) 

    +

    6704 ) 

    +

    6705 solid_part_indexes = ( 

    +

    6706 self.arrays[ArrayType.element_solid_part_indexes] + FORTRAN_OFFSET 

    +

    6707 if ArrayType.element_solid_part_indexes in self.arrays 

    +

    6708 else np.zeros(0, dtype=self._header.itype) 

    +

    6709 ) 

    +

    6710 solid_geom_array = np.concatenate( 

    +

    6711 (solid_node_indexes, solid_part_indexes.reshape(n_solids, 1)), axis=1 

    +

    6712 ) 

    +

    6713 n_bytes_written += fp.write(settings.pack(solid_geom_array, dtype_hint=np.integer)) 

    +

    6714 

    +

    6715 # SOLID 10 

    +

    6716 # the two extra nodes 

    +

    6717 if ArrayType.element_solid_extra_nodes in self.arrays: 

    +

    6718 array = self.arrays[ArrayType.element_solid_extra_nodes] + FORTRAN_OFFSET 

    +

    6719 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.integer)) 

    +

    6720 

    +

    6721 # THICK SHELLS 

    +

    6722 tshell_node_indexes = ( 

    +

    6723 self.arrays[ArrayType.element_tshell_node_indexes] + FORTRAN_OFFSET 

    +

    6724 if ArrayType.element_tshell_node_indexes in self.arrays 

    +

    6725 else np.zeros((0, 8), dtype=self._header.itype) 

    +

    6726 ) 

    +

    6727 tshell_part_indexes = ( 

    +

    6728 self.arrays[ArrayType.element_tshell_part_indexes] + FORTRAN_OFFSET 

    +

    6729 if ArrayType.element_tshell_part_indexes in self.arrays 

    +

    6730 else np.zeros(0, dtype=self._header.itype) 

    +

    6731 ) 

    +

    6732 tshell_geom_array = np.concatenate( 

    +

    6733 (tshell_node_indexes, tshell_part_indexes.reshape(-1, 1)), axis=1 

    +

    6734 ) 

    +

    6735 n_bytes_written += fp.write(settings.pack(tshell_geom_array, dtype_hint=np.integer)) 

    +

    6736 

    +

    6737 # BEAMS 

    +

    6738 beam_node_indexes = ( 

    +

    6739 self.arrays[ArrayType.element_beam_node_indexes] + FORTRAN_OFFSET 

    +

    6740 if ArrayType.element_beam_node_indexes in self.arrays 

    +

    6741 else np.zeros((0, 5), dtype=self._header.itype) 

    +

    6742 ) 

    +

    6743 beam_part_indexes = ( 

    +

    6744 self.arrays[ArrayType.element_beam_part_indexes] + FORTRAN_OFFSET 

    +

    6745 if ArrayType.element_beam_part_indexes in self.arrays 

    +

    6746 else np.zeros(0, dtype=self._header.itype) 

    +

    6747 ) 

    +

    6748 beam_geom_array = np.concatenate( 

    +

    6749 (beam_node_indexes, beam_part_indexes.reshape(-1, 1)), axis=1 

    +

    6750 ) 

    +

    6751 n_bytes_written += fp.write(settings.pack(beam_geom_array, dtype_hint=np.integer)) 

    +

    6752 

    +

    6753 # SHELLS 

    +

    6754 shell_node_indexes = ( 

    +

    6755 self.arrays[ArrayType.element_shell_node_indexes] + FORTRAN_OFFSET 

    +

    6756 if ArrayType.element_shell_node_indexes in self.arrays 

    +

    6757 else np.zeros((0, 4), dtype=self._header.itype) 

    +

    6758 ) 

    +

    6759 shell_part_indexes = ( 

    +

    6760 self.arrays[ArrayType.element_shell_part_indexes] + FORTRAN_OFFSET 

    +

    6761 if ArrayType.element_shell_part_indexes in self.arrays 

    +

    6762 else np.zeros(0, dtype=self._header.itype) 

    +

    6763 ) 

    +

    6764 shell_geom_array = np.concatenate( 

    +

    6765 (shell_node_indexes, shell_part_indexes.reshape(-1, 1)), axis=1 

    +

    6766 ) 

    +

    6767 n_bytes_written += fp.write(settings.pack(shell_geom_array, dtype_hint=np.integer)) 

    +

    6768 

    +

    6769 # check 

    +

    6770 n_bytes_expected = ( 

    +

    6771 settings.header["numnp"] * 3 

    +

    6772 + abs(settings.header["nel8"]) * 9 

    +

    6773 + settings.header["nelth"] * 9 

    +

    6774 + settings.header["nel2"] * 6 

    +

    6775 + settings.header["nel4"] * 5 

    +

    6776 ) * settings.wordsize 

    +

    6777 if ArrayType.element_solid_extra_nodes in self.arrays: 

    +

    6778 n_bytes_expected += 2 * abs(settings.header["nel8"]) 

    +

    6779 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6780 

    +

    6781 # return the chunks 

    +

    6782 return n_bytes_written 

    +

    6783 

    +

    6784 def _write_geom_user_ids(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: 

    +

    6785 

    +

    6786 narbs = settings.header["narbs"] 

    +

    6787 if narbs == 0: 

    +

    6788 return 0 

    +

    6789 

    +

    6790 info = self._numbering_info 

    +

    6791 

    +

    6792 _check_ndim( 

    +

    6793 self, 

    +

    6794 { 

    +

    6795 ArrayType.node_ids: ["n_nodes"], 

    +

    6796 ArrayType.element_solid_ids: ["n_solids"], 

    +

    6797 ArrayType.element_beam_ids: ["n_beams"], 

    +

    6798 ArrayType.element_shell_ids: ["n_shells"], 

    +

    6799 ArrayType.element_tshell_ids: ["n_tshells"], 

    +

    6800 ArrayType.part_ids: ["n_parts"], 

    +

    6801 ArrayType.part_ids_unordered: ["n_parts"], 

    +

    6802 ArrayType.part_ids_cross_references: ["n_parts"], 

    +

    6803 }, 

    +

    6804 ) 

    +

    6805 

    +

    6806 n_bytes_written = 0 

    +

    6807 

    +

    6808 # NUMBERING HEADER 

    +

    6809 

    +

    6810 # nsort seems to be solver internal pointer 

    +

    6811 # ... hopefully 

    +

    6812 nsort = info.ptr_node_ids 

    +

    6813 nsort *= -1 if ArrayType.part_ids in self.arrays else 1 

    +

    6814 

    +

    6815 n_bytes_written += fp.write(settings.pack(nsort)) 

    +

    6816 

    +

    6817 nsrh = abs(nsort) + settings.header["numnp"] 

    +

    6818 n_bytes_written += fp.write(settings.pack(nsrh)) 

    +

    6819 

    +

    6820 nsrb = nsrh + abs(settings.header["nel8"]) 

    +

    6821 n_bytes_written += fp.write(settings.pack(nsrb)) 

    +

    6822 

    +

    6823 nsrs = nsrb + settings.header["nel2"] 

    +

    6824 n_bytes_written += fp.write(settings.pack(nsrs)) 

    +

    6825 

    +

    6826 nsrt = nsrs + settings.header["nel4"] 

    +

    6827 n_bytes_written += fp.write(settings.pack(nsrt)) 

    +

    6828 

    +

    6829 nsortd = settings.header["numnp"] 

    +

    6830 n_bytes_written += fp.write(settings.pack(nsortd)) 

    +

    6831 

    +

    6832 nsrhd = abs(settings.header["nel8"]) 

    +

    6833 n_bytes_written += fp.write(settings.pack(nsrhd)) 

    +

    6834 

    +

    6835 nsrbd = settings.header["nel2"] 

    +

    6836 n_bytes_written += fp.write(settings.pack(nsrbd)) 

    +

    6837 

    +

    6838 nsrsd = settings.header["nel4"] 

    +

    6839 n_bytes_written += fp.write(settings.pack(nsrsd)) 

    +

    6840 

    +

    6841 nsrtd = settings.header["nelth"] 

    +

    6842 n_bytes_written += fp.write(settings.pack(nsrtd)) 

    +

    6843 

    +

    6844 if ArrayType.part_ids in self.arrays: 

    +

    6845 # some lsdyna material pointer 

    +

    6846 nsrma = info.ptr_material_ids 

    +

    6847 n_bytes_written += fp.write(settings.pack(nsrma)) 

    +

    6848 

    +

    6849 # some lsdyna material pointer 

    +

    6850 nsrmu = info.ptr_material_ids_defined_order 

    +

    6851 n_bytes_written += fp.write(settings.pack(nsrmu)) 

    +

    6852 

    +

    6853 # some lsdyna material pointer 

    +

    6854 nsrmp = info.ptr_material_ids_crossref 

    +

    6855 n_bytes_written += fp.write(settings.pack(nsrmp)) 

    +

    6856 

    +

    6857 # "Total number of materials (parts)" 

    +

    6858 nsrtm = settings.header["nmmat"] 

    +

    6859 n_bytes_written += fp.write(settings.pack(nsrtm)) 

    +

    6860 

    +

    6861 # Total number of nodal rigid body constraint sets 

    +

    6862 numrbs = settings.header["numrbs"] 

    +

    6863 n_bytes_written += fp.write(settings.pack(numrbs)) 

    +

    6864 

    +

    6865 # Total number of materials 

    +

    6866 # ... coz it's fun doing nice things twice 

    +

    6867 nmmat = settings.header["nmmat"] 

    +

    6868 n_bytes_written += fp.write(settings.pack(nmmat)) 

    +

    6869 

    +

    6870 # NODE IDS 

    +

    6871 node_ids = ( 

    +

    6872 self.arrays[ArrayType.node_ids] 

    +

    6873 if ArrayType.node_ids in self.arrays 

    +

    6874 else np.arange( 

    +

    6875 FORTRAN_OFFSET, settings.header["numnp"] + FORTRAN_OFFSET, dtype=settings.itype 

    +

    6876 ) 

    +

    6877 ) 

    +

    6878 n_bytes_written += fp.write(settings.pack(node_ids, dtype_hint=np.integer)) 

    +

    6879 

    +

    6880 # SOLID IDS 

    +

    6881 solid_ids = ( 

    +

    6882 self.arrays[ArrayType.element_solid_ids] 

    +

    6883 if ArrayType.element_solid_ids in self.arrays 

    +

    6884 else np.arange( 

    +

    6885 FORTRAN_OFFSET, settings.header["nel8"] + FORTRAN_OFFSET, dtype=settings.itype 

    +

    6886 ) 

    +

    6887 ) 

    +

    6888 n_bytes_written += fp.write(settings.pack(solid_ids, dtype_hint=np.integer)) 

    +

    6889 

    +

    6890 # BEAM IDS 

    +

    6891 beam_ids = ( 

    +

    6892 self.arrays[ArrayType.element_beam_ids] 

    +

    6893 if ArrayType.element_beam_ids in self.arrays 

    +

    6894 else np.arange( 

    +

    6895 FORTRAN_OFFSET, settings.header["nel2"] + FORTRAN_OFFSET, dtype=settings.itype 

    +

    6896 ) 

    +

    6897 ) 

    +

    6898 n_bytes_written += fp.write(settings.pack(beam_ids, dtype_hint=np.integer)) 

    +

    6899 

    +

    6900 # SHELL IDS 

    +

    6901 shell_ids = ( 

    +

    6902 self.arrays[ArrayType.element_shell_ids] 

    +

    6903 if ArrayType.element_shell_ids in self.arrays 

    +

    6904 else np.arange( 

    +

    6905 FORTRAN_OFFSET, settings.header["nel4"] + FORTRAN_OFFSET, dtype=settings.itype 

    +

    6906 ) 

    +

    6907 ) 

    +

    6908 n_bytes_written += fp.write(settings.pack(shell_ids, dtype_hint=np.integer)) 

    +

    6909 

    +

    6910 # TSHELL IDS 

    +

    6911 tshell_ids = ( 

    +

    6912 self.arrays[ArrayType.element_tshell_ids] 

    +

    6913 if ArrayType.element_tshell_ids in self.arrays 

    +

    6914 else np.arange( 

    +

    6915 FORTRAN_OFFSET, settings.header["nelth"] + FORTRAN_OFFSET, dtype=settings.itype 

    +

    6916 ) 

    +

    6917 ) 

    +

    6918 n_bytes_written += fp.write(settings.pack(tshell_ids, dtype_hint=np.integer)) 

    +

    6919 

    +

    6920 # MATERIALS .... yay 

    +

    6921 # 

    +

    6922 # lsdyna generates duplicate materials originally 

    +

    6923 # thus nmmat in header is larger than the materials used 

    +

    6924 # by the elements. Some are related to rigid bodies 

    +

    6925 # but some are also generated internally by material models 

    +

    6926 # by the following procedure the material array is larger 

    +

    6927 # than the actual amount of materials (there may be unused 

    +

    6928 # material ids), but it ensures a relatively consistent writing 

    +

    6929 

    +

    6930 material_ids = np.full(settings.header["nmmat"], -1, dtype=self._header.itype) 

    +

    6931 if ArrayType.part_ids in self.arrays: 

    +

    6932 part_ids = self.arrays[ArrayType.part_ids] 

    +

    6933 material_ids = part_ids 

    +

    6934 else: 

    +

    6935 material_ids = np.arange(start=0, stop=settings.header["nmmat"], dtype=settings.itype) 

    +

    6936 

    +

    6937 n_bytes_written += fp.write(settings.pack(material_ids, dtype_hint=np.integer)) 

    +

    6938 

    +

    6939 # unordered material ids can be ignored 

    +

    6940 data_array = np.zeros(settings.header["nmmat"], dtype=settings.itype) 

    +

    6941 if ArrayType.part_ids_unordered in self.arrays: 

    +

    6942 array = self.arrays[ArrayType.part_ids_unordered] 

    +

    6943 end_index = min(len(array), len(data_array)) 

    +

    6944 data_array[:end_index] = array[:end_index] 

    +

    6945 n_bytes_written += fp.write(settings.pack(data_array, dtype_hint=np.integer)) 

    +

    6946 

    +

    6947 # also cross-reference array for ids 

    +

    6948 data_array = np.zeros(settings.header["nmmat"], dtype=settings.itype) 

    +

    6949 if ArrayType.part_ids_cross_references in self.arrays: 

    +

    6950 array = self.arrays[ArrayType.part_ids_cross_references] 

    +

    6951 end_index = min(len(array), len(data_array)) 

    +

    6952 data_array[:end_index] = array[:end_index] 

    +

    6953 n_bytes_written += fp.write(settings.pack(data_array, dtype_hint=np.integer)) 

    +

    6954 

    +

    6955 # check 

    +

    6956 n_bytes_expected = settings.header["narbs"] * settings.wordsize 

    +

    6957 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    6958 

    +

    6959 return n_bytes_written 

    +

    6960 

    +

    6961 def _write_geom_rigid_body_description( 

    +

    6962 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    6963 ) -> int: 

    +

    6964 

    +

    6965 # this type of rigid body descriptions are very rare 

    +

    6966 # and thus badly tested 

    +

    6967 

    +

    6968 if settings.header["ndim"] not in (8, 9): 

    +

    6969 return 0 

    +

    6970 

    +

    6971 _check_ndim( 

    +

    6972 self, 

    +

    6973 { 

    +

    6974 ArrayType.rigid_body_part_indexes: ["n_rigid_bodies"], 

    +

    6975 }, 

    +

    6976 ) 

    +

    6977 array_dims = { 

    +

    6978 ArrayType.rigid_body_part_indexes: 0, 

    +

    6979 ArrayType.rigid_body_node_indexes_list: 0, 

    +

    6980 ArrayType.rigid_body_active_node_indexes_list: 0, 

    +

    6981 } 

    +

    6982 if not _check_array_occurrence(self, list(array_dims.keys()), list(array_dims.keys())): 

    +

    6983 return 0 

    +

    6984 

    +

    6985 # check length 

    +

    6986 # cannot use self._check_array_dims due to some lists 

    +

    6987 dim_size = -1 

    +

    6988 for typename in array_dims: 

    +

    6989 array = self.arrays[typename] 

    +

    6990 if dim_size < 0: 

    +

    6991 dim_size = len(array) 

    +

    6992 else: 

    +

    6993 if len(array) != dim_size: 

    +

    6994 dimension_size_dict = { 

    +

    6995 typename2: len(self.arrays[typename2]) for typename2 in array_dims 

    +

    6996 } 

    +

    6997 msg = "Inconsistency in array dim '{0}' detected:\n{1}" 

    +

    6998 size_list = [ 

    +

    6999 f" - name: {typename}, dim: {array_dims[typename]}, size: {size}" 

    +

    7000 for typename, size in dimension_size_dict.items() 

    +

    7001 ] 

    +

    7002 raise ValueError(msg.format("n_rigid_bodies", "\n".join(size_list))) 

    +

    7003 

    +

    7004 rigid_body_part_indexes = self.arrays[ArrayType.rigid_body_part_indexes] + FORTRAN_OFFSET 

    +

    7005 # rigid_body_n_nodes = self.arrays[ArrayType.rigid_body_n_nodes] 

    +

    7006 rigid_body_node_indexes_list = self.arrays[ArrayType.rigid_body_node_indexes_list] 

    +

    7007 # rigid_body_n_active_nodes = self.arrays[ArrayType.rigid_body_n_active_nodes] 

    +

    7008 rigid_body_active_node_indexes_list = self.arrays[ 

    +

    7009 ArrayType.rigid_body_active_node_indexes_list 

    +

    7010 ] 

    +

    7011 

    +

    7012 n_bytes_written = 0 

    +

    7013 n_bytes_expected = settings.wordsize 

    +

    7014 

    +

    7015 # NRIGID 

    +

    7016 n_rigid_bodies = len(rigid_body_part_indexes) 

    +

    7017 n_bytes_written += fp.write(settings.pack(n_rigid_bodies)) 

    +

    7018 

    +

    7019 for i_rigid in range(n_rigid_bodies): 

    +

    7020 # part index 

    +

    7021 n_bytes_written += fp.write(settings.pack(rigid_body_part_indexes[i_rigid])) 

    +

    7022 # node indexes 

    +

    7023 array = rigid_body_node_indexes_list[i_rigid] + FORTRAN_OFFSET 

    +

    7024 n_bytes_written += fp.write(settings.pack(len(array))) 

    +

    7025 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.integer)) 

    +

    7026 # active node indexes 

    +

    7027 array = rigid_body_active_node_indexes_list[i_rigid] 

    +

    7028 n_bytes_written += fp.write(settings.pack(len(array))) 

    +

    7029 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.integer)) 

    +

    7030 

    +

    7031 n_bytes_expected += settings.wordsize * ( 

    +

    7032 3 

    +

    7033 + len(rigid_body_node_indexes_list[i_rigid]) 

    +

    7034 + len(rigid_body_active_node_indexes_list[i_rigid]) 

    +

    7035 ) 

    +

    7036 

    +

    7037 # check 

    +

    7038 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    7039 

    +

    7040 return n_bytes_written 

    +

    7041 

    +

    7042 def _write_geom_sph_node_and_materials( 

    +

    7043 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    7044 ) -> int: 

    +

    7045 

    +

    7046 nmsph = settings.header["nmsph"] 

    +

    7047 

    +

    7048 if nmsph <= 0: 

    +

    7049 return 0 

    +

    7050 

    +

    7051 _check_ndim( 

    +

    7052 self, 

    +

    7053 { 

    +

    7054 ArrayType.sph_node_indexes: ["n_sph_nodes"], 

    +

    7055 ArrayType.sph_node_material_index: ["n_sph_nodes"], 

    +

    7056 }, 

    +

    7057 ) 

    +

    7058 array_dims = { 

    +

    7059 ArrayType.sph_node_indexes: 0, 

    +

    7060 ArrayType.sph_node_material_index: 0, 

    +

    7061 } 

    +

    7062 array_names = list(array_dims.keys()) 

    +

    7063 _check_array_occurrence(self, array_names, array_names) 

    +

    7064 self.check_array_dims(array_dims, "n_sph_nodes", nmsph) 

    +

    7065 

    +

    7066 sph_node_indexes = self.arrays[ArrayType.sph_node_indexes] + FORTRAN_OFFSET 

    +

    7067 sph_node_material_index = self.arrays[ArrayType.sph_node_material_index] + FORTRAN_OFFSET 

    +

    7068 sph_data = np.concatenate((sph_node_indexes, sph_node_material_index), axis=1) 

    +

    7069 

    +

    7070 # write 

    +

    7071 n_bytes_written = fp.write(settings.pack(sph_data, dtype_hint=np.integer)) 

    +

    7072 

    +

    7073 # check 

    +

    7074 n_bytes_expected = nmsph * settings.wordsize * 2 

    +

    7075 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    7076 

    +

    7077 return n_bytes_written 

    +

    7078 

    +

    7079 def _write_geom_particle_geometry_data( 

    +

    7080 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    7081 ) -> int: 

    +

    7082 

    +

    7083 npefg = settings.header["npefg"] 

    +

    7084 if npefg <= 0: 

    +

    7085 return 0 

    +

    7086 

    +

    7087 _check_ndim( 

    +

    7088 self, 

    +

    7089 { 

    +

    7090 ArrayType.airbags_first_particle_id: ["n_airbags"], 

    +

    7091 ArrayType.airbags_n_particles: ["n_airbags"], 

    +

    7092 ArrayType.airbags_ids: ["n_airbags"], 

    +

    7093 ArrayType.airbags_n_gas_mixtures: ["n_airbags"], 

    +

    7094 ArrayType.airbags_n_chambers: ["n_airbags"], 

    +

    7095 }, 

    +

    7096 ) 

    +

    7097 array_dims = { 

    +

    7098 ArrayType.airbags_first_particle_id: 0, 

    +

    7099 ArrayType.airbags_n_particles: 0, 

    +

    7100 ArrayType.airbags_ids: 0, 

    +

    7101 ArrayType.airbags_n_gas_mixtures: 0, 

    +

    7102 ArrayType.airbags_n_chambers: 0, 

    +

    7103 } 

    +

    7104 array_names = list(array_dims.keys()) 

    +

    7105 _check_array_occurrence(self, array_names, array_names) 

    +

    7106 self.check_array_dims(array_dims, "n_airbags") 

    +

    7107 

    +

    7108 # get the arrays 

    +

    7109 array_list = [ 

    +

    7110 self.arrays[ArrayType.airbags_first_particle_id].reshape(-1, 1), 

    +

    7111 self.arrays[ArrayType.airbags_n_particles].reshape(-1, 1), 

    +

    7112 self.arrays[ArrayType.airbags_ids].reshape(-1, 1), 

    +

    7113 self.arrays[ArrayType.airbags_n_gas_mixtures].reshape(-1, 1), 

    +

    7114 ] 

    +

    7115 if ArrayType.airbags_n_chambers in self.arrays: 

    +

    7116 array_list.append(self.arrays[ArrayType.airbags_n_chambers].reshape(-1, 1)) 

    +

    7117 

    +

    7118 # write 

    +

    7119 airbag_geometry_data = np.concatenate(array_list, axis=1) 

    +

    7120 n_bytes_written = fp.write(settings.pack(airbag_geometry_data, dtype_hint=np.integer)) 

    +

    7121 

    +

    7122 # check 

    +

    7123 n_airbags = npefg % 1000 

    +

    7124 ngeom = 5 if ArrayType.airbags_n_chambers in self.arrays else 4 

    +

    7125 n_bytes_expected = n_airbags * ngeom * settings.wordsize 

    +

    7126 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    7127 

    +

    7128 return n_bytes_written 

    +

    7129 

    +

    7130 def _write_geom_rigid_road_surface( 

    +

    7131 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    7132 ) -> int: 

    +

    7133 

    +

    7134 if settings.header["ndim"] <= 5: 

    +

    7135 return 0 

    +

    7136 

    +

    7137 _check_ndim( 

    +

    7138 self, 

    +

    7139 { 

    +

    7140 ArrayType.rigid_road_node_ids: ["rigid_road_n_nodes"], 

    +

    7141 ArrayType.rigid_road_node_coordinates: ["rigid_road_n_nodes", "x_y_z"], 

    +

    7142 ArrayType.rigid_road_segment_node_ids: ["n_segments", "n_nodes"], 

    +

    7143 ArrayType.rigid_road_segment_road_id: ["n_segments"], 

    +

    7144 }, 

    +

    7145 ) 

    +

    7146 array_dims = { 

    +

    7147 ArrayType.rigid_road_node_ids: 0, 

    +

    7148 ArrayType.rigid_road_node_coordinates: 0, 

    +

    7149 } 

    +

    7150 n_rigid_road_nodes = self.check_array_dims(array_dims, "rigid_road_n_nodes") 

    +

    7151 self.check_array_dims({ArrayType.rigid_road_node_coordinates: 1}, "x_y_z", 3) 

    +

    7152 array_dims = { 

    +

    7153 ArrayType.rigid_road_n_segments: 0, 

    +

    7154 ArrayType.rigid_road_segment_node_ids: 0, 

    +

    7155 ArrayType.rigid_road_segment_road_id: 0, 

    +

    7156 } 

    +

    7157 n_rigid_roads = self.check_array_dims(array_dims, "n_rigid_roads") 

    +

    7158 n_bytes_written = 0 

    +

    7159 

    +

    7160 # NODE COUNT 

    +

    7161 n_bytes_written += fp.write(settings.pack(n_rigid_road_nodes)) 

    +

    7162 

    +

    7163 # SEGMENT COUNT 

    +

    7164 # This was never verified 

    +

    7165 n_total_segments = np.sum( 

    +

    7166 len(segment_ids) for segment_ids in self.arrays[ArrayType.rigid_road_segment_node_ids] 

    +

    7167 ) 

    +

    7168 n_bytes_written += fp.write(settings.pack(n_total_segments)) 

    +

    7169 

    +

    7170 # SURFACE COUNT 

    +

    7171 n_bytes_written += fp.write(settings.pack(n_rigid_roads)) 

    +

    7172 

    +

    7173 # MOTION FLAG - if motion data is output 

    +

    7174 # by default let's just say ... yeah baby 

    +

    7175 # This was never verified 

    +

    7176 n_bytes_written += fp.write(settings.pack(1)) 

    +

    7177 

    +

    7178 # RIGID ROAD NODE IDS 

    +

    7179 rigid_road_node_ids = self.arrays[ArrayType.rigid_road_node_ids] 

    +

    7180 n_bytes_written += fp.write(settings.pack(rigid_road_node_ids, dtype_hint=np.integer)) 

    +

    7181 

    +

    7182 # RIGID ROAD NODE COORDS 

    +

    7183 rigid_road_node_coordinates = self.arrays[ArrayType.rigid_road_node_coordinates] 

    +

    7184 n_bytes_written += fp.write( 

    +

    7185 settings.pack(rigid_road_node_coordinates, dtype_hint=np.floating) 

    +

    7186 ) 

    +

    7187 

    +

    7188 # SURFACE ID 

    +

    7189 # SURFACE N_SEGMENTS 

    +

    7190 # SURFACE SEGMENTS 

    +

    7191 rigid_road_segment_road_id = self.arrays[ArrayType.rigid_road_segment_road_id] 

    +

    7192 rigid_road_segment_node_ids = self.arrays[ArrayType.rigid_road_segment_node_ids] 

    +

    7193 

    +

    7194 for segment_id, node_ids in zip(rigid_road_segment_road_id, rigid_road_segment_node_ids): 

    +

    7195 n_bytes_written += fp.write(settings.pack(segment_id)) 

    +

    7196 n_bytes_written += fp.write(settings.pack(len(node_ids))) 

    +

    7197 n_bytes_written += fp.write(settings.pack(node_ids, dtype_hint=np.integer)) 

    +

    7198 

    +

    7199 # check 

    +

    7200 n_bytes_expected = ( 

    +

    7201 4 + 4 * n_rigid_road_nodes + n_rigid_roads * (2 + 4 * n_total_segments) 

    +

    7202 ) * settings.wordsize 

    +

    7203 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    7204 

    +

    7205 return n_bytes_written 

    +

    7206 

    +

    7207 def _write_geom_extra_node_data( 

    +

    7208 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    7209 ) -> int: 

    +

    7210 

    +

    7211 n_bytes_written = 0 

    +

    7212 

    +

    7213 # 10 NODE SOLIDS 

    +

    7214 if settings.header["nel8"] < 0: 

    +

    7215 _check_ndim( 

    +

    7216 self, 

    +

    7217 { 

    +

    7218 ArrayType.element_solid_node10_extra_node_indexes: [ 

    +

    7219 "n_solids", 

    +

    7220 "2_extra_node_ids", 

    +

    7221 ], 

    +

    7222 }, 

    +

    7223 ) 

    +

    7224 array_dims = { 

    +

    7225 ArrayType.element_solid_node_indexes: 0, 

    +

    7226 ArrayType.element_solid_node10_extra_node_indexes: 0, 

    +

    7227 } 

    +

    7228 self.check_array_dims(array_dims, "n_solids") 

    +

    7229 self.check_array_dims( 

    +

    7230 {ArrayType.element_solid_node10_extra_node_indexes: 1}, "extra_node_ids", 2 

    +

    7231 ) 

    +

    7232 

    +

    7233 extra_nodes = ( 

    +

    7234 self.arrays[ArrayType.element_solid_node10_extra_node_indexes] + FORTRAN_OFFSET 

    +

    7235 ) 

    +

    7236 

    +

    7237 n_bytes_written += fp.write(settings.pack(extra_nodes, dtype_hint=np.integer)) 

    +

    7238 

    +

    7239 # 8 NODE SHELLS 

    +

    7240 if settings.header["nel48"] > 0: 

    +

    7241 _check_ndim( 

    +

    7242 self, 

    +

    7243 { 

    +

    7244 ArrayType.element_shell_node8_element_index: ["n_node8_shells"], 

    +

    7245 ArrayType.element_shell_node8_extra_node_indexes: [ 

    +

    7246 "n_node8_shells", 

    +

    7247 "4_extra_node_ids", 

    +

    7248 ], 

    +

    7249 }, 

    +

    7250 ) 

    +

    7251 array_dims = { 

    +

    7252 ArrayType.element_shell_node8_element_index: 0, 

    +

    7253 ArrayType.element_shell_node8_extra_node_indexes: 0, 

    +

    7254 } 

    +

    7255 self.check_array_dims(array_dims, "n_node8_shells") 

    +

    7256 self.check_array_dims( 

    +

    7257 {ArrayType.element_shell_node8_extra_node_indexes: 1}, "extra_node_ids", 4 

    +

    7258 ) 

    +

    7259 

    +

    7260 element_indexes = ( 

    +

    7261 self.arrays[ArrayType.element_shell_node8_element_index] + FORTRAN_OFFSET 

    +

    7262 ) 

    +

    7263 extra_nodes = ( 

    +

    7264 self.arrays[ArrayType.element_shell_node8_extra_node_indexes] + FORTRAN_OFFSET 

    +

    7265 ) 

    +

    7266 

    +

    7267 geom_data = np.concatenate((element_indexes, extra_nodes), axis=1) 

    +

    7268 

    +

    7269 n_bytes_written += fp.write(settings.pack(geom_data, dtype_hint=np.integer)) 

    +

    7270 

    +

    7271 # 20 NODE SOLIDS 

    +

    7272 if settings.header["extra"] > 0 and settings.header["nel20"] > 0: 

    +

    7273 _check_ndim( 

    +

    7274 self, 

    +

    7275 { 

    +

    7276 ArrayType.element_solid_node20_element_index: ["n_node20_solids"], 

    +

    7277 ArrayType.element_solid_node20_extra_node_indexes: [ 

    +

    7278 "n_node20_solids", 

    +

    7279 "12_extra_node_ids", 

    +

    7280 ], 

    +

    7281 }, 

    +

    7282 ) 

    +

    7283 array_dims = { 

    +

    7284 ArrayType.element_solid_node20_element_index: 0, 

    +

    7285 ArrayType.element_solid_node20_extra_node_indexes: 0, 

    +

    7286 } 

    +

    7287 self.check_array_dims(array_dims, "n_node20_solids") 

    +

    7288 self.check_array_dims( 

    +

    7289 {ArrayType.element_solid_node20_extra_node_indexes: 1}, "extra_node_ids", 12 

    +

    7290 ) 

    +

    7291 

    +

    7292 element_indexes = ( 

    +

    7293 self.arrays[ArrayType.element_solid_node20_element_index] + FORTRAN_OFFSET 

    +

    7294 ) 

    +

    7295 extra_nodes = ( 

    +

    7296 self.arrays[ArrayType.element_solid_node20_extra_node_indexes] + FORTRAN_OFFSET 

    +

    7297 ) 

    +

    7298 

    +

    7299 geom_data = np.concatenate((element_indexes, extra_nodes), axis=1) 

    +

    7300 

    +

    7301 n_bytes_written += fp.write(settings.pack(geom_data, dtype_hint=np.integer)) 

    +

    7302 

    +

    7303 # 27 NODE SOLIDS 

    +

    7304 if settings.header["extra"] > 0 and settings.header["nel27"] > 0: 

    +

    7305 _check_ndim( 

    +

    7306 self, 

    +

    7307 { 

    +

    7308 ArrayType.element_solid_node20_element_index: ["n_node27_solids"], 

    +

    7309 ArrayType.element_solid_node20_extra_node_indexes: [ 

    +

    7310 "n_node27_solids", 

    +

    7311 "19_extra_node_ids", 

    +

    7312 ], 

    +

    7313 }, 

    +

    7314 ) 

    +

    7315 array_dims = { 

    +

    7316 ArrayType.element_solid_node27_element_index: 0, 

    +

    7317 ArrayType.element_solid_node27_extra_node_indexes: 0, 

    +

    7318 } 

    +

    7319 self.check_array_dims(array_dims, "n_node27_solids") 

    +

    7320 self.check_array_dims( 

    +

    7321 {ArrayType.element_solid_node27_extra_node_indexes: 1}, "extra_node_ids", 19 

    +

    7322 ) 

    +

    7323 

    +

    7324 element_indexes = ( 

    +

    7325 self.arrays[ArrayType.element_solid_node27_element_index] + FORTRAN_OFFSET 

    +

    7326 ) 

    +

    7327 extra_nodes = ( 

    +

    7328 self.arrays[ArrayType.element_solid_node27_extra_node_indexes] + FORTRAN_OFFSET 

    +

    7329 ) 

    +

    7330 

    +

    7331 geom_data = np.concatenate((element_indexes, extra_nodes), axis=1) 

    +

    7332 

    +

    7333 n_bytes_written += fp.write(settings.pack(geom_data, dtype_hint=np.integer)) 

    +

    7334 

    +

    7335 # check 

    +

    7336 has_nel10 = settings.header["nel8"] < 0 

    +

    7337 n_bytes_expected = ( 

    +

    7338 has_nel10 * abs(settings.header["nel8"]) 

    +

    7339 + settings.header["nel48"] * 5 

    +

    7340 + settings.header["nel20"] * 13 

    +

    7341 + settings.header["nel27"] * 20 

    +

    7342 ) * settings.wordsize 

    +

    7343 D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) 

    +

    7344 

    +

    7345 return n_bytes_written 

    +

    7346 

    +

    7347 def _write_header_part_contact_interface_titles( 

    +

    7348 self, fp: typing.IO[Any], settings: D3plotWriterSettings 

    +

    7349 ) -> int: 

    +

    7350 

    +

    7351 n_bytes_written = 0 

    +

    7352 

    +

    7353 # PART TITLES 

    +

    7354 _check_ndim( 

    +

    7355 self, 

    +

    7356 { 

    +

    7357 # ArrayType.part_titles: ["n_parts", "n_chars"], 

    +

    7358 ArrayType.part_titles_ids: ["n_parts"], 

    +

    7359 }, 

    +

    7360 ) 

    +

    7361 array_dimensions = { 

    +

    7362 ArrayType.part_titles: 0, 

    +

    7363 ArrayType.part_titles_ids: 0, 

    +

    7364 } 

    +

    7365 if _check_array_occurrence( 

    +

    7366 self, list(array_dimensions.keys()), list(array_dimensions.keys()) 

    +

    7367 ): 

    +

    7368 self.check_array_dims(array_dimensions, "n_parts") 

    +

    7369 

    +

    7370 ntype = 90001 

    +

    7371 

    +

    7372 n_bytes_written += fp.write(settings.pack(ntype)) 

    +

    7373 

    +

    7374 part_titles_ids = self.arrays[ArrayType.part_titles_ids] 

    +

    7375 part_titles = self.arrays[ArrayType.part_titles] 

    +

    7376 

    +

    7377 n_entries = len(part_titles) 

    +

    7378 n_bytes_written += fp.write(settings.pack(n_entries)) 

    +

    7379 

    +

    7380 # title words always have 4 byte size 

    +

    7381 title_wordsize = 4 

    +

    7382 max_len = 18 * title_wordsize 

    +

    7383 fmt_name = "{0:" + str(max_len) + "}" 

    +

    7384 for pid, title in zip(part_titles_ids, part_titles): 

    +

    7385 title = title.decode("ascii") 

    +

    7386 n_bytes_written += fp.write(settings.pack(pid)) 

    +

    7387 

    +

    7388 formatted_title = fmt_name.format(title[:max_len]) 

    +

    7389 n_bytes_written += fp.write(settings.pack(formatted_title, max_len)) 

    +

    7390 

    +

    7391 # TITLE2 

    +

    7392 # yet another title, coz double is always more fun 

    +

    7393 if "title2" in self.header.title2: 

    +

    7394 ntype = 90000 

    +

    7395 

    +

    7396 # title words always have 4 bytes 

    +

    7397 title_wordsize = 4 

    +

    7398 title_size_words = 18 

    +

    7399 

    +

    7400 fmt_title2 = "{0:" + str(title_wordsize * title_size_words) + "}" 

    +

    7401 title2 = fmt_title2.format(self.header.title2[: settings.wordsize * title_size_words]) 

    +

    7402 

    +

    7403 n_bytes_written += fp.write(settings.pack(ntype)) 

    +

    7404 n_bytes_written += fp.write(settings.pack(title2, settings.wordsize * title_size_words)) 

    +

    7405 

    +

    7406 # CONTACT TITLES 

    +

    7407 array_dimensions = { 

    +

    7408 ArrayType.contact_titles: 0, 

    +

    7409 ArrayType.contact_title_ids: 0, 

    +

    7410 } 

    +

    7411 if _check_array_occurrence( 

    +

    7412 self, list(array_dimensions.keys()), list(array_dimensions.keys()) 

    +

    7413 ): 

    +

    7414 self.check_array_dims(array_dimensions, "n_parts") 

    +

    7415 

    +

    7416 ntype = 90002 

    +

    7417 n_bytes_written += fp.write(settings.pack(ntype)) 

    +

    7418 

    +

    7419 titles_ids = self.arrays[ArrayType.contact_title_ids] 

    +

    7420 titles = self.arrays[ArrayType.contact_titles] 

    +

    7421 

    +

    7422 n_entries = len(titles) 

    +

    7423 n_bytes_written += fp.write(settings.pack(n_entries)) 

    +

    7424 

    +

    7425 max_len = 18 * self.header.wordsize 

    +

    7426 fmt_name = "{0:" + str(max_len) + "}" 

    +

    7427 for pid, title in zip(titles_ids, titles): 

    +

    7428 n_bytes_written += fp.write(settings.pack(pid)) 

    +

    7429 

    +

    7430 formatted_title = fmt_name.format(title[:max_len]) 

    +

    7431 n_bytes_written += fp.write(settings.pack(formatted_title)) 

    +

    7432 

    +

    7433 return n_bytes_written 

    +

    7434 

    +

    7435 def _write_states( 

    +

    7436 self, filepath: Union[str, typing.BinaryIO], settings: D3plotWriterSettings 

    +

    7437 ) -> int: 

    +

    7438 

    +

    7439 # did we store any states? 

    +

    7440 n_timesteps_written = 0 

    +

    7441 

    +

    7442 # if timestep array is missing check for any state arrays 

    +

    7443 if ArrayType.global_timesteps not in self.arrays: 

    +

    7444 # if any state array is present simply make up a timestep array 

    +

    7445 if any(array_name in self.arrays for array_name in ArrayType.get_state_array_names()): 

    +

    7446 array_dims = {array_name: 0 for array_name in ArrayType.get_state_array_names()} 

    +

    7447 n_timesteps = self.check_array_dims( 

    +

    7448 array_dimensions=array_dims, dimension_name="n_timesteps" 

    +

    7449 ) 

    +

    7450 self._state_info.n_timesteps = n_timesteps 

    +

    7451 self.arrays[ArrayType.global_timesteps] = np.arange( 

    +

    7452 0, n_timesteps, dtype=settings.ftype 

    +

    7453 ) 

    +

    7454 # no state data so we call it a day 

    +

    7455 else: 

    +

    7456 return n_timesteps_written 

    +

    7457 

    +

    7458 # formatter for state files 

    +

    7459 timesteps = self.arrays[ArrayType.global_timesteps] 

    +

    7460 n_timesteps = len(timesteps) 

    +

    7461 fmt_state_file_counter = "{0:02d}" 

    +

    7462 

    +

    7463 # single file or multiple file handling 

    +

    7464 state_fp: Union[None, typing.BinaryIO] = None 

    +

    7465 file_to_close: Union[None, typing.BinaryIO] = None 

    +

    7466 if isinstance(filepath, str): 

    +

    7467 if settings.single_file: 

    +

    7468 # pylint: disable = consider-using-with 

    +

    7469 state_fp = file_to_close = open(filepath + fmt_state_file_counter.format(1), "ab") 

    +

    7470 else: 

    +

    7471 # create a new file per timestep 

    +

    7472 # see time loop 

    +

    7473 pass 

    +

    7474 else: 

    +

    7475 state_fp = filepath 

    +

    7476 

    +

    7477 try: 

    +

    7478 # time looping ... wheeeeeeeee 

    +

    7479 for i_timestep, _ in enumerate(timesteps): 

    +

    7480 

    +

    7481 # open new state file ... or not 

    +

    7482 state_filepath_or_file = ( 

    +

    7483 filepath + fmt_state_file_counter.format(i_timestep + 1) 

    +

    7484 if isinstance(filepath, str) and state_fp is None 

    +

    7485 else state_fp 

    +

    7486 ) 

    +

    7487 

    +

    7488 n_bytes_written = 0 

    +

    7489 

    +

    7490 with open_file_or_filepath(state_filepath_or_file, "ab") as fp: 

    +

    7491 

    +

    7492 # GLOBALS 

    +

    7493 n_bytes_written += self._write_states_globals(fp, i_timestep, settings) 

    +

    7494 

    +

    7495 # NODE DATA 

    +

    7496 n_bytes_written += self._write_states_nodes(fp, i_timestep, settings) 

    +

    7497 

    +

    7498 # SOLID THERMAL DATA 

    +

    7499 n_bytes_written += self._write_states_solid_thermal_data( 

    +

    7500 fp, i_timestep, settings 

    +

    7501 ) 

    +

    7502 

    +

    7503 # CFDDATA 

    +

    7504 # not supported 

    +

    7505 

    +

    7506 # SOLIDS 

    +

    7507 n_bytes_written += self._write_states_solids(fp, i_timestep, settings) 

    +

    7508 

    +

    7509 # THICK SHELLS 

    +

    7510 n_bytes_written += self._write_states_tshells(fp, i_timestep, settings) 

    +

    7511 

    +

    7512 # spocky ... BEAM me up 

    +

    7513 n_bytes_written += self._write_states_beams(fp, i_timestep, settings) 

    +

    7514 

    +

    7515 # SHELLS 

    +

    7516 n_bytes_written += self._write_states_shells(fp, i_timestep, settings) 

    +

    7517 

    +

    7518 # DELETION INFO 

    +

    7519 n_bytes_written += self._write_states_deletion_info(fp, i_timestep, settings) 

    +

    7520 

    +

    7521 # SPH 

    +

    7522 n_bytes_written += self._write_states_sph(fp, i_timestep, settings) 

    +

    7523 

    +

    7524 # AIRBAG 

    +

    7525 n_bytes_written += self._write_states_airbags(fp, i_timestep, settings) 

    +

    7526 

    +

    7527 # RIGID ROAD 

    +

    7528 n_bytes_written += self._write_states_rigid_road(fp, i_timestep, settings) 

    +

    7529 

    +

    7530 # RIGID BODY 

    +

    7531 n_bytes_written += self._write_states_rigid_bodies(fp, i_timestep, settings) 

    +

    7532 

    +

    7533 # EXTRA DATA 

    +

    7534 # not supported 

    +

    7535 

    +

    7536 # end mark 

    +

    7537 # at the end for single file buffer 

    +

    7538 # or behind each state file 

    +

    7539 if not settings.single_file or i_timestep == n_timesteps - 1: 

    +

    7540 n_bytes_written += fp.write(settings.pack(-999999.0)) 

    +

    7541 

    +

    7542 if settings.block_size_bytes > 0: 

    +

    7543 zero_bytes = self._get_zero_byte_padding( 

    +

    7544 n_bytes_written, settings.block_size_bytes 

    +

    7545 ) 

    +

    7546 n_bytes_written += fp.write(zero_bytes) 

    +

    7547 

    +

    7548 # log 

    +

    7549 msg = "_write_states wrote %d bytes" 

    +

    7550 LOGGER.debug(msg, n_bytes_written) 

    +

    7551 n_timesteps_written += 1 

    +

    7552 

    +

    7553 finally: 

    +

    7554 # close file if required 

    +

    7555 if file_to_close is not None: 

    +

    7556 file_to_close.close() 

    +

    7557 

    +

    7558 return n_timesteps_written 

    +

    7559 

    +

    7560 def _write_states_globals( 

    +

    7561 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    7562 ) -> int: 

    +

    7563 

    +

    7564 _check_ndim( 

    +

    7565 self, 

    +

    7566 { 

    +

    7567 ArrayType.global_kinetic_energy: ["n_timesteps"], 

    +

    7568 ArrayType.global_internal_energy: ["n_timesteps"], 

    +

    7569 ArrayType.global_total_energy: ["n_timesteps"], 

    +

    7570 ArrayType.global_velocity: ["n_timesteps", "vx_vy_vz"], 

    +

    7571 }, 

    +

    7572 ) 

    +

    7573 array_dims = { 

    +

    7574 ArrayType.global_timesteps: 0, 

    +

    7575 ArrayType.global_kinetic_energy: 0, 

    +

    7576 ArrayType.global_internal_energy: 0, 

    +

    7577 ArrayType.global_total_energy: 0, 

    +

    7578 ArrayType.global_velocity: 0, 

    +

    7579 } 

    +

    7580 self.check_array_dims(array_dims, "n_timesteps") 

    +

    7581 

    +

    7582 byte_checksum = 0 

    +

    7583 

    +

    7584 n_global_vars = settings.header["nglbv"] 

    +

    7585 

    +

    7586 # TIME 

    +

    7587 timesteps = self.arrays[ArrayType.global_timesteps] 

    +

    7588 byte_checksum += fp.write(settings.pack(timesteps[i_timestep])) 

    +

    7589 

    +

    7590 # GLOBAL KINETIC ENERGY 

    +

    7591 if n_global_vars >= 1: 

    +

    7592 array_type = ArrayType.global_kinetic_energy 

    +

    7593 value = ( 

    +

    7594 self.arrays[array_type][i_timestep] 

    +

    7595 if array_type in self.arrays 

    +

    7596 else self.header.ftype(0.0) 

    +

    7597 ) 

    +

    7598 byte_checksum += fp.write(settings.pack(value, dtype_hint=np.floating)) 

    +

    7599 

    +

    7600 # GLOBAL INTERNAL ENERGY 

    +

    7601 if n_global_vars >= 2: 

    +

    7602 array_type = ArrayType.global_internal_energy 

    +

    7603 value = ( 

    +

    7604 self.arrays[array_type][i_timestep] 

    +

    7605 if array_type in self.arrays 

    +

    7606 else self.header.ftype(0.0) 

    +

    7607 ) 

    +

    7608 byte_checksum += fp.write(settings.pack(value, dtype_hint=np.floating)) 

    +

    7609 

    +

    7610 # GLOBAL TOTAL ENERGY 

    +

    7611 if n_global_vars >= 3: 

    +

    7612 array_type = ArrayType.global_total_energy 

    +

    7613 value = ( 

    +

    7614 self.arrays[array_type][i_timestep] 

    +

    7615 if array_type in self.arrays 

    +

    7616 else self.header.ftype(0.0) 

    +

    7617 ) 

    +

    7618 byte_checksum += fp.write(settings.pack(value, dtype_hint=np.floating)) 

    +

    7619 

    +

    7620 # GLOBAL VELOCITY 

    +

    7621 if n_global_vars >= 6: 

    +

    7622 self.check_array_dims({ArrayType.global_velocity: 1}, "vx_vy_vz", 3) 

    +

    7623 array_type = ArrayType.global_velocity 

    +

    7624 array = ( 

    +

    7625 self.arrays[array_type][i_timestep] 

    +

    7626 if array_type in self.arrays 

    +

    7627 else np.zeros(3, self.header.ftype) 

    +

    7628 ) 

    +

    7629 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7630 

    +

    7631 # PARTS 

    +

    7632 # 

    +

    7633 # Parts always need special love since dyna 

    +

    7634 # writes many dummy parts 

    +

    7635 _check_ndim( 

    +

    7636 self, 

    +

    7637 { 

    +

    7638 ArrayType.part_internal_energy: ["n_timesteps", "n_parts"], 

    +

    7639 ArrayType.part_kinetic_energy: ["n_timesteps", "n_parts"], 

    +

    7640 ArrayType.part_velocity: ["n_timesteps", "n_parts", "vx_vy_vz"], 

    +

    7641 ArrayType.part_mass: ["n_timesteps", "n_parts"], 

    +

    7642 ArrayType.part_hourglass_energy: ["n_timesteps", "n_parts"], 

    +

    7643 }, 

    +

    7644 ) 

    +

    7645 array_dims = { 

    +

    7646 ArrayType.global_timesteps: 0, 

    +

    7647 ArrayType.part_internal_energy: 0, 

    +

    7648 ArrayType.part_kinetic_energy: 0, 

    +

    7649 ArrayType.part_velocity: 0, 

    +

    7650 ArrayType.part_mass: 0, 

    +

    7651 ArrayType.part_hourglass_energy: 0, 

    +

    7652 } 

    +

    7653 self.check_array_dims(array_dims, "n_timesteps") 

    +

    7654 

    +

    7655 self.check_array_dims({ArrayType.part_velocity: 2}, "vx_vy_vz", 3) 

    +

    7656 

    +

    7657 n_parts = settings.header["nmmat"] 

    +

    7658 

    +

    7659 def _write_part_field(array_type: str, default_shape: Union[int, Tuple], dtype: np.dtype): 

    +

    7660 array = ( 

    +

    7661 self.arrays[array_type][i_timestep] 

    +

    7662 if array_type in self.arrays 

    +

    7663 else np.zeros(default_shape, self.header.ftype) 

    +

    7664 ) 

    +

    7665 

    +

    7666 if len(array): 

    +

    7667 dummy_array = array 

    +

    7668 return fp.write(settings.pack(dummy_array, dtype_hint=np.floating)) 

    +

    7669 

    +

    7670 return 0 

    +

    7671 

    +

    7672 # PART INTERNAL ENERGY 

    +

    7673 if n_global_vars >= 6 + n_parts: 

    +

    7674 byte_checksum += _write_part_field( 

    +

    7675 ArrayType.part_internal_energy, n_parts, settings.ftype 

    +

    7676 ) 

    +

    7677 

    +

    7678 # PART KINETIC ENERGY 

    +

    7679 if n_global_vars >= 6 + 2 * n_parts: 

    +

    7680 byte_checksum += _write_part_field( 

    +

    7681 ArrayType.part_kinetic_energy, n_parts, settings.ftype 

    +

    7682 ) 

    +

    7683 

    +

    7684 # PART VELOCITY 

    +

    7685 if n_global_vars >= 6 + 5 * n_parts: 

    +

    7686 byte_checksum += _write_part_field( 

    +

    7687 ArrayType.part_velocity, (n_parts, 3), settings.ftype 

    +

    7688 ) 

    +

    7689 

    +

    7690 # PART MASS 

    +

    7691 if n_global_vars >= 6 + 6 * n_parts: 

    +

    7692 byte_checksum += _write_part_field(ArrayType.part_mass, n_parts, settings.ftype) 

    +

    7693 

    +

    7694 # PART HOURGLASS ENERGY 

    +

    7695 if n_global_vars >= 6 + 7 * n_parts: 

    +

    7696 byte_checksum += _write_part_field( 

    +

    7697 ArrayType.part_hourglass_energy, n_parts, settings.ftype 

    +

    7698 ) 

    +

    7699 

    +

    7700 # RIGID WALL 

    +

    7701 array_dims = { 

    +

    7702 ArrayType.global_timesteps: 0, 

    +

    7703 ArrayType.rigid_wall_force: 0, 

    +

    7704 ArrayType.rigid_wall_position: 0, 

    +

    7705 } 

    +

    7706 self.check_array_dims(array_dims, "n_timesteps") 

    +

    7707 array_dims = { 

    +

    7708 ArrayType.rigid_wall_force: 1, 

    +

    7709 ArrayType.rigid_wall_position: 1, 

    +

    7710 } 

    +

    7711 self.check_array_dims(array_dims, "n_rigid_walls") 

    +

    7712 self.check_array_dims({ArrayType.rigid_wall_position: 2}, "x_y_z", 3) 

    +

    7713 

    +

    7714 n_rigid_wall_vars = settings.header["n_rigid_wall_vars"] 

    +

    7715 n_rigid_walls = settings.header["n_rigid_walls"] 

    +

    7716 if n_global_vars >= 6 + 7 * n_parts + n_rigid_wall_vars * n_rigid_walls: 

    +

    7717 if n_rigid_wall_vars >= 1: 

    +

    7718 array = self.arrays[ArrayType.rigid_wall_force][i_timestep] 

    +

    7719 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7720 if n_rigid_wall_vars >= 4: 

    +

    7721 array = self.arrays[ArrayType.rigid_wall_position][i_timestep] 

    +

    7722 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7723 

    +

    7724 # check byte checksum 

    +

    7725 # pylint: disable = invalid-name 

    +

    7726 TIME_WORDSIZE = 1 

    +

    7727 byte_checksum_target = (TIME_WORDSIZE + settings.header["nglbv"]) * settings.wordsize 

    +

    7728 if byte_checksum != byte_checksum_target: 

    +

    7729 msg = ( 

    +

    7730 "byte checksum wrong: " 

    +

    7731 f"{byte_checksum_target} (header) != {byte_checksum} (checksum)" 

    +

    7732 ) 

    +

    7733 raise RuntimeError(msg) 

    +

    7734 

    +

    7735 # log 

    +

    7736 msg = "%s wrote %d bytes." 

    +

    7737 LOGGER.debug(msg, "_write_states_globals", byte_checksum) 

    +

    7738 

    +

    7739 return byte_checksum 

    +

    7740 

    +

    7741 def _write_states_nodes( 

    +

    7742 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    7743 ) -> int: 

    +

    7744 

    +

    7745 n_nodes = settings.header["numnp"] 

    +

    7746 if n_nodes <= 0: 

    +

    7747 return 0 

    +

    7748 

    +

    7749 _check_ndim( 

    +

    7750 self, 

    +

    7751 { 

    +

    7752 ArrayType.node_displacement: ["n_timesteps", "n_nodes", "x_y_z"], 

    +

    7753 ArrayType.node_velocity: ["n_timesteps", "n_nodes", "vx_vy_vz"], 

    +

    7754 ArrayType.node_acceleration: ["n_timesteps", "n_nodes", "ax_ay_az"], 

    +

    7755 ArrayType.node_heat_flux: ["n_timesteps", "n_nodes", "hx_hy_hz"], 

    +

    7756 # INFO: cannot check since it may have 1 or 3 values per node 

    +

    7757 # ArrayType.node_temperature: ["n_timesteps","n_nodes"], 

    +

    7758 ArrayType.node_mass_scaling: ["n_timesteps", "n_nodes"], 

    +

    7759 ArrayType.node_temperature_gradient: ["n_timesteps", "n_nodes"], 

    +

    7760 ArrayType.node_residual_forces: ["n_timesteps", "n_nodes", "fx_fy_fz"], 

    +

    7761 ArrayType.node_residual_moments: ["n_timesteps", "n_nodes", "mx_my_mz"], 

    +

    7762 }, 

    +

    7763 ) 

    +

    7764 array_dims = { 

    +

    7765 ArrayType.global_timesteps: 0, 

    +

    7766 ArrayType.node_displacement: 0, 

    +

    7767 ArrayType.node_velocity: 0, 

    +

    7768 ArrayType.node_acceleration: 0, 

    +

    7769 ArrayType.node_heat_flux: 0, 

    +

    7770 ArrayType.node_temperature: 0, 

    +

    7771 ArrayType.node_mass_scaling: 0, 

    +

    7772 ArrayType.node_temperature_gradient: 0, 

    +

    7773 ArrayType.node_residual_forces: 0, 

    +

    7774 ArrayType.node_residual_moments: 0, 

    +

    7775 } 

    +

    7776 self.check_array_dims(array_dims, "n_timesteps") 

    +

    7777 array_dims = { 

    +

    7778 ArrayType.node_coordinates: 0, 

    +

    7779 ArrayType.node_displacement: 1, 

    +

    7780 ArrayType.node_velocity: 1, 

    +

    7781 ArrayType.node_acceleration: 1, 

    +

    7782 ArrayType.node_heat_flux: 1, 

    +

    7783 ArrayType.node_temperature: 1, 

    +

    7784 ArrayType.node_mass_scaling: 1, 

    +

    7785 ArrayType.node_temperature_gradient: 1, 

    +

    7786 ArrayType.node_residual_forces: 1, 

    +

    7787 ArrayType.node_residual_moments: 1, 

    +

    7788 } 

    +

    7789 self.check_array_dims(array_dims, "n_nodes") 

    +

    7790 self.check_array_dims({ArrayType.node_heat_flux: 2}, "x_y_z", 3) 

    +

    7791 self.check_array_dims({ArrayType.node_displacement: 2}, "dx_dy_dz", 3) 

    +

    7792 self.check_array_dims({ArrayType.node_velocity: 2}, "vx_vy_vz", 3) 

    +

    7793 self.check_array_dims({ArrayType.node_acceleration: 2}, "ax_ay_az", 3) 

    +

    7794 self.check_array_dims({ArrayType.node_residual_forces: 2}, "fx_fy_fz", 3) 

    +

    7795 self.check_array_dims({ArrayType.node_residual_moments: 2}, "mx_my_mz", 3) 

    +

    7796 

    +

    7797 byte_checksum = 0 

    +

    7798 

    +

    7799 it = settings.header["it"] 

    +

    7800 has_mass_scaling = False 

    +

    7801 if it >= 10: 

    +

    7802 it -= 10 

    +

    7803 has_mass_scaling = True 

    +

    7804 

    +

    7805 n_nodes = settings.header["numnp"] 

    +

    7806 

    +

    7807 # NODE DISPLACEMENT 

    +

    7808 if settings.header["iu"]: 

    +

    7809 array = self.arrays[ArrayType.node_displacement][i_timestep] 

    +

    7810 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7811 

    +

    7812 if it != 0: 

    +

    7813 

    +

    7814 # NODE TEMPERATURES 

    +

    7815 array_type = ArrayType.node_temperature 

    +

    7816 array = ( 

    +

    7817 self.arrays[array_type][i_timestep] 

    +

    7818 if array_type in self.arrays 

    +

    7819 else np.zeros(n_nodes, dtype=settings.ftype) 

    +

    7820 ) 

    +

    7821 

    +

    7822 # just 1 temperature per node 

    +

    7823 if it < 3: 

    +

    7824 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7825 # 3 temperatures per node 

    +

    7826 else: 

    +

    7827 self.check_array_dims({ArrayType.node_temperature: 2}, "node_layer", 3) 

    +

    7828 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7829 

    +

    7830 # NODE HEAT FLUX 

    +

    7831 if it >= 2: 

    +

    7832 array = self.arrays[ArrayType.node_heat_flux][i_timestep] 

    +

    7833 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7834 

    +

    7835 # NODE MASS SCALING 

    +

    7836 if has_mass_scaling: 

    +

    7837 array = self.arrays[ArrayType.node_mass_scaling][i_timestep] 

    +

    7838 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7839 

    +

    7840 # NODE TEMPERATURE GRADIENT 

    +

    7841 if settings.has_node_temperature_gradient: 

    +

    7842 array = self.arrays[ArrayType.node_temperature_gradient][i_timestep] 

    +

    7843 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7844 

    +

    7845 # NODE RESIDUAL FORCES 

    +

    7846 if settings.has_node_residual_forces: 

    +

    7847 array = ( 

    +

    7848 self.arrays[ArrayType.node_residual_forces][i_timestep] 

    +

    7849 if ArrayType.node_residual_forces in self.arrays 

    +

    7850 else np.zeros((n_nodes, 3), dtype=settings.ftype) 

    +

    7851 ) 

    +

    7852 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7853 

    +

    7854 # NODE RESIDUAL MOMENTS 

    +

    7855 if settings.has_node_residual_moments: 

    +

    7856 array = ( 

    +

    7857 self.arrays[ArrayType.node_residual_moments][i_timestep] 

    +

    7858 if ArrayType.node_residual_forces in self.arrays 

    +

    7859 else np.zeros((n_nodes, 3), dtype=settings.ftype) 

    +

    7860 ) 

    +

    7861 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7862 

    +

    7863 # NODE VELOCITY 

    +

    7864 if settings.header["iv"]: 

    +

    7865 array = self.arrays[ArrayType.node_velocity][i_timestep] 

    +

    7866 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7867 

    +

    7868 # NODE ACCELERATION 

    +

    7869 if settings.header["ia"]: 

    +

    7870 array = self.arrays[ArrayType.node_acceleration][i_timestep] 

    +

    7871 byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7872 

    +

    7873 # check the checksum 

    +

    7874 n_thermal_vars = 0 

    +

    7875 if settings.header["it"] % 10 == 1: 

    +

    7876 n_thermal_vars = 1 

    +

    7877 elif settings.header["it"] % 10 == 2: 

    +

    7878 n_thermal_vars = 4 

    +

    7879 elif settings.header["it"] % 10 == 3: 

    +

    7880 n_thermal_vars = 6 

    +

    7881 

    +

    7882 if settings.header["it"] // 10 == 1: 

    +

    7883 n_thermal_vars += 1 

    +

    7884 

    +

    7885 n_temp_gradient_vars = settings.has_node_temperature_gradient 

    +

    7886 n_residual_forces_vars = settings.has_node_residual_forces * 3 

    +

    7887 n_residual_moments_vars = settings.has_node_residual_moments * 3 

    +

    7888 

    +

    7889 # pylint: disable = invalid-name 

    +

    7890 NDIM = 3 

    +

    7891 byte_checksum_target = ( 

    +

    7892 ( 

    +

    7893 (settings.header["iu"] + settings.header["iv"] + settings.header["ia"]) * NDIM 

    +

    7894 + n_thermal_vars 

    +

    7895 + n_temp_gradient_vars 

    +

    7896 + n_residual_forces_vars 

    +

    7897 + n_residual_moments_vars 

    +

    7898 ) 

    +

    7899 * settings.wordsize 

    +

    7900 * settings.header["numnp"] 

    +

    7901 ) 

    +

    7902 if byte_checksum != byte_checksum_target: 

    +

    7903 msg = ( 

    +

    7904 "byte checksum wrong: " 

    +

    7905 "{byte_checksum_target} (header) != {byte_checksum} (checksum)" 

    +

    7906 ) 

    +

    7907 raise RuntimeError(msg) 

    +

    7908 

    +

    7909 # log 

    +

    7910 msg = "%s wrote %d bytes." 

    +

    7911 LOGGER.debug(msg, "_write_states_nodes", byte_checksum) 

    +

    7912 

    +

    7913 return byte_checksum 

    +

    7914 

    +

    7915 def _write_states_solid_thermal_data( 

    +

    7916 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    7917 ) -> int: 

    +

    7918 

    +

    7919 if settings.header["nt3d"] <= 0: 

    +

    7920 return 0 

    +

    7921 

    +

    7922 _check_ndim( 

    +

    7923 self, 

    +

    7924 { 

    +

    7925 ArrayType.element_solid_thermal_data: [ 

    +

    7926 "n_timesteps", 

    +

    7927 "n_solids", 

    +

    7928 "n_solids_thermal_vars", 

    +

    7929 ] 

    +

    7930 }, 

    +

    7931 ) 

    +

    7932 

    +

    7933 array_dims = { 

    +

    7934 ArrayType.global_timesteps: 0, 

    +

    7935 ArrayType.element_solid_thermal_data: 0, 

    +

    7936 } 

    +

    7937 self.check_array_dims(array_dims, "n_timesteps") 

    +

    7938 

    +

    7939 array_dims = { 

    +

    7940 ArrayType.element_solid_node_indexes: 0, 

    +

    7941 ArrayType.element_solid_thermal_data: 1, 

    +

    7942 } 

    +

    7943 self.check_array_dims(array_dims, "n_solids") 

    +

    7944 

    +

    7945 array = self.arrays[ArrayType.element_solid_thermal_data][i_timestep] 

    +

    7946 n_bytes_written = fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    7947 

    +

    7948 # check bytes 

    +

    7949 n_bytes_expected = ( 

    +

    7950 settings.header["nt3d"] * abs(settings.header["nel8"]) * settings.wordsize 

    +

    7951 ) 

    +

    7952 if n_bytes_expected != n_bytes_written: 

    +

    7953 msg = ( 

    +

    7954 "byte checksum wrong: " 

    +

    7955 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    7956 ) 

    +

    7957 raise RuntimeError(msg) 

    +

    7958 

    +

    7959 # log 

    +

    7960 msg = "%s wrote %d bytes." 

    +

    7961 LOGGER.debug(msg, "_write_states_thermal_data", n_bytes_written) 

    +

    7962 

    +

    7963 return n_bytes_written 

    +

    7964 

    +

    7965 def _write_states_solids( 

    +

    7966 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    7967 ) -> int: 

    +

    7968 

    +

    7969 n_solids = abs(settings.header["nel8"]) 

    +

    7970 n_solid_vars = settings.header["nv3d"] 

    +

    7971 n_solid_layers = settings.n_solid_layers 

    +

    7972 

    +

    7973 if n_solids == 0 or n_solid_vars <= 0: 

    +

    7974 return 0 

    +

    7975 

    +

    7976 _check_ndim( 

    +

    7977 self, 

    +

    7978 { 

    +

    7979 ArrayType.element_solid_stress: [ 

    +

    7980 "n_timesteps", 

    +

    7981 "n_solids", 

    +

    7982 "n_solid_layers", 

    +

    7983 "σx_σy_σz_σxy_σyz_σxz", 

    +

    7984 ], 

    +

    7985 ArrayType.element_solid_effective_plastic_strain: [ 

    +

    7986 "n_timesteps", 

    +

    7987 "n_solid_layers", 

    +

    7988 "n_solids", 

    +

    7989 ], 

    +

    7990 ArrayType.element_solid_history_variables: [ 

    +

    7991 "n_timesteps", 

    +

    7992 "n_solids", 

    +

    7993 "n_solid_layers", 

    +

    7994 "n_solid_history_vars", 

    +

    7995 ], 

    +

    7996 ArrayType.element_solid_strain: [ 

    +

    7997 "n_timesteps", 

    +

    7998 "n_solids", 

    +

    7999 "n_solid_layers", 

    +

    8000 "εx_εy_εz_εxy_εyz_εxz", 

    +

    8001 ], 

    +

    8002 ArrayType.element_solid_plastic_strain_tensor: [ 

    +

    8003 "n_timesteps", 

    +

    8004 "n_solids", 

    +

    8005 "n_solid_layers", 

    +

    8006 "εx_εy_εz_εxy_εyz_εxz", 

    +

    8007 ], 

    +

    8008 ArrayType.element_solid_thermal_strain_tensor: [ 

    +

    8009 "n_timesteps", 

    +

    8010 "n_solids", 

    +

    8011 "n_solid_layers", 

    +

    8012 "εx_εy_εz_εxy_εyz_εxz", 

    +

    8013 ], 

    +

    8014 }, 

    +

    8015 ) 

    +

    8016 

    +

    8017 array_dims = { 

    +

    8018 ArrayType.global_timesteps: 0, 

    +

    8019 ArrayType.element_solid_stress: 0, 

    +

    8020 ArrayType.element_solid_effective_plastic_strain: 0, 

    +

    8021 ArrayType.element_solid_history_variables: 0, 

    +

    8022 ArrayType.element_solid_strain: 0, 

    +

    8023 ArrayType.element_solid_plastic_strain_tensor: 0, 

    +

    8024 ArrayType.element_solid_thermal_strain_tensor: 0, 

    +

    8025 } 

    +

    8026 self.check_array_dims(array_dims, "n_timesteps") 

    +

    8027 

    +

    8028 array_dims = { 

    +

    8029 ArrayType.element_solid_node_indexes: 0, 

    +

    8030 ArrayType.element_solid_stress: 1, 

    +

    8031 ArrayType.element_solid_effective_plastic_strain: 1, 

    +

    8032 ArrayType.element_solid_history_variables: 1, 

    +

    8033 ArrayType.element_solid_strain: 1, 

    +

    8034 ArrayType.element_solid_plastic_strain_tensor: 1, 

    +

    8035 ArrayType.element_solid_thermal_strain_tensor: 1, 

    +

    8036 } 

    +

    8037 self.check_array_dims(array_dims, "n_solids") 

    +

    8038 

    +

    8039 array_dims = { 

    +

    8040 ArrayType.element_solid_stress: 2, 

    +

    8041 ArrayType.element_solid_effective_plastic_strain: 2, 

    +

    8042 ArrayType.element_solid_history_variables: 2, 

    +

    8043 ArrayType.element_solid_strain: 2, 

    +

    8044 ArrayType.element_solid_plastic_strain_tensor: 2, 

    +

    8045 ArrayType.element_solid_thermal_strain_tensor: 2, 

    +

    8046 } 

    +

    8047 self.check_array_dims(array_dims, "n_solid_layers") 

    +

    8048 

    +

    8049 self.check_array_dims({ArrayType.element_solid_stress: 3}, "σx_σy_σz_σxy_σyz_σxz", 6) 

    +

    8050 

    +

    8051 self.check_array_dims({ArrayType.element_solid_strain: 3}, "εx_εy_εz_εxy_εyz_εxz", 6) 

    +

    8052 

    +

    8053 self.check_array_dims( 

    +

    8054 {ArrayType.element_solid_plastic_strain_tensor: 3}, "εx_εy_εz_εxy_εyz_εxz", 6 

    +

    8055 ) 

    +

    8056 

    +

    8057 self.check_array_dims( 

    +

    8058 {ArrayType.element_solid_thermal_strain_tensor: 3}, "εx_εy_εz_εxy_εyz_εxz", 6 

    +

    8059 ) 

    +

    8060 

    +

    8061 # allocate array 

    +

    8062 solid_data = np.zeros( 

    +

    8063 (n_solids, n_solid_layers, n_solid_vars // n_solid_layers), dtype=settings.ftype 

    +

    8064 ) 

    +

    8065 

    +

    8066 # SOLID STRESS 

    +

    8067 if ArrayType.element_solid_stress in self.arrays: 

    +

    8068 try: 

    +

    8069 array = self.arrays[ArrayType.element_solid_stress][i_timestep] 

    +

    8070 solid_data[:, :, 0:6] = array 

    +

    8071 except Exception: 

    +

    8072 trb_msg = traceback.format_exc() 

    +

    8073 msg = "A failure in %s was caught:\n%s" 

    +

    8074 LOGGER.warning(msg, "_write_states_solids, element_solid_stress", trb_msg) 

    +

    8075 

    +

    8076 # SOLID EFFECTIVE PSTRAIN 

    +

    8077 if ArrayType.element_solid_effective_plastic_strain in self.arrays: 

    +

    8078 try: 

    +

    8079 array = self.arrays[ArrayType.element_solid_effective_plastic_strain][i_timestep] 

    +

    8080 solid_data[:, :, 6] = array 

    +

    8081 except Exception: 

    +

    8082 trb_msg = traceback.format_exc() 

    +

    8083 msg = "A failure in %s was caught:\n%s" 

    +

    8084 LOGGER.warning( 

    +

    8085 msg, "_write_states_solids, element_solid_effective_plastic_strain", trb_msg 

    +

    8086 ) 

    +

    8087 

    +

    8088 # SOLID HISTORY VARIABLES 

    +

    8089 # (strains, pstrain tensor and thermal tensor are excluded here) 

    +

    8090 has_strain = settings.header["istrn"] 

    +

    8091 n_solid_history_variables = ( 

    +

    8092 settings.header["neiph"] 

    +

    8093 - 6 * has_strain 

    +

    8094 - 6 * settings.has_plastic_strain_tensor 

    +

    8095 - 6 * settings.has_thermal_strain_tensor 

    +

    8096 ) 

    +

    8097 

    +

    8098 if n_solid_history_variables: 

    +

    8099 try: 

    +

    8100 array = self.arrays[ArrayType.element_solid_history_variables][i_timestep] 

    +

    8101 solid_data[:, :, 7 : 7 + n_solid_history_variables] = array 

    +

    8102 except Exception: 

    +

    8103 trb_msg = traceback.format_exc() 

    +

    8104 msg = "A failure in %s was caught:\n%s" 

    +

    8105 LOGGER.warning( 

    +

    8106 msg, "_write_states_solids, element_solid_history_variables", trb_msg 

    +

    8107 ) 

    +

    8108 

    +

    8109 # SOLID STRAIN 

    +

    8110 if has_strain and ArrayType.element_solid_strain in self.arrays: 

    +

    8111 try: 

    +

    8112 array = self.arrays[ArrayType.element_solid_strain][i_timestep] 

    +

    8113 offset = 7 + n_solid_history_variables 

    +

    8114 solid_data[:, :, offset : offset + 6] = array 

    +

    8115 except Exception: 

    +

    8116 trb_msg = traceback.format_exc() 

    +

    8117 msg = "A failure in %s was caught:\n%s" 

    +

    8118 LOGGER.warning(msg, "_write_states_solids, element_solid_strain", trb_msg) 

    +

    8119 

    +

    8120 # PLASTIC STRAIN TENSOR 

    +

    8121 if ( 

    +

    8122 settings.has_plastic_strain_tensor 

    +

    8123 and ArrayType.element_solid_plastic_strain_tensor in self.arrays 

    +

    8124 ): 

    +

    8125 try: 

    +

    8126 array = self.arrays[ArrayType.element_solid_plastic_strain_tensor][i_timestep] 

    +

    8127 offset = 7 + n_solid_history_variables + 6 * has_strain 

    +

    8128 solid_data[:, :, offset : offset + 6] = array 

    +

    8129 except Exception: 

    +

    8130 trb_msg = traceback.format_exc() 

    +

    8131 msg = "A failure in %s was caught:\n%s" 

    +

    8132 LOGGER.warning( 

    +

    8133 msg, "_write_states_solids, element_solid_plastic_strain_tensor", trb_msg 

    +

    8134 ) 

    +

    8135 

    +

    8136 # THERMAL STRAIN TENSOR 

    +

    8137 if ( 

    +

    8138 settings.has_thermal_strain_tensor 

    +

    8139 and ArrayType.element_solid_thermal_strain_tensor in self.arrays 

    +

    8140 ): 

    +

    8141 try: 

    +

    8142 array = self.arrays[ArrayType.element_solid_thermal_strain_tensor][i_timestep] 

    +

    8143 offset = ( 

    +

    8144 7 

    +

    8145 + n_solid_history_variables 

    +

    8146 + 6 * has_strain 

    +

    8147 + 6 * settings.has_plastic_strain_tensor 

    +

    8148 ) 

    +

    8149 solid_data[:, :, offset : offset + 6] = array 

    +

    8150 except Exception: 

    +

    8151 trb_msg = traceback.format_exc() 

    +

    8152 msg = "A failure in %s was caught:\n%s" 

    +

    8153 LOGGER.warning( 

    +

    8154 msg, "_write_states_solids, element_solid_thermal_strain_tensor", trb_msg 

    +

    8155 ) 

    +

    8156 

    +

    8157 n_bytes_written = fp.write(settings.pack(solid_data, dtype_hint=np.floating)) 

    +

    8158 

    +

    8159 # check bytes 

    +

    8160 n_bytes_expected = ( 

    +

    8161 settings.header["nv3d"] * abs(settings.header["nel8"]) * settings.wordsize 

    +

    8162 ) 

    +

    8163 if n_bytes_expected != n_bytes_written: 

    +

    8164 msg = ( 

    +

    8165 "byte checksum wrong: " 

    +

    8166 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    8167 ) 

    +

    8168 raise RuntimeError(msg) 

    +

    8169 

    +

    8170 # log 

    +

    8171 msg = "%s wrote %d bytes." 

    +

    8172 LOGGER.debug(msg, "_write_states_solids", n_bytes_written) 

    +

    8173 

    +

    8174 return n_bytes_written 

    +

    8175 

    +

    8176 def _write_states_tshells( 

    +

    8177 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    8178 ) -> int: 

    +

    8179 

    +

    8180 n_tshells = settings.header["nelth"] 

    +

    8181 n_tshell_vars = settings.header["nv3dt"] 

    +

    8182 if n_tshells <= 0 or n_tshell_vars <= 0: 

    +

    8183 return 0 

    +

    8184 

    +

    8185 _check_ndim( 

    +

    8186 self, 

    +

    8187 { 

    +

    8188 ArrayType.element_tshell_stress: [ 

    +

    8189 "n_timesteps", 

    +

    8190 "n_tshells", 

    +

    8191 "n_shell_layers", 

    +

    8192 "σx_σy_σz_σxy_σyz_σxz", 

    +

    8193 ], 

    +

    8194 ArrayType.element_tshell_strain: [ 

    +

    8195 "n_timesteps", 

    +

    8196 "n_tshells", 

    +

    8197 "upper_lower", 

    +

    8198 "εx_εy_εz_εxy_εyz_εxz", 

    +

    8199 ], 

    +

    8200 ArrayType.element_tshell_effective_plastic_strain: [ 

    +

    8201 "n_timesteps", 

    +

    8202 "n_tshells", 

    +

    8203 "n_shell_layers", 

    +

    8204 ], 

    +

    8205 ArrayType.element_tshell_history_variables: [ 

    +

    8206 "n_timesteps", 

    +

    8207 "n_tshells", 

    +

    8208 "n_shell_layers", 

    +

    8209 "n_tshell_history_vars", 

    +

    8210 ], 

    +

    8211 }, 

    +

    8212 ) 

    +

    8213 

    +

    8214 array_dims = { 

    +

    8215 ArrayType.global_timesteps: 0, 

    +

    8216 ArrayType.element_tshell_stress: 0, 

    +

    8217 ArrayType.element_tshell_strain: 0, 

    +

    8218 ArrayType.element_tshell_effective_plastic_strain: 0, 

    +

    8219 ArrayType.element_tshell_history_variables: 0, 

    +

    8220 } 

    +

    8221 self.check_array_dims(array_dims, "n_timesteps") 

    +

    8222 

    +

    8223 array_dims = { 

    +

    8224 ArrayType.element_tshell_node_indexes: 0, 

    +

    8225 ArrayType.element_tshell_stress: 1, 

    +

    8226 ArrayType.element_tshell_strain: 1, 

    +

    8227 ArrayType.element_tshell_effective_plastic_strain: 1, 

    +

    8228 ArrayType.element_tshell_history_variables: 1, 

    +

    8229 } 

    +

    8230 self.check_array_dims(array_dims, "n_tshells") 

    +

    8231 

    +

    8232 self.check_array_dims({ArrayType.element_tshell_stress: 3}, "σx_σy_σz_σxy_σyz_σxz", 6) 

    +

    8233 

    +

    8234 self.check_array_dims({ArrayType.element_tshell_strain: 2}, "upper_lower", 2) 

    +

    8235 

    +

    8236 self.check_array_dims({ArrayType.element_tshell_strain: 3}, "εx_εy_εz_εxy_εyz_εxz", 6) 

    +

    8237 

    +

    8238 has_stress = settings.header["ioshl1"] == 1000 

    +

    8239 has_pstrain = settings.header["ioshl2"] == 1000 

    +

    8240 n_history_vars = settings.header["neips"] 

    +

    8241 n_layer_vars = settings.n_shell_layers * (6 * has_stress + has_pstrain + n_history_vars) 

    +

    8242 

    +

    8243 tshell_data = np.zeros((n_tshells, n_tshell_vars), settings.ftype) 

    +

    8244 tshell_layer_data = tshell_data[:, :n_layer_vars].reshape( 

    +

    8245 (n_tshells, settings.n_shell_layers, -1) 

    +

    8246 ) 

    +

    8247 tshell_nonlayer_data = tshell_data[:, n_layer_vars:] 

    +

    8248 

    +

    8249 # TSHELL STRESS 

    +

    8250 if has_stress: 

    +

    8251 if ArrayType.element_tshell_stress in self.arrays: 

    +

    8252 array = self.arrays[ArrayType.element_tshell_stress][i_timestep] 

    +

    8253 tshell_layer_data[:, :, 0:6] = array 

    +

    8254 

    +

    8255 # TSHELL EFF. PLASTIC STRAIN 

    +

    8256 if has_pstrain: 

    +

    8257 if ArrayType.element_tshell_effective_plastic_strain in self.arrays: 

    +

    8258 array = self.arrays[ArrayType.element_tshell_effective_plastic_strain][i_timestep] 

    +

    8259 start_index = 6 * has_stress 

    +

    8260 tshell_layer_data[:, :, start_index] = array 

    +

    8261 

    +

    8262 # TSHELL HISTORY VARS 

    +

    8263 if n_history_vars != 0: 

    +

    8264 if ArrayType.element_tshell_history_variables in self.arrays: 

    +

    8265 array = self.arrays[ArrayType.element_tshell_history_variables][i_timestep] 

    +

    8266 start_index = 6 * has_stress + has_pstrain 

    +

    8267 end_index = start_index + array.shape[2] 

    +

    8268 tshell_layer_data[:, :, start_index:end_index] = array 

    +

    8269 

    +

    8270 # TSHELL STRAIN 

    +

    8271 if settings.header["istrn"]: 

    +

    8272 if ArrayType.element_tshell_strain in self.arrays: 

    +

    8273 array = self.arrays[ArrayType.element_tshell_strain][i_timestep] 

    +

    8274 start_index = 6 * has_stress + has_pstrain + n_history_vars 

    +

    8275 tshell_nonlayer_data[:, :] = array.reshape(n_tshells, 12) 

    +

    8276 

    +

    8277 n_bytes_written = fp.write(settings.pack(tshell_data, dtype_hint=np.floating)) 

    +

    8278 

    +

    8279 # check bytes 

    +

    8280 n_bytes_expected = ( 

    +

    8281 settings.header["nv3dt"] * abs(settings.header["nelth"]) * settings.wordsize 

    +

    8282 ) 

    +

    8283 if n_bytes_expected != n_bytes_written: 

    +

    8284 msg = ( 

    +

    8285 "byte checksum wrong: " 

    +

    8286 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    8287 ) 

    +

    8288 raise RuntimeError(msg) 

    +

    8289 

    +

    8290 # log 

    +

    8291 msg = "%s wrote %d bytes." 

    +

    8292 LOGGER.debug(msg, "_write_states_tshells", n_bytes_written) 

    +

    8293 

    +

    8294 return n_bytes_written 

    +

    8295 

    +

    8296 def _write_states_beams( 

    +

    8297 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    8298 ) -> int: 

    +

    8299 

    +

    8300 n_beams = settings.header["nel2"] 

    +

    8301 n_beam_vars = settings.header["nv1d"] 

    +

    8302 if n_beams <= 0 or n_beam_vars <= 0: 

    +

    8303 return 0 

    +

    8304 

    +

    8305 n_beam_layers = settings.header["beamip"] 

    +

    8306 n_beam_history_vars = settings.header["neipb"] 

    +

    8307 

    +

    8308 _check_ndim( 

    +

    8309 self, 

    +

    8310 { 

    +

    8311 ArrayType.element_beam_axial_force: ["n_timesteps", "n_beams"], 

    +

    8312 ArrayType.element_beam_shear_force: ["n_timesteps", "n_beams", "fs_ft"], 

    +

    8313 ArrayType.element_beam_bending_moment: ["n_timesteps", "n_beams", "ms_mt"], 

    +

    8314 ArrayType.element_beam_torsion_moment: ["n_timesteps", "n_beams"], 

    +

    8315 ArrayType.element_beam_shear_stress: [ 

    +

    8316 "n_timesteps", 

    +

    8317 "n_beams", 

    +

    8318 "n_beam_layers", 

    +

    8319 "σrs_σtr", 

    +

    8320 ], 

    +

    8321 ArrayType.element_beam_axial_stress: ["n_timesteps", "n_beams", "n_beam_layers"], 

    +

    8322 ArrayType.element_beam_plastic_strain: ["n_timesteps", "n_beams", "n_beam_layers"], 

    +

    8323 ArrayType.element_beam_axial_strain: ["n_timesteps", "n_beams", "n_beam_layers"], 

    +

    8324 ArrayType.element_beam_history_vars: [ 

    +

    8325 "n_timesteps", 

    +

    8326 "n_beams", 

    +

    8327 "n_beam_layers+3", 

    +

    8328 "n_beam_history_vars", 

    +

    8329 ], 

    +

    8330 }, 

    +

    8331 ) 

    +

    8332 

    +

    8333 array_dims = { 

    +

    8334 ArrayType.global_timesteps: 0, 

    +

    8335 ArrayType.element_beam_axial_force: 0, 

    +

    8336 ArrayType.element_beam_shear_force: 0, 

    +

    8337 ArrayType.element_beam_bending_moment: 0, 

    +

    8338 ArrayType.element_beam_torsion_moment: 0, 

    +

    8339 ArrayType.element_beam_shear_stress: 0, 

    +

    8340 ArrayType.element_beam_axial_stress: 0, 

    +

    8341 ArrayType.element_beam_plastic_strain: 0, 

    +

    8342 ArrayType.element_beam_axial_strain: 0, 

    +

    8343 ArrayType.element_beam_history_vars: 0, 

    +

    8344 } 

    +

    8345 self.check_array_dims(array_dims, "n_timesteps") 

    +

    8346 array_dims = { 

    +

    8347 ArrayType.element_beam_axial_force: 1, 

    +

    8348 ArrayType.element_beam_shear_force: 1, 

    +

    8349 ArrayType.element_beam_bending_moment: 1, 

    +

    8350 ArrayType.element_beam_torsion_moment: 1, 

    +

    8351 ArrayType.element_beam_shear_stress: 1, 

    +

    8352 ArrayType.element_beam_axial_stress: 1, 

    +

    8353 ArrayType.element_beam_plastic_strain: 1, 

    +

    8354 ArrayType.element_beam_axial_strain: 1, 

    +

    8355 ArrayType.element_beam_history_vars: 1, 

    +

    8356 } 

    +

    8357 self.check_array_dims(array_dims, "n_beams") 

    +

    8358 self.check_array_dims({ArrayType.element_beam_shear_force: 2}, "fs_ft", 2) 

    +

    8359 self.check_array_dims({ArrayType.element_beam_bending_moment: 2}, "ms_mt", 2) 

    +

    8360 array_dims = { 

    +

    8361 ArrayType.element_beam_shear_stress: 2, 

    +

    8362 ArrayType.element_beam_axial_stress: 2, 

    +

    8363 ArrayType.element_beam_plastic_strain: 2, 

    +

    8364 ArrayType.element_beam_axial_strain: 2, 

    +

    8365 ArrayType.element_beam_history_vars: 2, 

    +

    8366 } 

    +

    8367 n_beam_layers = self.check_array_dims(array_dims, "n_beam_layers") 

    +

    8368 self.check_array_dims({ArrayType.element_beam_shear_stress: 3}, "σrs_σtr", 2) 

    +

    8369 self.check_array_dims( 

    +

    8370 {ArrayType.element_beam_history_vars: 2}, "n_modes", n_beam_layers + 3 

    +

    8371 ) 

    +

    8372 

    +

    8373 # allocate buffer 

    +

    8374 beam_data = np.zeros((n_beams, n_beam_vars), dtype=settings.ftype) 

    +

    8375 n_layer_vars_total = 5 * n_beam_layers 

    +

    8376 beam_layer_data = beam_data[:, 6 : 6 + n_layer_vars_total].reshape( 

    +

    8377 (n_beams, n_beam_layers, 5) 

    +

    8378 ) 

    +

    8379 beam_history_vars = beam_data[:, 6 + n_layer_vars_total :].reshape( 

    +

    8380 (n_beams, 3 + n_beam_layers, n_beam_history_vars) 

    +

    8381 ) 

    +

    8382 

    +

    8383 # BEAM AXIAL FORCE 

    +

    8384 if ArrayType.element_beam_axial_force in self.arrays: 

    +

    8385 array = self.arrays[ArrayType.element_beam_axial_force][i_timestep] 

    +

    8386 beam_data[:, 0] = array 

    +

    8387 

    +

    8388 # BEAM SHEAR FORCE 

    +

    8389 if ArrayType.element_beam_shear_force in self.arrays: 

    +

    8390 array = self.arrays[ArrayType.element_beam_shear_force][i_timestep] 

    +

    8391 beam_data[:, 1:3] = array 

    +

    8392 

    +

    8393 # BEAM BENDING MOMENTUM 

    +

    8394 if ArrayType.element_beam_bending_moment in self.arrays: 

    +

    8395 array = self.arrays[ArrayType.element_beam_bending_moment][i_timestep] 

    +

    8396 beam_data[:, 3:5] = array 

    +

    8397 

    +

    8398 # BEAM TORSION MOMENTUM 

    +

    8399 if ArrayType.element_beam_torsion_moment in self.arrays: 

    +

    8400 array = self.arrays[ArrayType.element_beam_torsion_moment][i_timestep] 

    +

    8401 beam_data[:, 5] = array 

    +

    8402 

    +

    8403 if n_beam_layers: 

    +

    8404 array = ( 

    +

    8405 self.arrays[ArrayType.element_beam_axial_stress][i_timestep] 

    +

    8406 if ArrayType.element_beam_axial_stress in self.arrays 

    +

    8407 else np.zeros((n_beams, n_beam_layers), dtype=settings.ftype) 

    +

    8408 ) 

    +

    8409 beam_layer_data[:, :, 0] = array 

    +

    8410 

    +

    8411 array = ( 

    +

    8412 self.arrays[ArrayType.element_beam_shear_stress][i_timestep] 

    +

    8413 if ArrayType.element_beam_shear_stress in self.arrays 

    +

    8414 else np.zeros((n_beams, n_beam_layers, 2), dtype=settings.ftype) 

    +

    8415 ) 

    +

    8416 beam_layer_data[:, :, 1:3] = array 

    +

    8417 

    +

    8418 array = ( 

    +

    8419 self.arrays[ArrayType.element_beam_plastic_strain][i_timestep] 

    +

    8420 if ArrayType.element_beam_plastic_strain in self.arrays 

    +

    8421 else np.zeros((n_beams, n_beam_layers), dtype=settings.ftype) 

    +

    8422 ) 

    +

    8423 beam_layer_data[:, :, 3] = array 

    +

    8424 

    +

    8425 array = ( 

    +

    8426 self.arrays[ArrayType.element_beam_axial_strain][i_timestep] 

    +

    8427 if ArrayType.element_beam_axial_strain in self.arrays 

    +

    8428 else np.zeros((n_beams, n_beam_layers), dtype=settings.ftype) 

    +

    8429 ) 

    +

    8430 beam_layer_data[:, :, 4] = array 

    +

    8431 

    +

    8432 # BEAM HISTORY VARIABLES 

    +

    8433 if n_beam_history_vars: 

    +

    8434 array = ( 

    +

    8435 self.arrays[ArrayType.element_beam_history_vars][i_timestep] 

    +

    8436 if ArrayType.element_beam_history_vars in self.arrays 

    +

    8437 else np.zeros( 

    +

    8438 (n_beams, n_beam_layers + 3, n_beam_history_vars), dtype=settings.ftype 

    +

    8439 ) 

    +

    8440 ) 

    +

    8441 beam_history_vars[:, :, :] = array 

    +

    8442 

    +

    8443 n_bytes_written = fp.write(settings.pack(beam_data, dtype_hint=np.floating)) 

    +

    8444 

    +

    8445 # check bytes 

    +

    8446 n_bytes_expected = settings.header["nv1d"] * settings.header["nel2"] * settings.wordsize 

    +

    8447 if n_bytes_expected != n_bytes_written: 

    +

    8448 msg = ( 

    +

    8449 "byte checksum wrong: " 

    +

    8450 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    8451 ) 

    +

    8452 raise RuntimeError(msg) 

    +

    8453 

    +

    8454 # log 

    +

    8455 msg = "%s wrote %d bytes." 

    +

    8456 LOGGER.debug(msg, "_write_states_tshells", n_bytes_written) 

    +

    8457 

    +

    8458 return n_bytes_written 

    +

    8459 

    +

    8460 def _write_states_shells( 

    +

    8461 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    8462 ) -> int: 

    +

    8463 

    +

    8464 n_shells = settings.header["nel4"] 

    +

    8465 n_shell_vars = settings.header["nv2d"] 

    +

    8466 n_rigid_shells = settings.n_rigid_shells 

    +

    8467 is_d3part = self.header.filetype == D3plotFiletype.D3PART 

    +

    8468 # d3part writes results also for rigid shells 

    +

    8469 n_reduced_shells = n_shells if is_d3part else n_shells - n_rigid_shells 

    +

    8470 

    +

    8471 if n_reduced_shells <= 0 or n_shell_vars <= 0: 

    +

    8472 return 0 

    +

    8473 

    +

    8474 has_stress = settings.header["ioshl1"] == 1000 

    +

    8475 has_pstrain = settings.header["ioshl2"] == 1000 

    +

    8476 has_forces = settings.header["ioshl3"] == 1000 

    +

    8477 has_else = settings.header["ioshl4"] == 1000 

    +

    8478 has_strain = settings.header["istrn"] != 0 

    +

    8479 n_shell_history_vars = settings.header["neips"] 

    +

    8480 

    +

    8481 _check_ndim( 

    +

    8482 self, 

    +

    8483 { 

    +

    8484 ArrayType.element_shell_stress: [ 

    +

    8485 "n_timesteps", 

    +

    8486 "n_shells", 

    +

    8487 "n_shell_layers", 

    +

    8488 "σx_σy_σz_σxy_σyz_σxz", 

    +

    8489 ], 

    +

    8490 ArrayType.element_shell_effective_plastic_strain: [ 

    +

    8491 "n_timesteps", 

    +

    8492 "n_shells", 

    +

    8493 "n_shell_layers", 

    +

    8494 ], 

    +

    8495 ArrayType.element_shell_history_vars: [ 

    +

    8496 "n_timesteps", 

    +

    8497 "n_shells", 

    +

    8498 "n_shell_layers", 

    +

    8499 "n_shell_history_vars", 

    +

    8500 ], 

    +

    8501 ArrayType.element_shell_bending_moment: ["n_timesteps", "n_shells", "mx_my_mxy"], 

    +

    8502 ArrayType.element_shell_shear_force: ["n_timesteps", "n_shells", "qx_qy"], 

    +

    8503 ArrayType.element_shell_normal_force: ["n_timesteps", "n_shells", "nx_ny_nxy"], 

    +

    8504 ArrayType.element_shell_thickness: ["n_timesteps", "n_shells"], 

    +

    8505 ArrayType.element_shell_unknown_variables: [ 

    +

    8506 "n_timesteps", 

    +

    8507 "n_shells", 

    +

    8508 "n_extra_vars", 

    +

    8509 ], 

    +

    8510 ArrayType.element_shell_internal_energy: ["n_timesteps", "n_shells"], 

    +

    8511 ArrayType.element_shell_strain: [ 

    +

    8512 "n_timesteps", 

    +

    8513 "n_shells", 

    +

    8514 "upper_lower", 

    +

    8515 "εx_εy_εz_εxy_εyz_εxz", 

    +

    8516 ], 

    +

    8517 }, 

    +

    8518 ) 

    +

    8519 

    +

    8520 array_dims = { 

    +

    8521 ArrayType.global_timesteps: 0, 

    +

    8522 ArrayType.element_shell_stress: 0, 

    +

    8523 ArrayType.element_shell_effective_plastic_strain: 0, 

    +

    8524 ArrayType.element_shell_history_vars: 0, 

    +

    8525 ArrayType.element_shell_bending_moment: 0, 

    +

    8526 ArrayType.element_shell_shear_force: 0, 

    +

    8527 ArrayType.element_shell_normal_force: 0, 

    +

    8528 ArrayType.element_shell_thickness: 0, 

    +

    8529 ArrayType.element_shell_unknown_variables: 0, 

    +

    8530 ArrayType.element_shell_internal_energy: 0, 

    +

    8531 ArrayType.element_shell_strain: 0, 

    +

    8532 } 

    +

    8533 self.check_array_dims(array_dims, "n_timesteps") 

    +

    8534 

    +

    8535 array_dims = { 

    +

    8536 ArrayType.element_shell_stress: 1, 

    +

    8537 ArrayType.element_shell_effective_plastic_strain: 1, 

    +

    8538 ArrayType.element_shell_history_vars: 1, 

    +

    8539 ArrayType.element_shell_bending_moment: 1, 

    +

    8540 ArrayType.element_shell_shear_force: 1, 

    +

    8541 ArrayType.element_shell_normal_force: 1, 

    +

    8542 ArrayType.element_shell_thickness: 1, 

    +

    8543 ArrayType.element_shell_unknown_variables: 1, 

    +

    8544 ArrayType.element_shell_internal_energy: 1, 

    +

    8545 ArrayType.element_shell_strain: 1, 

    +

    8546 } 

    +

    8547 n_reduced_shells = self.check_array_dims(array_dims, "n_shells") 

    +

    8548 if not is_d3part and n_reduced_shells != n_shells - n_rigid_shells: 

    +

    8549 msg = ( 

    +

    8550 "Parts with mattyp 20 (rigid material) were specified." 

    +

    8551 " For these parts no state data is output in dyna." 

    +

    8552 " The state arrays are thus expected output data for only" 

    +

    8553 f" {n_shells - n_rigid_shells} shells and not {n_reduced_shells}." 

    +

    8554 ) 

    +

    8555 raise ValueError(msg) 

    +

    8556 

    +

    8557 array_dims = { 

    +

    8558 ArrayType.element_shell_stress: 2, 

    +

    8559 ArrayType.element_shell_effective_plastic_strain: 2, 

    +

    8560 ArrayType.element_shell_history_vars: 2, 

    +

    8561 } 

    +

    8562 n_shell_layers = self.check_array_dims(array_dims, "n_shell_layers") 

    +

    8563 

    +

    8564 self.check_array_dims({ArrayType.element_shell_stress: 3}, "σx_σy_σz_σxy_σyz_σxz", 6) 

    +

    8565 self.check_array_dims({ArrayType.element_shell_bending_moment: 2}, "mx_my_mxy", 3) 

    +

    8566 self.check_array_dims({ArrayType.element_shell_shear_force: 2}, "qx_qy") 

    +

    8567 self.check_array_dims({ArrayType.element_shell_strain: 2}, "upper_lower", 2) 

    +

    8568 self.check_array_dims({ArrayType.element_shell_strain: 3}, "εx_εy_εz_εxy_εyz_εxz", 6) 

    +

    8569 

    +

    8570 # allocate buffer 

    +

    8571 shell_data = np.zeros((n_reduced_shells, n_shell_vars), dtype=settings.ftype) 

    +

    8572 n_layer_vars = has_stress * 6 + has_pstrain + n_shell_history_vars 

    +

    8573 n_layer_vars_total = n_layer_vars * n_shell_layers 

    +

    8574 

    +

    8575 shell_layer_data = shell_data[:, :n_layer_vars_total].reshape( 

    +

    8576 (n_reduced_shells, n_shell_layers, n_layer_vars) 

    +

    8577 ) 

    +

    8578 shell_nonlayer_data = shell_data[:, n_layer_vars_total:] 

    +

    8579 

    +

    8580 start_layer_index = 0 

    +

    8581 end_layer_index = 0 

    +

    8582 

    +

    8583 # SHELL STRESS 

    +

    8584 if has_stress: 

    +

    8585 start_layer_index = 0 

    +

    8586 end_layer_index = 6 

    +

    8587 if ArrayType.element_shell_stress in self.arrays: 

    +

    8588 array = self.arrays[ArrayType.element_shell_stress][i_timestep] 

    +

    8589 shell_layer_data[:, :, start_layer_index:end_layer_index] = array 

    +

    8590 

    +

    8591 # EFF PSTRAIN 

    +

    8592 if has_pstrain: 

    +

    8593 start_layer_index = end_layer_index 

    +

    8594 end_layer_index = start_layer_index + has_pstrain 

    +

    8595 if ArrayType.element_shell_effective_plastic_strain in self.arrays: 

    +

    8596 array = self.arrays[ArrayType.element_shell_effective_plastic_strain][i_timestep] 

    +

    8597 shell_layer_data[:, :, start_layer_index:end_layer_index] = array.reshape( 

    +

    8598 (n_reduced_shells, n_shell_layers, 1) 

    +

    8599 ) 

    +

    8600 

    +

    8601 # SHELL HISTORY VARS 

    +

    8602 if n_shell_history_vars: 

    +

    8603 start_layer_index = end_layer_index 

    +

    8604 end_layer_index = start_layer_index + n_shell_history_vars 

    +

    8605 if ArrayType.element_shell_history_vars in self.arrays: 

    +

    8606 array = self.arrays[ArrayType.element_shell_history_vars][i_timestep] 

    +

    8607 n_hist_vars_arr = array.shape[2] 

    +

    8608 end_layer_index2 = start_layer_index + min(n_hist_vars_arr, n_shell_history_vars) 

    +

    8609 shell_layer_data[:, :, start_layer_index:end_layer_index2] = array 

    +

    8610 

    +

    8611 start_index = 0 

    +

    8612 end_index = 0 

    +

    8613 

    +

    8614 # SHELL FORCES 

    +

    8615 if has_forces: 

    +

    8616 start_index = end_index 

    +

    8617 end_index = start_index + 8 

    +

    8618 

    +

    8619 # MOMENTUM 

    +

    8620 if ArrayType.element_shell_bending_moment in self.arrays: 

    +

    8621 start_index2 = start_index 

    +

    8622 end_index2 = start_index + 3 

    +

    8623 array = self.arrays[ArrayType.element_shell_bending_moment][i_timestep] 

    +

    8624 shell_nonlayer_data[:, start_index2:end_index2] = array 

    +

    8625 

    +

    8626 # SHEAR 

    +

    8627 if ArrayType.element_shell_shear_force in self.arrays: 

    +

    8628 start_index2 = start_index + 3 

    +

    8629 end_index2 = start_index + 5 

    +

    8630 array = self.arrays[ArrayType.element_shell_shear_force][i_timestep] 

    +

    8631 shell_nonlayer_data[:, start_index2:end_index2] = array 

    +

    8632 

    +

    8633 # NORMAL 

    +

    8634 if ArrayType.element_shell_normal_force in self.arrays: 

    +

    8635 start_index2 = start_index + 5 

    +

    8636 end_index2 = start_index + 8 

    +

    8637 array = self.arrays[ArrayType.element_shell_normal_force][i_timestep] 

    +

    8638 shell_nonlayer_data[:, start_index2:end_index2] = array 

    +

    8639 

    +

    8640 if has_else: 

    +

    8641 start_index = end_index 

    +

    8642 end_index = start_index + 3 

    +

    8643 

    +

    8644 # THICKNESS 

    +

    8645 if ArrayType.element_shell_thickness in self.arrays: 

    +

    8646 start_index2 = start_index 

    +

    8647 end_index2 = start_index + 1 

    +

    8648 array = self.arrays[ArrayType.element_shell_thickness][i_timestep] 

    +

    8649 shell_nonlayer_data[:, start_index2:end_index2] = array.reshape( 

    +

    8650 (n_reduced_shells, 1) 

    +

    8651 ) 

    +

    8652 

    +

    8653 # ELEMENT SPECIFIC VARS 

    +

    8654 if ArrayType.element_shell_unknown_variables in self.arrays: 

    +

    8655 start_index2 = start_index + 1 

    +

    8656 end_index2 = start_index + 3 

    +

    8657 array = self.arrays[ArrayType.element_shell_unknown_variables][i_timestep] 

    +

    8658 shell_nonlayer_data[:, start_index2:end_index2] = array 

    +

    8659 

    +

    8660 # SHELL STRAIN 

    +

    8661 # 

    +

    8662 # Strain is squeezed between the 3rd and 4th var of the else block 

    +

    8663 if has_strain: 

    +

    8664 start_index = end_index 

    +

    8665 end_index = start_index + 12 

    +

    8666 

    +

    8667 if ArrayType.element_shell_strain in self.arrays: 

    +

    8668 array = self.arrays[ArrayType.element_shell_strain][i_timestep] 

    +

    8669 shell_nonlayer_data[:, start_index:end_index] = array.reshape( 

    +

    8670 (n_reduced_shells, 12) 

    +

    8671 ) 

    +

    8672 

    +

    8673 # INTERNAL ENERGY 

    +

    8674 if has_else: 

    +

    8675 start_index = end_index 

    +

    8676 end_index = start_index + 1 

    +

    8677 

    +

    8678 if ArrayType.element_shell_internal_energy in self.arrays: 

    +

    8679 array = self.arrays[ArrayType.element_shell_internal_energy][i_timestep] 

    +

    8680 shell_nonlayer_data[:, start_index:end_index] = array.reshape((n_reduced_shells, 1)) 

    +

    8681 

    +

    8682 # THERMAL STRAIN TENSOR 

    +

    8683 if settings.has_plastic_strain_tensor: 

    +

    8684 start_index = end_index 

    +

    8685 end_index = start_index + n_shell_layers * 6 

    +

    8686 

    +

    8687 if ArrayType.element_shell_plastic_strain_tensor in self.arrays: 

    +

    8688 array = self.arrays[ArrayType.element_shell_plastic_strain_tensor][i_timestep] 

    +

    8689 shell_nonlayer_data[:, start_index:end_index] = array.reshape( 

    +

    8690 (n_reduced_shells, n_shell_layers * 6) 

    +

    8691 ) 

    +

    8692 

    +

    8693 # PLASTIC THERMAL TENSOR 

    +

    8694 if settings.has_thermal_strain_tensor: 

    +

    8695 start_index = end_index 

    +

    8696 end_index = start_index + 6 

    +

    8697 

    +

    8698 if ArrayType.element_shell_thermal_strain_tensor in self.arrays: 

    +

    8699 array = self.arrays[ArrayType.element_shell_thermal_strain_tensor][i_timestep] 

    +

    8700 shell_nonlayer_data[:, start_index:end_index] = array.reshape((n_reduced_shells, 6)) 

    +

    8701 

    +

    8702 n_bytes_written = fp.write(settings.pack(shell_data, dtype_hint=np.floating)) 

    +

    8703 

    +

    8704 # check bytes 

    +

    8705 # *(settings.header["nel4"]-settings.n_rigid_shells)\ 

    +

    8706 n_bytes_expected = settings.header["nv2d"] * n_reduced_shells * settings.wordsize 

    +

    8707 if n_bytes_expected != n_bytes_written: 

    +

    8708 msg = ( 

    +

    8709 "byte checksum wrong: " 

    +

    8710 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    8711 ) 

    +

    8712 raise RuntimeError(msg) 

    +

    8713 

    +

    8714 # log 

    +

    8715 msg = "%s wrote %d bytes." 

    +

    8716 LOGGER.debug(msg, "_write_states_shells", n_bytes_written) 

    +

    8717 

    +

    8718 return n_bytes_written 

    +

    8719 

    +

    8720 def _write_states_deletion_info( 

    +

    8721 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    8722 ) -> int: 

    +

    8723 

    +

    8724 if settings.mdlopt <= 0: 

    +

    8725 return 0 

    +

    8726 

    +

    8727 n_bytes_written = 0 

    +

    8728 n_bytes_expected = 0 

    +

    8729 

    +

    8730 # NODE DELETION 

    +

    8731 if settings.mdlopt == 1: 

    +

    8732 

    +

    8733 _check_ndim(self, {ArrayType.node_is_alive: ["n_timesteps", "n_nodes"]}) 

    +

    8734 

    +

    8735 array_dims = { 

    +

    8736 ArrayType.global_timesteps: 0, 

    +

    8737 ArrayType.node_is_alive: 0, 

    +

    8738 } 

    +

    8739 self.check_array_dims(array_dims, "n_timesteps") 

    +

    8740 

    +

    8741 array_dims = { 

    +

    8742 ArrayType.node_coordinates: 0, 

    +

    8743 ArrayType.node_is_alive: 1, 

    +

    8744 } 

    +

    8745 self.check_array_dims(array_dims, "n_nodes") 

    +

    8746 

    +

    8747 n_nodes = settings.header["numnp"] 

    +

    8748 

    +

    8749 array = ( 

    +

    8750 self.arrays[ArrayType.node_is_alive] 

    +

    8751 if ArrayType.node_is_alive in self.arrays 

    +

    8752 else np.zeros(n_nodes, dtype=settings.ftype) 

    +

    8753 ) 

    +

    8754 

    +

    8755 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    8756 

    +

    8757 # check 

    +

    8758 n_bytes_expected = settings.header["numnp"] * settings.wordsize 

    +

    8759 

    +

    8760 # ELEMENT DELETION 

    +

    8761 elif settings.mdlopt == 2: 

    +

    8762 

    +

    8763 _check_ndim( 

    +

    8764 self, 

    +

    8765 { 

    +

    8766 ArrayType.element_solid_is_alive: ["n_timesteps", "n_solids"], 

    +

    8767 ArrayType.element_shell_is_alive: ["n_timesteps", "n_shells"], 

    +

    8768 ArrayType.element_beam_is_alive: ["n_timesteps", "n_beams"], 

    +

    8769 ArrayType.element_tshell_is_alive: ["n_timesteps", "n_tshells"], 

    +

    8770 }, 

    +

    8771 ) 

    +

    8772 

    +

    8773 array_dims = { 

    +

    8774 ArrayType.global_timesteps: 0, 

    +

    8775 ArrayType.element_solid_is_alive: 0, 

    +

    8776 ArrayType.element_shell_is_alive: 0, 

    +

    8777 ArrayType.element_beam_is_alive: 0, 

    +

    8778 ArrayType.element_tshell_is_alive: 0, 

    +

    8779 } 

    +

    8780 self.check_array_dims(array_dims, "n_timesteps") 

    +

    8781 

    +

    8782 array_dims = { 

    +

    8783 ArrayType.element_solid_node_indexes: 0, 

    +

    8784 ArrayType.element_solid_is_alive: 1, 

    +

    8785 } 

    +

    8786 self.check_array_dims(array_dims, "n_solids") 

    +

    8787 

    +

    8788 array_dims = { 

    +

    8789 ArrayType.element_beam_node_indexes: 0, 

    +

    8790 ArrayType.element_beam_is_alive: 1, 

    +

    8791 } 

    +

    8792 self.check_array_dims(array_dims, "n_beams") 

    +

    8793 

    +

    8794 array_dims = { 

    +

    8795 ArrayType.element_shell_node_indexes: 0, 

    +

    8796 ArrayType.element_shell_is_alive: 1, 

    +

    8797 } 

    +

    8798 self.check_array_dims(array_dims, "n_shells") 

    +

    8799 

    +

    8800 array_dims = { 

    +

    8801 ArrayType.element_tshell_node_indexes: 0, 

    +

    8802 ArrayType.element_tshell_is_alive: 1, 

    +

    8803 } 

    +

    8804 self.check_array_dims(array_dims, "n_tshells") 

    +

    8805 

    +

    8806 n_solids = settings.header["nel8"] 

    +

    8807 n_tshells = settings.header["nelth"] 

    +

    8808 n_shells = settings.header["nel4"] 

    +

    8809 n_beams = settings.header["nel2"] 

    +

    8810 

    +

    8811 # SOLID DELETION 

    +

    8812 array = ( 

    +

    8813 self.arrays[ArrayType.element_solid_is_alive][i_timestep] 

    +

    8814 if ArrayType.element_solid_is_alive in self.arrays 

    +

    8815 else np.ones(n_solids, dtype=settings.ftype) 

    +

    8816 ) 

    +

    8817 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    8818 

    +

    8819 # THICK SHELL DELETION 

    +

    8820 array = ( 

    +

    8821 self.arrays[ArrayType.element_tshell_is_alive][i_timestep] 

    +

    8822 if ArrayType.element_tshell_is_alive in self.arrays 

    +

    8823 else np.ones(n_tshells, dtype=settings.ftype) 

    +

    8824 ) 

    +

    8825 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    8826 

    +

    8827 # SHELL DELETION 

    +

    8828 array = ( 

    +

    8829 self.arrays[ArrayType.element_shell_is_alive][i_timestep] 

    +

    8830 if ArrayType.element_shell_is_alive in self.arrays 

    +

    8831 else np.ones(n_shells, dtype=settings.ftype) 

    +

    8832 ) 

    +

    8833 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    8834 

    +

    8835 # BEAM DELETION 

    +

    8836 array = ( 

    +

    8837 self.arrays[ArrayType.element_beam_is_alive][i_timestep] 

    +

    8838 if ArrayType.element_beam_is_alive in self.arrays 

    +

    8839 else np.ones(n_beams, dtype=settings.ftype) 

    +

    8840 ) 

    +

    8841 n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) 

    +

    8842 

    +

    8843 # check 

    +

    8844 n_bytes_expected = ( 

    +

    8845 settings.header["nel2"] 

    +

    8846 + settings.header["nel4"] 

    +

    8847 + abs(settings.header["nel8"]) 

    +

    8848 + settings.header["nelth"] 

    +

    8849 ) * settings.wordsize 

    +

    8850 

    +

    8851 else: 

    +

    8852 msg = f"Invalid mdlopt flag during write process: {settings.mdlopt}" 

    +

    8853 raise RuntimeError(msg) 

    +

    8854 

    +

    8855 # check bytes 

    +

    8856 if n_bytes_expected != n_bytes_written: 

    +

    8857 msg = ( 

    +

    8858 "byte checksum wrong: " 

    +

    8859 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    8860 ) 

    +

    8861 raise RuntimeError(msg) 

    +

    8862 

    +

    8863 # log 

    +

    8864 msg = "%s wrote %d bytes." 

    +

    8865 LOGGER.debug(msg, "_write_states_deletion_info", n_bytes_written) 

    +

    8866 

    +

    8867 return n_bytes_written 

    +

    8868 

    +

    8869 def _write_states_sph( 

    +

    8870 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    8871 ) -> int: 

    +

    8872 

    +

    8873 if settings.header["nmsph"] <= 0: 

    +

    8874 return 0 

    +

    8875 

    +

    8876 _check_ndim( 

    +

    8877 self, 

    +

    8878 { 

    +

    8879 ArrayType.sph_deletion: ["n_timesteps", "n_particles"], 

    +

    8880 ArrayType.sph_radius: ["n_timesteps", "n_particles"], 

    +

    8881 ArrayType.sph_pressure: ["n_timesteps", "n_particles"], 

    +

    8882 ArrayType.sph_stress: ["n_timesteps", "n_particles", "σx_σy_σz_σxy_σyz_σxz"], 

    +

    8883 ArrayType.sph_effective_plastic_strain: ["n_timesteps", "n_particles"], 

    +

    8884 ArrayType.sph_density: ["n_timesteps", "n_particles"], 

    +

    8885 ArrayType.sph_internal_energy: ["n_timesteps", "n_particles"], 

    +

    8886 ArrayType.sph_n_neighbors: ["n_timesteps", "n_particles"], 

    +

    8887 ArrayType.sph_strain: ["n_timesteps", "n_particles", "εx_εy_εz_εxy_εyz_εxz"], 

    +

    8888 ArrayType.sph_mass: ["n_timesteps", "n_particles"], 

    +

    8889 }, 

    +

    8890 ) 

    +

    8891 

    +

    8892 array_dims = { 

    +

    8893 ArrayType.global_timesteps: 0, 

    +

    8894 ArrayType.sph_deletion: 0, 

    +

    8895 ArrayType.sph_radius: 0, 

    +

    8896 ArrayType.sph_pressure: 0, 

    +

    8897 ArrayType.sph_stress: 0, 

    +

    8898 ArrayType.sph_effective_plastic_strain: 0, 

    +

    8899 ArrayType.sph_density: 0, 

    +

    8900 ArrayType.sph_internal_energy: 0, 

    +

    8901 ArrayType.sph_n_neighbors: 0, 

    +

    8902 ArrayType.sph_strain: 0, 

    +

    8903 ArrayType.sph_mass: 0, 

    +

    8904 } 

    +

    8905 self.check_array_dims(array_dims, "n_timesteps") 

    +

    8906 

    +

    8907 array_dims = { 

    +

    8908 ArrayType.sph_node_indexes: 0, 

    +

    8909 ArrayType.sph_deletion: 1, 

    +

    8910 ArrayType.sph_radius: 1, 

    +

    8911 ArrayType.sph_pressure: 1, 

    +

    8912 ArrayType.sph_stress: 1, 

    +

    8913 ArrayType.sph_effective_plastic_strain: 1, 

    +

    8914 ArrayType.sph_density: 1, 

    +

    8915 ArrayType.sph_internal_energy: 1, 

    +

    8916 ArrayType.sph_n_neighbors: 1, 

    +

    8917 ArrayType.sph_strain: 1, 

    +

    8918 ArrayType.sph_mass: 1, 

    +

    8919 } 

    +

    8920 n_particles = self.check_array_dims(array_dims, "n_particles") 

    +

    8921 self.check_array_dims({ArrayType.sph_stress: 2}, "σx_σy_σz_σxy_σyz_σxz", 6) 

    +

    8922 self.check_array_dims({ArrayType.sph_strain: 2}, "εx_εy_εz_εxy_εyz_εxz", 6) 

    +

    8923 

    +

    8924 n_sph_variables = settings.header["numsph"] 

    +

    8925 

    +

    8926 sph_data = np.zeros((n_particles, n_sph_variables)) 

    +

    8927 

    +

    8928 start_index = 0 

    +

    8929 end_index = 0 

    +

    8930 

    +

    8931 # SPH MATERIAL AND DELETION 

    +

    8932 start_index = 0 

    +

    8933 end_index = 1 

    +

    8934 array = ( 

    +

    8935 self.arrays[ArrayType.sph_deletion][i_timestep] 

    +

    8936 if ArrayType.sph_deletion in self.arrays 

    +

    8937 else np.ones(n_particles) 

    +

    8938 ) 

    +

    8939 sph_data[:, start_index:end_index] = array 

    +

    8940 

    +

    8941 # INFLUENCE RADIUS 

    +

    8942 if settings.header["isphfg2"]: 

    +

    8943 start_index = end_index 

    +

    8944 end_index = start_index + n_particles 

    +

    8945 if ArrayType.sph_radius in self.arrays: 

    +

    8946 array = self.arrays[ArrayType.sph_radius][i_timestep] 

    +

    8947 sph_data[:, start_index:end_index] = array 

    +

    8948 

    +

    8949 # PRESSURE 

    +

    8950 if settings.header["isphfg3"]: 

    +

    8951 start_index = end_index 

    +

    8952 end_index = start_index + n_particles 

    +

    8953 if ArrayType.sph_pressure in self.arrays: 

    +

    8954 array = self.arrays[ArrayType.sph_pressure][i_timestep] 

    +

    8955 sph_data[:, start_index:end_index] = array 

    +

    8956 

    +

    8957 # STRESS 

    +

    8958 if settings.header["isphfg4"]: 

    +

    8959 start_index = end_index 

    +

    8960 end_index = start_index + 6 * n_particles 

    +

    8961 if ArrayType.sph_stress in self.arrays: 

    +

    8962 array = self.arrays[ArrayType.sph_stress][i_timestep] 

    +

    8963 sph_data[:, start_index:end_index] = array 

    +

    8964 

    +

    8965 # PSTRAIN 

    +

    8966 if settings.header["isphfg5"]: 

    +

    8967 start_index = end_index 

    +

    8968 end_index = start_index + n_particles 

    +

    8969 if ArrayType.sph_effective_plastic_strain in self.arrays: 

    +

    8970 array = self.arrays[ArrayType.sph_effective_plastic_strain][i_timestep] 

    +

    8971 sph_data[:, start_index:end_index] = array 

    +

    8972 

    +

    8973 # DENSITY 

    +

    8974 if settings.header["isphfg6"]: 

    +

    8975 start_index = end_index 

    +

    8976 end_index = start_index + n_particles 

    +

    8977 if ArrayType.sph_density in self.arrays: 

    +

    8978 array = self.arrays[ArrayType.sph_density][i_timestep] 

    +

    8979 sph_data[:, start_index:end_index] = array 

    +

    8980 

    +

    8981 # INTERNAL ENERGY 

    +

    8982 if settings.header["isphfg7"]: 

    +

    8983 start_index = end_index 

    +

    8984 end_index = start_index + n_particles 

    +

    8985 if ArrayType.sph_internal_energy in self.arrays: 

    +

    8986 array = self.arrays[ArrayType.sph_internal_energy][i_timestep] 

    +

    8987 sph_data[:, start_index:end_index] = array 

    +

    8988 

    +

    8989 # INTERNAL ENERGY 

    +

    8990 if settings.header["isphfg8"]: 

    +

    8991 start_index = end_index 

    +

    8992 end_index = start_index + n_particles 

    +

    8993 if ArrayType.sph_n_neighbors in self.arrays: 

    +

    8994 array = self.arrays[ArrayType.sph_n_neighbors][i_timestep] 

    +

    8995 sph_data[:, start_index:end_index] = array 

    +

    8996 

    +

    8997 # STRAIN 

    +

    8998 if settings.header["isphfg9"]: 

    +

    8999 start_index = end_index 

    +

    9000 end_index = start_index + n_particles * 6 

    +

    9001 if ArrayType.sph_strain in self.arrays: 

    +

    9002 array = self.arrays[ArrayType.sph_strain][i_timestep] 

    +

    9003 sph_data[:, start_index:end_index] = array 

    +

    9004 

    +

    9005 # MASS 

    +

    9006 if settings.header["isphfg10"]: 

    +

    9007 start_index = end_index 

    +

    9008 end_index = start_index + n_particles 

    +

    9009 if ArrayType.sph_mass in self.arrays: 

    +

    9010 array = self.arrays[ArrayType.sph_mass][i_timestep] 

    +

    9011 sph_data[:, start_index:end_index] = array 

    +

    9012 

    +

    9013 n_bytes_written = fp.write(settings.pack(sph_data, dtype_hint=np.floating)) 

    +

    9014 

    +

    9015 # check bytes 

    +

    9016 n_bytes_expected = ( 

    +

    9017 settings.header["nv2d"] 

    +

    9018 * (settings.header["nel4"] - settings.header["numrbe"]) 

    +

    9019 * settings.wordsize 

    +

    9020 ) 

    +

    9021 if n_bytes_expected != n_bytes_written: 

    +

    9022 msg = ( 

    +

    9023 "byte checksum wrong: " 

    +

    9024 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    9025 ) 

    +

    9026 raise RuntimeError(msg) 

    +

    9027 

    +

    9028 # log 

    +

    9029 msg = "%s wrote %d bytes." 

    +

    9030 LOGGER.debug(msg, "_write_states_sph", n_bytes_written) 

    +

    9031 

    +

    9032 return n_bytes_written 

    +

    9033 

    +

    9034 def _write_states_airbags( 

    +

    9035 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    9036 ) -> int: 

    +

    9037 

    +

    9038 if settings.header["npefg"] <= 0: 

    +

    9039 return 0 

    +

    9040 

    +

    9041 _check_ndim( 

    +

    9042 self, 

    +

    9043 { 

    +

    9044 ArrayType.airbag_n_active_particles: ["n_timesteps", "n_airbags"], 

    +

    9045 ArrayType.airbag_bag_volume: ["n_timesteps", "n_airbags"], 

    +

    9046 ArrayType.airbag_particle_gas_id: ["n_timesteps", "n_particles"], 

    +

    9047 ArrayType.airbag_particle_chamber_id: ["n_timesteps", "n_particles"], 

    +

    9048 ArrayType.airbag_particle_leakage: ["n_timesteps", "n_particles"], 

    +

    9049 ArrayType.airbag_particle_mass: ["n_timesteps", "n_particles"], 

    +

    9050 ArrayType.airbag_particle_radius: ["n_timesteps", "n_particles"], 

    +

    9051 ArrayType.airbag_particle_spin_energy: ["n_timesteps", "n_particles"], 

    +

    9052 ArrayType.airbag_particle_translation_energy: ["n_timesteps", "n_particles"], 

    +

    9053 ArrayType.airbag_particle_nearest_segment_distance: ["n_timesteps", "n_particles"], 

    +

    9054 ArrayType.airbag_particle_position: ["n_timesteps", "n_particles", "x_y_z"], 

    +

    9055 ArrayType.airbag_particle_velocity: ["n_timesteps", "n_particles", "vx_vy_vz"], 

    +

    9056 }, 

    +

    9057 ) 

    +

    9058 

    +

    9059 array_dims = { 

    +

    9060 ArrayType.global_timesteps: 0, 

    +

    9061 ArrayType.airbag_n_active_particles: 0, 

    +

    9062 ArrayType.airbag_bag_volume: 0, 

    +

    9063 } 

    +

    9064 self.check_array_dims(array_dims, "n_timesteps") 

    +

    9065 

    +

    9066 array_dims = { 

    +

    9067 ArrayType.airbags_ids: 0, 

    +

    9068 ArrayType.airbag_n_active_particles: 1, 

    +

    9069 ArrayType.airbag_bag_volume: 1, 

    +

    9070 } 

    +

    9071 n_airbags = self.check_array_dims(array_dims, "n_airbags") 

    +

    9072 assert n_airbags == settings.header["npefg"] % 1000 

    +

    9073 

    +

    9074 array_dims = { 

    +

    9075 ArrayType.global_timesteps: 0, 

    +

    9076 ArrayType.airbag_particle_gas_id: 0, 

    +

    9077 ArrayType.airbag_particle_chamber_id: 0, 

    +

    9078 ArrayType.airbag_particle_leakage: 0, 

    +

    9079 ArrayType.airbag_particle_mass: 0, 

    +

    9080 ArrayType.airbag_particle_radius: 0, 

    +

    9081 ArrayType.airbag_particle_spin_energy: 0, 

    +

    9082 ArrayType.airbag_particle_translation_energy: 0, 

    +

    9083 ArrayType.airbag_particle_nearest_segment_distance: 0, 

    +

    9084 ArrayType.airbag_particle_position: 0, 

    +

    9085 ArrayType.airbag_particle_velocity: 0, 

    +

    9086 } 

    +

    9087 self.check_array_dims(array_dims, "n_timesteps") 

    +

    9088 

    +

    9089 array_dims = { 

    +

    9090 ArrayType.airbag_particle_gas_id: 1, 

    +

    9091 ArrayType.airbag_particle_chamber_id: 1, 

    +

    9092 ArrayType.airbag_particle_leakage: 1, 

    +

    9093 ArrayType.airbag_particle_mass: 1, 

    +

    9094 ArrayType.airbag_particle_radius: 1, 

    +

    9095 ArrayType.airbag_particle_spin_energy: 1, 

    +

    9096 ArrayType.airbag_particle_translation_energy: 1, 

    +

    9097 ArrayType.airbag_particle_nearest_segment_distance: 1, 

    +

    9098 ArrayType.airbag_particle_position: 1, 

    +

    9099 ArrayType.airbag_particle_velocity: 1, 

    +

    9100 } 

    +

    9101 n_particles = self.check_array_dims(array_dims, "n_particles") 

    +

    9102 

    +

    9103 self.check_array_dims({ArrayType.airbag_particle_position: 2}, "x_y_z", 3) 

    +

    9104 

    +

    9105 self.check_array_dims({ArrayType.airbag_particle_velocity: 2}, "vx_vy_vz", 3) 

    +

    9106 

    +

    9107 # Info: 

    +

    9108 # we cast integers to floats here (no conversion, just a cast) 

    +

    9109 # to be able to concatenate the arrays while preserving the 

    +

    9110 # bytes internally. 

    +

    9111 

    +

    9112 # AIRBAG STATE DATA 

    +

    9113 airbag_n_active_particles = ( 

    +

    9114 self.arrays[ArrayType.airbag_n_active_particles][i_timestep] 

    +

    9115 if ArrayType.airbag_n_active_particles in self.arrays 

    +

    9116 else np.zeros(n_airbags, dtype=settings.itype) 

    +

    9117 ) 

    +

    9118 airbag_n_active_particles = airbag_n_active_particles.view(settings.ftype) 

    +

    9119 

    +

    9120 airbag_bag_volume = ( 

    +

    9121 self.arrays[ArrayType.airbag_bag_volume][i_timestep] 

    +

    9122 if ArrayType.airbag_bag_volume in self.arrays 

    +

    9123 else np.zeros(n_airbags, dtype=settings.ftype) 

    +

    9124 ) 

    +

    9125 

    +

    9126 airbag_data = np.concatenate( 

    +

    9127 [ 

    +

    9128 airbag_n_active_particles.reshape(n_airbags, 1), 

    +

    9129 airbag_bag_volume.reshape(n_airbags, 1), 

    +

    9130 ], 

    +

    9131 axis=1, 

    +

    9132 ) 

    +

    9133 n_bytes_written = fp.write(settings.pack(airbag_data, dtype_hint=np.floating)) 

    +

    9134 

    +

    9135 # particle var names 

    +

    9136 array_particle_list = [] 

    +

    9137 

    +

    9138 # PARTICLE GAS ID 

    +

    9139 array = ( 

    +

    9140 self.arrays[ArrayType.airbag_particle_gas_id][i_timestep] 

    +

    9141 if ArrayType.airbag_particle_gas_id in self.arrays 

    +

    9142 else np.zeros(n_particles, dtype=settings.itype) 

    +

    9143 ) 

    +

    9144 array = array.view(settings.ftype) 

    +

    9145 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9146 

    +

    9147 # PARTICLE CHAMBER ID 

    +

    9148 array = ( 

    +

    9149 self.arrays[ArrayType.airbag_particle_chamber_id][i_timestep] 

    +

    9150 if ArrayType.airbag_particle_chamber_id in self.arrays 

    +

    9151 else np.zeros(n_particles, dtype=settings.itype) 

    +

    9152 ) 

    +

    9153 array = array.view(settings.ftype) 

    +

    9154 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9155 

    +

    9156 # PARTICLE LEAKAGE 

    +

    9157 array = ( 

    +

    9158 self.arrays[ArrayType.airbag_particle_leakage][i_timestep] 

    +

    9159 if ArrayType.airbag_particle_leakage in self.arrays 

    +

    9160 else np.zeros(n_particles, dtype=settings.itype) 

    +

    9161 ) 

    +

    9162 array = array.view(settings.ftype) 

    +

    9163 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9164 

    +

    9165 # PARTICLE POSITION 

    +

    9166 array = ( 

    +

    9167 self.arrays[ArrayType.airbag_particle_position][i_timestep] 

    +

    9168 if ArrayType.airbag_particle_position in self.arrays 

    +

    9169 else np.zeros((n_particles, 3), dtype=settings.ftype) 

    +

    9170 ) 

    +

    9171 array_particle_list.append(array) 

    +

    9172 

    +

    9173 # PARTICLE VELOCITY 

    +

    9174 array = ( 

    +

    9175 self.arrays[ArrayType.airbag_particle_velocity][i_timestep] 

    +

    9176 if ArrayType.airbag_particle_velocity in self.arrays 

    +

    9177 else np.zeros((n_particles, 3), dtype=settings.ftype) 

    +

    9178 ) 

    +

    9179 array_particle_list.append(array) 

    +

    9180 

    +

    9181 # PARTICLE MASS 

    +

    9182 array = ( 

    +

    9183 self.arrays[ArrayType.airbag_particle_mass][i_timestep] 

    +

    9184 if ArrayType.airbag_particle_mass in self.arrays 

    +

    9185 else np.zeros(n_particles, dtype=settings.ftype) 

    +

    9186 ) 

    +

    9187 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9188 

    +

    9189 # PARTICLE RADIUS 

    +

    9190 array = ( 

    +

    9191 self.arrays[ArrayType.airbag_particle_radius][i_timestep] 

    +

    9192 if ArrayType.airbag_particle_radius in self.arrays 

    +

    9193 else np.zeros(n_particles, dtype=settings.ftype) 

    +

    9194 ) 

    +

    9195 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9196 

    +

    9197 # PARTICLE SPIN ENERGY 

    +

    9198 array = ( 

    +

    9199 self.arrays[ArrayType.airbag_particle_spin_energy][i_timestep] 

    +

    9200 if ArrayType.airbag_particle_spin_energy in self.arrays 

    +

    9201 else np.zeros(n_particles, dtype=settings.ftype) 

    +

    9202 ) 

    +

    9203 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9204 

    +

    9205 # PARTICLE TRANSL ENERGY 

    +

    9206 array = ( 

    +

    9207 self.arrays[ArrayType.airbag_particle_translation_energy][i_timestep] 

    +

    9208 if ArrayType.airbag_particle_translation_energy in self.arrays 

    +

    9209 else np.zeros(n_particles, dtype=settings.ftype) 

    +

    9210 ) 

    +

    9211 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9212 

    +

    9213 # PARTICLE NEAREST NEIGHBOR DISTANCE 

    +

    9214 array = ( 

    +

    9215 self.arrays[ArrayType.airbag_particle_nearest_segment_distance][i_timestep] 

    +

    9216 if ArrayType.airbag_particle_nearest_segment_distance in self.arrays 

    +

    9217 else np.zeros(n_particles, dtype=settings.ftype) 

    +

    9218 ) 

    +

    9219 array_particle_list.append(array.reshape(-1, 1)) 

    +

    9220 

    +

    9221 airbag_particle_data = np.concatenate(array_particle_list, axis=1) 

    +

    9222 n_bytes_written += fp.write(settings.pack(airbag_particle_data, dtype_hint=np.floating)) 

    +

    9223 

    +

    9224 # check bytes 

    +

    9225 n_bytes_expected = (2 * n_airbags + n_particles * 14) * settings.wordsize 

    +

    9226 if n_bytes_expected != n_bytes_written: 

    +

    9227 msg = ( 

    +

    9228 "byte checksum wrong: " 

    +

    9229 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    9230 ) 

    +

    9231 raise RuntimeError(msg) 

    +

    9232 

    +

    9233 # log 

    +

    9234 msg = "%s wrote %d bytes." 

    +

    9235 LOGGER.debug(msg, "_write_states_airbags", n_bytes_written) 

    +

    9236 

    +

    9237 return n_bytes_written 

    +

    9238 

    +

    9239 def _write_states_rigid_road( 

    +

    9240 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    9241 ) -> int: 

    +

    9242 

    +

    9243 if settings.header["ndim"] <= 5: 

    +

    9244 return 0 

    +

    9245 

    +

    9246 _check_ndim( 

    +

    9247 self, 

    +

    9248 { 

    +

    9249 ArrayType.rigid_road_displacement: ["n_timesteps", "n_rigid_roads", "x_y_z"], 

    +

    9250 ArrayType.rigid_road_velocity: ["n_timesteps", "n_rigid_roads", "vx_vy_vz"], 

    +

    9251 }, 

    +

    9252 ) 

    +

    9253 

    +

    9254 array_dims = { 

    +

    9255 ArrayType.global_timesteps: 0, 

    +

    9256 ArrayType.rigid_road_displacement: 0, 

    +

    9257 ArrayType.rigid_road_velocity: 0, 

    +

    9258 } 

    +

    9259 self.check_array_dims(array_dims, "n_rigid_roads") 

    +

    9260 

    +

    9261 array_dims = { 

    +

    9262 ArrayType.rigid_road_segment_road_id: 0, 

    +

    9263 ArrayType.rigid_road_displacement: 1, 

    +

    9264 ArrayType.rigid_road_velocity: 1, 

    +

    9265 } 

    +

    9266 n_rigid_roads = self.check_array_dims(array_dims, "n_rigid_roads") 

    +

    9267 

    +

    9268 self.check_array_dims({ArrayType.rigid_road_displacement: 2}, "x_y_z", 3) 

    +

    9269 

    +

    9270 self.check_array_dims({ArrayType.rigid_road_velocity: 2}, "vx_vy_vz", 3) 

    +

    9271 

    +

    9272 rigid_road_data = np.zeros((n_rigid_roads, 2, 3), dtype=settings.ftype) 

    +

    9273 

    +

    9274 # RIGID ROAD DISPLACEMENT 

    +

    9275 if ArrayType.rigid_road_displacement in self.arrays: 

    +

    9276 array = self.arrays[ArrayType.rigid_road_displacement][i_timestep] 

    +

    9277 rigid_road_data[:, 0, :] = array 

    +

    9278 

    +

    9279 # RIGID ROAD VELOCITY 

    +

    9280 if ArrayType.rigid_road_velocity in self.arrays: 

    +

    9281 array = self.arrays[ArrayType.rigid_road_velocity][i_timestep] 

    +

    9282 rigid_road_data[:, 1, :] = array 

    +

    9283 

    +

    9284 n_bytes_written = fp.write(settings.pack(rigid_road_data, dtype_hint=np.floating)) 

    +

    9285 

    +

    9286 # check bytes 

    +

    9287 n_bytes_expected = settings.header["nv1d"] * settings.header["nel2"] * settings.wordsize 

    +

    9288 if n_bytes_expected != n_bytes_written: 

    +

    9289 msg = ( 

    +

    9290 "byte checksum wrong: " 

    +

    9291 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    9292 ) 

    +

    9293 raise RuntimeError(msg) 

    +

    9294 

    +

    9295 # log 

    +

    9296 msg = "%s wrote %d bytes." 

    +

    9297 LOGGER.debug(msg, "_write_states_rigid_road", n_bytes_written) 

    +

    9298 

    +

    9299 return n_bytes_written 

    +

    9300 

    +

    9301 def _write_states_rigid_bodies( 

    +

    9302 self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings 

    +

    9303 ) -> int: 

    +

    9304 

    +

    9305 if 8 <= settings.header["ndim"] <= 9: 

    +

    9306 pass 

    +

    9307 else: 

    +

    9308 return 0 

    +

    9309 

    +

    9310 has_reduced_data = settings.header["ndim"] == 9 

    +

    9311 

    +

    9312 _check_ndim( 

    +

    9313 self, 

    +

    9314 { 

    +

    9315 ArrayType.rigid_body_coordinates: ["n_timesteps", "n_rigid_bodies", "x_y_z"], 

    +

    9316 ArrayType.rigid_body_rotation_matrix: ["n_timesteps", "n_rigid_bodies", "matrix"], 

    +

    9317 ArrayType.rigid_body_velocity: ["n_timesteps", "n_rigid_bodies", "vx_vy_vz"], 

    +

    9318 ArrayType.rigid_body_rot_velocity: ["n_timesteps", "n_rigid_bodies", "rvx_rvy_rvz"], 

    +

    9319 ArrayType.rigid_body_acceleration: ["n_timesteps", "n_rigid_bodies", "ax_ay_az"], 

    +

    9320 ArrayType.rigid_body_rot_acceleration: [ 

    +

    9321 "n_timesteps", 

    +

    9322 "n_rigid_bodies", 

    +

    9323 "rax_ray_raz", 

    +

    9324 ], 

    +

    9325 }, 

    +

    9326 ) 

    +

    9327 

    +

    9328 array_dims = { 

    +

    9329 ArrayType.global_timesteps: 0, 

    +

    9330 ArrayType.rigid_body_coordinates: 0, 

    +

    9331 ArrayType.rigid_body_rotation_matrix: 0, 

    +

    9332 ArrayType.rigid_body_velocity: 0, 

    +

    9333 ArrayType.rigid_body_rot_velocity: 0, 

    +

    9334 ArrayType.rigid_body_acceleration: 0, 

    +

    9335 ArrayType.rigid_body_rot_acceleration: 0, 

    +

    9336 } 

    +

    9337 self.check_array_dims(array_dims, "n_timesteps") 

    +

    9338 

    +

    9339 array_dims = { 

    +

    9340 ArrayType.rigid_body_part_indexes: 1, 

    +

    9341 ArrayType.rigid_body_coordinates: 1, 

    +

    9342 ArrayType.rigid_body_rotation_matrix: 1, 

    +

    9343 ArrayType.rigid_body_velocity: 1, 

    +

    9344 ArrayType.rigid_body_rot_velocity: 1, 

    +

    9345 ArrayType.rigid_body_acceleration: 1, 

    +

    9346 ArrayType.rigid_body_rot_acceleration: 1, 

    +

    9347 } 

    +

    9348 n_rigid_bodies = self.check_array_dims(array_dims, "n_rigid_bodies") 

    +

    9349 

    +

    9350 self.check_array_dims({ArrayType.rigid_body_coordinates: 2}, "x_y_z", 3) 

    +

    9351 

    +

    9352 self.check_array_dims({ArrayType.rigid_body_rotation_matrix: 2}, "matrix", 9) 

    +

    9353 

    +

    9354 self.check_array_dims({ArrayType.rigid_body_velocity: 2}, "vx_vy_vz", 3) 

    +

    9355 

    +

    9356 self.check_array_dims({ArrayType.rigid_body_rot_velocity: 2}, "rvx_rvy_rvz", 3) 

    +

    9357 

    +

    9358 self.check_array_dims({ArrayType.rigid_body_acceleration: 2}, "ax_ay_az", 3) 

    +

    9359 

    +

    9360 self.check_array_dims({ArrayType.rigid_body_rot_acceleration: 2}, "rax_ray_raz", 3) 

    +

    9361 

    +

    9362 # allocate block 

    +

    9363 rigid_body_data = ( 

    +

    9364 np.zeros((n_rigid_bodies, 12), dtype=settings.ftype) 

    +

    9365 if has_reduced_data 

    +

    9366 else np.zeros((n_rigid_bodies, 24), dtype=settings.ftype) 

    +

    9367 ) 

    +

    9368 

    +

    9369 start_index = 0 

    +

    9370 end_index = 0 

    +

    9371 

    +

    9372 # COORDINATES 

    +

    9373 if ArrayType.rigid_body_coordinates in self.arrays: 

    +

    9374 start_index = end_index 

    +

    9375 end_index = start_index + 3 

    +

    9376 array = self.arrays[ArrayType.rigid_body_coordinates][i_timestep] 

    +

    9377 rigid_body_data[:, start_index:end_index] = array 

    +

    9378 

    +

    9379 # ROTATION MATRIX 

    +

    9380 if ArrayType.rigid_body_rotation_matrix in self.arrays: 

    +

    9381 start_index = end_index 

    +

    9382 end_index = start_index + 9 

    +

    9383 array = self.arrays[ArrayType.rigid_body_coordinates][i_timestep] 

    +

    9384 rigid_body_data[:, start_index:end_index] = array 

    +

    9385 

    +

    9386 if not has_reduced_data: 

    +

    9387 

    +

    9388 # VELOCITY 

    +

    9389 if ArrayType.rigid_body_velocity in self.arrays: 

    +

    9390 start_index = end_index 

    +

    9391 end_index = start_index + 3 

    +

    9392 array = self.arrays[ArrayType.rigid_body_velocity][i_timestep] 

    +

    9393 rigid_body_data[:, start_index:end_index] = array 

    +

    9394 

    +

    9395 # ROTATION VELOCITY 

    +

    9396 if ArrayType.rigid_body_rot_velocity in self.arrays: 

    +

    9397 start_index = end_index 

    +

    9398 end_index = start_index + 3 

    +

    9399 array = self.arrays[ArrayType.rigid_body_rot_velocity][i_timestep] 

    +

    9400 rigid_body_data[:, start_index:end_index] = array 

    +

    9401 

    +

    9402 # ACCELERATION 

    +

    9403 if ArrayType.rigid_body_acceleration in self.arrays: 

    +

    9404 start_index = end_index 

    +

    9405 end_index = start_index + 3 

    +

    9406 array = self.arrays[ArrayType.rigid_body_acceleration][i_timestep] 

    +

    9407 rigid_body_data[:, start_index:end_index] = array 

    +

    9408 

    +

    9409 # ROTATION ACCELERATION 

    +

    9410 if ArrayType.rigid_body_rot_acceleration in self.arrays: 

    +

    9411 start_index = end_index 

    +

    9412 end_index = start_index + 3 

    +

    9413 array = self.arrays[ArrayType.rigid_body_rot_acceleration][i_timestep] 

    +

    9414 rigid_body_data[:, start_index:end_index] = array 

    +

    9415 

    +

    9416 n_bytes_written = fp.write(settings.pack(rigid_body_data, dtype_hint=np.floating)) 

    +

    9417 

    +

    9418 # check bytes 

    +

    9419 n_bytes_expected = settings.header["nv1d"] * settings.header["nel2"] * settings.wordsize 

    +

    9420 if n_bytes_expected != n_bytes_written: 

    +

    9421 msg = ( 

    +

    9422 "byte checksum wrong: " 

    +

    9423 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    9424 ) 

    +

    9425 raise RuntimeError(msg) 

    +

    9426 

    +

    9427 # log 

    +

    9428 msg = "%s wrote %d bytes." 

    +

    9429 LOGGER.debug(msg, "_write_states_rigid_bodies", n_bytes_written) 

    +

    9430 

    +

    9431 return n_bytes_written 

    +

    9432 

    +

    9433 def check_array_dims( 

    +

    9434 self, array_dimensions: Dict[str, int], dimension_name: str, dimension_size: int = -1 

    +

    9435 ): 

    +

    9436 """This function checks if multiple arrays share an array dimensions 

    +

    9437 with the same size. 

    +

    9438 

    +

    9439 Parameters 

    +

    9440 ---------- 

    +

    9441 array_dimensions: Dict[str, int] 

    +

    9442 Array name and expected number of dimensions as dict 

    +

    9443 dimension_name: str 

    +

    9444 Name of the array dimension for error messages 

    +

    9445 dimension_size: int 

    +

    9446 Optional expected size. If not set then all entries must equal 

    +

    9447 the first value collected. 

    +

    9448 

    +

    9449 Raises 

    +

    9450 ------ 

    +

    9451 ValueError 

    +

    9452 If dimensions do not match in any kind of way. 

    +

    9453 """ 

    +

    9454 

    +

    9455 dimension_size_dict = {} 

    +

    9456 

    +

    9457 # collect all dimensions 

    +

    9458 for typename, dimension_index in array_dimensions.items(): 

    +

    9459 if typename not in self.arrays: 

    +

    9460 continue 

    +

    9461 

    +

    9462 array = self.arrays[typename] 

    +

    9463 

    +

    9464 if dimension_index >= array.ndim: 

    +

    9465 msg = ( 

    +

    9466 f"Array '{typename}' requires at least " 

    +

    9467 f"{dimension_index} dimensions ({dimension_name})" 

    +

    9468 ) 

    +

    9469 raise ValueError(msg) 

    +

    9470 

    +

    9471 dimension_size_dict[typename] = array.shape[dimension_index] 

    +

    9472 

    +

    9473 # static dimension 

    +

    9474 if dimension_size >= 0: 

    +

    9475 arrays_with_wrong_dims = { 

    +

    9476 typename: size 

    +

    9477 for typename, size in dimension_size_dict.items() 

    +

    9478 if size != dimension_size 

    +

    9479 } 

    +

    9480 

    +

    9481 if arrays_with_wrong_dims: 

    +

    9482 msg = "The dimension %s of the following arrays is expected to have size %d:\n%s" 

    +

    9483 msg_arrays = [ 

    +

    9484 f" - name: {typename} dim: {array_dimensions[typename]} size: {size}" 

    +

    9485 for typename, size in arrays_with_wrong_dims.items() 

    +

    9486 ] 

    +

    9487 raise ValueError(msg, dimension_name, dimension_size, "\n".join(msg_arrays)) 

    +

    9488 

    +

    9489 # dynamic dimensions 

    +

    9490 else: 

    +

    9491 if dimension_size_dict: 

    +

    9492 unique_sizes = np.unique(list(dimension_size_dict.values())) 

    +

    9493 if len(unique_sizes) > 1: 

    +

    9494 msg = "Inconsistency in array dim '%d' detected:\n%s" 

    +

    9495 size_list = [ 

    +

    9496 f" - name: {typename}, dim: {array_dimensions[typename]}, size: {size}" 

    +

    9497 for typename, size in dimension_size_dict.items() 

    +

    9498 ] 

    +

    9499 raise ValueError(msg, dimension_name, "\n".join(size_list)) 

    +

    9500 if len(unique_sizes) == 1: 

    +

    9501 dimension_size = unique_sizes[0] 

    +

    9502 

    +

    9503 if dimension_size < 0: 

    +

    9504 return 0 

    +

    9505 

    +

    9506 return dimension_size 

    +

    9507 

    +

    9508 @staticmethod 

    +

    9509 def _compare_n_bytes_checksum(n_bytes_written: int, n_bytes_expected: int): 

    +

    9510 """Throw if the byte checksum was not ok 

    +

    9511 

    +

    9512 Parameters 

    +

    9513 ---------- 

    +

    9514 n_bytes_written: int 

    +

    9515 bytes written to the file 

    +

    9516 n_bytes_expected: int 

    +

    9517 bytes expected from the header computation 

    +

    9518 

    +

    9519 Raises 

    +

    9520 ------ 

    +

    9521 RuntimeError 

    +

    9522 If the byte count doesn't match. 

    +

    9523 """ 

    +

    9524 if n_bytes_expected != n_bytes_written: 

    +

    9525 msg = ( 

    +

    9526 "byte checksum wrong: " 

    +

    9527 f"{n_bytes_expected} (header) != {n_bytes_written} (checksum)" 

    +

    9528 ) 

    +

    9529 raise RuntimeError(msg) 

    +

    9530 

    +

    9531 def _get_zero_byte_padding(self, n_bytes_written: int, block_size_bytes: int): 

    +

    9532 """Compute the zero byte-padding at the end of files 

    +

    9533 

    +

    9534 Parameters 

    +

    9535 ---------- 

    +

    9536 n_bytes_written: int 

    +

    9537 number of bytes already written to file 

    +

    9538 block_size_bytes: int 

    +

    9539 byte block size of the file 

    +

    9540 

    +

    9541 Returns 

    +

    9542 ------- 

    +

    9543 zero_bytes: bytes 

    +

    9544 zero-byte padding ready to be written to the file 

    +

    9545 """ 

    +

    9546 

    +

    9547 if block_size_bytes > 0: 

    +

    9548 remaining_bytes = n_bytes_written % block_size_bytes 

    +

    9549 n_bytes_to_fill = block_size_bytes - remaining_bytes if remaining_bytes != 0 else 0 

    +

    9550 return b"\x00" * n_bytes_to_fill 

    +

    9551 

    +

    9552 return b"" 

    +

    9553 

    +

    9554 def compare(self, d3plot2, array_eps: Union[float, None] = None): 

    +

    9555 """Compare two d3plots and print the info 

    +

    9556 

    +

    9557 Parameters 

    +

    9558 ---------- 

    +

    9559 d3plot2: D3plot 

    +

    9560 second d3plot 

    +

    9561 array_eps: float or None 

    +

    9562 tolerance for arrays 

    +

    9563 

    +

    9564 Returns 

    +

    9565 ------- 

    +

    9566 hdr_differences: dict 

    +

    9567 differences in the header 

    +

    9568 array_differences: dict 

    +

    9569 difference between arrays as message 

    +

    9570 

    +

    9571 Examples 

    +

    9572 -------- 

    +

    9573 Comparison of a femzipped file and an uncompressed file. Femzip 

    +

    9574 is a lossy compression, thus precision is traded for memory. 

    +

    9575 

    +

    9576 >>> d3plot1 = D3plot("path/to/d3plot") 

    +

    9577 >>> d3plot2 = D3plot("path/to/d3plot.fz") 

    +

    9578 >>> hdr_diff, array_diff = d3plot1.compare(d3plot2) 

    +

    9579 >>> for arraytype, msg in array_diff.items(): 

    +

    9580 >>> print(name, msg) 

    +

    9581 node_coordinates Δmax = 0.050048828125 

    +

    9582 node_displacement Δmax = 0.050048828125 

    +

    9583 node_velocity Δmax = 0.050048828125 

    +

    9584 node_acceleration Δmax = 49998984.0 

    +

    9585 element_beam_axial_force Δmax = 6.103515625e-05 

    +

    9586 element_shell_stress Δmax = 0.0005035400390625 

    +

    9587 element_shell_thickness Δmax = 9.999999717180685e-10 

    +

    9588 element_shell_unknown_variables Δmax = 0.0005000010132789612 

    +

    9589 element_shell_internal_energy Δmax = 188.41957092285156 

    +

    9590 

    +

    9591 """ 

    +

    9592 

    +

    9593 # pylint: disable = too-many-nested-blocks 

    +

    9594 

    +

    9595 assert isinstance(d3plot2, D3plot) 

    +

    9596 d3plot1 = self 

    +

    9597 

    +

    9598 hdr_differences = d3plot1.header.compare(d3plot2.header) 

    +

    9599 

    +

    9600 # ARRAY COMPARISON 

    +

    9601 array_differences = {} 

    +

    9602 

    +

    9603 array_names = list(d3plot1.arrays.keys()) + list(d3plot2.arrays.keys()) 

    +

    9604 

    +

    9605 for name in array_names: 

    +

    9606 

    +

    9607 array1 = ( 

    +

    9608 d3plot1.arrays[name] if name in d3plot1.arrays else "Array is missing in original" 

    +

    9609 ) 

    +

    9610 

    +

    9611 array2 = d3plot2.arrays[name] if name in d3plot2.arrays else "Array is missing in other" 

    +

    9612 

    +

    9613 # d3parts write results for rigid shells. 

    +

    9614 # when rewriting as d3plot we simply 

    +

    9615 # don't write the part_material_types 

    +

    9616 # array which is the same as having no 

    +

    9617 # rigid shells. 

    +

    9618 d3plot1_is_d3part = d3plot1.header.filetype == D3plotFiletype.D3PART 

    +

    9619 d3plot2_is_d3part = d3plot2.header.filetype == D3plotFiletype.D3PART 

    +

    9620 if name == "part_material_type" and (d3plot1_is_d3part or d3plot2_is_d3part): 

    +

    9621 continue 

    +

    9622 

    +

    9623 # we have an array to compare 

    +

    9624 if isinstance(array1, str): 

    +

    9625 array_differences[name] = array1 

    +

    9626 elif isinstance(array2, str): 

    +

    9627 array_differences[name] = array2 

    +

    9628 elif isinstance(array2, np.ndarray): 

    +

    9629 comparison = False 

    +

    9630 

    +

    9631 # compare arrays 

    +

    9632 if isinstance(array1, np.ndarray): 

    +

    9633 if array1.shape != array2.shape: 

    +

    9634 comparison = f"shape mismatch {array1.shape} != {array2.shape}" 

    +

    9635 else: 

    +

    9636 if np.issubdtype(array1.dtype, np.number) and np.issubdtype( 

    +

    9637 array2.dtype, np.number 

    +

    9638 ): 

    +

    9639 diff = np.abs(array1 - array2) 

    +

    9640 if diff.size: 

    +

    9641 if array_eps is not None: 

    +

    9642 diff2 = diff[diff > array_eps] 

    +

    9643 if diff2.size: 

    +

    9644 diff2_max = diff2.max() 

    +

    9645 if diff2_max: 

    +

    9646 comparison = f"Δmax = {diff2_max}" 

    +

    9647 else: 

    +

    9648 diff_max = diff.max() 

    +

    9649 if diff_max: 

    +

    9650 comparison = f"Δmax = {diff_max}" 

    +

    9651 else: 

    +

    9652 n_mismatches = (array1 != array2).sum() 

    +

    9653 if n_mismatches: 

    +

    9654 comparison = f"Mismatches: {n_mismatches}" 

    +

    9655 

    +

    9656 else: 

    +

    9657 comparison = "Arrays don't match" 

    +

    9658 

    +

    9659 # print 

    +

    9660 if comparison: 

    +

    9661 array_differences[name] = comparison 

    +

    9662 

    +

    9663 return hdr_differences, array_differences 

    +

    9664 

    +

    9665 def get_part_filter( 

    +

    9666 self, filter_type: FilterType, part_ids: Iterable[int], for_state_array: bool = True 

    +

    9667 ) -> np.ndarray: 

    +

    9668 """Get a part filter for different entities 

    +

    9669 

    +

    9670 Parameters 

    +

    9671 ---------- 

    +

    9672 filter_type: lasso.dyna.FilterType 

    +

    9673 the array type to filter for (beam, shell, solid, tshell, node) 

    +

    9674 part_ids: Iterable[int] 

    +

    9675 part ids to filter out 

    +

    9676 for_state_array: bool 

    +

    9677 if the filter is meant for a state array. Makes a difference 

    +

    9678 for shells if rigid bodies are in the model (mattyp == 20) 

    +

    9679 

    +

    9680 Returns 

    +

    9681 ------- 

    +

    9682 mask: np.ndarray 

    +

    9683 mask usable on arrays to filter results 

    +

    9684 

    +

    9685 Examples 

    +

    9686 -------- 

    +

    9687 >>> from lasso.dyna import D3plot, ArrayType, FilterType 

    +

    9688 >>> d3plot = D3plot("path/to/d3plot") 

    +

    9689 >>> part_ids = [13, 14] 

    +

    9690 >>> mask = d3plot.get_part_filter(FilterType.shell) 

    +

    9691 >>> shell_stress = d3plot.arrays[ArrayType.element_shell_stress] 

    +

    9692 >>> shell_stress.shape 

    +

    9693 (34, 7463, 3, 6) 

    +

    9694 >>> # select only parts from part_ids 

    +

    9695 >>> shell_stress_parts = shell_stress[:, mask] 

    +

    9696 """ 

    +

    9697 

    +

    9698 # nodes are treated separately 

    +

    9699 if filter_type == FilterType.NODE: 

    +

    9700 node_index_arrays = [] 

    +

    9701 

    +

    9702 if ArrayType.element_shell_node_indexes in self.arrays: 

    +

    9703 shell_filter = self.get_part_filter( 

    +

    9704 FilterType.SHELL, part_ids, for_state_array=False 

    +

    9705 ) 

    +

    9706 shell_node_indexes = self.arrays[ArrayType.element_shell_node_indexes] 

    +

    9707 node_index_arrays.append(shell_node_indexes[shell_filter].flatten()) 

    +

    9708 

    +

    9709 if ArrayType.element_solid_node_indexes in self.arrays: 

    +

    9710 solid_filter = self.get_part_filter( 

    +

    9711 FilterType.SOLID, part_ids, for_state_array=False 

    +

    9712 ) 

    +

    9713 solid_node_indexes = self.arrays[ArrayType.element_solid_node_indexes] 

    +

    9714 node_index_arrays.append(solid_node_indexes[solid_filter].flatten()) 

    +

    9715 

    +

    9716 if ArrayType.element_tshell_node_indexes in self.arrays: 

    +

    9717 tshell_filter = self.get_part_filter( 

    +

    9718 FilterType.TSHELL, part_ids, for_state_array=False 

    +

    9719 ) 

    +

    9720 tshell_node_indexes = self.arrays[ArrayType.element_tshell_node_indexes] 

    +

    9721 node_index_arrays.append(tshell_node_indexes[tshell_filter].flatten()) 

    +

    9722 

    +

    9723 return np.unique(np.concatenate(node_index_arrays)) 

    +

    9724 

    +

    9725 # we need part ids first 

    +

    9726 if ArrayType.part_ids in self.arrays: 

    +

    9727 d3plot_part_ids = self.arrays[ArrayType.part_ids] 

    +

    9728 elif ArrayType.part_titles_ids in self.arrays: 

    +

    9729 d3plot_part_ids = self.arrays[ArrayType.part_titles_ids] 

    +

    9730 else: 

    +

    9731 msg = "D3plot does neither contain '%s' nor '%s'" 

    +

    9732 raise RuntimeError(msg, ArrayType.part_ids, ArrayType.part_titles_ids) 

    +

    9733 

    +

    9734 # if we filter parts we can stop here 

    +

    9735 if filter_type == FilterType.PART: 

    +

    9736 return np.isin(d3plot_part_ids, part_ids) 

    +

    9737 

    +

    9738 # get part indexes from part ids 

    +

    9739 part_indexes = np.argwhere(np.isin(d3plot_part_ids, part_ids)).flatten() 

    +

    9740 

    +

    9741 # associate part indexes with entities 

    +

    9742 if filter_type == FilterType.BEAM: 

    +

    9743 entity_part_indexes = self.arrays[ArrayType.element_beam_part_indexes] 

    +

    9744 elif filter_type == FilterType.SHELL: 

    +

    9745 entity_part_indexes = self.arrays[ArrayType.element_shell_part_indexes] 

    +

    9746 

    +

    9747 # shells may contain "rigid body shell elements" 

    +

    9748 # for these shells no state data is output and thus 

    +

    9749 # the state arrays have a reduced element count 

    +

    9750 if for_state_array and self._material_section_info.n_rigid_shells != 0: 

    +

    9751 mat_types = self.arrays[ArrayType.part_material_type] 

    +

    9752 mat_type_filter = mat_types[entity_part_indexes] != 20 

    +

    9753 entity_part_indexes = entity_part_indexes[mat_type_filter] 

    +

    9754 

    +

    9755 elif filter_type == FilterType.TSHELL: 

    +

    9756 entity_part_indexes = self.arrays[ArrayType.element_tshell_part_indexes] 

    +

    9757 elif filter_type == FilterType.SOLID: 

    +

    9758 entity_part_indexes = self.arrays[ArrayType.element_solid_part_indexes] 

    +

    9759 else: 

    +

    9760 msg = "Invalid filter_type '%s'. Use lasso.dyna.FilterType." 

    +

    9761 raise ValueError(msg, filter_type) 

    +

    9762 

    +

    9763 mask = np.isin(entity_part_indexes, part_indexes) 

    +

    9764 return mask 

    +

    9765 

    +

    9766 @staticmethod 

    +

    9767 def enable_logger(enable: bool): 

    +

    9768 """Enable the logger for this class 

    +

    9769 

    +

    9770 Parameters 

    +

    9771 ---------- 

    +

    9772 enable: bool 

    +

    9773 whether to enable logging for this class 

    +

    9774 """ 

    +

    9775 

    +

    9776 if enable: 

    +

    9777 LOGGER.setLevel(logging.DEBUG) 

    +

    9778 else: 

    +

    9779 LOGGER.setLevel(logging.NOTSET) 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_femzip_mapper_py.html b/coverage/d_233c5ceebba6ed8d_femzip_mapper_py.html new file mode 100644 index 0000000..b518911 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_femzip_mapper_py.html @@ -0,0 +1,969 @@ + + + + + Coverage for lasso/dyna/femzip_mapper.py: 73% + + + + + +
    +
    +

    + Coverage for lasso/dyna/femzip_mapper.py: + 73% +

    + +

    + 228 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +

    1import logging 

    +

    2import re 

    +

    3import traceback 

    +

    4from typing import Dict, List, Set, Tuple, Union 

    +

    5 

    +

    6import numpy as np 

    +

    7from lasso.dyna.array_type import ArrayType 

    +

    8from lasso.femzip.femzip_api import FemzipAPI, FemzipFileMetadata, VariableInfo 

    +

    9from lasso.femzip.fz_config import FemzipArrayType, FemzipVariableCategory, get_last_int_of_line 

    +

    10 

    +

    11 

    +

    12TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE: Dict[ 

    +

    13 Tuple[FemzipArrayType, FemzipVariableCategory], Set[str] 

    +

    14] = { 

    +

    15 # GLOBAL 

    +

    16 (FemzipArrayType.GLOBAL_DATA, FemzipVariableCategory.GLOBAL): { 

    +

    17 # ArrayType.global_timesteps, 

    +

    18 ArrayType.global_internal_energy, 

    +

    19 ArrayType.global_kinetic_energy, 

    +

    20 ArrayType.global_total_energy, 

    +

    21 ArrayType.global_velocity, 

    +

    22 }, 

    +

    23 # PART 

    +

    24 (FemzipArrayType.PART_RESULTS, FemzipVariableCategory.PART): { 

    +

    25 ArrayType.part_hourglass_energy, 

    +

    26 ArrayType.part_internal_energy, 

    +

    27 ArrayType.part_kinetic_energy, 

    +

    28 ArrayType.part_mass, 

    +

    29 ArrayType.part_velocity, 

    +

    30 }, 

    +

    31 # NODE 

    +

    32 (FemzipArrayType.NODE_DISPLACEMENT, FemzipVariableCategory.NODE): {ArrayType.node_displacement}, 

    +

    33 (FemzipArrayType.NODE_ACCELERATIONS, FemzipVariableCategory.NODE): { 

    +

    34 ArrayType.node_acceleration 

    +

    35 }, 

    +

    36 (FemzipArrayType.NODE_VELOCITIES, FemzipVariableCategory.NODE): {ArrayType.node_velocity}, 

    +

    37 (FemzipArrayType.NODE_TEMPERATURES, FemzipVariableCategory.NODE): {ArrayType.node_temperature}, 

    +

    38 (FemzipArrayType.NODE_HEAT_FLUX, FemzipVariableCategory.NODE): {ArrayType.node_heat_flux}, 

    +

    39 (FemzipArrayType.NODE_MASS_SCALING, FemzipVariableCategory.NODE): {ArrayType.node_mass_scaling}, 

    +

    40 (FemzipArrayType.NODE_TEMPERATURE_GRADIENT, FemzipVariableCategory.NODE): { 

    +

    41 ArrayType.node_temperature_gradient 

    +

    42 }, 

    +

    43 # BEAM 

    +

    44 (FemzipArrayType.BEAM_AXIAL_FORCE, FemzipVariableCategory.BEAM): { 

    +

    45 ArrayType.element_beam_axial_force 

    +

    46 }, 

    +

    47 (FemzipArrayType.BEAM_S_BENDING_MOMENT, FemzipVariableCategory.BEAM): { 

    +

    48 ArrayType.element_beam_bending_moment 

    +

    49 }, 

    +

    50 (FemzipArrayType.BEAM_T_BENDING_MOMENT, FemzipVariableCategory.BEAM): { 

    +

    51 ArrayType.element_beam_bending_moment 

    +

    52 }, 

    +

    53 (FemzipArrayType.BEAM_S_SHEAR_RESULTANT, FemzipVariableCategory.BEAM): { 

    +

    54 ArrayType.element_beam_shear_force 

    +

    55 }, 

    +

    56 (FemzipArrayType.BEAM_T_SHEAR_RESULTANT, FemzipVariableCategory.BEAM): { 

    +

    57 ArrayType.element_beam_shear_force 

    +

    58 }, 

    +

    59 (FemzipArrayType.BEAM_TORSIONAL_MOMENT, FemzipVariableCategory.BEAM): { 

    +

    60 ArrayType.element_beam_torsion_moment 

    +

    61 }, 

    +

    62 (FemzipArrayType.BEAM_AXIAL_STRESS, FemzipVariableCategory.BEAM): { 

    +

    63 ArrayType.element_beam_axial_stress 

    +

    64 }, 

    +

    65 (FemzipArrayType.BEAM_SHEAR_STRESS_RS, FemzipVariableCategory.BEAM): { 

    +

    66 ArrayType.element_beam_shear_stress 

    +

    67 }, 

    +

    68 (FemzipArrayType.BEAM_SHEAR_STRESS_TR, FemzipVariableCategory.BEAM): { 

    +

    69 ArrayType.element_beam_shear_stress 

    +

    70 }, 

    +

    71 (FemzipArrayType.BEAM_PLASTIC_STRAIN, FemzipVariableCategory.BEAM): { 

    +

    72 ArrayType.element_beam_plastic_strain 

    +

    73 }, 

    +

    74 (FemzipArrayType.BEAM_AXIAL_STRAIN, FemzipVariableCategory.BEAM): { 

    +

    75 ArrayType.element_beam_axial_strain 

    +

    76 }, 

    +

    77 # SHELL 

    +

    78 (FemzipArrayType.STRESS_X, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, 

    +

    79 (FemzipArrayType.STRESS_Y, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, 

    +

    80 (FemzipArrayType.STRESS_Z, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, 

    +

    81 (FemzipArrayType.STRESS_XY, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, 

    +

    82 (FemzipArrayType.STRESS_YZ, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, 

    +

    83 (FemzipArrayType.STRESS_XZ, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, 

    +

    84 (FemzipArrayType.EFF_PSTRAIN, FemzipVariableCategory.SHELL): { 

    +

    85 ArrayType.element_shell_effective_plastic_strain 

    +

    86 }, 

    +

    87 (FemzipArrayType.HISTORY_VARS, FemzipVariableCategory.SHELL): { 

    +

    88 ArrayType.element_shell_history_vars 

    +

    89 }, 

    +

    90 (FemzipArrayType.BENDING_MOMENT_MX, FemzipVariableCategory.SHELL): { 

    +

    91 ArrayType.element_shell_bending_moment 

    +

    92 }, 

    +

    93 (FemzipArrayType.BENDING_MOMENT_MY, FemzipVariableCategory.SHELL): { 

    +

    94 ArrayType.element_shell_bending_moment 

    +

    95 }, 

    +

    96 (FemzipArrayType.BENDING_MOMENT_MXY, FemzipVariableCategory.SHELL): { 

    +

    97 ArrayType.element_shell_bending_moment 

    +

    98 }, 

    +

    99 (FemzipArrayType.SHEAR_FORCE_X, FemzipVariableCategory.SHELL): { 

    +

    100 ArrayType.element_shell_shear_force 

    +

    101 }, 

    +

    102 (FemzipArrayType.SHEAR_FORCE_Y, FemzipVariableCategory.SHELL): { 

    +

    103 ArrayType.element_shell_shear_force 

    +

    104 }, 

    +

    105 (FemzipArrayType.NORMAL_FORCE_X, FemzipVariableCategory.SHELL): { 

    +

    106 ArrayType.element_shell_normal_force 

    +

    107 }, 

    +

    108 (FemzipArrayType.NORMAL_FORCE_Y, FemzipVariableCategory.SHELL): { 

    +

    109 ArrayType.element_shell_normal_force 

    +

    110 }, 

    +

    111 (FemzipArrayType.NORMAL_FORCE_XY, FemzipVariableCategory.SHELL): { 

    +

    112 ArrayType.element_shell_normal_force 

    +

    113 }, 

    +

    114 (FemzipArrayType.THICKNESS, FemzipVariableCategory.SHELL): {ArrayType.element_shell_thickness}, 

    +

    115 (FemzipArrayType.UNKNOWN_1, FemzipVariableCategory.SHELL): { 

    +

    116 ArrayType.element_shell_unknown_variables 

    +

    117 }, 

    +

    118 (FemzipArrayType.UNKNOWN_2, FemzipVariableCategory.SHELL): { 

    +

    119 ArrayType.element_shell_unknown_variables 

    +

    120 }, 

    +

    121 (FemzipArrayType.STRAIN_INNER_X, FemzipVariableCategory.SHELL): { 

    +

    122 ArrayType.element_shell_strain 

    +

    123 }, 

    +

    124 (FemzipArrayType.STRAIN_INNER_Y, FemzipVariableCategory.SHELL): { 

    +

    125 ArrayType.element_shell_strain 

    +

    126 }, 

    +

    127 (FemzipArrayType.STRAIN_INNER_Z, FemzipVariableCategory.SHELL): { 

    +

    128 ArrayType.element_shell_strain 

    +

    129 }, 

    +

    130 (FemzipArrayType.STRAIN_INNER_XY, FemzipVariableCategory.SHELL): { 

    +

    131 ArrayType.element_shell_strain 

    +

    132 }, 

    +

    133 (FemzipArrayType.STRAIN_INNER_YZ, FemzipVariableCategory.SHELL): { 

    +

    134 ArrayType.element_shell_strain 

    +

    135 }, 

    +

    136 (FemzipArrayType.STRAIN_INNER_XZ, FemzipVariableCategory.SHELL): { 

    +

    137 ArrayType.element_shell_strain 

    +

    138 }, 

    +

    139 (FemzipArrayType.STRAIN_OUTER_X, FemzipVariableCategory.SHELL): { 

    +

    140 ArrayType.element_shell_strain 

    +

    141 }, 

    +

    142 (FemzipArrayType.STRAIN_OUTER_Y, FemzipVariableCategory.SHELL): { 

    +

    143 ArrayType.element_shell_strain 

    +

    144 }, 

    +

    145 (FemzipArrayType.STRAIN_OUTER_Z, FemzipVariableCategory.SHELL): { 

    +

    146 ArrayType.element_shell_strain 

    +

    147 }, 

    +

    148 (FemzipArrayType.STRAIN_OUTER_XY, FemzipVariableCategory.SHELL): { 

    +

    149 ArrayType.element_shell_strain 

    +

    150 }, 

    +

    151 (FemzipArrayType.STRAIN_OUTER_YZ, FemzipVariableCategory.SHELL): { 

    +

    152 ArrayType.element_shell_strain 

    +

    153 }, 

    +

    154 (FemzipArrayType.STRAIN_OUTER_XZ, FemzipVariableCategory.SHELL): { 

    +

    155 ArrayType.element_shell_strain 

    +

    156 }, 

    +

    157 (FemzipArrayType.INTERNAL_ENERGY, FemzipVariableCategory.SHELL): { 

    +

    158 ArrayType.element_shell_internal_energy 

    +

    159 }, 

    +

    160 # THICK SHELL 

    +

    161 (FemzipArrayType.STRESS_X, FemzipVariableCategory.THICK_SHELL): { 

    +

    162 ArrayType.element_tshell_stress 

    +

    163 }, 

    +

    164 (FemzipArrayType.STRESS_Y, FemzipVariableCategory.THICK_SHELL): { 

    +

    165 ArrayType.element_tshell_stress 

    +

    166 }, 

    +

    167 (FemzipArrayType.STRESS_Z, FemzipVariableCategory.THICK_SHELL): { 

    +

    168 ArrayType.element_tshell_stress 

    +

    169 }, 

    +

    170 (FemzipArrayType.STRESS_XY, FemzipVariableCategory.THICK_SHELL): { 

    +

    171 ArrayType.element_tshell_stress 

    +

    172 }, 

    +

    173 (FemzipArrayType.STRESS_YZ, FemzipVariableCategory.THICK_SHELL): { 

    +

    174 ArrayType.element_tshell_stress 

    +

    175 }, 

    +

    176 (FemzipArrayType.STRESS_XZ, FemzipVariableCategory.THICK_SHELL): { 

    +

    177 ArrayType.element_tshell_stress 

    +

    178 }, 

    +

    179 (FemzipArrayType.EFF_PSTRAIN, FemzipVariableCategory.THICK_SHELL): { 

    +

    180 ArrayType.element_tshell_effective_plastic_strain 

    +

    181 }, 

    +

    182 (FemzipArrayType.STRAIN_OUTER_X, FemzipVariableCategory.THICK_SHELL): { 

    +

    183 ArrayType.element_tshell_strain 

    +

    184 }, 

    +

    185 (FemzipArrayType.STRAIN_OUTER_Y, FemzipVariableCategory.THICK_SHELL): { 

    +

    186 ArrayType.element_tshell_strain 

    +

    187 }, 

    +

    188 (FemzipArrayType.STRAIN_OUTER_Z, FemzipVariableCategory.THICK_SHELL): { 

    +

    189 ArrayType.element_tshell_strain 

    +

    190 }, 

    +

    191 (FemzipArrayType.STRAIN_OUTER_XY, FemzipVariableCategory.THICK_SHELL): { 

    +

    192 ArrayType.element_tshell_strain 

    +

    193 }, 

    +

    194 (FemzipArrayType.STRAIN_OUTER_YZ, FemzipVariableCategory.THICK_SHELL): { 

    +

    195 ArrayType.element_tshell_strain 

    +

    196 }, 

    +

    197 (FemzipArrayType.STRAIN_OUTER_XZ, FemzipVariableCategory.THICK_SHELL): { 

    +

    198 ArrayType.element_tshell_strain 

    +

    199 }, 

    +

    200 (FemzipArrayType.STRAIN_INNER_X, FemzipVariableCategory.THICK_SHELL): { 

    +

    201 ArrayType.element_tshell_strain 

    +

    202 }, 

    +

    203 (FemzipArrayType.STRAIN_INNER_Y, FemzipVariableCategory.THICK_SHELL): { 

    +

    204 ArrayType.element_tshell_strain 

    +

    205 }, 

    +

    206 (FemzipArrayType.STRAIN_INNER_Z, FemzipVariableCategory.THICK_SHELL): { 

    +

    207 ArrayType.element_tshell_strain 

    +

    208 }, 

    +

    209 (FemzipArrayType.STRAIN_INNER_XY, FemzipVariableCategory.THICK_SHELL): { 

    +

    210 ArrayType.element_tshell_strain 

    +

    211 }, 

    +

    212 (FemzipArrayType.STRAIN_INNER_YZ, FemzipVariableCategory.THICK_SHELL): { 

    +

    213 ArrayType.element_tshell_strain 

    +

    214 }, 

    +

    215 (FemzipArrayType.STRAIN_INNER_XZ, FemzipVariableCategory.THICK_SHELL): { 

    +

    216 ArrayType.element_tshell_strain 

    +

    217 }, 

    +

    218 # SOLID 

    +

    219 (FemzipArrayType.STRESS_X, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, 

    +

    220 (FemzipArrayType.STRESS_Y, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, 

    +

    221 (FemzipArrayType.STRESS_Z, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, 

    +

    222 (FemzipArrayType.STRESS_XY, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, 

    +

    223 (FemzipArrayType.STRESS_YZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, 

    +

    224 (FemzipArrayType.STRESS_XZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, 

    +

    225 (FemzipArrayType.EFF_PSTRAIN, FemzipVariableCategory.SOLID): { 

    +

    226 ArrayType.element_solid_effective_plastic_strain 

    +

    227 }, 

    +

    228 (FemzipArrayType.HISTORY_VARS, FemzipVariableCategory.SOLID): { 

    +

    229 ArrayType.element_solid_history_variables 

    +

    230 }, 

    +

    231 (FemzipArrayType.STRAIN_X, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    232 (FemzipArrayType.STRAIN_Y, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    233 (FemzipArrayType.STRAIN_Z, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    234 (FemzipArrayType.STRAIN_XY, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    235 (FemzipArrayType.STRAIN_YZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    236 (FemzipArrayType.STRAIN_XZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    237 (FemzipArrayType.STRAIN_X, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    238 (FemzipArrayType.STRAIN_Y, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    239 (FemzipArrayType.STRAIN_Z, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    240 (FemzipArrayType.STRAIN_XY, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    241 (FemzipArrayType.STRAIN_YZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    242 (FemzipArrayType.STRAIN_XZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, 

    +

    243 # AIRBAG 

    +

    244 (FemzipArrayType.AIRBAG_STATE_GEOM, FemzipVariableCategory.CPM_AIRBAG): { 

    +

    245 ArrayType.airbag_n_active_particles, 

    +

    246 ArrayType.airbag_bag_volume, 

    +

    247 }, 

    +

    248 # AIRBAG PARTICLES 

    +

    249 (FemzipArrayType.AIRBAG_PARTICLE_GAS_CHAMBER_ID, FemzipVariableCategory.CPM_INT_VAR): { 

    +

    250 ArrayType.airbag_particle_gas_id 

    +

    251 }, 

    +

    252 (FemzipArrayType.AIRBAG_PARTICLE_CHAMBER_ID, FemzipVariableCategory.CPM_INT_VAR): { 

    +

    253 ArrayType.airbag_particle_chamber_id 

    +

    254 }, 

    +

    255 (FemzipArrayType.AIRBAG_PARTICLE_LEAKAGE, FemzipVariableCategory.CPM_INT_VAR): { 

    +

    256 ArrayType.airbag_particle_leakage 

    +

    257 }, 

    +

    258 (FemzipArrayType.AIRBAG_PARTICLE_MASS, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    259 ArrayType.airbag_particle_mass 

    +

    260 }, 

    +

    261 (FemzipArrayType.AIRBAG_PARTICLE_POS_X, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    262 ArrayType.airbag_particle_position 

    +

    263 }, 

    +

    264 (FemzipArrayType.AIRBAG_PARTICLE_POS_Y, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    265 ArrayType.airbag_particle_position 

    +

    266 }, 

    +

    267 (FemzipArrayType.AIRBAG_PARTICLE_POS_Z, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    268 ArrayType.airbag_particle_position 

    +

    269 }, 

    +

    270 (FemzipArrayType.AIRBAG_PARTICLE_VEL_X, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    271 ArrayType.airbag_particle_velocity 

    +

    272 }, 

    +

    273 (FemzipArrayType.AIRBAG_PARTICLE_VEL_Y, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    274 ArrayType.airbag_particle_velocity 

    +

    275 }, 

    +

    276 (FemzipArrayType.AIRBAG_PARTICLE_VEL_Z, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    277 ArrayType.airbag_particle_velocity 

    +

    278 }, 

    +

    279 (FemzipArrayType.AIRBAG_PARTICLE_RADIUS, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    280 ArrayType.airbag_particle_radius 

    +

    281 }, 

    +

    282 (FemzipArrayType.AIRBAG_PARTICLE_SPIN_ENERGY, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    283 ArrayType.airbag_particle_spin_energy 

    +

    284 }, 

    +

    285 (FemzipArrayType.AIRBAG_PARTICLE_TRAN_ENERGY, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    286 ArrayType.airbag_particle_translation_energy 

    +

    287 }, 

    +

    288 (FemzipArrayType.AIRBAG_PARTICLE_NEIGHBOR_DIST, FemzipVariableCategory.CPM_FLOAT_VAR): { 

    +

    289 ArrayType.airbag_particle_nearest_segment_distance 

    +

    290 }, 

    +

    291} 

    +

    292 

    +

    293# indexes for various femzip arrays 

    +

    294stress_index = { 

    +

    295 FemzipArrayType.STRESS_X.value: 0, 

    +

    296 FemzipArrayType.STRESS_Y.value: 1, 

    +

    297 FemzipArrayType.STRESS_Z.value: 2, 

    +

    298 FemzipArrayType.STRESS_XY.value: 3, 

    +

    299 FemzipArrayType.STRESS_YZ.value: 4, 

    +

    300 FemzipArrayType.STRESS_XZ.value: 5, 

    +

    301 FemzipArrayType.NORMAL_FORCE_X.value: 0, 

    +

    302 FemzipArrayType.NORMAL_FORCE_Y.value: 1, 

    +

    303 FemzipArrayType.NORMAL_FORCE_XY.value: 2, 

    +

    304 FemzipArrayType.SHEAR_FORCE_X.value: 0, 

    +

    305 FemzipArrayType.SHEAR_FORCE_Y.value: 1, 

    +

    306 FemzipArrayType.STRAIN_INNER_X.value: 0, 

    +

    307 FemzipArrayType.STRAIN_INNER_Y.value: 1, 

    +

    308 FemzipArrayType.STRAIN_INNER_Z.value: 2, 

    +

    309 FemzipArrayType.STRAIN_INNER_XY.value: 3, 

    +

    310 FemzipArrayType.STRAIN_INNER_YZ.value: 4, 

    +

    311 FemzipArrayType.STRAIN_INNER_XZ.value: 5, 

    +

    312 FemzipArrayType.STRAIN_OUTER_X.value: 0, 

    +

    313 FemzipArrayType.STRAIN_OUTER_Y.value: 1, 

    +

    314 FemzipArrayType.STRAIN_OUTER_Z.value: 2, 

    +

    315 FemzipArrayType.STRAIN_OUTER_XY.value: 3, 

    +

    316 FemzipArrayType.STRAIN_OUTER_YZ.value: 4, 

    +

    317 FemzipArrayType.STRAIN_OUTER_XZ.value: 5, 

    +

    318 FemzipArrayType.BEAM_S_SHEAR_RESULTANT.value: 0, 

    +

    319 FemzipArrayType.BEAM_T_SHEAR_RESULTANT.value: 1, 

    +

    320 FemzipArrayType.BEAM_S_BENDING_MOMENT.value: 0, 

    +

    321 FemzipArrayType.BEAM_T_BENDING_MOMENT.value: 1, 

    +

    322 FemzipArrayType.STRAIN_X.value: 0, 

    +

    323 FemzipArrayType.STRAIN_Y.value: 1, 

    +

    324 FemzipArrayType.STRAIN_Z.value: 2, 

    +

    325 FemzipArrayType.STRAIN_XY.value: 3, 

    +

    326 FemzipArrayType.STRAIN_YZ.value: 4, 

    +

    327 FemzipArrayType.STRAIN_XZ.value: 5, 

    +

    328 FemzipArrayType.BEAM_SHEAR_STRESS_RS.value: 0, 

    +

    329 FemzipArrayType.BEAM_SHEAR_STRESS_TR.value: 1, 

    +

    330 FemzipArrayType.AIRBAG_PARTICLE_POS_X.value: 0, 

    +

    331 FemzipArrayType.AIRBAG_PARTICLE_POS_Y.value: 1, 

    +

    332 FemzipArrayType.AIRBAG_PARTICLE_POS_Z.value: 2, 

    +

    333 FemzipArrayType.AIRBAG_PARTICLE_VEL_X.value: 0, 

    +

    334 FemzipArrayType.AIRBAG_PARTICLE_VEL_Y.value: 1, 

    +

    335 FemzipArrayType.AIRBAG_PARTICLE_VEL_Z.value: 2, 

    +

    336 FemzipArrayType.BENDING_MOMENT_MX.value: 0, 

    +

    337 FemzipArrayType.BENDING_MOMENT_MY.value: 1, 

    +

    338 FemzipArrayType.BENDING_MOMENT_MXY.value: 2, 

    +

    339 FemzipArrayType.UNKNOWN_1.value: 0, 

    +

    340 FemzipArrayType.UNKNOWN_2.value: 1, 

    +

    341} 

    +

    342 

    +

    343 

    +

    344def femzip_to_d3plot( 

    +

    345 result_arrays: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] 

    +

    346) -> Dict[str, np.ndarray]: 

    +

    347 """Map femzip arrays to d3plot arrays 

    +

    348 

    +

    349 Parameters 

    +

    350 ---------- 

    +

    351 result_arrays: 

    +

    352 femzip arrays 

    +

    353 """ 

    +

    354 mapper = FemzipMapper() 

    +

    355 mapper.map(result_arrays) 

    +

    356 

    +

    357 return mapper.d3plot_arrays 

    +

    358 

    +

    359 

    +

    360class ArrayShapeInfo: 

    +

    361 """ArrayShapeInfo describes the shape of arrays""" 

    +

    362 

    +

    363 n_layers: Union[int, None] = None 

    +

    364 n_vars: Union[int, None] = None 

    +

    365 n_entries: Union[int, None] = None 

    +

    366 n_timesteps: Union[int, None] = None 

    +

    367 

    +

    368 def _set_attr(self, attr_name: str, value: Union[int, None]) -> None: 

    +

    369 self_attr_value = getattr(self, attr_name) 

    +

    370 if value is not None: 

    +

    371 if self_attr_value is None: 

    +

    372 setattr(self, attr_name, value) 

    +

    373 else: 

    +

    374 setattr(self, attr_name, max(self_attr_value, value)) 

    +

    375 

    +

    376 def set_n_layers(self, n_layers: Union[int, None]) -> None: 

    +

    377 """Set the number of layers 

    +

    378 

    +

    379 Parameters 

    +

    380 ---------- 

    +

    381 n_layers : Union[int, None] 

    +

    382 number of layers 

    +

    383 """ 

    +

    384 self._set_attr("n_layers", n_layers) 

    +

    385 

    +

    386 def set_n_vars(self, n_vars: Union[int, None]) -> None: 

    +

    387 """Set the number of variables 

    +

    388 

    +

    389 Parameters 

    +

    390 ---------- 

    +

    391 n_vars : Union[int, None] 

    +

    392 number of variables 

    +

    393 """ 

    +

    394 self._set_attr("n_vars", n_vars) 

    +

    395 

    +

    396 def set_n_entries(self, n_entries: Union[int, None]) -> None: 

    +

    397 """Set the number of entries 

    +

    398 

    +

    399 Parameters 

    +

    400 ---------- 

    +

    401 n_vars : Union[int, None] 

    +

    402 number of entries 

    +

    403 """ 

    +

    404 self._set_attr("n_entries", n_entries) 

    +

    405 

    +

    406 def set_n_timesteps(self, n_timesteps: Union[int, None]) -> None: 

    +

    407 """Set the number of timesteps 

    +

    408 

    +

    409 Parameters 

    +

    410 ---------- 

    +

    411 n_vars : Union[int, None] 

    +

    412 number of timesteps 

    +

    413 """ 

    +

    414 self._set_attr("n_timesteps", n_timesteps) 

    +

    415 

    +

    416 def to_shape(self) -> Tuple[int, ...]: 

    +

    417 """Set the number of variables 

    +

    418 

    +

    419 Returns 

    +

    420 ---------- 

    +

    421 shape : Tuple[int, ...] 

    +

    422 total shape 

    +

    423 """ 

    +

    424 

    +

    425 shape = [self.n_timesteps, self.n_entries] 

    +

    426 fortran_offset = 1 

    +

    427 if self.n_layers is not None: 

    +

    428 shape.append(self.n_layers + fortran_offset) 

    +

    429 if self.n_vars is not None: 

    +

    430 shape.append(self.n_vars + fortran_offset) 

    +

    431 return tuple(shape) 

    +

    432 

    +

    433 

    +

    434class D3plotArrayMapping: 

    +

    435 """D3plotArrayMapping maps femzip arrays to d3plot arrays""" 

    +

    436 

    +

    437 d3plot_array_type: str 

    +

    438 d3_layer_slice: Union[slice, int, None] = None 

    +

    439 d3_var_slice: Union[slice, int, None] = None 

    +

    440 

    +

    441 fz_layer_slice: Union[slice, int, None] = None 

    +

    442 fz_var_slice: Union[slice, int, None] = None 

    +

    443 

    +

    444 just_assign: bool = False 

    +

    445 

    +

    446 def to_slice(self) -> Tuple[Union[int, slice], ...]: 

    +

    447 """Get the slices mapping a femzip array to a d3plot array 

    +

    448 

    +

    449 Returns 

    +

    450 ------- 

    +

    451 slices: Tuple[Union[int, slice], ...] 

    +

    452 """ 

    +

    453 slices: List[Union[slice, int]] = [slice(None), slice(None)] 

    +

    454 if self.d3_layer_slice is not None: 

    +

    455 slices.append(self.d3_layer_slice) 

    +

    456 if self.d3_var_slice is not None: 

    +

    457 slices.append(self.d3_var_slice) 

    +

    458 return tuple(slices) 

    +

    459 

    +

    460 

    +

    461class FemzipArrayInfo: 

    +

    462 """FemzipArrayInfo contains information about the femzip array""" 

    +

    463 

    +

    464 # pylint: disable = too-many-instance-attributes 

    +

    465 

    +

    466 full_name: str = "" 

    +

    467 short_name: str = "" 

    +

    468 index: int = -1 

    +

    469 category: FemzipVariableCategory 

    +

    470 array_type: FemzipArrayType 

    +

    471 array: np.ndarray 

    +

    472 

    +

    473 i_layer: Union[int, None] = None 

    +

    474 i_var: Union[int, None] = None 

    +

    475 

    +

    476 mappings: List[D3plotArrayMapping] 

    +

    477 

    +

    478 def __init__(self): 

    +

    479 self.mappings = [] 

    +

    480 

    +

    481 def __str__(self) -> str: 

    +

    482 return f"""FemzipArrayInfo: 

    +

    483 full_name = {self.full_name} 

    +

    484 short_name = {self.short_name} 

    +

    485 index = {self.index} 

    +

    486 category = {self.category} 

    +

    487 array_type = {self.array_type}> 

    +

    488 i_layer = {self.i_layer} 

    +

    489 i_var = {self.i_var}""" 

    +

    490 

    +

    491 

    +

    492class FemzipMapper: 

    +

    493 """Class for mapping femzip variable data to d3plots.""" 

    +

    494 

    +

    495 # regex pattern for reading variables 

    +

    496 name_separation_pattern = re.compile(r"(^[^(\n]+)(\([^\)]+\))*") 

    +

    497 

    +

    498 FORTRAN_OFFSET: int = 1 

    +

    499 

    +

    500 _d3plot_arrays: Dict[str, np.ndarray] = {} 

    +

    501 _fz_array_slices = {} 

    +

    502 

    +

    503 def __init__(self): 

    +

    504 pass 

    +

    505 

    +

    506 def map(self, result_arrays: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray]): 

    +

    507 """Map femzip data to d3plot arrays. 

    +

    508 

    +

    509 Parameters 

    +

    510 ---------- 

    +

    511 result_arrays: 

    +

    512 femzip variable data 

    +

    513 """ 

    +

    514 self._d3plot_arrays = {} 

    +

    515 self._fz_array_slices = {} 

    +

    516 

    +

    517 # convert to internal datastructure 

    +

    518 array_infos = self._convert(result_arrays) 

    +

    519 

    +

    520 # build the array shapes 

    +

    521 d3plot_array_shapes = self._build(array_infos) 

    +

    522 

    +

    523 # init the numpy arrays 

    +

    524 self._d3plot_arrays = self._allocate_d3plot_arrays(d3plot_array_shapes) 

    +

    525 

    +

    526 # add all the data to its right place 

    +

    527 self._map_arrays(array_infos, self._d3plot_arrays) 

    +

    528 

    +

    529 def _convert( 

    +

    530 self, result_arrays: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] 

    +

    531 ) -> List[FemzipArrayInfo]: 

    +

    532 """Convert femzip result arrays into array infos 

    +

    533 

    +

    534 Parameters 

    +

    535 ---------- 

    +

    536 result_arrays: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] 

    +

    537 result arrays from femzip 

    +

    538 

    +

    539 Returns 

    +

    540 ------- 

    +

    541 array_infos: List[FemzipArrayInfo] 

    +

    542 infos about femzip arrays 

    +

    543 """ 

    +

    544 

    +

    545 array_infos = [] 

    +

    546 

    +

    547 # convert 

    +

    548 for (fz_index, fz_name, fz_cat), array in result_arrays.items(): 

    +

    549 femzip_array_info = FemzipArrayInfo() 

    +

    550 femzip_array_info.index = fz_index 

    +

    551 femzip_array_info.full_name = fz_name 

    +

    552 femzip_array_info.category = fz_cat 

    +

    553 femzip_array_info.array = array 

    +

    554 femzip_array_info.array_type = FemzipArrayType.from_string(fz_name) 

    +

    555 

    +

    556 var_name, i_layer, i_stress, i_history = self._parse_femzip_name(fz_name, fz_cat) 

    +

    557 

    +

    558 femzip_array_info.short_name = var_name 

    +

    559 femzip_array_info.i_layer = i_layer 

    +

    560 femzip_array_info.i_var = i_stress if i_stress is not None else i_history 

    +

    561 

    +

    562 array_infos.append(femzip_array_info) 

    +

    563 

    +

    564 return array_infos 

    +

    565 

    +

    566 @staticmethod 

    +

    567 def _build(fz_arrays: List[FemzipArrayInfo]) -> Dict[str, Tuple[int, ...]]: 

    +

    568 """Counts the occurrence of all variables in the result array such as the 

    +

    569 number of layers and stresses. 

    +

    570 

    +

    571 Parameters 

    +

    572 --------- 

    +

    573 fz_arrays: List[FemzipArrayInfo] 

    +

    574 infos about femzip arrays 

    +

    575 

    +

    576 Returns 

    +

    577 ------- 

    +

    578 d3plot_array_shapes: 

    +

    579 shapes of the d3plot arrays required to be allocated 

    +

    580 

    +

    581 Notes 

    +

    582 ----- 

    +

    583 Some variables only have partial stress results written for Sigma-x and Sigma-y 

    +

    584 and layers one to three for example. 

    +

    585 """ 

    +

    586 shape_infos: Dict[str, ArrayShapeInfo] = {} 

    +

    587 name_count: Dict[Tuple[str, FemzipVariableCategory], int] = {} 

    +

    588 

    +

    589 for arr_info in fz_arrays: 

    +

    590 # print(arr_info) 

    +

    591 

    +

    592 d3_array_types = TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE[ 

    +

    593 (arr_info.array_type, arr_info.category) 

    +

    594 ] 

    +

    595 

    +

    596 # var_name = var_name.strip() 

    +

    597 for array_type in d3_array_types: 

    +

    598 # print(array_type) 

    +

    599 array_shape_info = shape_infos.get(array_type) or ArrayShapeInfo() 

    +

    600 

    +

    601 # beam layer vars always have same name but 

    +

    602 # must be counted up as layers 

    +

    603 if (arr_info.full_name, arr_info.category) in name_count: 

    +

    604 count = name_count[(arr_info.full_name, arr_info.category)] 

    +

    605 i_layer = count + 1 

    +

    606 name_count[(arr_info.full_name, arr_info.category)] = i_layer 

    +

    607 else: 

    +

    608 name_count[(arr_info.full_name, arr_info.category)] = 0 

    +

    609 

    +

    610 # update shape 

    +

    611 array_shape_info.set_n_timesteps(arr_info.array.shape[0]) 

    +

    612 array_shape_info.set_n_entries(arr_info.array.shape[1]) 

    +

    613 array_shape_info.set_n_layers(arr_info.i_layer) 

    +

    614 array_shape_info.set_n_vars(arr_info.i_var) 

    +

    615 

    +

    616 shape_infos[array_type] = array_shape_info 

    +

    617 

    +

    618 # where to put it 

    +

    619 mapping = D3plotArrayMapping() 

    +

    620 mapping.d3plot_array_type = array_type 

    +

    621 if arr_info.i_layer is not None: 

    +

    622 mapping.d3_layer_slice = arr_info.i_layer 

    +

    623 if arr_info.i_var is not None: 

    +

    624 mapping.d3_var_slice = arr_info.i_var 

    +

    625 # arrays to copy: 

    +

    626 # - node displacement, velocity, acceleration 

    +

    627 # - airbag integer vars (so we don't need to cast) 

    +

    628 if ( 

    +

    629 arr_info.array.ndim == 3 

    +

    630 or arr_info.category == FemzipVariableCategory.CPM_INT_VAR 

    +

    631 ): 

    +

    632 mapping.just_assign = True 

    +

    633 

    +

    634 arr_info.mappings.append(mapping) 

    +

    635 

    +

    636 # correct layers 

    +

    637 # if a field has the same name for multiple 

    +

    638 # layers such as beam axial stress, we needed 

    +

    639 # to count in order to determine if it had layers 

    +

    640 # now we need to correct i_layers from None to 0 for them 

    +

    641 name_count2 = {} 

    +

    642 for arr_info in fz_arrays: 

    +

    643 count = name_count[(arr_info.full_name, arr_info.category)] 

    +

    644 

    +

    645 if count != 0 and arr_info.i_layer is None: 

    +

    646 count2 = name_count2.get((arr_info.full_name, arr_info.category), -1) 

    +

    647 count2 += 1 

    +

    648 arr_info.i_layer = count2 

    +

    649 name_count2[(arr_info.full_name, arr_info.category)] = count2 

    +

    650 

    +

    651 for mapping in arr_info.mappings: 

    +

    652 shape_info = shape_infos[mapping.d3plot_array_type] 

    +

    653 shape_info.set_n_layers(count) 

    +

    654 mapping.d3_layer_slice = count2 

    +

    655 

    +

    656 # all arrays which are simply copied (slice has len 2 and only one target) 

    +

    657 # get a just assign flag 

    +

    658 if len(arr_info.mappings) == 2 and len(arr_info.mappings[0].to_slice()) == 2: 

    +

    659 arr_info.mappings[0].just_assign = True 

    +

    660 

    +

    661 d3_array_types = TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE[ 

    +

    662 (arr_info.array_type, arr_info.category) 

    +

    663 ] 

    +

    664 

    +

    665 for array_type in d3_array_types: 

    +

    666 del shape_infos[array_type] 

    +

    667 

    +

    668 return {name: info.to_shape() for name, info in shape_infos.items()} 

    +

    669 

    +

    670 def _map_arrays(self, array_infos: List[FemzipArrayInfo], d3plot_arrays: Dict[str, np.ndarray]): 

    +

    671 """Allocate a femzip variable to its correct position in 

    +

    672 the d3plot array dictionary. 

    +

    673 

    +

    674 Parameters 

    +

    675 --------- 

    +

    676 array_infos: List[FemzipArrayInfo] 

    +

    677 femzip variables stored in a dictionary 

    +

    678 d3plot_arrays: Dict[str, np.ndarray] 

    +

    679 d3plot arrays pre-allocated 

    +

    680 

    +

    681 Notes 

    +

    682 ----- 

    +

    683 The keys are the femzip array name (un-parsed) 

    +

    684 and the category of the variable as an enum. 

    +

    685 """ 

    +

    686 for arr_info in array_infos: 

    +

    687 if arr_info.category == FemzipVariableCategory.CPM_AIRBAG: 

    +

    688 d3plot_arrays[ArrayType.airbag_n_active_particles] = arr_info.array[:, :, 0].view( 

    +

    689 np.int32 

    +

    690 ) 

    +

    691 d3plot_arrays[ArrayType.airbag_bag_volume] = arr_info.array[:, :, 1] 

    +

    692 else: 

    +

    693 for mapping in arr_info.mappings: 

    +

    694 if mapping.just_assign: 

    +

    695 d3plot_arrays[mapping.d3plot_array_type] = arr_info.array 

    +

    696 continue 

    +

    697 

    +

    698 slices = mapping.to_slice() 

    +

    699 d3plot_array = d3plot_arrays[mapping.d3plot_array_type] 

    +

    700 

    +

    701 # for femzip arrays with same name first var_index is missing 

    +

    702 if d3plot_array.ndim == 3 and len(slices) == 2 and arr_info.array.ndim == 2: 

    +

    703 slices = (*slices, 0) 

    +

    704 

    +

    705 d3plot_array[slices] = arr_info.array 

    +

    706 

    +

    707 def _allocate_d3plot_arrays( 

    +

    708 self, array_shapes: Dict[str, Tuple[int, ...]] 

    +

    709 ) -> Dict[str, np.ndarray]: 

    +

    710 """Initialize all the d3plot arrays. 

    +

    711 

    +

    712 Parameters 

    +

    713 ---------- 

    +

    714 array_shapes: array_shapes: Dict[str, Tuple[int, ...]] 

    +

    715 array shapes required to be allocated 

    +

    716 

    +

    717 Returns 

    +

    718 ------- 

    +

    719 d3plot_arrays: Dict[str, np.ndarray] 

    +

    720 d3plot arrays pre-allocated 

    +

    721 """ 

    +

    722 d3plot_arrays = {} 

    +

    723 for key, shape in array_shapes.items(): 

    +

    724 d3plot_arrays[key] = np.empty(shape, dtype=np.float32) 

    +

    725 return d3plot_arrays 

    +

    726 

    +

    727 @property 

    +

    728 def d3plot_arrays(self): 

    +

    729 """Returns the mapped d3plot arrays.""" 

    +

    730 return self._d3plot_arrays 

    +

    731 

    +

    732 def _parse_femzip_name( 

    +

    733 self, fz_name: str, var_type: FemzipVariableCategory 

    +

    734 ) -> Tuple[str, Union[int, None], Union[int, None], Union[int, None]]: 

    +

    735 """Parses the femzip variable names. 

    +

    736 

    +

    737 Parameters 

    +

    738 ---------- 

    +

    739 fz_name: 

    +

    740 cryptic femzip variable name we need to parse 

    +

    741 var_type: 

    +

    742 the category of this variable e.g. shells, parts, global etc. 

    +

    743 

    +

    744 Returns 

    +

    745 ------- 

    +

    746 var_name: 

    +

    747 femzip variable name without integration and layer info 

    +

    748 i_layer: 

    +

    749 layer index 

    +

    750 i_stress: 

    +

    751 stress index 

    +

    752 i_history: 

    +

    753 history variable index 

    +

    754 """ 

    +

    755 matches = self.name_separation_pattern.findall(fz_name) 

    +

    756 if not len(matches) == 1: 

    +

    757 err_msg = "Could not match femzip array name: {0}" 

    +

    758 raise ValueError(err_msg.format(fz_name)) 

    +

    759 if not len(matches[0]) == 2: 

    +

    760 err_msg = "Could not match femzip array name: {0}" 

    +

    761 raise ValueError(err_msg.format(fz_name)) 

    +

    762 

    +

    763 (first_grp, second_grp) = matches[0] 

    +

    764 var_name, extra_value = get_last_int_of_line(first_grp) 

    +

    765 var_name = var_name.strip() 

    +

    766 

    +

    767 # the slice 1:-1 leaves out the brackets '(' and ')' 

    +

    768 _, i_layer = get_last_int_of_line(second_grp[1:-1]) 

    +

    769 

    +

    770 if i_layer is not None: 

    +

    771 i_layer -= self.FORTRAN_OFFSET 

    +

    772 

    +

    773 i_history: Union[int, None] = None 

    +

    774 

    +

    775 if var_type != FemzipVariableCategory.PART or var_type != FemzipVariableCategory.GLOBAL: 

    +

    776 i_history = extra_value 

    +

    777 

    +

    778 if i_history: 

    +

    779 i_history -= self.FORTRAN_OFFSET 

    +

    780 

    +

    781 # set var name to the un-formatted femzip array type name 

    +

    782 if "Epsilon" in var_name: 

    +

    783 var_name = fz_name.strip() 

    +

    784 if "inner" in var_name: 

    +

    785 i_layer = 0 

    +

    786 elif "outer" in var_name: 

    +

    787 i_layer = 1 

    +

    788 else: 

    +

    789 # solid strain 

    +

    790 i_layer = 0 

    +

    791 

    +

    792 i_stress: Union[int, None] = stress_index.get(var_name, None) 

    +

    793 

    +

    794 return var_name, i_layer, i_stress, i_history 

    +

    795 

    +

    796 

    +

    797def filter_femzip_variables( 

    +

    798 file_metadata: FemzipFileMetadata, d3plot_array_filter: Union[Set[str], None] 

    +

    799) -> FemzipFileMetadata: 

    +

    800 """Filters variable infos regarding d3plot array types 

    +

    801 

    +

    802 Parameters 

    +

    803 ---------- 

    +

    804 file_metadata: FemzipFileMetadata 

    +

    805 metadata of femzip file including contained variables 

    +

    806 d3plot_array_filter: Union[Set[str], None] 

    +

    807 array types to filter for if wanted 

    +

    808 

    +

    809 Returns 

    +

    810 ------- 

    +

    811 file_metadata: FemzipFileMetadata 

    +

    812 filtered array according to array types 

    +

    813 """ 

    +

    814 

    +

    815 # pylint: disable = too-many-locals 

    +

    816 

    +

    817 # find out which arrays we need and 

    +

    818 vars_to_copy: List[int] = [] 

    +

    819 

    +

    820 for i_var in range(file_metadata.number_of_variables): 

    +

    821 try: 

    +

    822 var_info: VariableInfo = file_metadata.variable_infos[i_var] 

    +

    823 var_type: int = var_info.var_type 

    +

    824 var_index: int = var_info.var_index 

    +

    825 var_name: str = var_info.name.decode("utf-8") 

    +

    826 

    +

    827 logging.debug("%d, %d, %s", var_type, var_index, var_name.strip()) 

    +

    828 

    +

    829 if var_type == FemzipVariableCategory.GEOMETRY.value: 

    +

    830 continue 

    +

    831 

    +

    832 # find out which array from name 

    +

    833 try: 

    +

    834 fz_array_type = FemzipArrayType.from_string(var_name) 

    +

    835 except ValueError: 

    +

    836 warn_msg = ( 

    +

    837 "Warning: lasso-python does not support femzip result" 

    +

    838 f" field '{var_name.strip()}' category type '{var_type}'." 

    +

    839 ) 

    +

    840 logging.warning(warn_msg) 

    +

    841 continue 

    +

    842 

    +

    843 # check if we asked for the array 

    +

    844 matching_array_types = TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE[ 

    +

    845 (fz_array_type, FemzipVariableCategory(var_type)) 

    +

    846 ] 

    +

    847 

    +

    848 if d3plot_array_filter is not None: 

    +

    849 if not matching_array_types.intersection(d3plot_array_filter): 

    +

    850 continue 

    +

    851 vars_to_copy.append(i_var) 

    +

    852 except Exception: 

    +

    853 trb_msg = traceback.format_exc() 

    +

    854 err_msg = "An error occurred while preprocessing femzip variable information: %s" 

    +

    855 logging.warning(err_msg, trb_msg) 

    +

    856 

    +

    857 # copy filtered data 

    +

    858 filtered_file_metadata = FemzipFileMetadata() 

    +

    859 FemzipAPI.copy_struct(file_metadata, filtered_file_metadata) 

    +

    860 filtered_file_metadata.number_of_variables = len(vars_to_copy) 

    +

    861 

    +

    862 # pylint: disable = invalid-name 

    +

    863 FilteredVariableInfoArrayType = len(vars_to_copy) * VariableInfo 

    +

    864 filtered_info_array_data = FilteredVariableInfoArrayType() 

    +

    865 

    +

    866 for i_var, src_i_var in enumerate(vars_to_copy): 

    +

    867 FemzipAPI.copy_struct( 

    +

    868 file_metadata.variable_infos[src_i_var], filtered_info_array_data[i_var] 

    +

    869 ) 

    +

    870 filtered_file_metadata.variable_infos = filtered_info_array_data 

    +

    871 

    +

    872 return filtered_file_metadata 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_filter_type_py.html b/coverage/d_233c5ceebba6ed8d_filter_type_py.html new file mode 100644 index 0000000..5ae4c02 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_filter_type_py.html @@ -0,0 +1,130 @@ + + + + + Coverage for lasso/dyna/filter_type.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dyna/filter_type.py: + 100% +

    + +

    + 8 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from enum import Enum 

    +

    2 

    +

    3 

    +

    4class FilterType(Enum): 

    +

    5 """Used for filtering d3plot arrays 

    +

    6 

    +

    7 Attributes 

    +

    8 ---------- 

    +

    9 BEAM: str 

    +

    10 Filters for beam elements 

    +

    11 SHELL: str 

    +

    12 Filters for shell elements 

    +

    13 SOLID: str 

    +

    14 Filters for solid elements 

    +

    15 TSHELL: str 

    +

    16 Filters for thick shells elements 

    +

    17 PART: str 

    +

    18 Filters for parts 

    +

    19 NODE: str 

    +

    20 Filters for nodes 

    +

    21 

    +

    22 Examples 

    +

    23 -------- 

    +

    24 >>> part_ids = [13, 14] 

    +

    25 >>> d3plot.get_part_filter(FilterType.SHELL, part_ids) 

    +

    26 """ 

    +

    27 

    +

    28 BEAM = "beam" 

    +

    29 SHELL = "shell" 

    +

    30 SOLID = "solid" 

    +

    31 TSHELL = "tshell" 

    +

    32 PART = "part" 

    +

    33 NODE = "node" 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_lsda_py3_py.html b/coverage/d_233c5ceebba6ed8d_lsda_py3_py.html new file mode 100644 index 0000000..1c2eb42 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_lsda_py3_py.html @@ -0,0 +1,740 @@ + + + + + Coverage for lasso/dyna/lsda_py3.py: 14% + + + + + +
    +
    +

    + Coverage for lasso/dyna/lsda_py3.py: + 14% +

    + +

    + 424 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import glob 

    +

    2import struct 

    +

    3 

    +

    4# We disable pylint here since this code is ancient code from LSTC and has the 

    +

    5# respective quality. I tried rewriting it but could not understand it at all 

    +

    6# in time. 

    +

    7# pylint: skip-file 

    +

    8 

    +

    9 

    +

    10class LsdaError(Exception): 

    +

    11 """This is only here, so I can raise an error in case the data type 

    +

    12 sizes are not what I expect""" 

    +

    13 

    +

    14 

    +

    15class _Diskfile: 

    +

    16 """ 

    +

    17 Handles all the low level file I/O. Nothing here should be 

    +

    18 called directly by a user. 

    +

    19 """ 

    +

    20 

    +

    21 packsize = [0, "b", "h", 0, "i", 0, 0, 0, "q"] 

    +

    22 packtype = [0, "b", "h", "i", "q", "B", "H", "I", "Q", "f", "d", "s"] 

    +

    23 sizeof = [0, 1, 2, 4, 8, 1, 2, 4, 8, 4, 8, 1] 

    +

    24 

    +

    25 def __init__(self, name, mode): 

    +

    26 self.mode = mode # file open mode (r,r+,w,w+) 

    +

    27 self.name = name # file name 

    +

    28 self.ateof = 0 # 1 if the file pointer is at EOF 

    +

    29 self.fp = open(name, mode + "b") 

    +

    30 if mode[0] == "r": 

    +

    31 s = self.fp.read(8) 

    +

    32 header = struct.unpack("BBBBBBBB", s) 

    +

    33 if header[0] > 8: 

    +

    34 self.fp.seek(header[0]) 

    +

    35 else: 

    +

    36 header = [8, 8, 8, 1, 1, 0, 0, 0] 

    +

    37 # Determine if my native ordering is big or little endian.... 

    +

    38 b = struct.unpack("bbbb", struct.pack("i", 1)) 

    +

    39 if b[0]: 

    +

    40 header[5] = 1 

    +

    41 else: 

    +

    42 header[5] = 0 

    +

    43 self.lengthsize = header[1] 

    +

    44 self.offsetsize = header[2] 

    +

    45 self.commandsize = header[3] 

    +

    46 self.typesize = header[4] 

    +

    47 if header[5] == 0: 

    +

    48 self.ordercode = ">" 

    +

    49 else: 

    +

    50 self.ordercode = "<" 

    +

    51 self.ounpack = self.ordercode + _Diskfile.packsize[self.offsetsize] 

    +

    52 self.lunpack = self.ordercode + _Diskfile.packsize[self.lengthsize] 

    +

    53 self.lcunpack = ( 

    +

    54 self.ordercode 

    +

    55 + _Diskfile.packsize[self.lengthsize] 

    +

    56 + _Diskfile.packsize[self.commandsize] 

    +

    57 ) 

    +

    58 self.tolunpack = ( 

    +

    59 self.ordercode 

    +

    60 + _Diskfile.packsize[self.typesize] 

    +

    61 + _Diskfile.packsize[self.offsetsize] 

    +

    62 + _Diskfile.packsize[self.lengthsize] 

    +

    63 ) 

    +

    64 self.comp1 = self.typesize + self.offsetsize + self.lengthsize 

    +

    65 self.comp2 = self.lengthsize + self.commandsize + self.typesize + 1 

    +

    66 if mode[0] != "r": 

    +

    67 # Write initial header and ST offset command. 

    +

    68 s = bytes("", "UTF-8") 

    +

    69 for h in header: 

    +

    70 s = s + struct.pack("B", h) 

    +

    71 self.fp.write(s) 

    +

    72 self.writecommand(17, Lsda.SYMBOLTABLEOFFSET) 

    +

    73 self.writeoffset(17, 0) 

    +

    74 self.lastoffset = 17 

    +

    75 

    +

    76 def readcommand(self): 

    +

    77 """Read a LENGTH,COMMAND pair from the file at the current location""" 

    +

    78 s = self.fp.read(self.lengthsize + self.commandsize) 

    +

    79 return struct.unpack(self.lcunpack, s) 

    +

    80 

    +

    81 def writecommand(self, length, cmd): 

    +

    82 """Write a LENGTH,COMMAND pair to the file at the current location""" 

    +

    83 s = struct.pack(self.lcunpack, length, cmd) 

    +

    84 self.fp.write(s) 

    +

    85 

    +

    86 def readoffset(self): 

    +

    87 """Read an OFFSET from the file at the current location""" 

    +

    88 s = self.fp.read(self.offsetsize) 

    +

    89 return struct.unpack(self.ounpack, s)[0] 

    +

    90 

    +

    91 def writeoffset(self, offset, value): 

    +

    92 """Write an OFFSET to the file at the given location""" 

    +

    93 self.fp.seek(offset, 0) 

    +

    94 s = struct.pack(self.ounpack, value) 

    +

    95 self.fp.write(s) 

    +

    96 self.ateof = 0 

    +

    97 

    +

    98 def writelength(self, length): 

    +

    99 """Write a LENGTH to the file at the current location""" 

    +

    100 s = struct.pack(self.lunpack, length) 

    +

    101 self.fp.write(s) 

    +

    102 

    +

    103 def writecd(self, dir): 

    +

    104 """Write a whole CD command to the file at the current location""" 

    +

    105 length = self.lengthsize + self.commandsize + len(dir) 

    +

    106 s = struct.pack(self.lcunpack, length, Lsda.CD) 

    +

    107 self.fp.write(s) 

    +

    108 if type(dir) is str: 

    +

    109 self.fp.write(bytes(dir, "utf-8")) 

    +

    110 else: 

    +

    111 self.fp.write(dir) 

    +

    112 

    +

    113 def writestentry(self, r): 

    +

    114 """Write a VARIABLE command (symbol table entry) to the file at 

    +

    115 the current location""" 

    +

    116 length = ( 

    +

    117 2 * self.lengthsize + self.commandsize + len(r.name) + self.typesize + self.offsetsize 

    +

    118 ) 

    +

    119 s = struct.pack(self.lcunpack, length, Lsda.VARIABLE) 

    +

    120 self.fp.write(s) 

    +

    121 if type(r.name) is str: 

    +

    122 self.fp.write(bytes(r.name, "utf-8")) 

    +

    123 else: 

    +

    124 self.fp.write(r.name) 

    +

    125 s = struct.pack(self.tolunpack, r.type, r.offset, r.length) 

    +

    126 self.fp.write(s) 

    +

    127 

    +

    128 def writedata(self, sym, data): 

    +

    129 """Write a DATA command to the file at the current location""" 

    +

    130 nlen = len(sym.name) 

    +

    131 length = ( 

    +

    132 self.lengthsize 

    +

    133 + self.commandsize 

    +

    134 + self.typesize 

    +

    135 + 1 

    +

    136 + nlen 

    +

    137 + self.sizeof[sym.type] * sym.length 

    +

    138 ) 

    +

    139 sym.offset = self.fp.tell() 

    +

    140 self.fp.write(struct.pack(self.lcunpack, length, Lsda.DATA)) 

    +

    141 self.fp.write(struct.pack("bb", sym.type, nlen) + bytes(sym.name, "utf-8")) 

    +

    142 # fmt=self.ordercode+self.packtype[sym.type]*sym.length 

    +

    143 fmt = "%c%d%c" % (self.ordercode, sym.length, self.packtype[sym.type]) 

    +

    144 self.fp.write(struct.pack(fmt, *data)) 

    +

    145 sym.file = self 

    +

    146 

    +

    147 

    +

    148class Symbol: 

    +

    149 """ 

    +

    150 A directory tree structure. A Symbol can be a directory (type==0) 

    +

    151 or data 

    +

    152 """ 

    +

    153 

    +

    154 def __init__(self, name="", parent=0): 

    +

    155 self.name = name # name of var or directory 

    +

    156 self.type = 0 # data type 

    +

    157 self.offset = 0 # offset of DATA record in file 

    +

    158 self.length = 0 # number of data entries, or # of children 

    +

    159 self.file = 0 # which file the data is in 

    +

    160 self.children = {} # directory contents 

    +

    161 self.parent = parent # directory that holds me 

    +

    162 if parent: 

    +

    163 parent.children[name] = self 

    +

    164 parent.length = len(parent.children) 

    +

    165 

    +

    166 def path(self): 

    +

    167 """Return absolute path for this Symbol""" 

    +

    168 if not self.parent: 

    +

    169 return "/" 

    +

    170 sym = self 

    +

    171 ret = "/" + sym.name 

    +

    172 while sym.parent and sym.parent.name != "/": 

    +

    173 sym = sym.parent 

    +

    174 ret = "/" + sym.name + ret 

    +

    175 return ret 

    +

    176 

    +

    177 def get(self, name): 

    +

    178 """Return the Symbol with the indicated name. The name can be 

    +

    179 prefixed with a relative or absolute path""" 

    +

    180 # If I am just a variable, let my parent handle this 

    +

    181 if self.type != 0: 

    +

    182 return self.parent.get(name) 

    +

    183 # If I have this variable, return it 

    +

    184 if name in self.children: 

    +

    185 return self.children[name] 

    +

    186 # If name has a path component, then look for it there 

    +

    187 if name[0] == "/": # absolute path 

    +

    188 parts = name.split("/")[1:] 

    +

    189 sym = self 

    +

    190 while sym.parent: 

    +

    191 sym = sym.parent 

    +

    192 for i in range(len(parts)): 

    +

    193 if parts[i] in sym.children: 

    +

    194 sym = sym.children[parts[i]] 

    +

    195 else: 

    +

    196 return None 

    +

    197 return sym 

    +

    198 if name[0] == ".": # relative path 

    +

    199 parts = name.split("/")[1:] 

    +

    200 # Throw out any "." in the path -- those are just useless.... 

    +

    201 parts = filter(lambda p: p != ".", parts) 

    +

    202 if len(parts) == 0: 

    +

    203 return self 

    +

    204 sym = self 

    +

    205 for i in range(parts): 

    +

    206 if parts[i] == "..": 

    +

    207 if sym.parent: 

    +

    208 sym = sym.parent 

    +

    209 elif parts[i] in sym: 

    +

    210 sym = sym.children[parts[i]] 

    +

    211 else: 

    +

    212 return None 

    +

    213 return sym 

    +

    214 # Not found 

    +

    215 return None 

    +

    216 

    +

    217 def lread(self, start=0, end=2000000000): 

    +

    218 """Read data from the file. 

    +

    219 If this symbol is a DIRECTORY, this returns a sorted list of the 

    +

    220 contents of the directory, and "start" and "end" are ignored. 

    +

    221 Otherwise, read and return data[start:end] (including start but 

    +

    222 not including end -- standard Python slice behavior). 

    +

    223 This routine does NOT follow links.""" 

    +

    224 if self.type == 0: # directory -- return listing 

    +

    225 return sorted(self.children.keys()) 

    +

    226 if end > self.length: 

    +

    227 end = self.length 

    +

    228 if end < 0: 

    +

    229 end = self.length + end 

    +

    230 if start > self.length: 

    +

    231 return () 

    +

    232 if start < 0: 

    +

    233 start = self.length + start 

    +

    234 if start >= end: 

    +

    235 return () 

    +

    236 size = _Diskfile.sizeof[self.type] 

    +

    237 pos = self.offset + self.file.comp2 + len(self.name) + start * size 

    +

    238 self.file.fp.seek(pos) 

    +

    239 self.file.ateof = 0 

    +

    240 # format = self.file.ordercode + _Diskfile.packtype[self.type]*(end-start) 

    +

    241 # return struct.unpack(format,self.file.fp.read(size*(end-start))) 

    +

    242 format = "%c%d%c" % (self.file.ordercode, (end - start), _Diskfile.packtype[self.type]) 

    +

    243 if self.type == Lsda.LINK: 

    +

    244 return struct.unpack(format, self.file.fp.read(size * (end - start)))[0] 

    +

    245 else: 

    +

    246 return struct.unpack(format, self.file.fp.read(size * (end - start))) 

    +

    247 

    +

    248 def read(self, start=0, end=2000000000): 

    +

    249 """Read data from the file. Same as lread, but follows links""" 

    +

    250 return _resolve_link(self).lread(start, end) 

    +

    251 

    +

    252 def read_raw(self, start=0, end=2000000000): 

    +

    253 """Read data from the file and return as bytestring""" 

    +

    254 if self.type == 0: # directory -- return listing 

    +

    255 return sorted(self.children.keys()) 

    +

    256 if end > self.length: 

    +

    257 end = self.length 

    +

    258 if end < 0: 

    +

    259 end = self.length + end 

    +

    260 if start > self.length: 

    +

    261 return () 

    +

    262 if start < 0: 

    +

    263 start = self.length + start 

    +

    264 if start >= end: 

    +

    265 return () 

    +

    266 size = _Diskfile.sizeof[self.type] 

    +

    267 pos = self.offset + self.file.comp2 + len(self.name) + start * size 

    +

    268 self.file.fp.seek(pos) 

    +

    269 self.file.ateof = 0 

    +

    270 size = size * (end - start) 

    +

    271 return self.file.fp.read(size) 

    +

    272 

    +

    273 

    +

    274def _resolve_link(var): 

    +

    275 """Follow a link to find what it finally resolves to""" 

    +

    276 ret = var 

    +

    277 while ret.type == Lsda.LINK: 

    +

    278 ret = ret.get(ret.lread()) 

    +

    279 return ret 

    +

    280 

    +

    281 

    +

    282def _readentry(f, reclen, parent): 

    +

    283 """ 

    +

    284 Read a VARIABLE record from the file, and construct the proper Symbol 

    +

    285 Users should never call this. 

    +

    286 """ 

    +

    287 s = f.fp.read(reclen) 

    +

    288 n = reclen - f.comp1 

    +

    289 name = s[:n] 

    +

    290 # If parent already has a symbol by this name, orphan it.... 

    +

    291 # if parent.children.has_key(name)): 

    +

    292 if name in parent.children: 

    +

    293 var = parent.children[name] 

    +

    294 else: 

    +

    295 var = Symbol(name, parent) 

    +

    296 (var.type, var.offset, var.length) = struct.unpack(f.tolunpack, s[n:]) 

    +

    297 var.file = f 

    +

    298 

    +

    299 

    +

    300def _readsymboltable(lsda, f): 

    +

    301 """ 

    +

    302 Read all the SYMBOLTABLEs in the current file 

    +

    303 Users should never call this. 

    +

    304 """ 

    +

    305 f.ateof = 0 

    +

    306 while 1: 

    +

    307 f.lastoffset = f.fp.tell() 

    +

    308 offset = f.readoffset() 

    +

    309 if offset == 0: 

    +

    310 return 

    +

    311 f.fp.seek(offset) 

    +

    312 (clen, cmd) = f.readcommand() 

    +

    313 if cmd != Lsda.BEGINSYMBOLTABLE: 

    +

    314 return 

    +

    315 while 1: 

    +

    316 (clen, cmd) = f.readcommand() 

    +

    317 clen = clen - f.commandsize - f.lengthsize 

    +

    318 if cmd == Lsda.CD: 

    +

    319 path = f.fp.read(clen) 

    +

    320 lsda.cd(path, 1) 

    +

    321 elif cmd == Lsda.VARIABLE: 

    +

    322 _readentry(f, clen, lsda.cwd) 

    +

    323 else: # is end of symbol table...get next part if there is one 

    +

    324 break 

    +

    325 

    +

    326 

    +

    327def _writesymboltable(lsda, f): 

    +

    328 """ 

    +

    329 Collect all the symbols we want to write out, and sort 

    +

    330 them by path. This is a bit strange: the symbols don't store 

    +

    331 the path, but build it when needed. So build it, and store 

    +

    332 (symbol,path) pairs, then sort by path. "path" returns the full 

    +

    333 path to the symbol, and we only want the directory it is in, so 

    +

    334 get the path of its parent instead. 

    +

    335 """ 

    +

    336 if len(lsda.dirty_symbols) == 0: 

    +

    337 return 

    +

    338 

    +

    339 slist = [] 

    +

    340 for s in lsda.dirty_symbols: 

    +

    341 p = s.parent.path() 

    +

    342 slist.append((s, p)) 

    +

    343 # slist.sort(key = lambda r1,r2: cmp(r1[1],r2[1])) 

    +

    344 slist.sort(key=lambda x: x[1]) 

    +

    345 lsda.dirty_symbols = set() 

    +

    346 

    +

    347 # Move to end of the file and write the symbol table 

    +

    348 if not f.ateof: 

    +

    349 f.fp.seek(0, 2) 

    +

    350 f.ateof = 1 

    +

    351 start_st_at = f.fp.tell() 

    +

    352 f.writecommand(0, Lsda.BEGINSYMBOLTABLE) 

    +

    353 cwd = None 

    +

    354 

    +

    355 # Write all records 

    +

    356 for (s, path) in slist: 

    +

    357 if path != cwd: 

    +

    358 cdcmd = _get_min_cd(cwd, path) 

    +

    359 f.writecd(cdcmd) 

    +

    360 cwd = path 

    +

    361 f.writestentry(s) 

    +

    362 

    +

    363 # Finish ST: write END record, and patch up ST length 

    +

    364 cmdlen = f.offsetsize + f.lengthsize + f.commandsize 

    +

    365 f.writecommand(cmdlen, Lsda.ENDSYMBOLTABLE) 

    +

    366 nextoffset = f.fp.tell() 

    +

    367 f.writeoffset(nextoffset, 0) 

    +

    368 cmdlen = nextoffset + f.offsetsize - start_st_at 

    +

    369 f.fp.seek(start_st_at) 

    +

    370 f.writelength(cmdlen) 

    +

    371 

    +

    372 # Purge symbol table, if we are only writing 

    +

    373 if f.mode == "w": 

    +

    374 cwd = lsda.cwd 

    +

    375 cwd.children = {} 

    +

    376 while cwd.parent: 

    +

    377 cwd.parent.children = {cwd.name: cwd} 

    +

    378 cwd = cwd.parent 

    +

    379 

    +

    380 # And add link from previous ST 

    +

    381 f.writeoffset(f.lastoffset, start_st_at) 

    +

    382 f.lastoffset = nextoffset 

    +

    383 f.ateof = 0 

    +

    384 

    +

    385 

    +

    386def _get_min_cd(cwd, cd): 

    +

    387 """ 

    +

    388 Given two absolute paths, return the shortest "cd" string that 

    +

    389 gets from the first (cwd) to the second (cd) 

    +

    390 """ 

    +

    391 if cwd is None: 

    +

    392 return cd 

    +

    393 

    +

    394 # Find common part of path 

    +

    395 have = cwd.split("/")[1:] 

    +

    396 want = cd.split("/")[1:] 

    +

    397 nhave = len(have) 

    +

    398 nwant = len(want) 

    +

    399 n = min(nhave, nwant) 

    +

    400 head = 0 

    +

    401 head_length = 0 

    +

    402 for i in range(n): 

    +

    403 if have[i] != want[i]: 

    +

    404 break 

    +

    405 head = i + 1 

    +

    406 head_length = head_length + len(have[i]) 

    +

    407 if head == 0: 

    +

    408 return cd 

    +

    409 

    +

    410 # head = # of common components. 

    +

    411 # head_length = string length of common part of path (sans "/" separators) 

    +

    412 # tail1 = Number of components we would need ".." leaders for 

    +

    413 tail1 = nhave - head 

    +

    414 

    +

    415 # Now see if "cd" is shorter than "../../tail_part" 

    +

    416 if 2 * tail1 >= head_length: 

    +

    417 return cd 

    +

    418 

    +

    419 # nope, the ".." version is shorter.... 

    +

    420 return tail1 * "../" + "/".join(want[head:]) 

    +

    421 

    +

    422 

    +

    423class Lsda: 

    +

    424 """ 

    +

    425 Main class: holds all the Symbols for an LSDA file, and has methods 

    +

    426 for reading data from and writing data to the file 

    +

    427 """ 

    +

    428 

    +

    429 CD = 2 

    +

    430 DATA = 3 

    +

    431 VARIABLE = 4 

    +

    432 BEGINSYMBOLTABLE = 5 

    +

    433 ENDSYMBOLTABLE = 6 

    +

    434 SYMBOLTABLEOFFSET = 7 

    +

    435 I1 = 1 

    +

    436 I2 = 2 

    +

    437 I4 = 3 

    +

    438 I8 = 4 

    +

    439 U1 = 5 

    +

    440 U2 = 6 

    +

    441 U4 = 7 

    +

    442 U8 = 8 

    +

    443 R4 = 9 

    +

    444 R8 = 10 

    +

    445 LINK = 11 

    +

    446 

    +

    447 def __init__(self, files, mode="r"): 

    +

    448 """Creates the LSDA structure, opens the file and reads the 

    +

    449 SYMBOLTABLE (if reading), or creates the initial file contents 

    +

    450 (if writing). "files" is a tuple of file names to be opened 

    +

    451 and treated as a single file. All the %XXX continuation files 

    +

    452 will be automatically included. "mode" is the file open mode: 

    +

    453 "r", "r+", "w", or "w+". If a "w" mode is selected, "files" 

    +

    454 must contain only a single file name""" 

    +

    455 

    +

    456 # If they only input a single name, put it in a tuple, so I can 

    +

    457 # accept input of either kind 

    +

    458 if not types_ok: 

    +

    459 raise LsdaError 

    +

    460 if not isinstance(files, (tuple, list)): 

    +

    461 files = (files,) 

    +

    462 self.files = [] 

    +

    463 

    +

    464 if mode[0] == "r": 

    +

    465 # Open all the files in the list that is input, and anything 

    +

    466 # that looks like a continuation of one of them. 

    +

    467 nameset = set() 

    +

    468 for name in files: 

    +

    469 nameset.add(name) 

    +

    470 nameset = nameset.union(set(glob.glob(name + "%[0-9][0-9]*"))) 

    +

    471 

    +

    472 # Convert to a list and sort, because if I'm going to be writing, 

    +

    473 # I want the last one in the list to be the last one of its family 

    +

    474 namelist = list(nameset) 

    +

    475 namelist.sort() 

    +

    476 for file in namelist: 

    +

    477 self.files.append(_Diskfile(file, mode)) 

    +

    478 self.root = Symbol("/") 

    +

    479 for f in self.files: 

    +

    480 # We are already positioned to read the SYMBOLTABLEOFFSET record 

    +

    481 _, cmd = f.readcommand() 

    +

    482 self.cwd = self.root 

    +

    483 if cmd == Lsda.SYMBOLTABLEOFFSET: 

    +

    484 _readsymboltable(self, f) 

    +

    485 else: 

    +

    486 if len(files) > 1: 

    +

    487 return None # can't open multiple files for WRITING 

    +

    488 self.files.append(_Diskfile(files[0], mode)) 

    +

    489 self.root = Symbol("/") 

    +

    490 self.cwd = self.root 

    +

    491 self.dirty_symbols = set() 

    +

    492 self.lastpath = None 

    +

    493 self.mode = mode 

    +

    494 

    +

    495 # writing will always be to the last one of the files 

    +

    496 if mode == "r": 

    +

    497 self.fw = None 

    +

    498 self.make_dirs = 0 

    +

    499 else: 

    +

    500 self.fw = self.files[-1] 

    +

    501 self.make_dirs = 1 

    +

    502 

    +

    503 def __del__(self): # close files 

    +

    504 self.flush() 

    +

    505 for f in self.files: 

    +

    506 if not f.fp.closed: 

    +

    507 f.fp.close() 

    +

    508 

    +

    509 def cd(self, path, create=2): # change CWD 

    +

    510 """Change the current working directory in the file. The optional 

    +

    511 argument "create" is for internal use only""" 

    +

    512 # DEBUG FIX qd-codie: 

    +

    513 # Someone forgot to decode bytes into str here. Due to this the 

    +

    514 # following comparisons always went wrong (of course they were) 

    +

    515 # not similar ... 

    +

    516 if isinstance(path, bytes): 

    +

    517 path = path.decode("utf-8") 

    +

    518 if path == "/": 

    +

    519 self.cwd = self.root 

    +

    520 return self.root 

    +

    521 if path[-1] == "/": # remove trailing / 

    +

    522 path = path[:-1] 

    +

    523 if path[0] == "/": # absolute path 

    +

    524 path = path[1:] 

    +

    525 self.cwd = self.root 

    +

    526 # path = string.split(path,"/") 

    +

    527 # print(type(path)) 

    +

    528 if type(path) is bytes: 

    +

    529 path = str(path, "utf-8").split("/") 

    +

    530 else: 

    +

    531 path = path.split("/") 

    +

    532 

    +

    533 for part in path: 

    +

    534 if part == "..": 

    +

    535 if self.cwd.parent: 

    +

    536 self.cwd = self.cwd.parent 

    +

    537 else: 

    +

    538 # if self.cwd.children.has_key(part)): 

    +

    539 if part in self.cwd.children: 

    +

    540 self.cwd = self.cwd.children[part] 

    +

    541 if self.cwd.type != 0: # component is a variable, not a directory! 

    +

    542 self.cwd = self.cwd.parent 

    +

    543 break 

    +

    544 elif create == 1 or (create == 2 and self.make_dirs == 1): 

    +

    545 self.cwd = Symbol(part, self.cwd) # Create directory on the fly 

    +

    546 else: # component in path is missing 

    +

    547 break 

    +

    548 return self.cwd 

    +

    549 

    +

    550 def write(self, name, type, data): 

    +

    551 """Write a new DATA record to the file. Creates and returns 

    +

    552 the Symbol for the data written""" 

    +

    553 if self.fw is None: 

    +

    554 return None 

    +

    555 

    +

    556 # want a tuple, but if they hand us a single value that should work too... 

    +

    557 try: 

    +

    558 _ = data[0] 

    +

    559 except TypeError: 

    +

    560 data = (data,) 

    +

    561 pwd = self.cwd.path() 

    +

    562 if not self.fw.ateof: 

    +

    563 self.fw.fp.seek(0, 2) 

    +

    564 self.fw.ateof = 1 

    +

    565 if pwd != self.lastpath: 

    +

    566 cdcmd = _get_min_cd(self.lastpath, pwd) 

    +

    567 self.fw.writecd(cdcmd) 

    +

    568 self.lastpath = pwd 

    +

    569 

    +

    570 # Overwrite existing symbol if there is one 

    +

    571 if name in self.cwd.children: 

    +

    572 sym = self.cwd.children[name] 

    +

    573 else: 

    +

    574 sym = Symbol(name, self.cwd) 

    +

    575 sym.type = type 

    +

    576 sym.length = len(data) 

    +

    577 self.fw.writedata(sym, data) 

    +

    578 self.dirty_symbols.add(sym) 

    +

    579 return sym 

    +

    580 

    +

    581 def close(self): 

    +

    582 """Close the file""" 

    +

    583 self.flush() 

    +

    584 for f in self.files: 

    +

    585 if not f.fp.closed: 

    +

    586 f.fp.close() 

    +

    587 self.files = [] 

    +

    588 

    +

    589 def get(self, path): 

    +

    590 """Return the Symbol with the indicated name. The name can be 

    +

    591 prefixed with a relative or absolute path""" 

    +

    592 return self.cwd.get(path) 

    +

    593 

    +

    594 def flush(self): # write ST and flush file 

    +

    595 """Write a SYMBOLTABLE as needed for any new DATA, and flush the file""" 

    +

    596 if self.fw is None or self.fw.fp.closed: 

    +

    597 return 

    +

    598 _writesymboltable(self, self.fw) 

    +

    599 self.fw.fp.flush() 

    +

    600 

    +

    601 def filesize(self): 

    +

    602 """Returns the current size, on disk, of the file we are currently 

    +

    603 writing to. Returns 0 for files that are opened readonly""" 

    +

    604 if self.fw is None: 

    +

    605 return 0 

    +

    606 if not self.fw.ateof: 

    +

    607 self.fw.fp.seek(0, 2) 

    +

    608 self.fw.ateof = 1 

    +

    609 return self.fw.fp.tell() 

    +

    610 

    +

    611 def nextfile(self): # Open next file in sequence 

    +

    612 """Flush the current output file and open the next file in the 

    +

    613 sequence""" 

    +

    614 if self.fw is None: 

    +

    615 return None 

    +

    616 if not self.fw.fp.closed: 

    +

    617 _writesymboltable(self, self.fw) 

    +

    618 self.fw.fp.flush() 

    +

    619 parts = self.fw.name.split("%") 

    +

    620 if len(parts) == 1: 

    +

    621 ret = 1 

    +

    622 newname = parts[0] + "%001" 

    +

    623 else: 

    +

    624 ret = int(parts[1]) + 1 

    +

    625 newname = "%s%%%3.3d" % (parts[0], ret) 

    +

    626 if self.mode == "w": 

    +

    627 self.fw = _Diskfile(newname, "w") 

    +

    628 else: 

    +

    629 self.fw = _Diskfile(newname, "w+") 

    +

    630 self.files.append(self.fw) 

    +

    631 self.lastpath = None 

    +

    632 return ret 

    +

    633 

    +

    634 

    +

    635types = [("b", 1), ("h", 2), ("i", 4), ("q", 8), ("f", 4), ("d", 8)] 

    +

    636x = 17 

    +

    637types_ok = 1 

    +

    638for (a, b) in types: 

    +

    639 s = struct.pack(a, x) 

    +

    640 if len(s) != b: 

    +

    641 print("LSDA: initialization error") 

    +

    642 print("Data type %s has length %d instead of %d" % (a, len(s), b)) 

    +

    643 types_ok = 0 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_test_d3plot_header_py.html b/coverage/d_233c5ceebba6ed8d_test_d3plot_header_py.html new file mode 100644 index 0000000..022ee70 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_test_d3plot_header_py.html @@ -0,0 +1,199 @@ + + + + + Coverage for lasso/dyna/test_d3plot_header.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dyna/test_d3plot_header.py: + 100% +

    + +

    + 42 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from unittest import TestCase 

    +

    2 

    +

    3import numpy as np 

    +

    4from lasso.dyna.d3plot_header import ( 

    +

    5 D3plotFiletype, 

    +

    6 D3plotHeader, 

    +

    7 d3plot_filetype_from_integer, 

    +

    8 get_digit, 

    +

    9) 

    +

    10from lasso.io.binary_buffer import BinaryBuffer 

    +

    11 

    +

    12 

    +

    13class D3plotHeaderTest(TestCase): 

    +

    14 def test_loading(self): 

    +

    15 

    +

    16 filepaths = [ 

    +

    17 "test/simple_d3plot/d3plot", 

    +

    18 "test/d3plot_node_temperature/d3plot", 

    +

    19 "test/d3plot_beamip/d3plot", 

    +

    20 "test/d3plot_solid_int/d3plot", 

    +

    21 ] 

    +

    22 

    +

    23 for filepath in filepaths: 

    +

    24 D3plotHeader().load_file(filepath) 

    +

    25 

    +

    26 # TODO more 

    +

    27 

    +

    28 def test_get_digit(self) -> None: 

    +

    29 

    +

    30 number = 1234567890 

    +

    31 

    +

    32 # the numbers are sorted from the lowest importance 

    +

    33 # upwards 

    +

    34 # 0 -> 0 

    +

    35 # 1 -> 9 

    +

    36 # ... 

    +

    37 number_str = str(number)[::-1] 

    +

    38 

    +

    39 for index in range(len(number_str)): 

    +

    40 digit = get_digit(number, index) 

    +

    41 self.assertEqual( 

    +

    42 digit, 

    +

    43 int(number_str[index]), 

    +

    44 f"index {index} digit {digit} digit_str {number_str[index]}", 

    +

    45 ) 

    +

    46 

    +

    47 self.assertEqual(get_digit(number, 10), 0) 

    +

    48 

    +

    49 def test_d3plot_filetype_from_integer(self) -> None: 

    +

    50 

    +

    51 self.assertEqual( 

    +

    52 d3plot_filetype_from_integer(1), 

    +

    53 D3plotFiletype.D3PLOT, 

    +

    54 ) 

    +

    55 self.assertEqual( 

    +

    56 d3plot_filetype_from_integer(5), 

    +

    57 D3plotFiletype.D3PART, 

    +

    58 ) 

    +

    59 self.assertEqual( 

    +

    60 d3plot_filetype_from_integer(11), 

    +

    61 D3plotFiletype.D3EIGV, 

    +

    62 ) 

    +

    63 

    +

    64 # INFOR is forbidden 

    +

    65 with self.assertRaises(ValueError): 

    +

    66 d3plot_filetype_from_integer(4) 

    +

    67 

    +

    68 with self.assertRaises(ValueError): 

    +

    69 d3plot_filetype_from_integer(0) 

    +

    70 

    +

    71 def test_determine_file_settings(self) -> None: 

    +

    72 

    +

    73 # the routine checks the "filetype" flag 

    +

    74 # if it makes any sense under any circumstances 

    +

    75 # we assume the corresponding file settings 

    +

    76 

    +

    77 # 44 -> int32 

    +

    78 # 88 -> int64 

    +

    79 for position in (44, 88): 

    +

    80 for filetype in (D3plotFiletype.D3PLOT, D3plotFiletype.D3PART, D3plotFiletype.D3EIGV): 

    +

    81 

    +

    82 bb = BinaryBuffer() 

    +

    83 bb.memoryview = memoryview(bytearray(256)) 

    +

    84 bb.write_number(position, filetype.value, np.int32) 

    +

    85 

    +

    86 word_size, itype, ftype = D3plotHeader._determine_file_settings(bb) 

    +

    87 

    +

    88 if position == 44: 

    +

    89 self.assertEqual(word_size, 4) 

    +

    90 self.assertEqual(itype, np.int32) 

    +

    91 self.assertEqual(ftype, np.float32) 

    +

    92 else: 

    +

    93 self.assertEqual(word_size, 8) 

    +

    94 self.assertEqual(itype, np.int64) 

    +

    95 self.assertEqual(ftype, np.float64) 

    +

    96 

    +

    97 # error 

    +

    98 bb = BinaryBuffer() 

    +

    99 bb.memoryview = memoryview(bytearray(256)) 

    +

    100 

    +

    101 with self.assertRaises(RuntimeError): 

    +

    102 D3plotHeader._determine_file_settings(bb) 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_test_d3plot_py.html b/coverage/d_233c5ceebba6ed8d_test_d3plot_py.html new file mode 100644 index 0000000..06228d3 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_test_d3plot_py.html @@ -0,0 +1,578 @@ + + + + + Coverage for lasso/dyna/test_d3plot.py: 96% + + + + + +
    +
    +

    + Coverage for lasso/dyna/test_d3plot.py: + 96% +

    + +

    + 198 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import tempfile 

    +

    3from lasso.io.binary_buffer import BinaryBuffer 

    +

    4from lasso.femzip.femzip_api import FemzipAPI 

    +

    5from unittest import TestCase 

    +

    6 

    +

    7import struct 

    +

    8import numpy as np 

    +

    9 

    +

    10from lasso.dyna.d3plot import D3plot, FilterType, _negative_to_positive_state_indexes 

    +

    11from lasso.dyna.array_type import ArrayType 

    +

    12 

    +

    13 

    +

    14class D3plotTest(TestCase): 

    +

    15 def test_init(self): 

    +

    16 

    +

    17 # settings 

    +

    18 self.maxDiff = None 

    +

    19 

    +

    20 filepath = "test/simple_d3plot/d3plot" 

    +

    21 

    +

    22 geometry_array_shapes = { 

    +

    23 "node_coordinates": (4915, 3), 

    +

    24 "element_solid_part_indexes": (0,), 

    +

    25 "element_solid_node_indexes": (0, 8), 

    +

    26 "element_tshell_node_indexes": (0, 8), 

    +

    27 "element_tshell_part_indexes": (0,), 

    +

    28 "element_beam_part_indexes": (0,), 

    +

    29 "element_beam_node_indexes": (0, 5), 

    +

    30 "element_shell_node_indexes": (4696, 4), 

    +

    31 "element_shell_part_indexes": (4696,), 

    +

    32 "node_ids": (4915,), 

    +

    33 "element_solid_ids": (0,), 

    +

    34 "element_beam_ids": (0,), 

    +

    35 "element_shell_ids": (4696,), 

    +

    36 "element_tshell_ids": (0,), 

    +

    37 "part_titles_ids": (1,), 

    +

    38 "part_titles": (1,), 

    +

    39 } 

    +

    40 

    +

    41 state_array_shapes = { 

    +

    42 "timesteps": (1,), 

    +

    43 "global_kinetic_energy": (1,), 

    +

    44 "global_internal_energy": (1,), 

    +

    45 "global_total_energy": (1,), 

    +

    46 "global_velocity": (1, 3), 

    +

    47 "part_internal_energy": (1, 1), 

    +

    48 "part_kinetic_energy": (1, 1), 

    +

    49 "part_velocity": (1, 1, 3), 

    +

    50 "part_mass": (1, 1), 

    +

    51 "part_hourglass_energy": (1, 1), 

    +

    52 "node_displacement": (1, 4915, 3), 

    +

    53 "node_velocity": (1, 4915, 3), 

    +

    54 "node_acceleration": (1, 4915, 3), 

    +

    55 "element_shell_stress": (1, 4696, 3, 6), 

    +

    56 "element_shell_effective_plastic_strain": (1, 4696, 3), 

    +

    57 "element_shell_history_vars": (1, 4696, 3, 19), 

    +

    58 "element_shell_bending_moment": (1, 4696, 3), 

    +

    59 "element_shell_shear_force": (1, 4696, 2), 

    +

    60 "element_shell_normal_force": (1, 4696, 3), 

    +

    61 "element_shell_thickness": (1, 4696), 

    +

    62 "element_shell_unknown_variables": (1, 4696, 2), 

    +

    63 "element_shell_strain": (1, 4696, 2, 6), 

    +

    64 "element_shell_internal_energy": (1, 4696), 

    +

    65 "element_shell_is_alive": (1, 4696), 

    +

    66 } 

    +

    67 

    +

    68 all_array_shapes = {**geometry_array_shapes, **state_array_shapes} 

    +

    69 

    +

    70 # empty constructor 

    +

    71 D3plot() 

    +

    72 

    +

    73 # file thing 

    +

    74 d3plot = D3plot(filepath) 

    +

    75 d3plot_shapes = {array_name: array.shape for array_name, array in d3plot.arrays.items()} 

    +

    76 self.assertDictEqual(d3plot_shapes, all_array_shapes) 

    +

    77 

    +

    78 # limited buffer files 

    +

    79 d3plot = D3plot(filepath, buffered_reading=True) 

    +

    80 d3plot_shapes = {array_name: array.shape for array_name, array in d3plot.arrays.items()} 

    +

    81 self.assertDictEqual(d3plot_shapes, all_array_shapes) 

    +

    82 

    +

    83 # test loading single state arrays 

    +

    84 for array_name, array_shape in state_array_shapes.items(): 

    +

    85 d3plot = D3plot(filepath, state_array_filter=[array_name]) 

    +

    86 d3plot_shapes = {array_name: array.shape for array_name, array in d3plot.arrays.items()} 

    +

    87 self.assertDictEqual(d3plot_shapes, {**geometry_array_shapes, array_name: array_shape}) 

    +

    88 

    +

    89 # test loading individual states 

    +

    90 d3plot = D3plot(filepath, state_filter={0}) 

    +

    91 d3plot2 = D3plot(filepath) 

    +

    92 hdr_diff, array_diff = d3plot.compare(d3plot2) 

    +

    93 self.assertEqual(d3plot.n_timesteps, 1) 

    +

    94 self.assertDictEqual(hdr_diff, {}) 

    +

    95 self.assertDictEqual(array_diff, {}) 

    +

    96 

    +

    97 def test_header(self): 

    +

    98 

    +

    99 test_header_data = { 

    +

    100 "title": " ", 

    +

    101 "runtime": 1472027823, 

    +

    102 "filetype": 1, 

    +

    103 "source_version": -971095103, 

    +

    104 "release_version": "R712", 

    +

    105 "version": 960.0, 

    +

    106 "ndim": 4, 

    +

    107 "numnp": 4915, 

    +

    108 "it": 0, 

    +

    109 "iu": 1, 

    +

    110 "iv": 1, 

    +

    111 "ia": 1, 

    +

    112 "nel2": 0, 

    +

    113 "nel4": 4696, 

    +

    114 "nel8": 0, 

    +

    115 "nelt": 0, 

    +

    116 "nel20": 0, 

    +

    117 "nel27": 0, 

    +

    118 "nel48": 0, 

    +

    119 "nv1d": 6, 

    +

    120 "nv2d": 102, 

    +

    121 "nv3d": 32, 

    +

    122 "nv3dt": 90, 

    +

    123 "nummat4": 1, 

    +

    124 "nummat8": 0, 

    +

    125 "nummat2": 0, 

    +

    126 "nummatt": 0, 

    +

    127 "icode": 6, 

    +

    128 "nglbv": 13, 

    +

    129 "numst": 0, 

    +

    130 "numds": 0, 

    +

    131 "neiph": 25, 

    +

    132 "neips": 19, 

    +

    133 "maxint": -10003, 

    +

    134 "nmsph": 0, 

    +

    135 "ngpsph": 0, 

    +

    136 "narbs": 9624, 

    +

    137 "ioshl1": 1000, 

    +

    138 "ioshl2": 1000, 

    +

    139 "ioshl3": 1000, 

    +

    140 "ioshl4": 1000, 

    +

    141 "ialemat": 0, 

    +

    142 "ncfdv1": 0, 

    +

    143 "ncfdv2": 0, 

    +

    144 "nadapt": 0, 

    +

    145 "nmmat": 1, 

    +

    146 "numfluid": 0, 

    +

    147 "inn": 1, 

    +

    148 "npefg": 0, 

    +

    149 "idtdt": 0, 

    +

    150 "extra": 0, 

    +

    151 "nt3d": 0, 

    +

    152 "neipb": 0, 

    +

    153 } 

    +

    154 

    +

    155 d3plot = D3plot("test/simple_d3plot/d3plot") 

    +

    156 header = d3plot.header 

    +

    157 

    +

    158 for name, value in test_header_data.items(): 

    +

    159 self.assertEqual(header.raw_header[name], value, "Invalid var %s" % name) 

    +

    160 

    +

    161 def test_beam_integration_points(self): 

    +

    162 

    +

    163 self.maxDiff = None 

    +

    164 

    +

    165 filepath = "test/d3plot_beamip/d3plot" 

    +

    166 maxmin_test_values = { 

    +

    167 # "element_beam_shear_stress": (-0.007316963, 0.), 

    +

    168 "element_beam_shear_stress": (0.0, 0.0056635854), 

    +

    169 "element_beam_axial_stress": (-0.007316963, 0.0), 

    +

    170 "element_beam_plastic_strain": (0.0, 0.0056297667), 

    +

    171 "element_beam_axial_strain": (-0.0073745, 0.0), 

    +

    172 } 

    +

    173 

    +

    174 d3plot = D3plot(filepath) 

    +

    175 

    +

    176 for array_name, minmax in maxmin_test_values.items(): 

    +

    177 array = d3plot.arrays[array_name] 

    +

    178 self.assertAlmostEqual( 

    +

    179 array.min(), 

    +

    180 minmax[0], 

    +

    181 msg="{0}: {1} != {2}".format(array_name, array.min(), minmax[0]), 

    +

    182 ) 

    +

    183 self.assertAlmostEqual( 

    +

    184 array.max(), 

    +

    185 minmax[1], 

    +

    186 msg="{0}: {1} != {2}".format(array_name, array.max(), minmax[1]), 

    +

    187 ) 

    +

    188 

    +

    189 def test_correct_sort_of_more_than_100_state_files(self): 

    +

    190 

    +

    191 filepath = "test/order_d3plot/d3plot" 

    +

    192 

    +

    193 d3plot = D3plot(filepath) 

    +

    194 

    +

    195 timesteps = d3plot.arrays[ArrayType.global_timesteps] 

    +

    196 self.assertListEqual(timesteps.astype(int).tolist(), [1, 2, 10, 11, 12, 22, 100]) 

    +

    197 

    +

    198 def test_femzip_basic(self): 

    +

    199 

    +

    200 self.maxDiff = None 

    +

    201 

    +

    202 filepath1 = "test/femzip/d3plot.fz" 

    +

    203 filepath2 = "test/femzip/d3plot" 

    +

    204 

    +

    205 d3plot_kwargs_list = [{}, {"buffered_reading": True}, {"state_filter": [0]}] 

    +

    206 

    +

    207 D3plot.use_advanced_femzip_api = False 

    +

    208 

    +

    209 for d3plot_kwargs in d3plot_kwargs_list: 

    +

    210 

    +

    211 d3plot1 = D3plot(filepath1, **d3plot_kwargs) 

    +

    212 d3plot2 = D3plot(filepath2, **d3plot_kwargs) 

    +

    213 

    +

    214 hdr_diff, array_diff = d3plot1.compare(d3plot2, array_eps=1e-2) 

    +

    215 

    +

    216 self.assertDictEqual(hdr_diff, {}) 

    +

    217 self.assertDictEqual(array_diff, {}) 

    +

    218 

    +

    219 def test_femzip_extended(self): 

    +

    220 

    +

    221 self.maxDiff = None 

    +

    222 

    +

    223 filepath1 = "test/femzip/d3plot.fz" 

    +

    224 filepath2 = "test/femzip/d3plot" 

    +

    225 

    +

    226 d3plot_kwargs_list = [{}, {"buffered_reading": True}, {"state_filter": [0]}] 

    +

    227 

    +

    228 api = FemzipAPI() 

    +

    229 if not api.has_femunziplib_license(): 

    +

    230 return 

    +

    231 

    +

    232 D3plot.use_advanced_femzip_api = True 

    +

    233 

    +

    234 for d3plot_kwargs in d3plot_kwargs_list: 

    +

    235 

    +

    236 d3plot1 = D3plot(filepath1, **d3plot_kwargs) 

    +

    237 d3plot2 = D3plot(filepath2, **d3plot_kwargs) 

    +

    238 

    +

    239 hdr_diff, array_diff = d3plot1.compare(d3plot2, array_eps=1e-2) 

    +

    240 

    +

    241 self.assertDictEqual(hdr_diff, {}) 

    +

    242 self.assertDictEqual(array_diff, {}) 

    +

    243 

    +

    244 def test_part_filter(self): 

    +

    245 

    +

    246 self.maxDiff = None 

    +

    247 

    +

    248 filepath = "test/simple_d3plot/d3plot" 

    +

    249 part_ids = [1] 

    +

    250 

    +

    251 d3plot = D3plot(filepath) 

    +

    252 shell_filter = d3plot.get_part_filter(FilterType.SHELL, part_ids) 

    +

    253 self.assertEqual(shell_filter.sum(), 4696) 

    +

    254 

    +

    255 part_filter = d3plot.get_part_filter(FilterType.PART, part_ids) 

    +

    256 self.assertEqual(part_filter.sum(), 1) 

    +

    257 

    +

    258 node_filter = d3plot.get_part_filter(FilterType.NODE, part_ids) 

    +

    259 self.assertEqual(len(node_filter), 4915) 

    +

    260 

    +

    261 def test_read_solid_integration_points(self): 

    +

    262 

    +

    263 filepath = "test/d3plot_solid_int/d3plot" 

    +

    264 

    +

    265 # data from META 

    +

    266 stress_valid = np.array( 

    +

    267 [ 

    +

    268 2.132084e02, 

    +

    269 1.792203e02, 

    +

    270 1.397527e02, 

    +

    271 2.307352e02, 

    +

    272 2.132105e02, 

    +

    273 1.792210e02, 

    +

    274 1.397558e02, 

    +

    275 2.307304e02, 

    +

    276 ] 

    +

    277 ) 

    +

    278 pstrain_valid = np.array( 

    +

    279 [ 

    +

    280 2.227418e-02, 

    +

    281 2.576126e-03, 

    +

    282 1.909884e-02, 

    +

    283 3.695280e-02, 

    +

    284 2.227416e-02, 

    +

    285 2.576110e-03, 

    +

    286 1.909888e-02, 

    +

    287 3.695256e-02, 

    +

    288 ] 

    +

    289 ) 

    +

    290 last_timestep = -1 

    +

    291 first_element = 0 

    +

    292 stress_xx = 0 

    +

    293 

    +

    294 d3plot = D3plot(filepath) 

    +

    295 

    +

    296 stress = d3plot.arrays[ArrayType.element_solid_stress] 

    +

    297 np.array_equal(stress[last_timestep, first_element, :, stress_xx], stress_valid) 

    +

    298 

    +

    299 pstrain = d3plot.arrays[ArrayType.element_solid_effective_plastic_strain] 

    +

    300 np.array_equal(pstrain[last_timestep, first_element, :], pstrain_valid) 

    +

    301 

    +

    302 def test_negative_to_positive_state_indexes(self) -> None: 

    +

    303 

    +

    304 indexes = set() 

    +

    305 new_indexes = _negative_to_positive_state_indexes(indexes, len(indexes)) 

    +

    306 self.assertSetEqual(indexes, new_indexes) 

    +

    307 

    +

    308 indexes = {0, 1, 2} 

    +

    309 with self.assertRaises(ValueError): 

    +

    310 new_indexes = _negative_to_positive_state_indexes(indexes, 2) 

    +

    311 

    +

    312 indexes = {0, -1} 

    +

    313 new_indexes = _negative_to_positive_state_indexes(indexes, 8) 

    +

    314 self.assertSetEqual(new_indexes, {0, 7}) 

    +

    315 

    +

    316 def test_is_end_of_file_marker(self) -> None: 

    +

    317 

    +

    318 # -999999. in float32 

    +

    319 bb = BinaryBuffer() 

    +

    320 bb.memoryview = memoryview(struct.pack("<f", -999999.0)) 

    +

    321 

    +

    322 result = D3plot._is_end_of_file_marker(bb, 0, np.float32) 

    +

    323 self.assertEqual(result, True) 

    +

    324 

    +

    325 # -999999. in float64 

    +

    326 bb = BinaryBuffer() 

    +

    327 bb.memoryview = memoryview(struct.pack("<d", -999999.0)) 

    +

    328 

    +

    329 result = D3plot._is_end_of_file_marker(bb, 0, np.float64) 

    +

    330 self.assertEqual(result, True) 

    +

    331 

    +

    332 # some other number 

    +

    333 bb = BinaryBuffer() 

    +

    334 bb.memoryview = memoryview(struct.pack("<d", -41.0)) 

    +

    335 

    +

    336 result = D3plot._is_end_of_file_marker(bb, 0, np.float64) 

    +

    337 self.assertEqual(result, False) 

    +

    338 

    +

    339 # invalid dtype 

    +

    340 with self.assertRaises(ValueError): 

    +

    341 result = D3plot._is_end_of_file_marker(bb, 0, np.int32) 

    +

    342 

    +

    343 def test_write(self): 

    +

    344 

    +

    345 self.maxDiff = None 

    +

    346 

    +

    347 filepaths = [ 

    +

    348 "test/simple_d3plot/d3plot", 

    +

    349 "test/d3plot_beamip/d3plot", 

    +

    350 "test/d3plot_node_temperature/d3plot", 

    +

    351 "test/d3plot_solid_int/d3plot", 

    +

    352 ] 

    +

    353 

    +

    354 d3plot_kwargs_list = [ 

    +

    355 {}, 

    +

    356 {"buffered_reading": True}, 

    +

    357 ] 

    +

    358 

    +

    359 with tempfile.TemporaryDirectory() as dirpath: 

    +

    360 

    +

    361 for d3plot_kwargs in d3plot_kwargs_list: 

    +

    362 for d3plot_filepath, _ in zip(filepaths, d3plot_kwargs_list): 

    +

    363 

    +

    364 print(d3plot_filepath) 

    +

    365 

    +

    366 # read d3plot 

    +

    367 d3plot1 = D3plot(d3plot_filepath, **d3plot_kwargs) 

    +

    368 

    +

    369 # rewrite d3plot 

    +

    370 out_filepath = os.path.join(dirpath, "yay.d3plot") 

    +

    371 d3plot1.write_d3plot(out_filepath) 

    +

    372 

    +

    373 # read it in again and compare 

    +

    374 d3plot2 = D3plot(out_filepath, **d3plot_kwargs) 

    +

    375 hdr_diff, array_diff = d3plot1.compare(d3plot2) 

    +

    376 

    +

    377 err_msg = f"{d3plot_filepath}: {d3plot_kwargs}" 

    +

    378 self.assertDictEqual(hdr_diff, {}, err_msg) 

    +

    379 self.assertDictEqual(array_diff, {}, err_msg) 

    +

    380 

    +

    381 def test_write_new(self): 

    +

    382 

    +

    383 self.maxDiff = None 

    +

    384 

    +

    385 d3plot1 = D3plot() 

    +

    386 d3plot1.arrays[ArrayType.node_coordinates] = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0]]) 

    +

    387 d3plot1.arrays[ArrayType.element_shell_node_indexes] = np.array([[0, 2, 1, 1]]) 

    +

    388 d3plot1.arrays[ArrayType.element_shell_part_indexes] = np.array([0]) 

    +

    389 d3plot1.arrays[ArrayType.node_displacement] = np.array([[[0, 0, 0], [1, 0, 0], [0, 1, 0]]]) 

    +

    390 

    +

    391 with tempfile.TemporaryDirectory() as dirpath: 

    +

    392 filepath = os.path.join(dirpath, "yay.d3plot") 

    +

    393 

    +

    394 # single file 

    +

    395 d3plot1.write_d3plot(filepath) 

    +

    396 d3plot2 = D3plot(filepath) 

    +

    397 hdr_diff, array_diff = d3plot1.compare(d3plot2) 

    +

    398 array_diff = { 

    +

    399 name: reason 

    +

    400 for name, reason in array_diff.items() 

    +

    401 if "missing in original" not in reason 

    +

    402 } 

    +

    403 self.assertDictEqual(hdr_diff, {}) 

    +

    404 self.assertDictEqual(array_diff, {}) 

    +

    405 

    +

    406 # multiple files 

    +

    407 d3plot1.write_d3plot(filepath, single_file=False) 

    +

    408 d3plot2 = D3plot(filepath) 

    +

    409 hdr_diff, array_diff = d3plot1.compare(d3plot2) 

    +

    410 array_diff = { 

    +

    411 name: reason 

    +

    412 for name, reason in array_diff.items() 

    +

    413 if "missing in original" not in reason 

    +

    414 } 

    +

    415 self.assertDictEqual(hdr_diff, {}) 

    +

    416 self.assertDictEqual(array_diff, {}) 

    +

    417 self.assertTrue(os.path.isfile(filepath)) 

    +

    418 self.assertTrue(os.path.isfile(filepath + "01")) 

    +

    419 

    +

    420 def test_append_4_shell_hists_then_read_bug(self): 

    +

    421 

    +

    422 self.maxDiff = None 

    +

    423 

    +

    424 # we need some d3plot 

    +

    425 d3plot = D3plot() 

    +

    426 d3plot.arrays[ArrayType.node_coordinates] = np.array( 

    +

    427 [[0, 0, 0], [1, 0, 0], [0, 1, 0]], dtype=np.float32 

    +

    428 ) 

    +

    429 d3plot.arrays[ArrayType.element_shell_node_indexes] = np.array([[0, 2, 1, 1]]) 

    +

    430 d3plot.arrays[ArrayType.element_shell_part_indexes] = np.array([0]) 

    +

    431 d3plot.arrays[ArrayType.node_displacement] = np.array( 

    +

    432 [[[0, 0, 0], [1, 0, 0], [0, 1, 0]]], dtype=np.float32 

    +

    433 ) 

    +

    434 

    +

    435 # there was a bug occurring if more than 3 history vars 

    +

    436 # were added, these were written and read back in again 

    +

    437 n_history_vars = 4 

    +

    438 

    +

    439 with tempfile.TemporaryDirectory() as dirpath: 

    +

    440 filepath1 = os.path.join(dirpath, "original") 

    +

    441 d3plot.write_d3plot(filepath1) 

    +

    442 

    +

    443 # open it again to have a safe copy 

    +

    444 d3plot1 = D3plot(filepath1) 

    +

    445 n_timesteps, n_shells, n_layers = 1, d3plot1.header.n_shells, 3 

    +

    446 

    +

    447 d3plot1.arrays[ArrayType.element_shell_history_vars] = np.random.random( 

    +

    448 (n_timesteps, n_shells, n_layers, n_history_vars) 

    +

    449 ) 

    +

    450 

    +

    451 filepath2 = os.path.join(dirpath, "modified") 

    +

    452 d3plot1.write_d3plot(filepath2) 

    +

    453 

    +

    454 d3plot_modif = D3plot(filepath2) 

    +

    455 self.assertTrue(ArrayType.element_shell_internal_energy not in d3plot_modif.arrays) 

    +

    456 

    +

    457 def test_reading_selected_states(self): 

    +

    458 

    +

    459 # read all states 

    +

    460 filepath = "test/d3plot_solid_int/d3plot" 

    +

    461 

    +

    462 d3plot = D3plot(filepath) 

    +

    463 d3plot2 = D3plot(filepath, state_filter=np.arange(0, 22)) 

    +

    464 

    +

    465 hdr_diff, array_diff = d3plot.compare(d3plot2) 

    +

    466 

    +

    467 self.assertDictEqual(hdr_diff, {}) 

    +

    468 self.assertDictEqual(array_diff, {}) 

    +

    469 

    +

    470 # select first and last state 

    +

    471 d3plot = D3plot(filepath, state_filter={0, -1}) 

    +

    472 

    +

    473 node_id = 119 

    +

    474 disp_node_real = np.array( 

    +

    475 [[50.0, 70.0, 5.0], [47.50418, 70.0, -10.000001]], dtype=np.float32 

    +

    476 ) 

    +

    477 

    +

    478 node_index = d3plot.arrays[ArrayType.node_ids].tolist().index(node_id) 

    +

    479 node_disp = d3plot.arrays[ArrayType.node_displacement][:, node_index] 

    +

    480 

    +

    481 np.testing.assert_allclose(node_disp, disp_node_real, rtol=1e-4) 

    +
    + + + diff --git a/coverage/d_233c5ceebba6ed8d_test_mapper_py.html b/coverage/d_233c5ceebba6ed8d_test_mapper_py.html new file mode 100644 index 0000000..5b2e216 --- /dev/null +++ b/coverage/d_233c5ceebba6ed8d_test_mapper_py.html @@ -0,0 +1,575 @@ + + + + + Coverage for lasso/dyna/test_mapper.py: 92% + + + + + +
    +
    +

    + Coverage for lasso/dyna/test_mapper.py: + 92% +

    + +

    + 102 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:45 +0100 +

    + +
    +
    +
    +

    1from typing import Dict, Set, Tuple, Union 

    +

    2from unittest import TestCase 

    +

    3 

    +

    4import numpy as np 

    +

    5 

    +

    6from ..femzip.fz_config import FemzipArrayType, FemzipVariableCategory 

    +

    7from .array_type import ArrayType 

    +

    8from .femzip_mapper import FemzipMapper 

    +

    9 

    +

    10part_global_femzip_translations: Dict[Tuple[FemzipArrayType, FemzipVariableCategory], Set[str]] = { 

    +

    11 # GLOBAL 

    +

    12 (FemzipArrayType.GLOBAL_DATA, FemzipVariableCategory.GLOBAL): { 

    +

    13 # ArrayType.global_timesteps, 

    +

    14 ArrayType.global_internal_energy, 

    +

    15 ArrayType.global_kinetic_energy, 

    +

    16 ArrayType.global_total_energy, 

    +

    17 ArrayType.global_velocity, 

    +

    18 }, 

    +

    19 # PART 

    +

    20 (FemzipArrayType.PART_RESULTS, FemzipVariableCategory.PART): { 

    +

    21 ArrayType.part_hourglass_energy, 

    +

    22 ArrayType.part_internal_energy, 

    +

    23 ArrayType.part_kinetic_energy, 

    +

    24 ArrayType.part_mass, 

    +

    25 ArrayType.part_velocity, 

    +

    26 }, 

    +

    27} 

    +

    28 

    +

    29element_nope_femzip_translations: Dict[Tuple[str, FemzipVariableCategory], str] = { 

    +

    30 # NODE 

    +

    31 ( 

    +

    32 FemzipArrayType.NODE_DISPLACEMENT.value, 

    +

    33 FemzipVariableCategory.NODE, 

    +

    34 ): ArrayType.node_displacement, 

    +

    35 ( 

    +

    36 FemzipArrayType.NODE_ACCELERATIONS.value, 

    +

    37 FemzipVariableCategory.NODE, 

    +

    38 ): ArrayType.node_acceleration, 

    +

    39 (FemzipArrayType.NODE_VELOCITIES.value, FemzipVariableCategory.NODE): ArrayType.node_velocity, 

    +

    40 ( 

    +

    41 FemzipArrayType.NODE_TEMPERATURES.value, 

    +

    42 FemzipVariableCategory.NODE, 

    +

    43 ): ArrayType.node_temperature, 

    +

    44 (FemzipArrayType.NODE_HEAT_FLUX.value, FemzipVariableCategory.NODE): ArrayType.node_heat_flux, 

    +

    45 ( 

    +

    46 FemzipArrayType.NODE_MASS_SCALING.value, 

    +

    47 FemzipVariableCategory.NODE, 

    +

    48 ): ArrayType.node_mass_scaling, 

    +

    49 ( 

    +

    50 FemzipArrayType.NODE_TEMPERATURE_GRADIENT.value, 

    +

    51 FemzipVariableCategory.NODE, 

    +

    52 ): ArrayType.node_temperature_gradient, 

    +

    53 # BEAM 

    +

    54 ( 

    +

    55 FemzipArrayType.BEAM_AXIAL_FORCE.value, 

    +

    56 FemzipVariableCategory.BEAM, 

    +

    57 ): ArrayType.element_beam_axial_force, 

    +

    58 ( 

    +

    59 FemzipArrayType.BEAM_S_BENDING_MOMENT.value, 

    +

    60 FemzipVariableCategory.BEAM, 

    +

    61 ): ArrayType.element_beam_bending_moment, 

    +

    62 ( 

    +

    63 FemzipArrayType.BEAM_T_BENDING_MOMENT.value, 

    +

    64 FemzipVariableCategory.BEAM, 

    +

    65 ): ArrayType.element_beam_bending_moment, 

    +

    66 ( 

    +

    67 FemzipArrayType.BEAM_S_SHEAR_RESULTANT.value, 

    +

    68 FemzipVariableCategory.BEAM, 

    +

    69 ): ArrayType.element_beam_shear_force, 

    +

    70 ( 

    +

    71 FemzipArrayType.BEAM_T_SHEAR_RESULTANT.value, 

    +

    72 FemzipVariableCategory.BEAM, 

    +

    73 ): ArrayType.element_beam_shear_force, 

    +

    74 ( 

    +

    75 FemzipArrayType.BEAM_TORSIONAL_MOMENT.value, 

    +

    76 FemzipVariableCategory.BEAM, 

    +

    77 ): ArrayType.element_beam_torsion_moment, 

    +

    78 (FemzipArrayType.STRESS_X.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, 

    +

    79 (FemzipArrayType.STRESS_Y.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, 

    +

    80 (FemzipArrayType.STRESS_Z.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, 

    +

    81 (FemzipArrayType.STRESS_XY.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, 

    +

    82 (FemzipArrayType.STRESS_YZ.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, 

    +

    83 (FemzipArrayType.STRESS_XZ.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, 

    +

    84 ( 

    +

    85 FemzipArrayType.EFF_PSTRAIN.value, 

    +

    86 FemzipVariableCategory.SHELL, 

    +

    87 ): ArrayType.element_shell_effective_plastic_strain, 

    +

    88 ( 

    +

    89 FemzipArrayType.HISTORY_VARS.value, 

    +

    90 FemzipVariableCategory.SHELL, 

    +

    91 ): ArrayType.element_shell_history_vars, 

    +

    92 ( 

    +

    93 FemzipArrayType.BENDING_MOMENT_MX.value, 

    +

    94 FemzipVariableCategory.SHELL, 

    +

    95 ): ArrayType.element_shell_bending_moment, 

    +

    96 ( 

    +

    97 FemzipArrayType.BENDING_MOMENT_MY.value, 

    +

    98 FemzipVariableCategory.SHELL, 

    +

    99 ): ArrayType.element_shell_bending_moment, 

    +

    100 ( 

    +

    101 FemzipArrayType.BENDING_MOMENT_MXY.value, 

    +

    102 FemzipVariableCategory.SHELL, 

    +

    103 ): ArrayType.element_shell_bending_moment, 

    +

    104 ( 

    +

    105 FemzipArrayType.SHEAR_FORCE_X.value, 

    +

    106 FemzipVariableCategory.SHELL, 

    +

    107 ): ArrayType.element_shell_shear_force, 

    +

    108 ( 

    +

    109 FemzipArrayType.SHEAR_FORCE_Y.value, 

    +

    110 FemzipVariableCategory.SHELL, 

    +

    111 ): ArrayType.element_shell_shear_force, 

    +

    112 ( 

    +

    113 FemzipArrayType.NORMAL_FORCE_X.value, 

    +

    114 FemzipVariableCategory.SHELL, 

    +

    115 ): ArrayType.element_shell_normal_force, 

    +

    116 ( 

    +

    117 FemzipArrayType.NORMAL_FORCE_Y.value, 

    +

    118 FemzipVariableCategory.SHELL, 

    +

    119 ): ArrayType.element_shell_normal_force, 

    +

    120 ( 

    +

    121 FemzipArrayType.NORMAL_FORCE_XY.value, 

    +

    122 FemzipVariableCategory.SHELL, 

    +

    123 ): ArrayType.element_shell_normal_force, 

    +

    124 ( 

    +

    125 FemzipArrayType.THICKNESS.value, 

    +

    126 FemzipVariableCategory.SHELL, 

    +

    127 ): ArrayType.element_shell_thickness, 

    +

    128 ( 

    +

    129 FemzipArrayType.UNKNOWN_1.value, 

    +

    130 FemzipVariableCategory.SHELL, 

    +

    131 ): ArrayType.element_shell_unknown_variables, 

    +

    132 ( 

    +

    133 FemzipArrayType.UNKNOWN_2.value, 

    +

    134 FemzipVariableCategory.SHELL, 

    +

    135 ): ArrayType.element_shell_unknown_variables, 

    +

    136 ( 

    +

    137 FemzipArrayType.STRAIN_INNER_X.value, 

    +

    138 FemzipVariableCategory.SHELL, 

    +

    139 ): ArrayType.element_shell_strain, 

    +

    140 ( 

    +

    141 FemzipArrayType.STRAIN_INNER_Y.value, 

    +

    142 FemzipVariableCategory.SHELL, 

    +

    143 ): ArrayType.element_shell_strain, 

    +

    144 ( 

    +

    145 FemzipArrayType.STRAIN_INNER_Z.value, 

    +

    146 FemzipVariableCategory.SHELL, 

    +

    147 ): ArrayType.element_shell_strain, 

    +

    148 ( 

    +

    149 FemzipArrayType.STRAIN_INNER_XY.value, 

    +

    150 FemzipVariableCategory.SHELL, 

    +

    151 ): ArrayType.element_shell_strain, 

    +

    152 ( 

    +

    153 FemzipArrayType.STRAIN_INNER_YZ.value, 

    +

    154 FemzipVariableCategory.SHELL, 

    +

    155 ): ArrayType.element_shell_strain, 

    +

    156 ( 

    +

    157 FemzipArrayType.STRAIN_INNER_XZ.value, 

    +

    158 FemzipVariableCategory.SHELL, 

    +

    159 ): ArrayType.element_shell_strain, 

    +

    160 ( 

    +

    161 FemzipArrayType.STRAIN_OUTER_X.value, 

    +

    162 FemzipVariableCategory.SHELL, 

    +

    163 ): ArrayType.element_shell_strain, 

    +

    164 ( 

    +

    165 FemzipArrayType.STRAIN_OUTER_Y.value, 

    +

    166 FemzipVariableCategory.SHELL, 

    +

    167 ): ArrayType.element_shell_strain, 

    +

    168 ( 

    +

    169 FemzipArrayType.STRAIN_OUTER_Z.value, 

    +

    170 FemzipVariableCategory.SHELL, 

    +

    171 ): ArrayType.element_shell_strain, 

    +

    172 ( 

    +

    173 FemzipArrayType.STRAIN_OUTER_XY.value, 

    +

    174 FemzipVariableCategory.SHELL, 

    +

    175 ): ArrayType.element_shell_strain, 

    +

    176 ( 

    +

    177 FemzipArrayType.STRAIN_OUTER_YZ.value, 

    +

    178 FemzipVariableCategory.SHELL, 

    +

    179 ): ArrayType.element_shell_strain, 

    +

    180 ( 

    +

    181 FemzipArrayType.STRAIN_OUTER_XZ.value, 

    +

    182 FemzipVariableCategory.SHELL, 

    +

    183 ): ArrayType.element_shell_strain, 

    +

    184 ( 

    +

    185 FemzipArrayType.INTERNAL_ENERGY.value, 

    +

    186 FemzipVariableCategory.SHELL, 

    +

    187 ): ArrayType.element_shell_internal_energy, 

    +

    188 # SOLID 

    +

    189 (FemzipArrayType.STRESS_X.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, 

    +

    190 (FemzipArrayType.STRESS_Y.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, 

    +

    191 (FemzipArrayType.STRESS_Z.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, 

    +

    192 (FemzipArrayType.STRESS_XY.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, 

    +

    193 (FemzipArrayType.STRESS_YZ.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, 

    +

    194 (FemzipArrayType.STRESS_XZ.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, 

    +

    195 ( 

    +

    196 FemzipArrayType.EFF_PSTRAIN.value, 

    +

    197 FemzipVariableCategory.SOLID, 

    +

    198 ): ArrayType.element_solid_effective_plastic_strain, 

    +

    199 ( 

    +

    200 FemzipArrayType.STRAIN_INNER_X.value, 

    +

    201 FemzipVariableCategory.SOLID, 

    +

    202 ): ArrayType.element_solid_strain, 

    +

    203 ( 

    +

    204 FemzipArrayType.STRAIN_INNER_Y.value, 

    +

    205 FemzipVariableCategory.SOLID, 

    +

    206 ): ArrayType.element_solid_strain, 

    +

    207 ( 

    +

    208 FemzipArrayType.STRAIN_INNER_Z.value, 

    +

    209 FemzipVariableCategory.SOLID, 

    +

    210 ): ArrayType.element_solid_strain, 

    +

    211 ( 

    +

    212 FemzipArrayType.STRAIN_INNER_XY.value, 

    +

    213 FemzipVariableCategory.SOLID, 

    +

    214 ): ArrayType.element_solid_strain, 

    +

    215 ( 

    +

    216 FemzipArrayType.HISTORY_VARS.value, 

    +

    217 FemzipVariableCategory.SOLID, 

    +

    218 ): ArrayType.element_solid_history_variables, 

    +

    219 ( 

    +

    220 FemzipArrayType.STRAIN_INNER_YZ.value, 

    +

    221 FemzipVariableCategory.SOLID, 

    +

    222 ): ArrayType.element_solid_strain, 

    +

    223 ( 

    +

    224 FemzipArrayType.STRAIN_INNER_XZ.value, 

    +

    225 FemzipVariableCategory.SOLID, 

    +

    226 ): ArrayType.element_solid_strain, 

    +

    227 ( 

    +

    228 FemzipArrayType.STRAIN_OUTER_X.value, 

    +

    229 FemzipVariableCategory.SOLID, 

    +

    230 ): ArrayType.element_solid_strain, 

    +

    231 ( 

    +

    232 FemzipArrayType.STRAIN_OUTER_Y.value, 

    +

    233 FemzipVariableCategory.SOLID, 

    +

    234 ): ArrayType.element_solid_strain, 

    +

    235 ( 

    +

    236 FemzipArrayType.STRAIN_OUTER_Z.value, 

    +

    237 FemzipVariableCategory.SOLID, 

    +

    238 ): ArrayType.element_solid_strain, 

    +

    239 ( 

    +

    240 FemzipArrayType.STRAIN_OUTER_XY.value, 

    +

    241 FemzipVariableCategory.SOLID, 

    +

    242 ): ArrayType.element_solid_strain, 

    +

    243 ( 

    +

    244 FemzipArrayType.STRAIN_OUTER_YZ.value, 

    +

    245 FemzipVariableCategory.SOLID, 

    +

    246 ): ArrayType.element_solid_strain, 

    +

    247 ( 

    +

    248 FemzipArrayType.STRAIN_OUTER_XZ.value, 

    +

    249 FemzipVariableCategory.SOLID, 

    +

    250 ): ArrayType.element_solid_strain, 

    +

    251} 

    +

    252 

    +

    253 

    +

    254class MapperTest(TestCase): 

    +

    255 def validate( 

    +

    256 self, 

    +

    257 fz: Dict[Tuple[str, FemzipVariableCategory], np.ndarray], 

    +

    258 d3plot_shape: tuple, 

    +

    259 data_index_positions: Union[tuple, slice] = slice(None), 

    +

    260 ): 

    +

    261 """Validate that the arrays have the same shape and that the 

    +

    262 raw data has been allocated to the correct positions in the 

    +

    263 d3plot arrays. 

    +

    264 

    +

    265 Parameters 

    +

    266 ---------- 

    +

    267 fz: 

    +

    268 femzip data following the same schema as in the api 

    +

    269 d3plot_shape: 

    +

    270 shape of the d3plot array 

    +

    271 data_index_positions: 

    +

    272 positions of the raw data in the d3plot array 

    +

    273 """ 

    +

    274 d3plot_name = [] 

    +

    275 

    +

    276 m = FemzipMapper() 

    +

    277 

    +

    278 # filter out parts and globals if they exist 

    +

    279 for key in fz.keys(): 

    +

    280 if key in element_nope_femzip_translations: 

    +

    281 d3plot_name.append(element_nope_femzip_translations[key]) 

    +

    282 

    +

    283 d3plot_name = set(d3plot_name).pop() 

    +

    284 

    +

    285 m.map(fz) 

    +

    286 

    +

    287 _ = m.d3plot_arrays[d3plot_name] 

    +

    288 

    +

    289 def test_nodal_disp(self): 

    +

    290 m = FemzipMapper() 

    +

    291 

    +

    292 # NODE DISPLACEMENT 

    +

    293 nd = np.random.randn(2, 10, 3) 

    +

    294 

    +

    295 fz = {(1, FemzipArrayType.NODE_DISPLACEMENT.value, FemzipVariableCategory.NODE): nd} 

    +

    296 

    +

    297 m.map(fz) 

    +

    298 

    +

    299 result = m.d3plot_arrays 

    +

    300 self.assertTrue(np.allclose(nd, result["node_displacement"])) 

    +

    301 

    +

    302 def test_tshells(self): 

    +

    303 d = np.random.randn(2, 2) 

    +

    304 

    +

    305 fz = { 

    +

    306 (1, "Sigma-z (IP 2)", FemzipVariableCategory.THICK_SHELL): d, 

    +

    307 (2, "Epsilon-xy (inner)", FemzipVariableCategory.THICK_SHELL): d, 

    +

    308 } 

    +

    309 

    +

    310 m = FemzipMapper() 

    +

    311 

    +

    312 m.map(fz) 

    +

    313 

    +

    314 r = m.d3plot_arrays 

    +

    315 

    +

    316 self.assertEqual(r[ArrayType.element_tshell_stress].shape, (2, 2, 2, 3)) 

    +

    317 self.assertTrue(np.allclose(r[ArrayType.element_tshell_stress][:, :, 1, 2], d)) 

    +

    318 

    +

    319 self.assertEqual(r[ArrayType.element_tshell_strain].shape, (2, 2, 1, 4)) 

    +

    320 self.assertTrue(np.allclose(r[ArrayType.element_tshell_strain][:, :, 0, 3], d)) 

    +

    321 

    +

    322 def test_internal_shell_energy(self): 

    +

    323 interal_energy = np.array([[1, 1, 0.12, 2.121202, 2.1123, 7.213]]).reshape(2, 3) 

    +

    324 

    +

    325 fz = { 

    +

    326 (1, "internal_energy", FemzipVariableCategory.SHELL): interal_energy, 

    +

    327 } 

    +

    328 m = FemzipMapper() 

    +

    329 

    +

    330 m.map(fz) 

    +

    331 

    +

    332 r = m.d3plot_arrays[ArrayType.element_shell_internal_energy] 

    +

    333 self.assertTrue(np.allclose(r, interal_energy)) 

    +

    334 

    +

    335 def test_dependent_variable(self): 

    +

    336 d1 = np.random.randn(2, 1200) 

    +

    337 d2 = np.random.randn(2, 1200) 

    +

    338 

    +

    339 fz: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] = { 

    +

    340 (1, "element_dependent_variable_2", FemzipVariableCategory.SHELL): d2, 

    +

    341 (2, "element_dependent_variable_1", FemzipVariableCategory.SHELL): d1, 

    +

    342 } 

    +

    343 m = FemzipMapper() 

    +

    344 

    +

    345 m.map(fz) 

    +

    346 

    +

    347 r = m.d3plot_arrays 

    +

    348 

    +

    349 self.assertEqual(r[ArrayType.element_shell_unknown_variables].shape, (2, 1200, 2)) 

    +

    350 

    +

    351 self.assertTrue(np.allclose(d1, r[ArrayType.element_shell_unknown_variables][:, :, 0])) 

    +

    352 self.assertTrue(np.allclose(d2, r[ArrayType.element_shell_unknown_variables][:, :, 1])) 

    +

    353 

    +

    354 def test_effective_p_strain(self): 

    +

    355 m = FemzipMapper() 

    +

    356 d1 = np.random.randn(2, 20000) 

    +

    357 d2 = np.random.randn(2, 20000) 

    +

    358 d3 = np.random.randn(2, 20000) 

    +

    359 

    +

    360 fz: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] = { 

    +

    361 (1, "Effective plastic strain ( 1)", FemzipVariableCategory.SHELL): d1, 

    +

    362 (2, "Effective plastic strain ( 2)", FemzipVariableCategory.SHELL): d2, 

    +

    363 (3, "Effective plastic strain ( 3)", FemzipVariableCategory.SHELL): d3, 

    +

    364 } 

    +

    365 

    +

    366 m.map(fz) 

    +

    367 

    +

    368 r = m.d3plot_arrays 

    +

    369 

    +

    370 self.assertEqual(r[ArrayType.element_shell_effective_plastic_strain].shape, (2, 20000, 3)) 

    +

    371 

    +

    372 self.assertTrue( 

    +

    373 np.allclose(d1, r[ArrayType.element_shell_effective_plastic_strain][:, :, 0]) 

    +

    374 ) 

    +

    375 self.assertTrue( 

    +

    376 np.allclose(d2, r[ArrayType.element_shell_effective_plastic_strain][:, :, 1]) 

    +

    377 ) 

    +

    378 self.assertTrue( 

    +

    379 np.allclose(d3, r[ArrayType.element_shell_effective_plastic_strain][:, :, 2]) 

    +

    380 ) 

    +

    381 

    +

    382 def test_others(self): 

    +

    383 stress_1 = np.random.randn(2, 2) 

    +

    384 stress_2 = np.random.randn(2, 2) 

    +

    385 stress_3 = np.random.randn(2, 2) 

    +

    386 

    +

    387 strain1 = np.random.randn(1, 2) 

    +

    388 strain2 = np.random.randn(1, 2) 

    +

    389 

    +

    390 history_vars = np.array([[1, 2], [0, 3], [12, 2]], dtype=float) 

    +

    391 

    +

    392 history_vars1 = np.random.randn(3, 2) 

    +

    393 history_vars2 = np.random.randn(3, 2) 

    +

    394 

    +

    395 fz: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] = { 

    +

    396 # stress 

    +

    397 (1, "Sigma-x (IP 6)", FemzipVariableCategory.SOLID): stress_1, 

    +

    398 (2, "Sigma-y (IP 3)", FemzipVariableCategory.SOLID): stress_2, 

    +

    399 (3, "Sigma-x (IP 3)", FemzipVariableCategory.SOLID): stress_3, 

    +

    400 # history 

    +

    401 (4, "extra_value_per_element 2 (IP 2)", FemzipVariableCategory.SOLID): history_vars, 

    +

    402 (5, "extra_value_per_element 21 (IP 15)", FemzipVariableCategory.SOLID): history_vars1, 

    +

    403 (6, "extra_value_per_element 4 (IP 3)", FemzipVariableCategory.SOLID): history_vars2, 

    +

    404 # strain 

    +

    405 (7, "Epsilon-xy (outer)", FemzipVariableCategory.SHELL): strain1, 

    +

    406 (8, "Epsilon-z (outer)", FemzipVariableCategory.SHELL): strain2, 

    +

    407 } 

    +

    408 

    +

    409 m = FemzipMapper() 

    +

    410 

    +

    411 m.map(fz) 

    +

    412 

    +

    413 r = m.d3plot_arrays 

    +

    414 

    +

    415 self.assertEqual(r[ArrayType.element_solid_stress].shape, (2, 2, 6, 2)) 

    +

    416 

    +

    417 self.assertTrue(np.allclose(stress_1, r[ArrayType.element_solid_stress][:, :, 5, 0])) 

    +

    418 self.assertTrue(np.allclose(stress_2, r[ArrayType.element_solid_stress][:, :, 2, 1])) 

    +

    419 self.assertTrue(np.allclose(stress_3, r[ArrayType.element_solid_stress][:, :, 2, 0])) 

    +

    420 

    +

    421 self.assertEqual(r[ArrayType.element_solid_history_variables].shape, (3, 2, 15, 21)) 

    +

    422 

    +

    423 self.assertTrue( 

    +

    424 np.allclose(history_vars, r[ArrayType.element_solid_history_variables][:, :, 1, 1]) 

    +

    425 ) 

    +

    426 

    +

    427 self.assertTrue( 

    +

    428 np.allclose(history_vars1, r[ArrayType.element_solid_history_variables][:, :, 14, 20]) 

    +

    429 ) 

    +

    430 

    +

    431 self.assertTrue( 

    +

    432 np.allclose(history_vars2, r[ArrayType.element_solid_history_variables][:, :, 2, 3]) 

    +

    433 ) 

    +

    434 

    +

    435 self.assertEqual(r[ArrayType.element_shell_strain].shape, (1, 2, 2, 4)) 

    +

    436 

    +

    437 def test_beam(self): 

    +

    438 axial_force = np.random.randn(5, 12) 

    +

    439 shear = np.random.randn(2, 4) 

    +

    440 

    +

    441 bending = np.random.randn(3, 123) 

    +

    442 torsion = np.random.rand(2, 5) 

    +

    443 

    +

    444 fz: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] = { 

    +

    445 (1, "axial_force", FemzipVariableCategory.BEAM): axial_force, 

    +

    446 (2, "s_shear_resultant", FemzipVariableCategory.BEAM): shear, 

    +

    447 (3, "t_bending_moment", FemzipVariableCategory.BEAM): bending, 

    +

    448 (4, "torsional_resultant", FemzipVariableCategory.BEAM): torsion, 

    +

    449 } 

    +

    450 

    +

    451 m = FemzipMapper() 

    +

    452 

    +

    453 m.map(fz) 

    +

    454 

    +

    455 r = m.d3plot_arrays 

    +

    456 

    +

    457 # axial force 

    +

    458 self.assertTrue(np.allclose(r["element_beam_axial_force"], axial_force)) 

    +

    459 

    +

    460 self.assertEqual(r[ArrayType.element_beam_shear_force].shape, (2, 4, 1)) 

    +

    461 self.assertTrue(np.allclose(r[ArrayType.element_beam_shear_force][:, :, 0], shear)) 

    +

    462 

    +

    463 # bending moment 

    +

    464 self.assertEqual(r[ArrayType.element_beam_bending_moment].shape, (3, 123, 2)) 

    +

    465 self.assertTrue(np.allclose(r[ArrayType.element_beam_bending_moment][:, :, 1], bending)) 

    +

    466 

    +

    467 # torsion 

    +

    468 self.assertEqual(r[ArrayType.element_beam_torsion_moment].shape, (2, 5)) 

    +

    469 self.assertTrue(np.allclose(r[ArrayType.element_beam_torsion_moment], torsion)) 

    +

    470 

    +

    471 # # TODO 

    +

    472 # # unknown1 and unknown2 

    +

    473 

    +

    474 # # shp 

    +

    475 

    +

    476 # # airbags 

    +

    477 

    +

    478 # # rigids 

    +
    + + + diff --git a/coverage/d_2a4fb047d150a06c___init___py.html b/coverage/d_2a4fb047d150a06c___init___py.html new file mode 100644 index 0000000..adde222 --- /dev/null +++ b/coverage/d_2a4fb047d150a06c___init___py.html @@ -0,0 +1,97 @@ + + + + + Coverage for lasso/utils/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/utils/__init__.py: + 100% +

    + +

    + 0 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +
    + + + diff --git a/coverage/d_2a4fb047d150a06c_console_coloring_py.html b/coverage/d_2a4fb047d150a06c_console_coloring_py.html new file mode 100644 index 0000000..8456ac4 --- /dev/null +++ b/coverage/d_2a4fb047d150a06c_console_coloring_py.html @@ -0,0 +1,234 @@ + + + + + Coverage for lasso/utils/console_coloring.py: 85% + + + + + +
    +
    +

    + Coverage for lasso/utils/console_coloring.py: + 85% +

    + +

    + 34 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1class ConsoleColoring: 

    +

    2 """Holds coloring escape sequences for command line shells""" 

    +

    3 

    +

    4 # text coloring 

    +

    5 LIGHT_GREEN = "\033[92m" 

    +

    6 LIGHT_RED = "\033[91m" 

    +

    7 LIGHT_CYAN = "\033[96m" 

    +

    8 LIGHT_BLUE = "\033[94m" 

    +

    9 LIGHT_PURPLE = "\033[95m" 

    +

    10 LIGHT_YELLOW = "\033[93m" 

    +

    11 

    +

    12 PURPLE = "\033[95m" 

    +

    13 RED = "\033[91m" 

    +

    14 GREEN = "\u001b[32m" 

    +

    15 CYAN = "\u001b[36m" 

    +

    16 WHITE = "\u001b[37m" 

    +

    17 BLACK = "\u001b[30m" 

    +

    18 BLUE = "\u001b[34m" 

    +

    19 ORANGE = "\u001b[33m" 

    +

    20 

    +

    21 # special stuff 

    +

    22 BOLD = "\033[1m" 

    +

    23 UNDERLINE = "\033[4m" 

    +

    24 REVERSED = "\u001b[7m" 

    +

    25 

    +

    26 # ends coloring 

    +

    27 RESET = "\033[0m" 

    +

    28 

    +

    29 @staticmethod 

    +

    30 def purple(msg, light=False): 

    +

    31 """Format a string in purple 

    +

    32 

    +

    33 Parameters 

    +

    34 ---------- 

    +

    35 msg : `str` 

    +

    36 string to format 

    +

    37 light : `bool` 

    +

    38 whether to use light coloring 

    +

    39 

    +

    40 Returns 

    +

    41 ------- 

    +

    42 formatted_msg : `str` 

    +

    43 string colored for console output 

    +

    44 """ 

    +

    45 return ( 

    +

    46 ConsoleColoring.LIGHT_PURPLE + msg + ConsoleColoring.RESET 

    +

    47 if light 

    +

    48 else ConsoleColoring.PURPLE + msg + ConsoleColoring.RESET 

    +

    49 ) 

    +

    50 

    +

    51 @staticmethod 

    +

    52 def yellow(msg, light=False): 

    +

    53 """Format a string in yellow 

    +

    54 

    +

    55 Parameters 

    +

    56 ---------- 

    +

    57 msg : `str` 

    +

    58 string to format 

    +

    59 light : `bool` 

    +

    60 whether to use light coloring 

    +

    61 

    +

    62 Returns 

    +

    63 ------- 

    +

    64 formatted_msg : `str` 

    +

    65 string colored for console output 

    +

    66 """ 

    +

    67 return ( 

    +

    68 ConsoleColoring.LIGHT_YELLOW + msg + ConsoleColoring.RESET 

    +

    69 if light 

    +

    70 else ConsoleColoring.ORANGE + msg + ConsoleColoring.RESET 

    +

    71 ) 

    +

    72 

    +

    73 @staticmethod 

    +

    74 def red(msg, light=False): 

    +

    75 """Format a string in red 

    +

    76 

    +

    77 Parameters 

    +

    78 ---------- 

    +

    79 msg : `str` 

    +

    80 string to format 

    +

    81 light : `bool` 

    +

    82 whether to use light coloring 

    +

    83 

    +

    84 Returns 

    +

    85 ------- 

    +

    86 formatted_msg : `str` 

    +

    87 string colored for console output 

    +

    88 """ 

    +

    89 return ( 

    +

    90 ConsoleColoring.LIGHT_RED + msg + ConsoleColoring.RESET 

    +

    91 if light 

    +

    92 else ConsoleColoring.RED + msg + ConsoleColoring.RESET 

    +

    93 ) 

    +

    94 

    +

    95 @staticmethod 

    +

    96 def green(msg, light=False): 

    +

    97 """Format a string in green 

    +

    98 

    +

    99 Parameters 

    +

    100 ---------- 

    +

    101 msg : `str` 

    +

    102 string to format 

    +

    103 light : `bool` 

    +

    104 whether to use light coloring 

    +

    105 

    +

    106 Returns 

    +

    107 ------- 

    +

    108 formatted_msg : `str` 

    +

    109 string colored for console output 

    +

    110 """ 

    +

    111 return ( 

    +

    112 ConsoleColoring.LIGHT_GREEN + msg + ConsoleColoring.RESET 

    +

    113 if light 

    +

    114 else ConsoleColoring.GREEN + msg + ConsoleColoring.RESET 

    +

    115 ) 

    +

    116 

    +

    117 @staticmethod 

    +

    118 def blue(msg, light=False): 

    +

    119 """Format a string in green 

    +

    120 

    +

    121 Parameters 

    +

    122 ---------- 

    +

    123 msg : `str` 

    +

    124 string to format 

    +

    125 light : `bool` 

    +

    126 whether to use light coloring 

    +

    127 

    +

    128 Returns 

    +

    129 ------- 

    +

    130 formatted_msg : `str` 

    +

    131 string colored for console output 

    +

    132 """ 

    +

    133 return ( 

    +

    134 ConsoleColoring.LIGHT_BLUE + msg + ConsoleColoring.RESET 

    +

    135 if light 

    +

    136 else ConsoleColoring.BLUE + msg + ConsoleColoring.RESET 

    +

    137 ) 

    +
    + + + diff --git a/coverage/d_2a4fb047d150a06c_decorators_py.html b/coverage/d_2a4fb047d150a06c_decorators_py.html new file mode 100644 index 0000000..6d6c3a3 --- /dev/null +++ b/coverage/d_2a4fb047d150a06c_decorators_py.html @@ -0,0 +1,151 @@ + + + + + Coverage for lasso/utils/decorators.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/utils/decorators.py: + 0% +

    + +

    + 28 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import inspect 

    +

    2 

    +

    3 

    +

    4# Source: https://www.fast.ai/2019/08/06/delegation/ 

    +

    5 

    +

    6 

    +

    7def delegates(to_function=None, keep=False): 

    +

    8 """Decorator: replace `**kwargs` in signature with params from `to`""" 

    +

    9 

    +

    10 def _f(f_att): 

    +

    11 if to_function is None: 

    +

    12 to_f, from_f = f_att.__base__.__init__, f_att.__init__ 

    +

    13 else: 

    +

    14 to_f, from_f = to_function, f_att 

    +

    15 sig = inspect.signature(from_f) 

    +

    16 sig_dict = dict(sig.parameters) 

    +

    17 k = sig_dict.pop("kwargs") 

    +

    18 s2_dict = { 

    +

    19 k: v 

    +

    20 for k, v in inspect.signature(to_f).parameters.items() 

    +

    21 if v.default != inspect.Parameter.empty and k not in sig_dict 

    +

    22 } 

    +

    23 sig_dict.update(s2_dict) 

    +

    24 if keep: 

    +

    25 sig_dict["kwargs"] = k 

    +

    26 # noinspection PyTypeChecker 

    +

    27 from_f.__signature__ = sig.replace(parameters=sig_dict.values()) 

    +

    28 return f_att 

    +

    29 

    +

    30 return _f 

    +

    31 

    +

    32 

    +

    33def custom_dir(custom_c, add): 

    +

    34 """Custom dir *add description?""" 

    +

    35 return dir(type(custom_c)) + list(custom_c.__dict__.keys()) + add 

    +

    36 

    +

    37 

    +

    38class GetAttr: 

    +

    39 

    +

    40 """ 

    +

    41 Base class for attr accesses in `self._xtra` passed down to `self.default 

    +

    42 """ 

    +

    43 

    +

    44 @property 

    +

    45 def _xtra(self): 

    +

    46 return [o for o in dir(self.default) if not o.startswith("_")] 

    +

    47 

    +

    48 def __getattr__(self, k): 

    +

    49 if k in self._xtra: 

    +

    50 return getattr(self.default, k) 

    +

    51 raise AttributeError(k) 

    +

    52 

    +

    53 def __dir__(self): 

    +

    54 return custom_dir(self, self._xtra) 

    +
    + + + diff --git a/coverage/d_2a4fb047d150a06c_language_py.html b/coverage/d_2a4fb047d150a06c_language_py.html new file mode 100644 index 0000000..ef6a79b --- /dev/null +++ b/coverage/d_2a4fb047d150a06c_language_py.html @@ -0,0 +1,154 @@ + + + + + Coverage for lasso/utils/language.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/utils/language.py: + 0% +

    + +

    + 21 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1def get_var(name, context, default=None): 

    +

    2 """Get a variable from a dict context 

    +

    3 

    +

    4 Parameters 

    +

    5 ---------- 

    +

    6 name : str or list(str) 

    +

    7 variable name 

    +

    8 context : dict 

    +

    9 variable dict 

    +

    10 default: 

    +

    11 default value or function which creates the default 

    +

    12 value if failed to find var in context 

    +

    13 """ 

    +

    14 if not isinstance(name, (list, tuple)): 

    +

    15 name = (name,) 

    +

    16 

    +

    17 current_context = context 

    +

    18 for current_name in name: 

    +

    19 if current_name in current_context: 

    +

    20 current_context = current_context[current_name] 

    +

    21 else: 

    +

    22 return default() if callable(default) else default 

    +

    23 

    +

    24 return current_context 

    +

    25 

    +

    26 

    +

    27def set_var(name, value, context): 

    +

    28 """ 

    +

    29 Set a variable in a dict context 

    +

    30 

    +

    31 Parameters 

    +

    32 ---------- 

    +

    33 name : str or list(str) 

    +

    34 variable name or path as list 

    +

    35 value : object 

    +

    36 anything to set 

    +

    37 context : dict 

    +

    38 variable dict 

    +

    39 """ 

    +

    40 

    +

    41 if not isinstance(name, (list, tuple)): 

    +

    42 name = (name,) 

    +

    43 

    +

    44 current_context = context 

    +

    45 for i_name, current_name in enumerate(name): 

    +

    46 

    +

    47 # at last level set var 

    +

    48 if i_name == len(name) - 1: 

    +

    49 current_context[current_name] = value 

    +

    50 # otherwise iterate into next level 

    +

    51 else: 

    +

    52 if current_name in current_context: 

    +

    53 current_context = current_context[current_name] 

    +

    54 else: 

    +

    55 new_level = {} 

    +

    56 current_context[current_name] = new_level 

    +

    57 current_context = new_level 

    +
    + + + diff --git a/coverage/d_2a4fb047d150a06c_rich_progress_bars_py.html b/coverage/d_2a4fb047d150a06c_rich_progress_bars_py.html new file mode 100644 index 0000000..478d0c2 --- /dev/null +++ b/coverage/d_2a4fb047d150a06c_rich_progress_bars_py.html @@ -0,0 +1,222 @@ + + + + + Coverage for lasso/utils/rich_progress_bars.py: 42% + + + + + +
    +
    +

    + Coverage for lasso/utils/rich_progress_bars.py: + 42% +

    + +

    + 78 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import math 

    +

    2import time 

    +

    3from typing import Any 

    +

    4 

    +

    5from rich.progress import ProgressColumn 

    +

    6 

    +

    7 

    +

    8class PlaceHolderBar: 

    +

    9 """This bar is simply a placeholder bar""" 

    +

    10 

    +

    11 finished: bool 

    +

    12 tasks: list = [] 

    +

    13 

    +

    14 # noinspection PyUnusedLocal 

    +

    15 # pylint: disable = unused-argument 

    +

    16 def __init__(self, **kwargs): 

    +

    17 """This is a placeholder to not clutter console during testing""" 

    +

    18 self.finished: False 

    +

    19 

    +

    20 # noinspection PyUnusedLocal 

    +

    21 # pylint: disable = unused-argument 

    +

    22 def render(self, task: Any) -> str: 

    +

    23 """returns the planned output: empty string""" 

    +

    24 return "" 

    +

    25 

    +

    26 def add_task(self, description: str, total: int) -> int: 

    +

    27 """Adds a new task""" 

    +

    28 self.tasks.append([description, total, 0]) 

    +

    29 # entry in list is tuple of description, total tasks, remaining tasks 

    +

    30 return len(self.tasks) - 1 

    +

    31 

    +

    32 def advance(self, task_id): 

    +

    33 """advances the given task""" 

    +

    34 prog = self.tasks[task_id][2] 

    +

    35 prog += 1 

    +

    36 self.tasks[task_id][2] = prog 

    +

    37 if prog == self.tasks[task_id][1]: 

    +

    38 self.finished = True 

    +

    39 

    +

    40 def __enter__(self): 

    +

    41 self.finished = False 

    +

    42 

    +

    43 def __exit__(self, exception_type, exception_value, traceback): 

    +

    44 self.finished = True 

    +

    45 

    +

    46 

    +

    47class WorkingDots(ProgressColumn): 

    +

    48 """TODO: add description""" 

    +

    49 

    +

    50 max_refresh = 0.5 

    +

    51 is_silenced: bool = False 

    +

    52 

    +

    53 def __init__(self, output=True): 

    +

    54 self.counter = 0 

    +

    55 if not output: 

    +

    56 self.is_silenced = True 

    +

    57 super().__init__() 

    +

    58 

    +

    59 def render(self, task: Any) -> str: 

    +

    60 self.counter += 1 

    +

    61 if self.is_silenced: 

    +

    62 return "" 

    +

    63 if task.completed == task.total: 

    +

    64 msg = "..." 

    +

    65 elif self.counter % 3 == 0: 

    +

    66 msg = ". " 

    +

    67 elif self.counter % 3 == 1: 

    +

    68 msg = ".. " 

    +

    69 else: 

    +

    70 msg = "..." 

    +

    71 self.counter = 2 

    +

    72 return msg 

    +

    73 

    +

    74 

    +

    75class SubsamplingWaitTime(ProgressColumn): 

    +

    76 """TODO: add description""" 

    +

    77 

    +

    78 max_refresh = 0.5 

    +

    79 

    +

    80 def __init__(self, n_proc: int): 

    +

    81 super().__init__() 

    +

    82 

    +

    83 # Last time we updated 

    +

    84 self.last_time = time.time() 

    +

    85 # Cumulative time of all completed sub-sampling processes 

    +

    86 self.cum_time = 0 

    +

    87 # Number of parallel running processes 

    +

    88 self.n_proc = n_proc 

    +

    89 self.t_rem = -1 

    +

    90 

    +

    91 def render(self, task: Any) -> str: 

    +

    92 """TODO: add description?""" 

    +

    93 

    +

    94 if task.completed == task.total: 

    +

    95 return "Time remaining: 00:00" 

    +

    96 

    +

    97 if self.cum_time > 0: 

    +

    98 avrg_time = self.cum_time / max(1, task.completed) 

    +

    99 rem_tasks = task.total - task.completed 

    +

    100 gr_tasks = math.floor(rem_tasks / self.n_proc) 

    +

    101 if (rem_tasks % self.n_proc) != 0: 

    +

    102 gr_tasks += 1 

    +

    103 

    +

    104 total_time = gr_tasks * avrg_time 

    +

    105 if self.t_rem < 0 or self.t_rem > total_time: 

    +

    106 self.t_rem = total_time 

    +

    107 

    +

    108 t_out = self.t_rem - (time.time() - self.last_time) 

    +

    109 mins = str(math.floor(t_out / 60)) 

    +

    110 secs = str(math.trunc(t_out % 60)) 

    +

    111 

    +

    112 if len(mins) == 1: 

    +

    113 mins = "0" + mins 

    +

    114 if len(secs) == 1: 

    +

    115 secs = "0" + secs 

    +

    116 out_str = "Time remaining: " + mins + ":" + secs 

    +

    117 return out_str 

    +

    118 

    +

    119 return "Time remaining: --:--" 

    +

    120 

    +

    121 def update_avrg(self, new_time: float): 

    +

    122 """TODO: add description""" 

    +

    123 

    +

    124 self.cum_time += new_time 

    +

    125 self.last_time = time.time() 

    +
    + + + diff --git a/coverage/d_306dfaf9bde54f34___init___py.html b/coverage/d_306dfaf9bde54f34___init___py.html new file mode 100644 index 0000000..f31ecb8 --- /dev/null +++ b/coverage/d_306dfaf9bde54f34___init___py.html @@ -0,0 +1,97 @@ + + + + + Coverage for lasso/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/__init__.py: + 100% +

    + +

    + 0 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +
    + + + diff --git a/coverage/d_306dfaf9bde54f34_logging_py.html b/coverage/d_306dfaf9bde54f34_logging_py.html new file mode 100644 index 0000000..a8f6604 --- /dev/null +++ b/coverage/d_306dfaf9bde54f34_logging_py.html @@ -0,0 +1,205 @@ + + + + + Coverage for lasso/logging.py: 77% + + + + + +
    +
    +

    + Coverage for lasso/logging.py: + 77% +

    + +

    + 22 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import logging 

    +

    2import platform 

    +

    3 

    +

    4from lasso.utils.console_coloring import ConsoleColoring 

    +

    5 

    +

    6# settings 

    +

    7MARKER_INFO = "[/]" 

    +

    8MARKER_RUNNING = "[~]" 

    +

    9MARKER_WARNING = "[!]" 

    +

    10MARKER_SUCCESS = "[Y]" if platform.system() == "Windows" else "[✔]" 

    +

    11MARKER_ERROR = "[X]" if platform.system() == "Windows" else "[✘]" 

    +

    12 

    +

    13LOGGER_NAME = "lasso" 

    +

    14 

    +

    15 

    +

    16def str_info(msg: str): 

    +

    17 """Format a message as stuff is running 

    +

    18 

    +

    19 Parameters 

    +

    20 ---------- 

    +

    21 msg: str 

    +

    22 message to format 

    +

    23 

    +

    24 Returns 

    +

    25 ------- 

    +

    26 msg_ret: str 

    +

    27 formatted message 

    +

    28 """ 

    +

    29 # return ConsoleColoring.blue("[/] {0}".format(msg), light=True) 

    +

    30 return f"{MARKER_INFO} {msg}" 

    +

    31 

    +

    32 

    +

    33def str_running(msg: str): 

    +

    34 """Format a message as stuff is running 

    +

    35 

    +

    36 Parameters 

    +

    37 ---------- 

    +

    38 msg: str 

    +

    39 message to format 

    +

    40 

    +

    41 Returns 

    +

    42 ------- 

    +

    43 msg_ret: str 

    +

    44 formatted message 

    +

    45 """ 

    +

    46 return f"{MARKER_RUNNING} {msg}" 

    +

    47 

    +

    48 

    +

    49def str_success(msg: str): 

    +

    50 """Format a message as successful 

    +

    51 

    +

    52 Parameters 

    +

    53 ---------- 

    +

    54 msg: str 

    +

    55 message to format 

    +

    56 

    +

    57 Returns 

    +

    58 ------- 

    +

    59 msg_ret: str 

    +

    60 formatted message 

    +

    61 """ 

    +

    62 return ConsoleColoring.green(f"{MARKER_SUCCESS} {msg}") 

    +

    63 

    +

    64 

    +

    65def str_warn(msg: str): 

    +

    66 """Format a string as a warning 

    +

    67 

    +

    68 Parameters 

    +

    69 ---------- 

    +

    70 msg: str 

    +

    71 message to format 

    +

    72 

    +

    73 Returns 

    +

    74 ------- 

    +

    75 msg_ret: str 

    +

    76 formatted message 

    +

    77 """ 

    +

    78 return ConsoleColoring.yellow(f"{MARKER_WARNING} {msg}") 

    +

    79 

    +

    80 

    +

    81def str_error(msg: str): 

    +

    82 """Format a string as an error 

    +

    83 

    +

    84 Parameters 

    +

    85 ---------- 

    +

    86 msg: str 

    +

    87 message to format 

    +

    88 

    +

    89 Returns 

    +

    90 ------- 

    +

    91 msg_ret: str 

    +

    92 formatted message 

    +

    93 """ 

    +

    94 return ConsoleColoring.red(f"{MARKER_ERROR} {msg}") 

    +

    95 

    +

    96 

    +

    97def get_logger(file_flag: str) -> logging.Logger: 

    +

    98 """Get the logger for the lasso module 

    +

    99 

    +

    100 Returns 

    +

    101 ------- 

    +

    102 logger: logging.Logger 

    +

    103 logger for the lasso module 

    +

    104 """ 

    +

    105 logging.basicConfig( 

    +

    106 datefmt="[%(levelname)s] %(message)s [%(pathname)s %(funcName)s %(lineno)d]" 

    +

    107 ) 

    +

    108 return logging.getLogger(file_flag) 

    +
    + + + diff --git a/coverage/d_542c2d228fe7f497___init___py.html b/coverage/d_542c2d228fe7f497___init___py.html new file mode 100644 index 0000000..374965e --- /dev/null +++ b/coverage/d_542c2d228fe7f497___init___py.html @@ -0,0 +1,97 @@ + + + + + Coverage for lasso/math/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/math/__init__.py: + 100% +

    + +

    + 0 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +
    + + + diff --git a/coverage/d_542c2d228fe7f497_sampling_py.html b/coverage/d_542c2d228fe7f497_sampling_py.html new file mode 100644 index 0000000..96a3be7 --- /dev/null +++ b/coverage/d_542c2d228fe7f497_sampling_py.html @@ -0,0 +1,175 @@ + + + + + Coverage for lasso/math/sampling.py: 59% + + + + + +
    +
    +

    + Coverage for lasso/math/sampling.py: + 59% +

    + +

    + 22 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import random 

    +

    2from typing import Union 

    +

    3import numpy as np 

    +

    4from sklearn.neighbors import KDTree 

    +

    5 

    +

    6 

    +

    7def unique_subsamples(start: int, end: int, n_samples: int, seed=None) -> np.ndarray: 

    +

    8 """Retrieve unique subsample indexes 

    +

    9 

    +

    10 Parameters 

    +

    11 ---------- 

    +

    12 start: int 

    +

    13 starting index of population 

    +

    14 end: int 

    +

    15 ending index of population (end <= start) 

    +

    16 n_samples: int 

    +

    17 number of samples to draw 

    +

    18 seed: int 

    +

    19 seed for random number generator 

    +

    20 

    +

    21 Returns 

    +

    22 ------- 

    +

    23 indexes: np.ndarray 

    +

    24 unique sample indexes 

    +

    25 """ 

    +

    26 assert start <= end 

    +

    27 

    +

    28 if end - start < n_samples: 

    +

    29 n_samples = end - start 

    +

    30 

    +

    31 random.seed(seed) 

    +

    32 indexes = np.array(random.sample(range(start, end), n_samples), dtype=np.int64) 

    +

    33 random.seed() 

    +

    34 return indexes 

    +

    35 

    +

    36 

    +

    37def homogenize_density( 

    +

    38 points: np.ndarray, 

    +

    39 dim: int = 2, 

    +

    40 target_distance: Union[float, None] = None, 

    +

    41 n_neighbors: int = 18, 

    +

    42 seed=None, 

    +

    43) -> np.ndarray: 

    +

    44 """homogenize a cloud density by probabilities 

    +

    45 

    +

    46 Parameters 

    +

    47 ---------- 

    +

    48 points: np.ndarray 

    +

    49 point cloud 

    +

    50 dim: int 

    +

    51 intrinsic dimension of the data 

    +

    52 target_distance: float 

    +

    53 target distance to aim for 

    +

    54 n_neighbors: int 

    +

    55 neighbors used for computation of average neighborhood distance 

    +

    56 seed: int 

    +

    57 seed for random number generator 

    +

    58 

    +

    59 Returns 

    +

    60 ------- 

    +

    61 is_selected: np.ndarray 

    +

    62 boolean array indicating which subsamples were selected 

    +

    63 """ 

    +

    64 n_neighbors = min(n_neighbors, len(points)) 

    +

    65 

    +

    66 random.seed(seed) 

    +

    67 d, _ = KDTree(points).query(points, k=n_neighbors + 1) 

    +

    68 d_average = np.average(d[:, 1:], axis=1) 

    +

    69 if target_distance is None: 

    +

    70 target_distance = np.median(d_average) 

    +

    71 is_selected = np.array( 

    +

    72 [ 

    +

    73 dist >= target_distance or random.random() < (dist / target_distance) ** dim 

    +

    74 for i, dist in enumerate(d_average) 

    +

    75 ] 

    +

    76 ) 

    +

    77 random.seed() 

    +

    78 return is_selected 

    +
    + + + diff --git a/coverage/d_542c2d228fe7f497_stochastic_py.html b/coverage/d_542c2d228fe7f497_stochastic_py.html new file mode 100644 index 0000000..a023a5f --- /dev/null +++ b/coverage/d_542c2d228fe7f497_stochastic_py.html @@ -0,0 +1,123 @@ + + + + + Coverage for lasso/math/stochastic.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/math/stochastic.py: + 100% +

    + +

    + 9 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import numpy as np 

    +

    2from scipy import stats 

    +

    3 

    +

    4 

    +

    5def jensen_shannon_entropy(p: np.ndarray, q: np.ndarray) -> float: 

    +

    6 """Jensen Shannon Entropy 

    +

    7 

    +

    8 Parameters 

    +

    9 ---------- 

    +

    10 p: np.ndarray 

    +

    11 first probability distribution 

    +

    12 q: np.ndarray 

    +

    13 second probability distribution 

    +

    14 

    +

    15 Returns 

    +

    16 ------- 

    +

    17 js_divergence: float 

    +

    18 Jensen-Shannon divergence 

    +

    19 """ 

    +

    20 p = np.asarray(p) 

    +

    21 q = np.asarray(q) 

    +

    22 # normalize 

    +

    23 p = p / p.sum() 

    +

    24 q = q / q.sum() 

    +

    25 m = (p + q) / 2 

    +

    26 return (stats.entropy(p, m) + stats.entropy(q, m)) / 2 

    +
    + + + diff --git a/coverage/d_542c2d228fe7f497_test_sampling_py.html b/coverage/d_542c2d228fe7f497_test_sampling_py.html new file mode 100644 index 0000000..b3a081a --- /dev/null +++ b/coverage/d_542c2d228fe7f497_test_sampling_py.html @@ -0,0 +1,107 @@ + + + + + Coverage for lasso/math/test_sampling.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/math/test_sampling.py: + 100% +

    + +

    + 6 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import unittest 

    +

    2 

    +

    3from lasso.math.sampling import unique_subsamples 

    +

    4 

    +

    5 

    +

    6class Test(unittest.TestCase): 

    +

    7 def test_unique_subsamples(self): 

    +

    8 

    +

    9 self.assertEqual(len(set(unique_subsamples(0, 20, 100))), 20) 

    +

    10 self.assertEqual(len(set(unique_subsamples(0, 200, 100))), 100) 

    +
    + + + diff --git a/coverage/d_542c2d228fe7f497_test_stochastic_py.html b/coverage/d_542c2d228fe7f497_test_stochastic_py.html new file mode 100644 index 0000000..f66efd4 --- /dev/null +++ b/coverage/d_542c2d228fe7f497_test_stochastic_py.html @@ -0,0 +1,110 @@ + + + + + Coverage for lasso/math/test_stochastic.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/math/test_stochastic.py: + 100% +

    + +

    + 9 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import unittest 

    +

    2 

    +

    3from lasso.math.stochastic import jensen_shannon_entropy 

    +

    4 

    +

    5 

    +

    6class Test(unittest.TestCase): 

    +

    7 def test_jensen_shannon_entropy(self): 

    +

    8 p1 = [0.5, 0.5, 0.0] 

    +

    9 p2 = [0, 0.1, 0.9] 

    +

    10 

    +

    11 self.assertEqual(jensen_shannon_entropy(p1, p1), 0) 

    +

    12 self.assertAlmostEqual(jensen_shannon_entropy(p1, p2), 0.55797881790005399) 

    +

    13 self.assertAlmostEqual(jensen_shannon_entropy(p2, p1), 0.55797881790005399) 

    +
    + + + diff --git a/coverage/d_8c1f8dfb65cd62c9___init___py.html b/coverage/d_8c1f8dfb65cd62c9___init___py.html new file mode 100644 index 0000000..c78c45a --- /dev/null +++ b/coverage/d_8c1f8dfb65cd62c9___init___py.html @@ -0,0 +1,97 @@ + + + + + Coverage for lasso/io/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/io/__init__.py: + 100% +

    + +

    + 0 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +
    + + + diff --git a/coverage/d_8c1f8dfb65cd62c9_binary_buffer_py.html b/coverage/d_8c1f8dfb65cd62c9_binary_buffer_py.html new file mode 100644 index 0000000..8943bed --- /dev/null +++ b/coverage/d_8c1f8dfb65cd62c9_binary_buffer_py.html @@ -0,0 +1,386 @@ + + + + + Coverage for lasso/io/binary_buffer.py: 87% + + + + + +
    +
    +

    + Coverage for lasso/io/binary_buffer.py: + 87% +

    + +

    + 78 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import mmap 

    +

    2import os 

    +

    3from typing import Any, List, Union 

    +

    4 

    +

    5import numpy as np 

    +

    6 

    +

    7 

    +

    8class BinaryBuffer: 

    +

    9 """This class is used to handle binary data""" 

    +

    10 

    +

    11 def __init__(self, filepath: Union[str, None] = None, n_bytes: int = 0): 

    +

    12 """Buffer used to read binary files 

    +

    13 

    +

    14 Parameters 

    +

    15 ---------- 

    +

    16 filepath: Union[str, None] 

    +

    17 path to a binary file 

    +

    18 n_bytes: int 

    +

    19 how many bytes to load (uses memory mapping) 

    +

    20 

    +

    21 Returns 

    +

    22 ------- 

    +

    23 instance: BinaryBuffer 

    +

    24 """ 

    +

    25 self.filepath_ = None 

    +

    26 self.sizes_ = [] 

    +

    27 self.load(filepath, n_bytes) 

    +

    28 

    +

    29 @property 

    +

    30 def memoryview(self) -> memoryview: 

    +

    31 """Get the underlying memoryview of the binary buffer 

    +

    32 

    +

    33 Returns 

    +

    34 ------- 

    +

    35 mv_: memoryview 

    +

    36 memoryview used to store the data 

    +

    37 """ 

    +

    38 return self.mv_ 

    +

    39 

    +

    40 @memoryview.setter 

    +

    41 def memoryview(self, new_mv): 

    +

    42 """Set the memoryview of the binary buffer manually 

    +

    43 

    +

    44 Parameters 

    +

    45 ---------- 

    +

    46 new_mv: memoryview 

    +

    47 memoryview used to store the bytes 

    +

    48 """ 

    +

    49 assert isinstance(new_mv, memoryview) 

    +

    50 self.mv_ = new_mv 

    +

    51 self.sizes_ = [len(self.mv_)] 

    +

    52 

    +

    53 def get_slice(self, start: int, end=Union[None, int], step: int = 1) -> "BinaryBuffer": 

    +

    54 """Get a slice of the binary buffer 

    +

    55 

    +

    56 Parameters 

    +

    57 ---------- 

    +

    58 start: int 

    +

    59 start position in bytes 

    +

    60 end: Union[int, None] 

    +

    61 end position 

    +

    62 step: int 

    +

    63 step for slicing (default 1) 

    +

    64 

    +

    65 Returns 

    +

    66 ------- 

    +

    67 new_buffer: BinaryBuffer 

    +

    68 the slice as a new buffer 

    +

    69 """ 

    +

    70 

    +

    71 assert start < len(self) 

    +

    72 assert end is None or end < len(self) 

    +

    73 

    +

    74 end = len(self) if end is None else end 

    +

    75 

    +

    76 new_binary_buffer = BinaryBuffer() 

    +

    77 new_binary_buffer.memoryview = self.mv_[start:end:step] 

    +

    78 

    +

    79 return new_binary_buffer 

    +

    80 

    +

    81 def __len__(self) -> int: 

    +

    82 """Get the length of the byte buffer 

    +

    83 

    +

    84 Returns 

    +

    85 ------- 

    +

    86 len: int 

    +

    87 """ 

    +

    88 return len(self.mv_) 

    +

    89 

    +

    90 @property 

    +

    91 def size(self) -> int: 

    +

    92 """Get the size of the byte buffer 

    +

    93 

    +

    94 Returns 

    +

    95 ------- 

    +

    96 size: int 

    +

    97 size of buffer in bytes 

    +

    98 """ 

    +

    99 return len(self.mv_) 

    +

    100 

    +

    101 @size.setter 

    +

    102 def size(self, size: int): 

    +

    103 """Set the length of the byte buffer 

    +

    104 

    +

    105 Parameters 

    +

    106 ---------- 

    +

    107 size: int 

    +

    108 new size of the buffer 

    +

    109 """ 

    +

    110 

    +

    111 if len(self.mv_) > size: 

    +

    112 self.mv_ = self.mv_[:size] 

    +

    113 elif len(self.mv_) < size: 

    +

    114 buffer = bytearray(self.mv_) + bytearray(b"0" * (size - len(self.mv_))) 

    +

    115 self.mv_ = memoryview(buffer) 

    +

    116 

    +

    117 def read_number(self, start: int, dtype: np.dtype) -> Union[float, int]: 

    +

    118 """Read a number from the buffer 

    +

    119 

    +

    120 Parameters 

    +

    121 ---------- 

    +

    122 start: int 

    +

    123 at which byte to start reading 

    +

    124 dtype: np.dtype 

    +

    125 type of the number to read 

    +

    126 

    +

    127 Returns 

    +

    128 ------- 

    +

    129 number: np.dtype 

    +

    130 number with the type specified 

    +

    131 """ 

    +

    132 return np.frombuffer(self.mv_, dtype=dtype, count=1, offset=start)[0] 

    +

    133 

    +

    134 def write_number(self, start: int, value: Any, dtype: np.dtype): 

    +

    135 """Write a number to the buffer 

    +

    136 

    +

    137 Parameters 

    +

    138 ---------- 

    +

    139 start: int 

    +

    140 at which byte to start writing 

    +

    141 value: Any 

    +

    142 value to write 

    +

    143 dtype: np.dtype 

    +

    144 type of the number to write 

    +

    145 """ 

    +

    146 

    +

    147 wrapper = np.frombuffer(self.mv_[start:], dtype=dtype) 

    +

    148 wrapper[0] = value 

    +

    149 

    +

    150 def read_ndarray(self, start: int, length: int, step: int, dtype: np.dtype) -> np.ndarray: 

    +

    151 """Read a numpy array from the buffer 

    +

    152 

    +

    153 Parameters 

    +

    154 ---------- 

    +

    155 start: int 

    +

    156 at which byte to start reading 

    +

    157 length: int 

    +

    158 length in bytes to read 

    +

    159 step: int 

    +

    160 byte step size (how many bytes to skip) 

    +

    161 dtype: np.dtype 

    +

    162 type of the number to read 

    +

    163 

    +

    164 Returns 

    +

    165 ------- 

    +

    166 array: np.ndarray 

    +

    167 """ 

    +

    168 

    +

    169 return np.frombuffer(self.mv_[start : start + length : step], dtype=dtype) 

    +

    170 

    +

    171 def write_ndarray(self, array: np.ndarray, start: int, step: int): 

    +

    172 """Write a numpy array to the buffer 

    +

    173 

    +

    174 Parameters 

    +

    175 ---------- 

    +

    176 array: np.ndarray 

    +

    177 array to save to the file 

    +

    178 start: int 

    +

    179 start in bytes 

    +

    180 step: int 

    +

    181 byte step size (how many bytes to skip) 

    +

    182 """ 

    +

    183 

    +

    184 wrapper = np.frombuffer(self.mv_[start::step], dtype=array.dtype) 

    +

    185 

    +

    186 np.copyto(wrapper[: array.size], array, casting="no") 

    +

    187 

    +

    188 def read_text(self, start: int, length: int, step: int = 1, encoding: str = "utf8") -> str: 

    +

    189 """Read text from the binary buffer 

    +

    190 

    +

    191 Parameters 

    +

    192 ---------- 

    +

    193 start: int 

    +

    194 start in bytes 

    +

    195 length: int 

    +

    196 length in bytes to read 

    +

    197 step: int 

    +

    198 byte step size 

    +

    199 encoding: str 

    +

    200 encoding used 

    +

    201 """ 

    +

    202 return self.mv_[start : start + length : step].tobytes().decode(encoding) 

    +

    203 

    +

    204 def save(self, filepath: Union[str, None] = None): 

    +

    205 """Save the binary buffer to a file 

    +

    206 

    +

    207 Parameters 

    +

    208 ---------- 

    +

    209 filepath: str 

    +

    210 path where to save the data 

    +

    211 

    +

    212 Notes 

    +

    213 ----- 

    +

    214 Overwrites to original file if no filepath 

    +

    215 is specified. 

    +

    216 """ 

    +

    217 

    +

    218 filepath_parsed = filepath if filepath else (self.filepath_[0] if self.filepath_ else None) 

    +

    219 

    +

    220 if filepath_parsed is None: 

    +

    221 return 

    +

    222 

    +

    223 with open(filepath_parsed, "wb") as fp: 

    +

    224 fp.write(self.mv_) 

    +

    225 

    +

    226 self.filepath_ = filepath_parsed 

    +

    227 

    +

    228 def load(self, filepath: Union[List[str], str, None] = None, n_bytes: int = 0): 

    +

    229 """load a file 

    +

    230 

    +

    231 Parameters 

    +

    232 ---------- 

    +

    233 filepath: Union[str, None] 

    +

    234 path to the file to load 

    +

    235 n_bytes: int 

    +

    236 number of bytes to load (uses memory mapping if nonzero) 

    +

    237 

    +

    238 Notes 

    +

    239 ----- 

    +

    240 If not filepath is specified, then the opened file is simply 

    +

    241 reloaded. 

    +

    242 """ 

    +

    243 

    +

    244 filepath = filepath if filepath else self.filepath_ 

    +

    245 

    +

    246 if not filepath: 

    +

    247 return 

    +

    248 

    +

    249 # convert to a list if only a single file is given 

    +

    250 filepath_parsed = [filepath] if isinstance(filepath, str) else filepath 

    +

    251 

    +

    252 # get size of all files 

    +

    253 sizes = [os.path.getsize(path) for path in filepath_parsed] 

    +

    254 

    +

    255 # reduce memory if required 

    +

    256 sizes = [entry if n_bytes == 0 else min(n_bytes, entry) for entry in sizes] 

    +

    257 

    +

    258 memorysize = sum(sizes) 

    +

    259 

    +

    260 # allocate memory 

    +

    261 buffer = memoryview(bytearray(b"0" * memorysize)) 

    +

    262 

    +

    263 # read files and concatenate them 

    +

    264 sizes_tmp = [0] + sizes 

    +

    265 for i_path, path in enumerate(filepath_parsed): 

    +

    266 with open(path, "br") as fp: 

    +

    267 if n_bytes: 

    +

    268 mm = mmap.mmap(fp.fileno(), sizes[i_path], access=mmap.ACCESS_READ) 

    +

    269 buffer[sizes_tmp[i_path] :] = mm[: sizes[i_path]] 

    +

    270 else: 

    +

    271 fp.readinto(buffer[sizes_tmp[i_path] :]) 

    +

    272 

    +

    273 self.filepath_ = filepath_parsed 

    +

    274 self.sizes_ = sizes 

    +

    275 self.mv_ = buffer 

    +

    276 

    +

    277 def append(self, binary_buffer: "BinaryBuffer"): 

    +

    278 """Append another binary buffer to this one 

    +

    279 

    +

    280 Parameters 

    +

    281 ---------- 

    +

    282 binary_buffer: BinaryBuffer 

    +

    283 buffer to append 

    +

    284 """ 

    +

    285 

    +

    286 assert isinstance(binary_buffer, BinaryBuffer) 

    +

    287 

    +

    288 self.mv_ = memoryview(bytearray(self.mv_) + bytearray(binary_buffer.mv_)) 

    +

    289 self.sizes_.append(len(binary_buffer)) 

    +
    + + + diff --git a/coverage/d_8c1f8dfb65cd62c9_files_py.html b/coverage/d_8c1f8dfb65cd62c9_files_py.html new file mode 100644 index 0000000..3246793 --- /dev/null +++ b/coverage/d_8c1f8dfb65cd62c9_files_py.html @@ -0,0 +1,181 @@ + + + + + Coverage for lasso/io/files.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/io/files.py: + 100% +

    + +

    + 31 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import contextlib 

    +

    2import glob 

    +

    3import os 

    +

    4import typing 

    +

    5from typing import Iterator, List, Union 

    +

    6 

    +

    7 

    +

    8@contextlib.contextmanager 

    +

    9def open_file_or_filepath( 

    +

    10 path_or_file: Union[str, typing.BinaryIO], mode: str 

    +

    11) -> Iterator[typing.BinaryIO]: 

    +

    12 """This function accepts a file or filepath and handles closing correctly 

    +

    13 

    +

    14 Parameters 

    +

    15 ---------- 

    +

    16 path_or_file: Union[str, typing.IO] 

    +

    17 path or file 

    +

    18 mode: str 

    +

    19 filemode 

    +

    20 

    +

    21 Yields 

    +

    22 ------ 

    +

    23 f: file object 

    +

    24 """ 

    +

    25 if isinstance(path_or_file, str): 

    +

    26 # We open this file in binary mode anyway so no encoding is needed. 

    +

    27 # pylint: disable = unspecified-encoding 

    +

    28 f = file_to_close = open(path_or_file, mode) 

    +

    29 else: 

    +

    30 f = path_or_file 

    +

    31 file_to_close = None 

    +

    32 try: 

    +

    33 yield f 

    +

    34 finally: 

    +

    35 if file_to_close: 

    +

    36 file_to_close.close() 

    +

    37 

    +

    38 

    +

    39def collect_files( 

    +

    40 dirpath: Union[str, List[str]], patterns: Union[str, List[str]], recursive: bool = False 

    +

    41): 

    +

    42 """Collect files from directories 

    +

    43 

    +

    44 Parameters 

    +

    45 ---------- 

    +

    46 dirpath: Union[str, List[str]] 

    +

    47 path to one or multiple directories to search through 

    +

    48 patterns: Union[str, List[str]] 

    +

    49 patterns to search for 

    +

    50 recursive: bool 

    +

    51 whether to also search subdirs 

    +

    52 

    +

    53 Returns 

    +

    54 ------- 

    +

    55 found_files: Union[List[str], List[List[str]]] 

    +

    56 returns the list of files found for every pattern specified 

    +

    57 

    +

    58 Examples 

    +

    59 -------- 

    +

    60 >>> png_images, jpeg_images = collect_files('./folder', ['*.png', '*.jpeg']) 

    +

    61 """ 

    +

    62 

    +

    63 if not isinstance(dirpath, (list, tuple)): 

    +

    64 dirpath = [dirpath] 

    +

    65 if not isinstance(patterns, (list, tuple)): 

    +

    66 patterns = [patterns] 

    +

    67 

    +

    68 found_files = [] 

    +

    69 for pattern in patterns: 

    +

    70 

    +

    71 files_with_pattern = [] 

    +

    72 for current_dir in dirpath: 

    +

    73 # files in root dir 

    +

    74 files_with_pattern += glob.glob(os.path.join(current_dir, pattern)) 

    +

    75 # subfolders 

    +

    76 if recursive: 

    +

    77 files_with_pattern += glob.glob(os.path.join(current_dir, "**", pattern)) 

    +

    78 

    +

    79 found_files.append(sorted(files_with_pattern)) 

    +

    80 

    +

    81 if len(found_files) == 1: 

    +

    82 return found_files[0] 

    +

    83 

    +

    84 return found_files 

    +
    + + + diff --git a/coverage/d_8c1f8dfb65cd62c9_test_binary_buffer_py.html b/coverage/d_8c1f8dfb65cd62c9_test_binary_buffer_py.html new file mode 100644 index 0000000..93f67e9 --- /dev/null +++ b/coverage/d_8c1f8dfb65cd62c9_test_binary_buffer_py.html @@ -0,0 +1,165 @@ + + + + + Coverage for lasso/io/test_binary_buffer.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/io/test_binary_buffer.py: + 100% +

    + +

    + 44 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import numpy as np 

    +

    3from unittest import TestCase 

    +

    4import filecmp 

    +

    5 

    +

    6from lasso.io.binary_buffer import BinaryBuffer 

    +

    7 

    +

    8 

    +

    9class BinaryBufferTest(TestCase): 

    +

    10 def setUp(self): 

    +

    11 

    +

    12 # read file 

    +

    13 self.bb = BinaryBuffer("test/simple_d3plot/d3plot") 

    +

    14 

    +

    15 def test_init(self): 

    +

    16 

    +

    17 # test some stuff for fun 

    +

    18 self.assertEqual(self.bb.mv_[40:42].tobytes(), b"\xaf\\") 

    +

    19 self.assertEqual(len(self.bb), len(self.bb.mv_)) 

    +

    20 self.assertEqual(len(self.bb), 192512) 

    +

    21 

    +

    22 def test_memoryview(self): 

    +

    23 

    +

    24 self.assertEqual(self.bb.mv_, self.bb.memoryview) 

    +

    25 with self.assertRaises(AssertionError): 

    +

    26 self.bb.memoryview = None 

    +

    27 self.memoryview = memoryview(bytearray(b"")) 

    +

    28 

    +

    29 def test_reading(self): 

    +

    30 

    +

    31 # numbers 

    +

    32 self.assertEqual(self.bb.read_number(44, np.int32), 1) 

    +

    33 self.assertEqual(self.bb.read_number(56, np.float32), 960.0) 

    +

    34 

    +

    35 self.assertEqual(self.bb.read_text(0, 40), " " * 40) 

    +

    36 self.assertEqual(self.bb.read_text(52, 4), "R712") 

    +

    37 

    +

    38 self.assertListEqual(self.bb.read_ndarray(60, 12, 1, np.int32).tolist(), [4, 4915, 6]) 

    +

    39 

    +

    40 def test_save(self): 

    +

    41 

    +

    42 self.bb.save("test/tmp") 

    +

    43 eq = filecmp.cmp("test/simple_d3plot/d3plot", "test/tmp") 

    +

    44 os.remove("test/tmp") 

    +

    45 self.assertEqual(eq, True) 

    +

    46 

    +

    47 def test_writing(self): 

    +

    48 

    +

    49 bb = BinaryBuffer("test/simple_d3plot/d3plot") 

    +

    50 bb.write_number(44, 13, np.int32) 

    +

    51 self.assertEqual(bb.read_number(44, np.int32), 13) 

    +

    52 

    +

    53 array = np.array([1, 2, 3, 4], np.int32) 

    +

    54 bb.write_ndarray(array, 44, 1) 

    +

    55 self.assertListEqual(bb.read_ndarray(44, 16, 1, array.dtype).tolist(), array.tolist()) 

    +

    56 

    +

    57 def test_size(self): 

    +

    58 

    +

    59 bb = BinaryBuffer("test/simple_d3plot/d3plot") 

    +

    60 self.assertEqual(bb.size, 192512) 

    +

    61 self.assertEqual(bb.size, len(bb)) 

    +

    62 

    +

    63 bb.size = 192511 

    +

    64 self.assertEqual(bb.size, 192511) 

    +

    65 

    +

    66 bb.size = 192512 

    +

    67 self.assertEqual(bb.size, 192512) 

    +

    68 self.assertEqual(bb.mv_[-1 : len(bb)].tobytes(), b"0") 

    +
    + + + diff --git a/coverage/d_8c1f8dfb65cd62c9_test_files_py.html b/coverage/d_8c1f8dfb65cd62c9_test_files_py.html new file mode 100644 index 0000000..f68eb11 --- /dev/null +++ b/coverage/d_8c1f8dfb65cd62c9_test_files_py.html @@ -0,0 +1,118 @@ + + + + + Coverage for lasso/io/test_files.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/io/test_files.py: + 100% +

    + +

    + 14 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import unittest 

    +

    2from lasso.io.files import collect_files 

    +

    3 

    +

    4 

    +

    5class Test(unittest.TestCase): 

    +

    6 def test_collect_files(self): 

    +

    7 files = collect_files("test/io_test", "*.txt") 

    +

    8 self.assertEqual(len(files), 1) 

    +

    9 

    +

    10 files = collect_files("test/io_test/", "*.txt", recursive=True) 

    +

    11 self.assertEqual(len(files), 2) 

    +

    12 

    +

    13 files1, files2 = collect_files("test/io_test/", ["*.txt", "*.yay"], recursive=True) 

    +

    14 self.assertEqual(len(files1), 2) 

    +

    15 self.assertEqual(len(files2), 1) 

    +

    16 

    +

    17 files1, files2 = collect_files( 

    +

    18 ["test/io_test/", "test/io_test/subfolder"], ["*.txt", "*.yay"] 

    +

    19 ) 

    +

    20 self.assertEqual(len(files1), 2) 

    +

    21 self.assertEqual(len(files2), 1) 

    +
    + + + diff --git a/coverage/d_9912f5017dc9b562___init___py.html b/coverage/d_9912f5017dc9b562___init___py.html new file mode 100644 index 0000000..70ba9ed --- /dev/null +++ b/coverage/d_9912f5017dc9b562___init___py.html @@ -0,0 +1,97 @@ + + + + + Coverage for lasso/plotting/resources/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/plotting/resources/__init__.py: + 100% +

    + +

    + 0 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +
    + + + diff --git a/coverage/d_9d33c8608d0cbf05___init___py.html b/coverage/d_9d33c8608d0cbf05___init___py.html new file mode 100644 index 0000000..bdd34de --- /dev/null +++ b/coverage/d_9d33c8608d0cbf05___init___py.html @@ -0,0 +1,98 @@ + + + + + Coverage for lasso/dimred/sphere/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/sphere/__init__.py: + 100% +

    + +

    + 0 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1# from .algorithms import * 

    +
    + + + diff --git a/coverage/d_9d33c8608d0cbf05_algorithms_py.html b/coverage/d_9d33c8608d0cbf05_algorithms_py.html new file mode 100644 index 0000000..cc4c982 --- /dev/null +++ b/coverage/d_9d33c8608d0cbf05_algorithms_py.html @@ -0,0 +1,323 @@ + + + + + Coverage for lasso/dimred/sphere/algorithms.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/dimred/sphere/algorithms.py: + 0% +

    + +

    + 67 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import numpy as np 

    +

    2 

    +

    3from sklearn.preprocessing import normalize 

    +

    4 

    +

    5# scipy is C-code which causes invalid linter warning about ConvexHull not 

    +

    6# being around. 

    +

    7# pylint: disable = no-name-in-module 

    +

    8from scipy.spatial import ConvexHull 

    +

    9from scipy.stats import binned_statistic_2d 

    +

    10from scipy.stats._binned_statistic import BinnedStatistic2dResult 

    +

    11 

    +

    12 

    +

    13def to_spherical_coordinates(points: np.ndarray, centroid: np.ndarray, axis: str = "Z"): 

    +

    14 """Converts the points to spherical coordinates. 

    +

    15 

    +

    16 Parameters 

    +

    17 ---------- 

    +

    18 points: np.ndarray 

    +

    19 The point cloud to be sphered. 

    +

    20 centroid: np.ndarray 

    +

    21 Centroid of the point cloud. 

    +

    22 axis: str 

    +

    23 Sphere axis in the global coordinate system. 

    +

    24 

    +

    25 Returns 

    +

    26 ------- 

    +

    27 az : np.ndarray 

    +

    28 Azimuthal angle vector. 

    +

    29 po: np.ndarray 

    +

    30 Polar angle vector. 

    +

    31 

    +

    32 Notes 

    +

    33 ----- 

    +

    34 The local x-axis is set as the zero marker for azimuthal angles. 

    +

    35 """ 

    +

    36 indexes = [0, 1, 2] 

    +

    37 # set the correct indexes for swapping if the sphere 

    +

    38 # axis is not aligned with the global z axis 

    +

    39 if axis == "Y": 

    +

    40 indexes = [0, 2, 1] # sphere z axis aligned with global y-axis 

    +

    41 elif axis == "X": 

    +

    42 indexes = [2, 1, 0] # sphere z axis aligned with global x-axis 

    +

    43 

    +

    44 # vectors from centroid to points 

    +

    45 vec = points - centroid 

    +

    46 vec = normalize(vec, axis=1, norm="l2") 

    +

    47 

    +

    48 # azimuthal angles on the local xy plane 

    +

    49 # x-axis is the zero marker, and we correct 

    +

    50 # all negative angles 

    +

    51 az = np.arctan2(vec[:, indexes[1]], vec[:, indexes[0]]) 

    +

    52 neg_indexes = np.where(az < 0) 

    +

    53 az[neg_indexes] += 2 * np.pi 

    +

    54 

    +

    55 # polar angles 

    +

    56 po = np.arccos(vec[:, indexes[2]]) 

    +

    57 

    +

    58 return az, po 

    +

    59 

    +

    60 

    +

    61def sphere_hashing(histo: BinnedStatistic2dResult, field: np.ndarray): 

    +

    62 """Compute the hash of each bucket in the histogram by mapping 

    +

    63 the bin numbers to the field values and scaling the field values 

    +

    64 by the number of counts in each bin. 

    +

    65 

    +

    66 Parameters 

    +

    67 ---------- 

    +

    68 histo: BinnedStatistic2dResult 

    +

    69 3D histogram containing the indexes of all points of a simulation 

    +

    70 mapped to their projected bins. 

    +

    71 field: ndarray 

    +

    72 

    +

    73 Returns 

    +

    74 ------- 

    +

    75 hashes: np.ndarray 

    +

    76 The hashing result of all points mapped to an embedding space. 

    +

    77 

    +

    78 """ 

    +

    79 bin_n = histo.binnumber 

    +

    80 

    +

    81 assert len(bin_n[0] == len(field)) 

    +

    82 

    +

    83 # get dims of the embedding space 

    +

    84 n_rows = histo.statistic.shape[0] 

    +

    85 n_cols = histo.statistic.shape[1] 

    +

    86 

    +

    87 # bin stores the indexes of the points 

    +

    88 # index 0 stores the azimuthal angles 

    +

    89 # index 1 stores the polar angles 

    +

    90 # we want zero indexing 

    +

    91 binx = np.asarray(bin_n[0]) - 1 

    +

    92 biny = np.asarray(bin_n[1]) - 1 

    +

    93 

    +

    94 # allocate arrays 

    +

    95 bin_count = np.zeros((n_rows, n_cols)) 

    +

    96 hashes = np.zeros((n_rows, n_cols)) 

    +

    97 

    +

    98 # sum all the field values to each bin 

    +

    99 hashes[binx[:], biny[:]] += field[:] 

    +

    100 bin_count[binx[:], biny[:]] += 1 

    +

    101 

    +

    102 hashes = hashes.flatten() 

    +

    103 bin_count = bin_count.flatten() 

    +

    104 

    +

    105 # exclude all zero entries 

    +

    106 nonzero_inds = np.where(bin_count != 0) 

    +

    107 

    +

    108 # average the fields 

    +

    109 hashes[nonzero_inds] /= bin_count[nonzero_inds] 

    +

    110 

    +

    111 return hashes 

    +

    112 

    +

    113 

    +

    114def create_sphere(diameter: float): 

    +

    115 """Creates two vectors along the alpha and beta axis of a sphere. Alpha represents 

    +

    116 the angle from the sphere axis to the equator. Beta between vectors from the 

    +

    117 center of the sphere to one of the poles and the equator. 

    +

    118 

    +

    119 Parameters 

    +

    120 ---------- 

    +

    121 diameter: 

    +

    122 Diameter of the sphere. 

    +

    123 

    +

    124 Returns 

    +

    125 ------- 

    +

    126 bin_beta: np.ndarray 

    +

    127 Bin bounds for the beta angles. 

    +

    128 

    +

    129 bin_alpha: np.ndarray 

    +

    130 Bin bounds for the alpha angles. 

    +

    131 

    +

    132 """ 

    +

    133 # number of partitions for equator 

    +

    134 n_alpha = 145 

    +

    135 # number of partitions for longitude 

    +

    136 n_beta = 144 

    +

    137 

    +

    138 r = diameter / 2.0 

    +

    139 

    +

    140 # area of sphere 

    +

    141 a_sphere = 4 * np.pi * r**2 

    +

    142 n_ele = n_beta**2 

    +

    143 a_ele = a_sphere / n_ele 

    +

    144 

    +

    145 # alpha angles around the equator and the size of one step 

    +

    146 bin_alpha, delt_alpha = np.linspace(0, 2 * np.pi, n_alpha, retstep=True) 

    +

    147 

    +

    148 # bins for beta axis in terms of axis coorindates between -1 and 1 

    +

    149 count = np.linspace(0.0, float(n_beta), 145) 

    +

    150 tmp = count * a_ele 

    +

    151 tmp /= r**2 * delt_alpha 

    +

    152 bin_beta = 1 - tmp 

    +

    153 if bin_beta[-1] < -1: 

    +

    154 bin_beta[-1] = -1 

    +

    155 

    +

    156 bin_beta = np.arccos(bin_beta) 

    +

    157 return bin_alpha, bin_beta 

    +

    158 

    +

    159 

    +

    160def compute_similarity(embeddings: np.ndarray) -> np.ndarray: 

    +

    161 """Computes the similarity of each embedding. 

    +

    162 

    +

    163 Parameters 

    +

    164 ---------- 

    +

    165 embeddings: np.ndarray 

    +

    166 Model embeddings. 

    +

    167 

    +

    168 Returns 

    +

    169 ------- 

    +

    170 smatrix: np.ndarray 

    +

    171 Similarity matrix. 

    +

    172 """ 

    +

    173 

    +

    174 n_runs = len(embeddings) 

    +

    175 smatrix = np.empty((n_runs, n_runs), dtype=np.float32) 

    +

    176 for ii in range(n_runs): 

    +

    177 for jj in range(n_runs): 

    +

    178 smatrix[ii, jj] = np.dot(embeddings[ii], embeddings[jj]) / np.sqrt( 

    +

    179 np.dot(embeddings[ii], embeddings[ii]) * np.dot(embeddings[jj], embeddings[jj]) 

    +

    180 ) 

    +

    181 

    +

    182 return smatrix 

    +

    183 

    +

    184 

    +

    185def create_historgram( 

    +

    186 cloud: np.ndarray, sphere_axis: str = "Z", planar: bool = False 

    +

    187) -> BinnedStatistic2dResult: 

    +

    188 """Builds a histogram using the blocks of a sphered globe and returns a 

    +

    189 binned statistics result for two dimensions. 

    +

    190 

    +

    191 Parameters 

    +

    192 ---------- 

    +

    193 cloud: np.ndarray 

    +

    194 Point cloud around which we create an embedding. 

    +

    195 sphere_axis: str 

    +

    196 Axis of the sphere. This is aligned with the global axis system. 

    +

    197 planar: bool 

    +

    198 Set to true for planar point clouds and false for higher dimensions. 

    +

    199 

    +

    200 Returns 

    +

    201 ------- 

    +

    202 stats: BinnedStatistic2dResult 

    +

    203 Returns a 2D histogram of the sphere with bin numbers and bin statistics. 

    +

    204 """ 

    +

    205 # casting to array because of typing 

    +

    206 centroid = np.array(np.mean(cloud, axis=0)) 

    +

    207 

    +

    208 qhull_options = "" 

    +

    209 if planar: 

    +

    210 qhull_options = "QJ" 

    +

    211 

    +

    212 hull = ConvexHull(cloud, qhull_options=qhull_options) 

    +

    213 

    +

    214 # we need to determine the largest distance in this point 

    +

    215 # cloud, so we can give the sphere a dimension 

    +

    216 # we can also create a sphere of random size but this could 

    +

    217 # skew the results 

    +

    218 dist = np.linalg.norm(hull.max_bound - hull.min_bound) 

    +

    219 

    +

    220 bins_a, bins_b = create_sphere(dist) 

    +

    221 

    +

    222 cloud_alpha, cloud_beta = to_spherical_coordinates(cloud, centroid, axis=sphere_axis) 

    +

    223 

    +

    224 return binned_statistic_2d( 

    +

    225 cloud_alpha, cloud_beta, None, "count", bins=[bins_a, bins_b], expand_binnumbers=True 

    +

    226 ) 

    +
    + + + diff --git a/coverage/d_a84314dfc0388a73___init___py.html b/coverage/d_a84314dfc0388a73___init___py.html new file mode 100644 index 0000000..74d6960 --- /dev/null +++ b/coverage/d_a84314dfc0388a73___init___py.html @@ -0,0 +1,100 @@ + + + + + Coverage for lasso/plotting/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/plotting/__init__.py: + 100% +

    + +

    + 2 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from .plot_shell_mesh import plot_shell_mesh 

    +

    2 

    +

    3__all__ = ["plot_shell_mesh"] 

    +
    + + + diff --git a/coverage/d_a84314dfc0388a73_plot_shell_mesh_py.html b/coverage/d_a84314dfc0388a73_plot_shell_mesh_py.html new file mode 100644 index 0000000..8b85c02 --- /dev/null +++ b/coverage/d_a84314dfc0388a73_plot_shell_mesh_py.html @@ -0,0 +1,314 @@ + + + + + Coverage for lasso/plotting/plot_shell_mesh.py: 15% + + + + + +
    +
    +

    + Coverage for lasso/plotting/plot_shell_mesh.py: + 15% +

    + +

    + 80 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import io 

    +

    3import uuid 

    +

    4import json 

    +

    5from base64 import b64encode 

    +

    6from zipfile import ZipFile, ZIP_DEFLATED 

    +

    7from typing import Union, Tuple 

    +

    8import numpy as np 

    +

    9 

    +

    10 

    +

    11def _read_file(filepath: str): 

    +

    12 """This function reads file as str 

    +

    13 

    +

    14 Parameters 

    +

    15 ---------- 

    +

    16 filepath : str 

    +

    17 filepath of the file to read as string 

    +

    18 

    +

    19 Returns 

    +

    20 ------- 

    +

    21 file_content : str 

    +

    22 """ 

    +

    23 

    +

    24 with open(filepath, "r", encoding="utf-8") as fp_filepath: 

    +

    25 return fp_filepath.read() 

    +

    26 

    +

    27 

    +

    28def plot_shell_mesh( 

    +

    29 node_coordinates: np.ndarray, 

    +

    30 shell_node_indexes: np.ndarray, 

    +

    31 field: Union[np.ndarray, None] = None, 

    +

    32 is_element_field: bool = True, 

    +

    33 fringe_limits: Union[Tuple[float, float], None] = None, 

    +

    34): 

    +

    35 """Plot a mesh 

    +

    36 

    +

    37 Parameters 

    +

    38 ---------- 

    +

    39 node_coordinates : np.ndarray 

    +

    40 array of node coordinates for elements 

    +

    41 shell_node_indexes : np.ndarray 

    +

    42 node indexes of shells 

    +

    43 field : Union[np.ndarray, None] 

    +

    44 Array containing a field value for every element or node 

    +

    45 is_element_field : bool 

    +

    46 if the specified field is for elements or nodes 

    +

    47 fringe_limits : Union[Tuple[float, float], None] 

    +

    48 limits for the fringe bar. Set by default to min and max. 

    +

    49 

    +

    50 Returns 

    +

    51 ------- 

    +

    52 html : str 

    +

    53 html code for plotting as string 

    +

    54 """ 

    +

    55 

    +

    56 # pylint: disable = too-many-locals, too-many-statements 

    +

    57 

    +

    58 assert node_coordinates.ndim == 2 

    +

    59 assert node_coordinates.shape[1] == 3 

    +

    60 assert shell_node_indexes.ndim == 2 

    +

    61 assert shell_node_indexes.shape[1] in [3, 4] 

    +

    62 if isinstance(field, np.ndarray): 

    +

    63 assert field.ndim == 1 

    +

    64 if is_element_field: 

    +

    65 assert field.shape[0] == shell_node_indexes.shape[0] 

    +

    66 else: 

    +

    67 assert field.shape[0] == node_coordinates.shape[0] 

    +

    68 

    +

    69 # cast types correctly 

    +

    70 # the types MUST be float32 

    +

    71 node_coordinates = node_coordinates.astype(np.float32) 

    +

    72 if isinstance(field, np.ndarray): 

    +

    73 field = field.astype(np.float32) 

    +

    74 

    +

    75 # distinguish tria and quads 

    +

    76 is_quad = shell_node_indexes[:, 2] != shell_node_indexes[:, 3] 

    +

    77 is_tria = np.logical_not(is_quad) 

    +

    78 

    +

    79 # separate tria and quads ... I know its sad :( 

    +

    80 tria_node_indexes = shell_node_indexes[is_tria][:, :3] 

    +

    81 quad_node_indexes = shell_node_indexes[is_quad] 

    +

    82 

    +

    83 # we can only plot tria, therefore we need to split quads 

    +

    84 # into two trias 

    +

    85 quad_node_indexes_tria1 = quad_node_indexes[:, :3] 

    +

    86 # quad_node_indexes_tria2 = quad_node_indexes[:, [True, False, True, True]] 

    +

    87 quad_node_indexes_tria2 = quad_node_indexes[:, [0, 2, 3]] 

    +

    88 

    +

    89 # assemble elements for plotting 

    +

    90 # This seems to take a lot of memory, and you are right, thinking this, 

    +

    91 # the issue is just in order to plot fringe values, we need to output 

    +

    92 # the element values at the 3 corner nodes. Since elements share nodes 

    +

    93 # we can not use the same nodes, thus we need to create multiple nodes 

    +

    94 # at the same position but with different fringe. 

    +

    95 nodes_xyz = np.concatenate( 

    +

    96 [ 

    +

    97 node_coordinates[tria_node_indexes].reshape((-1, 3)), 

    +

    98 node_coordinates[quad_node_indexes_tria1].reshape((-1, 3)), 

    +

    99 node_coordinates[quad_node_indexes_tria2].reshape((-1, 3)), 

    +

    100 ] 

    +

    101 ) 

    +

    102 

    +

    103 # fringe value and hover title 

    +

    104 if isinstance(field, np.ndarray): 

    +

    105 

    +

    106 if is_element_field: 

    +

    107 n_shells = len(shell_node_indexes) 

    +

    108 n_tria = np.sum(is_tria) 

    +

    109 n_quads = n_shells - n_tria 

    +

    110 

    +

    111 # split field according to elements 

    +

    112 field_tria = field[is_tria] 

    +

    113 field_quad = field[is_quad] 

    +

    114 

    +

    115 # allocate fringe array 

    +

    116 node_fringe = np.zeros((len(field_tria) + 2 * len(field_quad), 3), dtype=np.float32) 

    +

    117 

    +

    118 # set fringe values 

    +

    119 node_fringe[:n_tria, 0] = field_tria 

    +

    120 node_fringe[:n_tria, 1] = field_tria 

    +

    121 node_fringe[:n_tria, 2] = field_tria 

    +

    122 

    +

    123 node_fringe[n_tria : n_tria + n_quads, 0] = field_quad 

    +

    124 node_fringe[n_tria : n_tria + n_quads, 1] = field_quad 

    +

    125 node_fringe[n_tria : n_tria + n_quads, 2] = field_quad 

    +

    126 

    +

    127 node_fringe[n_tria + n_quads : n_tria + 2 * n_quads, 0] = field_quad 

    +

    128 node_fringe[n_tria + n_quads : n_tria + 2 * n_quads, 1] = field_quad 

    +

    129 node_fringe[n_tria + n_quads : n_tria + 2 * n_quads, 2] = field_quad 

    +

    130 

    +

    131 # flatty paddy 

    +

    132 node_fringe = node_fringe.flatten() 

    +

    133 else: 

    +

    134 # copy & paste ftw 

    +

    135 node_fringe = np.concatenate( 

    +

    136 [ 

    +

    137 field[tria_node_indexes].reshape((-1, 3)), 

    +

    138 field[quad_node_indexes_tria1].reshape((-1, 3)), 

    +

    139 field[quad_node_indexes_tria2].reshape((-1, 3)), 

    +

    140 ] 

    +

    141 ) 

    +

    142 node_fringe = node_fringe.flatten() 

    +

    143 

    +

    144 # element text 

    +

    145 node_txt = [str(entry) for entry in node_fringe.flatten()] 

    +

    146 else: 

    +

    147 node_fringe = np.zeros(len(nodes_xyz), dtype=np.float32) 

    +

    148 node_txt = [""] * len(nodes_xyz) 

    +

    149 

    +

    150 # zip compression of data for HTML (reduces size) 

    +

    151 zip_data = io.BytesIO() 

    +

    152 with ZipFile(zip_data, "w", compression=ZIP_DEFLATED) as zipfile: 

    +

    153 zipfile.writestr("/intensities", node_fringe.tostring()) 

    +

    154 zipfile.writestr("/positions", nodes_xyz.tostring()) 

    +

    155 zipfile.writestr("/text", json.dumps(node_txt)) 

    +

    156 zip_data = b64encode(zip_data.getvalue()).decode("utf-8") 

    +

    157 

    +

    158 # read html template 

    +

    159 _html_template = _read_file( 

    +

    160 os.path.join(os.path.dirname(__file__), "resources", "template.html") 

    +

    161 ) 

    +

    162 

    +

    163 # format html template file 

    +

    164 min_value = 0 

    +

    165 max_value = 0 

    +

    166 if fringe_limits: 

    +

    167 min_value = fringe_limits[0] 

    +

    168 max_value = fringe_limits[1] 

    +

    169 elif isinstance(field, np.ndarray): 

    +

    170 min_value = field.min() 

    +

    171 max_value = field.max() 

    +

    172 

    +

    173 _html_div = _html_template.format( 

    +

    174 div_id=uuid.uuid4(), lowIntensity=min_value, highIntensity=max_value, zdata=zip_data 

    +

    175 ) 

    +

    176 

    +

    177 # wrap it up with all needed js libraries 

    +

    178 

    +

    179 script_string_js = '<script type="text/javascript">{0}</script>' 

    +

    180 jszip_js_format = _read_file( 

    +

    181 os.path.join(os.path.dirname(__file__), "resources", "jszip.min.js") 

    +

    182 ) 

    +

    183 jszip_three_format = _read_file( 

    +

    184 os.path.join(os.path.dirname(__file__), "resources", "three.min.js") 

    +

    185 ) 

    +

    186 jszip_chroma_format = _read_file( 

    +

    187 os.path.join(os.path.dirname(__file__), "resources", "chroma.min.js") 

    +

    188 ) 

    +

    189 jszip_jquery_format = _read_file( 

    +

    190 os.path.join(os.path.dirname(__file__), "resources", "jquery.min.js") 

    +

    191 ) 

    +

    192 _html_jszip_js = script_string_js.format(jszip_js_format) 

    +

    193 _html_three_js = script_string_js.format(jszip_three_format) 

    +

    194 _html_chroma_js = script_string_js.format(jszip_chroma_format) 

    +

    195 _html_jquery_js = script_string_js.format(jszip_jquery_format) 

    +

    196 

    +

    197 # pylint: disable = consider-using-f-string 

    +

    198 return """ 

    +

    199<!DOCTYPE html> 

    +

    200<html lang="en"> 

    +

    201 <head> 

    +

    202 <meta charset="utf-8" /> 

    +

    203 {_jquery_js} 

    +

    204 {_jszip_js} 

    +

    205 {_three_js} 

    +

    206 {_chroma_js} 

    +

    207 </head> 

    +

    208 <body> 

    +

    209 {_html_div} 

    +

    210 </body> 

    +

    211</html>""".format( 

    +

    212 _html_div=_html_div, 

    +

    213 _jszip_js=_html_jszip_js, 

    +

    214 _three_js=_html_three_js, 

    +

    215 _chroma_js=_html_chroma_js, 

    +

    216 _jquery_js=_html_jquery_js, 

    +

    217 ) 

    +
    + + + diff --git a/coverage/d_d5eca2bf8c9eb372___init___py.html b/coverage/d_d5eca2bf8c9eb372___init___py.html new file mode 100644 index 0000000..b81a1bf --- /dev/null +++ b/coverage/d_d5eca2bf8c9eb372___init___py.html @@ -0,0 +1,100 @@ + + + + + Coverage for lasso/diffcrash/__init__.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/diffcrash/__init__.py: + 0% +

    + +

    + 2 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from .diffcrash_run import DiffcrashRun 

    +

    2 

    +

    3__all__ = ["DiffcrashRun"] 

    +
    + + + diff --git a/coverage/d_d5eca2bf8c9eb372_diffcrash_run_py.html b/coverage/d_d5eca2bf8c9eb372_diffcrash_run_py.html new file mode 100644 index 0000000..233afef --- /dev/null +++ b/coverage/d_d5eca2bf8c9eb372_diffcrash_run_py.html @@ -0,0 +1,1456 @@ + + + + + Coverage for lasso/diffcrash/diffcrash_run.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/diffcrash/diffcrash_run.py: + 0% +

    + +

    + 587 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import argparse 

    +

    2import glob 

    +

    3import logging 

    +

    4import os 

    +

    5import platform 

    +

    6import re 

    +

    7import shutil 

    +

    8import subprocess 

    +

    9import sys 

    +

    10import time 

    +

    11import typing 

    +

    12from concurrent import futures 

    +

    13from typing import List, Union 

    +

    14 

    +

    15import psutil 

    +

    16 

    +

    17from ..logging import str_error, str_info, str_running, str_success, str_warn 

    +

    18 

    +

    19# pylint: disable = too-many-lines 

    +

    20 

    +

    21DC_STAGE_SETUP = "SETUP" 

    +

    22DC_STAGE_IMPORT = "IMPORT" 

    +

    23DC_STAGE_MATH = "MATH" 

    +

    24DC_STAGE_EXPORT = "EXPORT" 

    +

    25DC_STAGE_MATRIX = "MATRIX" 

    +

    26DC_STAGE_EIGEN = "EIGEN" 

    +

    27DC_STAGE_MERGE = "MERGE" 

    +

    28DC_STAGES = [ 

    +

    29 DC_STAGE_SETUP, 

    +

    30 DC_STAGE_IMPORT, 

    +

    31 DC_STAGE_MATH, 

    +

    32 DC_STAGE_EXPORT, 

    +

    33 DC_STAGE_MATRIX, 

    +

    34 DC_STAGE_EIGEN, 

    +

    35 DC_STAGE_MERGE, 

    +

    36] 

    +

    37 

    +

    38 

    +

    39def get_application_header(): 

    +

    40 """Prints the header of the command line tool""" 

    +

    41 

    +

    42 return """ 

    +

    43 

    +

    44 ==== D I F F C R A S H ==== 

    +

    45 

    +

    46 an open-lasso-python utility script 

    +

    47 """ 

    +

    48 

    +

    49 

    +

    50def str2bool(value) -> bool: 

    +

    51 """Converts some value from the cmd line to a boolean 

    +

    52 

    +

    53 Parameters 

    +

    54 ---------- 

    +

    55 value: `str` or `bool` 

    +

    56 

    +

    57 Returns 

    +

    58 ------- 

    +

    59 bool_value: `bool` 

    +

    60 value as boolean 

    +

    61 """ 

    +

    62 

    +

    63 if isinstance(value, bool): 

    +

    64 return value 

    +

    65 if value.lower() in ("yes", "true", "t", "y", "1"): 

    +

    66 return True 

    +

    67 if value.lower() in ("no", "false", "f", "n", "0"): 

    +

    68 return False 

    +

    69 raise argparse.ArgumentTypeError("Boolean value expected.") 

    +

    70 

    +

    71 

    +

    72def parse_diffcrash_args(): 

    +

    73 """Parse the arguments from the command line 

    +

    74 

    +

    75 Returns 

    +

    76 ------- 

    +

    77 args : `argparse.Namespace` 

    +

    78 parsed arguments 

    +

    79 """ 

    +

    80 

    +

    81 # print title 

    +

    82 print(get_application_header()) 

    +

    83 

    +

    84 parser = argparse.ArgumentParser( 

    +

    85 description="Python utility script for Diffcrash written by OPEN-LASSO." 

    +

    86 ) 

    +

    87 

    +

    88 parser.add_argument( 

    +

    89 "--reference-run", type=str, required=True, help="filepath of the reference run." 

    +

    90 ) 

    +

    91 parser.add_argument( 

    +

    92 "--exclude-runs", type=str, nargs="*", default=[], help="Runs to exclude from the analysis." 

    +

    93 ) 

    +

    94 parser.add_argument( 

    +

    95 "--crash-code", 

    +

    96 type=str, 

    +

    97 required=True, 

    +

    98 help="Which crash code is used ('dyna', 'pam' or 'radioss').", 

    +

    99 ) 

    +

    100 parser.add_argument( 

    +

    101 "--start-stage", 

    +

    102 type=str, 

    +

    103 nargs="?", 

    +

    104 default=DC_STAGES[0], 

    +

    105 help=f"At which specific stage to start the analysis ({', '.join(DC_STAGES)}).", 

    +

    106 ) 

    +

    107 parser.add_argument( 

    +

    108 "--end-stage", 

    +

    109 type=str, 

    +

    110 nargs="?", 

    +

    111 default=DC_STAGES[-1], 

    +

    112 help=f"At which specific stage to stop the analysis ({', '.join(DC_STAGES)}).", 

    +

    113 ) 

    +

    114 parser.add_argument( 

    +

    115 "--diffcrash-home", 

    +

    116 type=str, 

    +

    117 default=os.environ["DIFFCRASHHOME"] if "DIFFCRASHHOME" in os.environ else "", 

    +

    118 nargs="?", 

    +

    119 required=False, 

    +

    120 help=( 

    +

    121 "Home directory where Diffcrash is installed." 

    +

    122 " Uses environment variable 'DIFFCRASHHOME' if unspecified." 

    +

    123 ), 

    +

    124 ) 

    +

    125 parser.add_argument( 

    +

    126 "--use-id-mapping", 

    +

    127 type=str2bool, 

    +

    128 nargs="?", 

    +

    129 const=True, 

    +

    130 default=False, 

    +

    131 help="Whether to use id-based mapping (default is nearest neighbour).", 

    +

    132 ) 

    +

    133 parser.add_argument( 

    +

    134 "--project-dir", 

    +

    135 type=str, 

    +

    136 nargs="?", 

    +

    137 default="project", 

    +

    138 help="Project dir to use for femzip.", 

    +

    139 ) 

    +

    140 parser.add_argument( 

    +

    141 "--config-file", type=str, nargs="?", default="", help="Path to the config file." 

    +

    142 ) 

    +

    143 parser.add_argument( 

    +

    144 "--parameter-file", type=str, nargs="?", default="", help="Path to the parameter file." 

    +

    145 ) 

    +

    146 parser.add_argument( 

    +

    147 "--n-processes", 

    +

    148 type=int, 

    +

    149 nargs="?", 

    +

    150 default=max(1, psutil.cpu_count() - 1), 

    +

    151 help="Number of processes to use (default: max-1).", 

    +

    152 ) 

    +

    153 parser.add_argument( 

    +

    154 "simulation_runs", 

    +

    155 type=str, 

    +

    156 nargs="*", 

    +

    157 help="Simulation runs or patterns used to search for simulation runs.", 

    +

    158 ) 

    +

    159 

    +

    160 if len(sys.argv) < 2: 

    +

    161 parser.print_help() 

    +

    162 sys.exit(0) 

    +

    163 

    +

    164 return parser.parse_args(sys.argv[1:]) 

    +

    165 

    +

    166 

    +

    167def run_subprocess(args): 

    +

    168 """Run a subprocess with the specified arguments 

    +

    169 

    +

    170 Parameters: 

    +

    171 ----------- 

    +

    172 args : `list` of `str` 

    +

    173 

    +

    174 Returns 

    +

    175 ------- 

    +

    176 rc : `int` 

    +

    177 process return code 

    +

    178 

    +

    179 Notes 

    +

    180 ----- 

    +

    181 Suppresses stderr. 

    +

    182 """ 

    +

    183 return subprocess.Popen(args, stderr=subprocess.DEVNULL).wait() 

    +

    184 

    +

    185 

    +

    186class DiffcrashRun: 

    +

    187 """Class for handling the settings of a diffcrash run""" 

    +

    188 

    +

    189 # pylint: disable = too-many-instance-attributes 

    +

    190 

    +

    191 # pylint: disable = too-many-arguments 

    +

    192 def __init__( 

    +

    193 self, 

    +

    194 project_dir: str, 

    +

    195 crash_code: str, 

    +

    196 reference_run: str, 

    +

    197 simulation_runs: typing.Sequence[str], 

    +

    198 exclude_runs: typing.Sequence[str], 

    +

    199 diffcrash_home: str = "", 

    +

    200 use_id_mapping: bool = False, 

    +

    201 config_file: str = None, 

    +

    202 parameter_file: str = None, 

    +

    203 n_processes: int = 1, 

    +

    204 logfile_dir: str = None, 

    +

    205 ): 

    +

    206 """Object handling a diffcrash run 

    +

    207 

    +

    208 Parameters 

    +

    209 ---------- 

    +

    210 project_dir : `str` 

    +

    211 directory to put all buffer files etc., in 

    +

    212 crash_code : `str` 

    +

    213 crash code to use. 

    +

    214 reference_run : `str` 

    +

    215 filepath to the reference run 

    +

    216 simulation_runs: `list` of `str` 

    +

    217 patterns used to search for simulation runs 

    +

    218 diffcrash_home : `str` 

    +

    219 home directory of diffcrash installation. Uses environment 

    +

    220 variable DIFFCRASHHOME if not set. 

    +

    221 use_id_mapping : `bool` 

    +

    222 whether to use id mapping instead of nearest neighbor mapping 

    +

    223 config_file : `str` 

    +

    224 filepath to a config file 

    +

    225 parameter_file : `str` 

    +

    226 filepath to the parameter file 

    +

    227 n_processes : `int` 

    +

    228 number of processes to spawn for worker pool 

    +

    229 logfile_dir : `str` 

    +

    230 directory to put logfiles in 

    +

    231 """ 

    +

    232 

    +

    233 # settings 

    +

    234 self._msg_option = "{:16s}: {}" 

    +

    235 self._log_formatter = logging.Formatter("%(levelname)s:%(asctime)s %(message)s") 

    +

    236 

    +

    237 # logdir 

    +

    238 if logfile_dir is not None: 

    +

    239 self.logfile_dir = logfile_dir 

    +

    240 else: 

    +

    241 self.logfile_dir = os.path.join(project_dir, "Log") 

    +

    242 self.logfile_filepath = os.path.join(self.logfile_dir, "DiffcrashRun.log") 

    +

    243 

    +

    244 # logger 

    +

    245 self.logger = self._setup_logger() 

    +

    246 

    +

    247 # make some space in the log 

    +

    248 self.logger.info(get_application_header()) 

    +

    249 

    +

    250 # diffcrash home 

    +

    251 self.diffcrash_home = self._parse_diffcrash_home(diffcrash_home) 

    +

    252 self.diffcrash_home = os.path.join(self.diffcrash_home, "bin") 

    +

    253 self.diffcrash_lib = os.path.join(os.path.dirname(self.diffcrash_home), "lib") 

    +

    254 

    +

    255 if platform.system() == "Linux": 

    +

    256 os.environ["PATH"] = ( 

    +

    257 os.environ["PATH"] + ":" + self.diffcrash_home + ":" + self.diffcrash_lib 

    +

    258 ) 

    +

    259 if platform.system() == "Windows": 

    +

    260 os.environ["PATH"] = ( 

    +

    261 os.environ["PATH"] + ";" + self.diffcrash_home + ";" + self.diffcrash_lib 

    +

    262 ) 

    +

    263 

    +

    264 # project dir 

    +

    265 self.project_dir = self._parse_project_dir(project_dir) 

    +

    266 

    +

    267 # crashcode 

    +

    268 self.crash_code = self._parse_crash_code(crash_code) 

    +

    269 

    +

    270 # reference run 

    +

    271 self.reference_run = self._parse_reference_run(reference_run) 

    +

    272 

    +

    273 # mapping 

    +

    274 self.use_id_mapping = self._parse_use_id_mapping(use_id_mapping) 

    +

    275 

    +

    276 # exlude runs 

    +

    277 self.exclude_runs = exclude_runs 

    +

    278 

    +

    279 # simulation runs 

    +

    280 self.simulation_runs = self._parse_simulation_runs( 

    +

    281 simulation_runs, self.reference_run, self.exclude_runs 

    +

    282 ) 

    +

    283 

    +

    284 # config file 

    +

    285 self.config_file = self._parse_config_file(config_file) 

    +

    286 

    +

    287 # parameter file 

    +

    288 self.parameter_file = self._parse_parameter_file(parameter_file) 

    +

    289 

    +

    290 # n processes 

    +

    291 self.n_processes = self._parse_n_processes(n_processes) 

    +

    292 

    +

    293 def _setup_logger(self) -> logging.Logger: 

    +

    294 

    +

    295 # better safe than sorry 

    +

    296 os.makedirs(self.logfile_dir, exist_ok=True) 

    +

    297 

    +

    298 # create console log channel 

    +

    299 # streamHandler = logging.StreamHandler(sys.stdout) 

    +

    300 # streamHandler.setLevel(logging.INFO) 

    +

    301 # streamHandler.setFormatter(self._log_formatter) 

    +

    302 

    +

    303 # create file log channel 

    +

    304 file_handler = logging.FileHandler(self.logfile_filepath) 

    +

    305 file_handler.setLevel(logging.INFO) 

    +

    306 file_handler.setFormatter(self._log_formatter) 

    +

    307 

    +

    308 # create logger 

    +

    309 logger = logging.getLogger("DiffcrashRun") 

    +

    310 logger.setLevel(logging.INFO) 

    +

    311 # logger.addHandler(streamHandler) 

    +

    312 logger.addHandler(file_handler) 

    +

    313 

    +

    314 return logger 

    +

    315 

    +

    316 def _parse_diffcrash_home(self, diffcrash_home) -> str: 

    +

    317 

    +

    318 diffcrash_home_ok = len(diffcrash_home) != 0 

    +

    319 

    +

    320 msg = self._msg_option.format("diffcrash-home", diffcrash_home) 

    +

    321 print(str_info(msg)) 

    +

    322 self.logger.info(msg) 

    +

    323 

    +

    324 if not diffcrash_home_ok: 

    +

    325 err_msg = ( 

    +

    326 "Specify the path to the Diffcrash installation either " 

    +

    327 + "with the environment variable 'DIFFCRASHHOME' or the option --diffcrash-home." 

    +

    328 ) 

    +

    329 self.logger.error(err_msg) 

    +

    330 raise RuntimeError(str_error(err_msg)) 

    +

    331 

    +

    332 return diffcrash_home 

    +

    333 

    +

    334 def _parse_crash_code(self, crash_code) -> str: 

    +

    335 

    +

    336 # these guys are allowed 

    +

    337 valid_crash_codes = ["dyna", "radioss", "pam"] 

    +

    338 

    +

    339 # do the thing 

    +

    340 crash_code_ok = crash_code in valid_crash_codes 

    +

    341 

    +

    342 print(str_info(self._msg_option.format("crash-code", crash_code))) 

    +

    343 self.logger.info(self._msg_option.format("crash-code", crash_code)) 

    +

    344 

    +

    345 if not crash_code_ok: 

    +

    346 err_msg = ( 

    +

    347 f"Invalid crash code '{crash_code}'. " 

    +

    348 f"Please use one of: {str(valid_crash_codes)}" 

    +

    349 ) 

    +

    350 self.logger.error(err_msg) 

    +

    351 raise RuntimeError(str_error(err_msg)) 

    +

    352 

    +

    353 return crash_code 

    +

    354 

    +

    355 def _parse_reference_run(self, reference_run) -> str: 

    +

    356 

    +

    357 reference_run_ok = os.path.isfile(reference_run) 

    +

    358 

    +

    359 msg = self._msg_option.format("reference-run", reference_run) 

    +

    360 print(str_info(msg)) 

    +

    361 self.logger.info(msg) 

    +

    362 

    +

    363 if not reference_run_ok: 

    +

    364 err_msg = f"Filepath '{reference_run}' is not a file." 

    +

    365 self.logger.error(err_msg) 

    +

    366 raise RuntimeError(str_error(err_msg)) 

    +

    367 

    +

    368 return reference_run 

    +

    369 

    +

    370 def _parse_use_id_mapping(self, use_id_mapping) -> bool: 

    +

    371 

    +

    372 msg = self._msg_option.format("use-id-mapping", use_id_mapping) 

    +

    373 print(str_info(msg)) 

    +

    374 self.logger.info(msg) 

    +

    375 

    +

    376 return use_id_mapping 

    +

    377 

    +

    378 def _parse_project_dir(self, project_dir): 

    +

    379 project_dir = os.path.abspath(project_dir) 

    +

    380 

    +

    381 msg = self._msg_option.format("project-dir", project_dir) 

    +

    382 print(str_info(msg)) 

    +

    383 self.logger.info(msg) 

    +

    384 

    +

    385 return project_dir 

    +

    386 

    +

    387 def _parse_simulation_runs( 

    +

    388 self, 

    +

    389 simulation_run_patterns: typing.Sequence[str], 

    +

    390 reference_run: str, 

    +

    391 exclude_runs: typing.Sequence[str], 

    +

    392 ): 

    +

    393 

    +

    394 # search all denoted runs 

    +

    395 simulation_runs = [] 

    +

    396 for pattern in simulation_run_patterns: 

    +

    397 simulation_runs += glob.glob(pattern) 

    +

    398 simulation_runs = [filepath for filepath in simulation_runs if os.path.isfile(filepath)] 

    +

    399 

    +

    400 # search all excluded runs 

    +

    401 runs_to_exclude = [] 

    +

    402 for pattern in exclude_runs: 

    +

    403 runs_to_exclude += glob.glob(pattern) 

    +

    404 runs_to_exclude = [filepath for filepath in runs_to_exclude if os.path.isfile(filepath)] 

    +

    405 

    +

    406 n_runs_before_filtering = len(simulation_runs) 

    +

    407 simulation_runs = [ 

    +

    408 filepath for filepath in simulation_runs if filepath not in runs_to_exclude 

    +

    409 ] 

    +

    410 n_runs_after_filtering = len(simulation_runs) 

    +

    411 

    +

    412 # remove the reference run 

    +

    413 if reference_run in simulation_runs: 

    +

    414 simulation_runs.remove(reference_run) 

    +

    415 

    +

    416 # sort it because we can! 

    +

    417 def atoi(text): 

    +

    418 return int(text) if text.isdigit() else text 

    +

    419 

    +

    420 def natural_keys(text): 

    +

    421 return [atoi(c) for c in re.split(r"(\d+)", text)] 

    +

    422 

    +

    423 simulation_runs = sorted(simulation_runs, key=natural_keys) 

    +

    424 

    +

    425 # check 

    +

    426 simulation_runs_ok = len(simulation_runs) != 0 

    +

    427 

    +

    428 msg = self._msg_option.format("# simul.-files", len(simulation_runs)) 

    +

    429 print(str_info(msg)) 

    +

    430 self.logger.info(msg) 

    +

    431 

    +

    432 msg = self._msg_option.format( 

    +

    433 "# excluded files", (n_runs_before_filtering - n_runs_after_filtering) 

    +

    434 ) 

    +

    435 print(str_info(msg)) 

    +

    436 self.logger.info(msg) 

    +

    437 

    +

    438 if not simulation_runs_ok: 

    +

    439 err_msg = ( 

    +

    440 "No simulation files could be found with the specified patterns. " 

    +

    441 "Check the argument 'simulation_runs'." 

    +

    442 ) 

    +

    443 self.logger.error(err_msg) 

    +

    444 raise RuntimeError(str_error(err_msg)) 

    +

    445 

    +

    446 return simulation_runs 

    +

    447 

    +

    448 def _parse_config_file(self, config_file) -> Union[str, None]: 

    +

    449 

    +

    450 _msg_config_file = "" 

    +

    451 if len(config_file) > 0 and not os.path.isfile(config_file): 

    +

    452 config_file = None 

    +

    453 _msg_config_file = f"Can not find config file '{config_file}'" 

    +

    454 

    +

    455 # missing config file 

    +

    456 else: 

    +

    457 

    +

    458 config_file = None 

    +

    459 _msg_config_file = ( 

    +

    460 "Config file missing. " 

    +

    461 "Consider specifying the path with the option '--config-file'." 

    +

    462 ) 

    +

    463 

    +

    464 msg = self._msg_option.format("config-file", config_file) 

    +

    465 print(str_info(msg)) 

    +

    466 self.logger.info(msg) 

    +

    467 

    +

    468 if _msg_config_file: 

    +

    469 print(str_warn(_msg_config_file)) 

    +

    470 self.logger.warning(_msg_config_file) 

    +

    471 

    +

    472 return config_file 

    +

    473 

    +

    474 def _parse_parameter_file(self, parameter_file) -> Union[None, str]: 

    +

    475 

    +

    476 _msg_parameter_file = "" 

    +

    477 if len(parameter_file) > 0 and not os.path.isfile(parameter_file): 

    +

    478 parameter_file = None 

    +

    479 _msg_parameter_file = f"Can not find parameter file '{parameter_file}'" 

    +

    480 # missing parameter file 

    +

    481 else: 

    +

    482 parameter_file = None 

    +

    483 _msg_parameter_file = ( 

    +

    484 "Parameter file missing. Consider specifying the " 

    +

    485 "path with the option '--parameter-file'." 

    +

    486 ) 

    +

    487 

    +

    488 msg = self._msg_option.format("parameter-file", parameter_file) 

    +

    489 print(str_info(msg)) 

    +

    490 self.logger.info(msg) 

    +

    491 

    +

    492 if _msg_parameter_file: 

    +

    493 print(str_warn(_msg_parameter_file)) 

    +

    494 self.logger.warning(_msg_parameter_file) 

    +

    495 

    +

    496 return parameter_file 

    +

    497 

    +

    498 def _parse_n_processes(self, n_processes) -> int: 

    +

    499 

    +

    500 print(str_info(self._msg_option.format("n-processes", n_processes))) 

    +

    501 

    +

    502 if n_processes <= 0: 

    +

    503 err_msg = f"n-processes is '{n_processes}' but must be at least 1." 

    +

    504 self.logger.error(err_msg) 

    +

    505 raise ValueError(str_error(err_msg)) 

    +

    506 

    +

    507 return n_processes 

    +

    508 

    +

    509 def create_project_dirs(self): 

    +

    510 """Creates all project relevant directores 

    +

    511 

    +

    512 Notes 

    +

    513 ----- 

    +

    514 Created dirs: 

    +

    515 - logfile_dir 

    +

    516 - project_dir 

    +

    517 """ 

    +

    518 os.makedirs(self.project_dir, exist_ok=True) 

    +

    519 os.makedirs(self.logfile_dir, exist_ok=True) 

    +

    520 

    +

    521 def run_setup(self, pool: futures.ThreadPoolExecutor): 

    +

    522 """Run diffcrash setup 

    +

    523 

    +

    524 Parameters 

    +

    525 ---------- 

    +

    526 pool : `concurrent.futures.ThreadPoolExecutor` 

    +

    527 multiprocessing pool 

    +

    528 """ 

    +

    529 

    +

    530 # SETUP 

    +

    531 msg = "Running Setup ... " 

    +

    532 print(str_running(msg) + "\r", end="", flush="") 

    +

    533 self.logger.info(msg) 

    +

    534 

    +

    535 args = [] 

    +

    536 if self.config_file is None and self.parameter_file is None: 

    +

    537 args = [ 

    +

    538 os.path.join(self.diffcrash_home, "DFC_Setup_" + self.crash_code + "_fem"), 

    +

    539 self.reference_run, 

    +

    540 self.project_dir, 

    +

    541 ] 

    +

    542 elif self.config_file is not None and self.parameter_file is None: 

    +

    543 args = [ 

    +

    544 os.path.join(self.diffcrash_home, "DFC_Setup_" + self.crash_code + "_fem"), 

    +

    545 self.reference_run, 

    +

    546 self.project_dir, 

    +

    547 "-C", 

    +

    548 self.config_file, 

    +

    549 ] 

    +

    550 elif self.config_file is None and self.parameter_file is not None: 

    +

    551 if ".fz" in self.reference_run: 

    +

    552 args = [ 

    +

    553 os.path.join(self.diffcrash_home, "DFC_Setup_" + self.crash_code + "_fem"), 

    +

    554 self.reference_run, 

    +

    555 self.project_dir, 

    +

    556 "-P", 

    +

    557 self.parameter_file, 

    +

    558 ] 

    +

    559 else: 

    +

    560 args = [ 

    +

    561 os.path.join(self.diffcrash_home, "DFC_Setup_" + self.crash_code), 

    +

    562 self.reference_run, 

    +

    563 self.project_dir, 

    +

    564 "-P", 

    +

    565 self.parameter_file, 

    +

    566 ] 

    +

    567 elif self.config_file is not None and self.parameter_file is not None: 

    +

    568 if ".fz" in self.reference_run: 

    +

    569 args = [ 

    +

    570 os.path.join(self.diffcrash_home, "DFC_Setup_" + self.crash_code + "_fem"), 

    +

    571 self.reference_run, 

    +

    572 self.project_dir, 

    +

    573 "-C", 

    +

    574 self.config_file, 

    +

    575 "-P", 

    +

    576 self.parameter_file, 

    +

    577 ] 

    +

    578 else: 

    +

    579 args = [ 

    +

    580 os.path.join(self.diffcrash_home, "DFC_Setup_" + self.crash_code), 

    +

    581 self.reference_run, 

    +

    582 self.project_dir, 

    +

    583 "-C", 

    +

    584 self.config_file, 

    +

    585 "-P", 

    +

    586 self.parameter_file, 

    +

    587 ] 

    +

    588 start_time = time.time() 

    +

    589 

    +

    590 # submit task 

    +

    591 return_code_future = pool.submit(run_subprocess, args) 

    +

    592 return_code = return_code_future.result() 

    +

    593 

    +

    594 # check return code 

    +

    595 if return_code != 0: 

    +

    596 err_msg = f"Running Setup ... done in {time.time() - start_time:.2f}s" 

    +

    597 print(str_error(err_msg)) 

    +

    598 self.logger.error(err_msg) 

    +

    599 

    +

    600 err_msg = "Process somehow failed." 

    +

    601 self.logger.error(err_msg) 

    +

    602 raise RuntimeError(str_error(err_msg)) 

    +

    603 

    +

    604 # check log 

    +

    605 messages = self.check_if_logfiles_show_success("DFC_Setup.log") 

    +

    606 if messages: 

    +

    607 err_msg = f"Running Setup ... done in {time.time() - start_time:.2f}s" 

    +

    608 print(str_error(err_msg)) 

    +

    609 self.logger.error(err_msg) 

    +

    610 

    +

    611 # print failed logs 

    +

    612 for msg in messages: 

    +

    613 print(str_error(msg)) 

    +

    614 self.logger.error(msg) 

    +

    615 

    +

    616 err_msg = "Setup failed." 

    +

    617 self.logger.error(err_msg) 

    +

    618 raise RuntimeError(str_error(err_msg)) 

    +

    619 

    +

    620 # print success 

    +

    621 err_msg = f"Running Setup ... done in {time.time() - start_time:.2f}s" 

    +

    622 print(str_success(msg)) 

    +

    623 self.logger.info(msg) 

    +

    624 

    +

    625 def run_import(self, pool: futures.ThreadPoolExecutor): 

    +

    626 """Run diffcrash import of runs 

    +

    627 

    +

    628 Parameters 

    +

    629 ---------- 

    +

    630 pool : `concurrent.futures.ThreadPoolExecutor` 

    +

    631 multiprocessing pool 

    +

    632 """ 

    +

    633 

    +

    634 # pylint: disable = too-many-locals, too-many-branches, too-many-statements 

    +

    635 

    +

    636 # list of arguments to run in the command line 

    +

    637 import_arguments = [] 

    +

    638 

    +

    639 # id 1 is the reference run 

    +

    640 # id 2 and higher are the imported runs 

    +

    641 counter_offset = 2 

    +

    642 

    +

    643 # assemble arguments for running the import 

    +

    644 # entry 0 is the reference run, thus we start at 1 

    +

    645 # pylint: disable = consider-using-enumerate 

    +

    646 for i_filepath in range(len(self.simulation_runs)): 

    +

    647 

    +

    648 # parameter file missing 

    +

    649 if self.parameter_file is None: 

    +

    650 if self.use_id_mapping: 

    +

    651 args = [ 

    +

    652 os.path.join(self.diffcrash_home, "DFC_Import_" + self.crash_code + "_fem"), 

    +

    653 "-id", 

    +

    654 self.simulation_runs[i_filepath], 

    +

    655 self.project_dir, 

    +

    656 str(i_filepath + counter_offset), 

    +

    657 ] 

    +

    658 else: 

    +

    659 args = [ 

    +

    660 os.path.join(self.diffcrash_home, "DFC_Import_" + self.crash_code + "_fem"), 

    +

    661 self.simulation_runs[i_filepath], 

    +

    662 self.project_dir, 

    +

    663 str(i_filepath + counter_offset), 

    +

    664 ] 

    +

    665 # indeed there is a parameter file 

    +

    666 else: 

    +

    667 if self.use_id_mapping: 

    +

    668 args = [ 

    +

    669 os.path.join(self.diffcrash_home, "DFC_Import_" + self.crash_code), 

    +

    670 "-ID", 

    +

    671 self.simulation_runs[i_filepath], 

    +

    672 self.project_dir, 

    +

    673 str(i_filepath + counter_offset), 

    +

    674 ] 

    +

    675 else: 

    +

    676 args = [ 

    +

    677 os.path.join(self.diffcrash_home, "DFC_Import_" + self.crash_code), 

    +

    678 self.simulation_runs[i_filepath], 

    +

    679 self.project_dir, 

    +

    680 str(i_filepath + counter_offset), 

    +

    681 ] 

    +

    682 

    +

    683 # append args to list 

    +

    684 import_arguments.append(args) 

    +

    685 

    +

    686 # do the thing 

    +

    687 msg = "Running Imports ...\r" 

    +

    688 print(str_running(msg), end="", flush=True) 

    +

    689 self.logger.info(msg) 

    +

    690 start_time = time.time() 

    +

    691 return_code_futures = [pool.submit(run_subprocess, args) for args in import_arguments] 

    +

    692 

    +

    693 # wait for imports to finish (with a progressbar) 

    +

    694 n_imports_finished = sum( 

    +

    695 return_code_future.done() for return_code_future in return_code_futures 

    +

    696 ) 

    +

    697 while n_imports_finished != len(return_code_futures): 

    +

    698 

    +

    699 # check again 

    +

    700 n_new_imports_finished = sum( 

    +

    701 return_code_future.done() for return_code_future in return_code_futures 

    +

    702 ) 

    +

    703 

    +

    704 # print 

    +

    705 percentage = n_new_imports_finished / len(return_code_futures) * 100 

    +

    706 

    +

    707 if n_imports_finished != n_new_imports_finished: 

    +

    708 # pylint: disable = consider-using-f-string 

    +

    709 msg = "Running Imports ... [{0}/{1}] - {2:3.2f}%\r".format( 

    +

    710 n_new_imports_finished, len(return_code_futures), percentage 

    +

    711 ) 

    +

    712 print(str_running(msg), end="", flush=True) 

    +

    713 self.logger.info(msg) 

    +

    714 

    +

    715 n_imports_finished = n_new_imports_finished 

    +

    716 

    +

    717 # wait a little bit 

    +

    718 time.sleep(0.25) 

    +

    719 

    +

    720 return_codes = [return_code_future.result() for return_code_future in return_code_futures] 

    +

    721 

    +

    722 # print failure 

    +

    723 if any(return_code != 0 for return_code in return_codes): 

    +

    724 

    +

    725 n_failed_runs = 0 

    +

    726 for i_run, return_code in enumerate(return_codes): 

    +

    727 if return_code != 0: 

    +

    728 _err_msg = str_error( 

    +

    729 f"Run {i_run} failed to import with error code '{return_code}'." 

    +

    730 ) 

    +

    731 print(str_error(_err_msg)) 

    +

    732 self.logger.error(_err_msg) 

    +

    733 n_failed_runs += 1 

    +

    734 

    +

    735 err_msg = f"Running Imports ... done in {time.time() - start_time:.2f}s " 

    +

    736 print(str_error(err_msg)) 

    +

    737 self.logger.error(err_msg) 

    +

    738 

    +

    739 err_msg = f"Import of {n_failed_runs} runs failed." 

    +

    740 self.logger.error(err_msg) 

    +

    741 raise RuntimeError(str_error(err_msg)) 

    +

    742 

    +

    743 # check log files 

    +

    744 messages = self.check_if_logfiles_show_success("DFC_Import_*.log") 

    +

    745 if messages: 

    +

    746 

    +

    747 # print failure 

    +

    748 msg = f"Running Imports ... done in {time.time() - start_time:.2f}s " 

    +

    749 print(str_error(msg)) 

    +

    750 self.logger.info(msg) 

    +

    751 

    +

    752 # print failed logs 

    +

    753 for msg in messages: 

    +

    754 self.logger.error(msg) 

    +

    755 print(str_error(msg)) 

    +

    756 

    +

    757 err_msg = ( 

    +

    758 f"At least one import failed. Please check the log files in '{self.logfile_dir}'." 

    +

    759 ) 

    +

    760 self.logger.error(err_msg) 

    +

    761 raise RuntimeError(str_error(err_msg)) 

    +

    762 

    +

    763 # print success 

    +

    764 print(str_success(f"Running Imports ... done in {time.time() - start_time:.2f}s ")) 

    +

    765 

    +

    766 def run_math(self, pool: futures.ThreadPoolExecutor): 

    +

    767 """Run diffcrash math 

    +

    768 

    +

    769 Parameters 

    +

    770 ---------- 

    +

    771 pool : `concurrent.futures.ThreadPoolExecutor` 

    +

    772 multiprocessing pool 

    +

    773 """ 

    +

    774 

    +

    775 msg = "Running Math ... \r" 

    +

    776 print(str_running(msg), end="", flush=True) 

    +

    777 self.logger.info(msg) 

    +

    778 

    +

    779 start_time = time.time() 

    +

    780 return_code_future = pool.submit( 

    +

    781 run_subprocess, 

    +

    782 [os.path.join(self.diffcrash_home, "DFC_Math_" + self.crash_code), self.project_dir], 

    +

    783 ) 

    +

    784 return_code = return_code_future.result() 

    +

    785 

    +

    786 # check return code 

    +

    787 if return_code != 0: 

    +

    788 

    +

    789 msg = f"Running Math ... done in {time.time() - start_time:.2f}s " 

    +

    790 print(str_error(msg)) 

    +

    791 self.logger.error(msg) 

    +

    792 

    +

    793 err_msg = f"Caught a nonzero return code '{return_code}'" 

    +

    794 self.logger.error(err_msg) 

    +

    795 raise RuntimeError(str_error(err_msg)) 

    +

    796 

    +

    797 # check logs 

    +

    798 messages = self.check_if_logfiles_show_success("DFC_MATH*.log") 

    +

    799 if messages: 

    +

    800 

    +

    801 # print failure 

    +

    802 msg = f"Running Math ... done in {time.time() - start_time:.2f}s " 

    +

    803 print(str_error(msg)) 

    +

    804 self.logger.error(msg) 

    +

    805 

    +

    806 # print failed logs 

    +

    807 for msg in messages: 

    +

    808 print(str_error(msg)) 

    +

    809 self.logger.error(msg) 

    +

    810 

    +

    811 err_msg = ( 

    +

    812 "Logfile does indicate a failure. " 

    +

    813 f"Please check the log files in '{self.logfile_dir}'." 

    +

    814 ) 

    +

    815 self.logger.error(err_msg) 

    +

    816 raise RuntimeError(str_error(err_msg)) 

    +

    817 

    +

    818 # print success 

    +

    819 msg = f"Running Math ... done in {time.time() - start_time:.2f}s " 

    +

    820 print(str_success(msg)) 

    +

    821 self.logger.info(msg) 

    +

    822 

    +

    823 def run_export(self, pool: futures.ThreadPoolExecutor): 

    +

    824 """Run diffcrash export 

    +

    825 

    +

    826 Parameters 

    +

    827 ---------- 

    +

    828 pool : `concurrent.futures.ThreadPoolExecutor` 

    +

    829 multiprocessing pool 

    +

    830 """ 

    +

    831 

    +

    832 msg = "Running Export ... " 

    +

    833 print(str_running(msg) + "\r", end="", flush=True) 

    +

    834 self.logger.info(msg) 

    +

    835 

    +

    836 if self.config_file is None: 

    +

    837 export_item_list = [] 

    +

    838 

    +

    839 # check for pdmx 

    +

    840 pdmx_filepath_list = glob.glob(os.path.join(self.project_dir, "*_pdmx")) 

    +

    841 if pdmx_filepath_list: 

    +

    842 export_item_list.append(os.path.basename(pdmx_filepath_list[0])) 

    +

    843 

    +

    844 # check for pdij 

    +

    845 pdij_filepath_list = glob.glob(os.path.join(self.project_dir, "*_pdij")) 

    +

    846 if pdij_filepath_list: 

    +

    847 export_item_list.append(os.path.basename(pdij_filepath_list[0])) 

    +

    848 

    +

    849 else: 

    +

    850 export_item_list = self.read_config_file(self.config_file) 

    +

    851 

    +

    852 # remove previous existing exports 

    +

    853 for export_item in export_item_list: 

    +

    854 export_item_filepath = os.path.join(self.project_dir, export_item + ".d3plot.fz") 

    +

    855 if os.path.isfile(export_item_filepath): 

    +

    856 os.remove(export_item_filepath) 

    +

    857 

    +

    858 # do the thing 

    +

    859 start_time = time.time() 

    +

    860 return_code_futures = [ 

    +

    861 pool.submit( 

    +

    862 run_subprocess, 

    +

    863 [ 

    +

    864 os.path.join(self.diffcrash_home, "DFC_Export_" + self.crash_code), 

    +

    865 self.project_dir, 

    +

    866 export_item, 

    +

    867 ], 

    +

    868 ) 

    +

    869 for export_item in export_item_list 

    +

    870 ] 

    +

    871 

    +

    872 return_codes = [result_future.result() for result_future in return_code_futures] 

    +

    873 

    +

    874 # check return code 

    +

    875 if any(rc != 0 for rc in return_codes): 

    +

    876 msg = f"Running Export ... done in {time.time() - start_time:.2f}s " 

    +

    877 print(str_error(msg)) 

    +

    878 self.logger.error(msg) 

    +

    879 

    +

    880 for i_export, export_return_code in enumerate(return_codes): 

    +

    881 if export_return_code != 0: 

    +

    882 msg = ( 

    +

    883 f"Return code of export '{export_item_list[i_export]}' " 

    +

    884 f"was nonzero: '{export_return_code}'" 

    +

    885 ) 

    +

    886 self.logger.error(msg) 

    +

    887 print(str_error(msg)) 

    +

    888 

    +

    889 msg = "At least one export process failed." 

    +

    890 self.logger.error(msg) 

    +

    891 raise RuntimeError(str_error(msg)) 

    +

    892 

    +

    893 # check logs 

    +

    894 messages = self.check_if_logfiles_show_success("DFC_Export_*") 

    +

    895 if messages: 

    +

    896 

    +

    897 # print failure 

    +

    898 msg = f"Running Export ... done in {time.time() - start_time:.2f}s " 

    +

    899 print(str_error(msg)) 

    +

    900 self.logger.error(msg) 

    +

    901 

    +

    902 # print logs 

    +

    903 for msg in messages: 

    +

    904 print(str_error(msg)) 

    +

    905 self.logger.error(msg) 

    +

    906 

    +

    907 msg = ( 

    +

    908 "At least one export failed. " 

    +

    909 f"Please check the log files in '{self.logfile_dir}'." 

    +

    910 ) 

    +

    911 self.logger.error(msg) 

    +

    912 raise RuntimeError(str_error(msg)) 

    +

    913 

    +

    914 # print success 

    +

    915 msg = f"Running Export ... done in {time.time() - start_time:.2f}s " 

    +

    916 print(str_success(msg)) 

    +

    917 self.logger.info(msg) 

    +

    918 

    +

    919 def run_matrix(self, pool: futures.ThreadPoolExecutor): 

    +

    920 """Run diffcrash matrix 

    +

    921 

    +

    922 Parameters 

    +

    923 ---------- 

    +

    924 pool : `concurrent.futures.ThreadPoolExecutor` 

    +

    925 multiprocessing pool 

    +

    926 """ 

    +

    927 

    +

    928 msg = "Running Matrix ... " 

    +

    929 print(str_running(msg) + "\r", end="", flush=True) 

    +

    930 self.logger.info(msg) 

    +

    931 

    +

    932 start_time = time.time() 

    +

    933 

    +

    934 # create the input file for the process 

    +

    935 matrix_inputfile = self._create_matrix_input_file(self.project_dir) 

    +

    936 

    +

    937 # run the thing 

    +

    938 return_code_future = pool.submit( 

    +

    939 run_subprocess, 

    +

    940 [ 

    +

    941 os.path.join(self.diffcrash_home, "DFC_Matrix_" + self.crash_code), 

    +

    942 self.project_dir, 

    +

    943 matrix_inputfile, 

    +

    944 ], 

    +

    945 ) 

    +

    946 

    +

    947 # please hold the line ... 

    +

    948 return_code = return_code_future.result() 

    +

    949 

    +

    950 # check return code 

    +

    951 if return_code != 0: 

    +

    952 

    +

    953 # print failure 

    +

    954 msg = f"Running Matrix ... done in {time.time() - start_time:.2f}s " 

    +

    955 print(str_error(msg)) 

    +

    956 self.logger.error(msg) 

    +

    957 

    +

    958 msg = "The DFC_Matrix process failed somehow." 

    +

    959 self.logger.error(msg) 

    +

    960 raise RuntimeError(str_error(msg)) 

    +

    961 

    +

    962 # check log file 

    +

    963 messages = self.check_if_logfiles_show_success("DFC_Matrix_*") 

    +

    964 if messages: 

    +

    965 

    +

    966 # print failure 

    +

    967 msg = f"Running Matrix ... done in {time.time() - start_time:.2f}s " 

    +

    968 print(str_error(msg)) 

    +

    969 self.logger.info(msg) 

    +

    970 

    +

    971 # print why 

    +

    972 for msg in messages: 

    +

    973 print(str_error(msg)) 

    +

    974 self.logger.error(msg) 

    +

    975 

    +

    976 msg = f"DFC_Matrix failed. Please check the log files in '{self.logfile_dir}'." 

    +

    977 self.logger.error(msg) 

    +

    978 raise RuntimeError(str_error(msg)) 

    +

    979 

    +

    980 # print success 

    +

    981 msg = f"Running Matrix ... done in {time.time() - start_time:.2f}s " 

    +

    982 print(str_success(msg)) 

    +

    983 self.logger.info(msg) 

    +

    984 

    +

    985 def run_eigen(self, pool: futures.ThreadPoolExecutor): 

    +

    986 """Run diffcrash eigen 

    +

    987 

    +

    988 Parameters 

    +

    989 ---------- 

    +

    990 pool : `concurrent.futures.ThreadPoolExecutor` 

    +

    991 multiprocessing pool 

    +

    992 """ 

    +

    993 

    +

    994 msg = "Running Eigen ... " 

    +

    995 print(str_running(msg) + "\r", end="", flush=True) 

    +

    996 self.logger.info(msg) 

    +

    997 

    +

    998 # create input file for process 

    +

    999 eigen_inputfile = self._create_eigen_input_file(self.project_dir) 

    +

    1000 

    +

    1001 # run the thing 

    +

    1002 start_time = time.time() 

    +

    1003 return_code_future = pool.submit( 

    +

    1004 run_subprocess, 

    +

    1005 [ 

    +

    1006 os.path.join(self.diffcrash_home, "DFC_Eigen_" + self.crash_code), 

    +

    1007 self.project_dir, 

    +

    1008 eigen_inputfile, 

    +

    1009 ], 

    +

    1010 ) 

    +

    1011 

    +

    1012 # please hold the line ... 

    +

    1013 return_code = return_code_future.result() 

    +

    1014 

    +

    1015 # check return code 

    +

    1016 if return_code != 0: 

    +

    1017 msg = f"Running Eigen ... done in {time.time() - start_time:.2f}s " 

    +

    1018 print(str_error(msg)) 

    +

    1019 self.logger.error(msg) 

    +

    1020 

    +

    1021 msg = "The process failed somehow." 

    +

    1022 self.logger.error(msg) 

    +

    1023 raise RuntimeError(str_error(msg)) 

    +

    1024 

    +

    1025 # check log file 

    +

    1026 messages = self.check_if_logfiles_show_success("DFC_Matrix_*") 

    +

    1027 if messages: 

    +

    1028 

    +

    1029 # print failure 

    +

    1030 msg = f"Running Eigen ... done in {time.time() - start_time:.2f}s " 

    +

    1031 print(str_error(msg)) 

    +

    1032 self.logger.error(msg) 

    +

    1033 

    +

    1034 # print why 

    +

    1035 for msg in messages: 

    +

    1036 print(str_error(msg)) 

    +

    1037 self.logger.error(msg) 

    +

    1038 

    +

    1039 msg = f"DFC_Eigen failed. Please check the log files in '{self.logfile_dir}'." 

    +

    1040 self.logger.error(msg) 

    +

    1041 raise RuntimeError(str_error(msg)) 

    +

    1042 

    +

    1043 # print success 

    +

    1044 msg = f"Running Eigen ... done in {time.time() - start_time:.2f}s " 

    +

    1045 print(str_success(msg)) 

    +

    1046 self.logger.info(msg) 

    +

    1047 

    +

    1048 def run_merge(self, pool: futures.ThreadPoolExecutor): 

    +

    1049 """Run diffcrash merge 

    +

    1050 

    +

    1051 Parameters 

    +

    1052 ---------- 

    +

    1053 pool : `concurrent.futures.ThreadPoolExecutor` 

    +

    1054 multiprocessing pool 

    +

    1055 """ 

    +

    1056 

    +

    1057 msg = "Running Merge ... " 

    +

    1058 print(str_running(msg) + "\r", end="", flush=True) 

    +

    1059 self.logger.info(msg) 

    +

    1060 

    +

    1061 # create ionput file for merge 

    +

    1062 merge_inputfile = self._create_merge_input_file(self.project_dir) 

    +

    1063 

    +

    1064 # clear previous merges 

    +

    1065 for filepath in glob.glob(os.path.join(self.project_dir, "mode_*")): 

    +

    1066 if os.path.isfile(filepath): 

    +

    1067 os.remove(filepath) 

    +

    1068 

    +

    1069 # run the thing 

    +

    1070 start_time = time.time() 

    +

    1071 return_code_future = pool.submit( 

    +

    1072 run_subprocess, 

    +

    1073 [ 

    +

    1074 os.path.join(self.diffcrash_home, "DFC_Merge_All_" + self.crash_code), 

    +

    1075 self.project_dir, 

    +

    1076 merge_inputfile, 

    +

    1077 ], 

    +

    1078 ) 

    +

    1079 return_code = return_code_future.result() 

    +

    1080 

    +

    1081 # check return code 

    +

    1082 if return_code != 0: 

    +

    1083 msg = f"Running Merge ... done in {time.time() - start_time:.2f}s " 

    +

    1084 print(str_error(msg)) 

    +

    1085 self.logger.info(msg) 

    +

    1086 

    +

    1087 msg = "The process failed somehow." 

    +

    1088 self.logger.error(msg) 

    +

    1089 raise RuntimeError(str_error(msg)) 

    +

    1090 

    +

    1091 # check logfiles 

    +

    1092 messages = self.check_if_logfiles_show_success("DFC_Merge_All.log") 

    +

    1093 if messages: 

    +

    1094 msg = f"Running Merge ... done in {time.time() - start_time:.2f}s " 

    +

    1095 print(str_error(msg)) 

    +

    1096 self.logger.error(msg) 

    +

    1097 

    +

    1098 for msg in messages: 

    +

    1099 print(str_error(msg)) 

    +

    1100 self.logger.info(msg) 

    +

    1101 

    +

    1102 msg = "DFC_Merge_All failed. Please check the log files in '{self.logfile_dir}'." 

    +

    1103 self.logger.error(msg) 

    +

    1104 raise RuntimeError(str_error(msg)) 

    +

    1105 

    +

    1106 # print success 

    +

    1107 msg = f"Running Merge ... done in {time.time() - start_time:.2f}s " 

    +

    1108 print(str_success(msg)) 

    +

    1109 self.logger.info(msg) 

    +

    1110 

    +

    1111 def is_logfile_successful(self, logfile: str) -> bool: 

    +

    1112 """Checks if a logfile indicates a success 

    +

    1113 

    +

    1114 Parameters 

    +

    1115 ---------- 

    +

    1116 logfile : `str` 

    +

    1117 filepath to the logfile 

    +

    1118 

    +

    1119 Returns 

    +

    1120 ------- 

    +

    1121 success : `bool` 

    +

    1122 """ 

    +

    1123 

    +

    1124 with open(logfile, "r", encoding="utf-8") as fp: 

    +

    1125 for line in fp: 

    +

    1126 if "successfully" in line: 

    +

    1127 return True 

    +

    1128 return False 

    +

    1129 

    +

    1130 def _create_merge_input_file(self, directory: str) -> str: 

    +

    1131 """Create an input file for the merge executable 

    +

    1132 

    +

    1133 Notes 

    +

    1134 ----- 

    +

    1135 From the official diffcrash docs. 

    +

    1136 """ 

    +

    1137 

    +

    1138 # creates default inputfile for DFC_Merge 

    +

    1139 filepath = os.path.join(directory, "merge_all.txt") 

    +

    1140 with open(filepath, "w", encoding="utf-8") as merge_input_file: 

    +

    1141 merge_input_file.write("eigen_all ! Name of eigen input file\n") 

    +

    1142 merge_input_file.write( 

    +

    1143 "mode_ ! Name of Output file " 

    +

    1144 + "(string will be apended with mode information)\n" 

    +

    1145 ) 

    +

    1146 merge_input_file.write("1 1 ! Mode number to be generated\n") 

    +

    1147 merge_input_file.write("'d+ d-' ! Mode type to be generated\n") 

    +

    1148 # TIMESTEPSFILE optional 

    +

    1149 merge_input_file.write( 

    +

    1150 " ! Optional: Timestepfile (specify timesteps used for merge)\n" 

    +

    1151 ) 

    +

    1152 # PARTSFILE optional 

    +

    1153 merge_input_file.write( 

    +

    1154 " ! Optional: Partlistfile (specify parts used for merge)\n" 

    +

    1155 ) 

    +

    1156 

    +

    1157 return filepath 

    +

    1158 

    +

    1159 def _create_eigen_input_file(self, directory: str) -> str: 

    +

    1160 """Create an input file for the eigen executable 

    +

    1161 

    +

    1162 Notes 

    +

    1163 ----- 

    +

    1164 From the official diffcrash docs. 

    +

    1165 """ 

    +

    1166 

    +

    1167 # creates default inputfile for DFC_Eigen 

    +

    1168 filepath = os.path.join(directory, "eigen_all.txt") 

    +

    1169 with open(filepath, "w", encoding="utf-8") as eigen_input_file: 

    +

    1170 eigen_input_file.write("matrix_all\n") 

    +

    1171 eigen_input_file.write('""\n') 

    +

    1172 eigen_input_file.write("1 1000\n") 

    +

    1173 eigen_input_file.write('""\n') 

    +

    1174 eigen_input_file.write("0 0\n") 

    +

    1175 eigen_input_file.write('""\n') 

    +

    1176 eigen_input_file.write("eigen_all\n") 

    +

    1177 eigen_input_file.write('""\n') 

    +

    1178 eigen_input_file.write("0 0\n") 

    +

    1179 

    +

    1180 return filepath 

    +

    1181 

    +

    1182 def _create_matrix_input_file(self, directory: str) -> str: 

    +

    1183 """Create an input file for the matrix executable 

    +

    1184 

    +

    1185 Notes 

    +

    1186 ----- 

    +

    1187 From the official diffcrash docs. 

    +

    1188 """ 

    +

    1189 

    +

    1190 # creates default inputfile for DFC_Matrix 

    +

    1191 filepath = os.path.join(directory, "matrix.txt") 

    +

    1192 with open(filepath, "w", encoding="utf-8") as matrix_input_file: 

    +

    1193 matrix_input_file.write("0 1000 ! Initial and final time stept to consider\n") 

    +

    1194 matrix_input_file.write('"" ! not used\n') 

    +

    1195 matrix_input_file.write('"" ! not used\n') 

    +

    1196 matrix_input_file.write("matrix_all ! Name of matrix file set (Output)\n") 

    +

    1197 

    +

    1198 return filepath 

    +

    1199 

    +

    1200 def clear_project_dir(self): 

    +

    1201 """Clears the entire project dir""" 

    +

    1202 

    +

    1203 # disable logging 

    +

    1204 for handler in self.logger.handlers: 

    +

    1205 handler.close() 

    +

    1206 self.logger.removeHandler(handler) 

    +

    1207 

    +

    1208 # delete folder 

    +

    1209 if os.path.exists(self.project_dir): 

    +

    1210 shutil.rmtree(self.project_dir) 

    +

    1211 

    +

    1212 # reinit logger 

    +

    1213 self.logger = self._setup_logger() 

    +

    1214 

    +

    1215 def read_config_file(self, config_file: str) -> List[str]: 

    +

    1216 """Read a diffcrash config file 

    +

    1217 

    +

    1218 Parameters 

    +

    1219 ---------- 

    +

    1220 config_file : `str` 

    +

    1221 path to the config file 

    +

    1222 

    +

    1223 Notes 

    +

    1224 ----- 

    +

    1225 From the official diffcrash docs ... seriously. 

    +

    1226 """ 

    +

    1227 

    +

    1228 # Just to make it clear, this is not code from OPEN-LASSO 

    +

    1229 # ... 

    +

    1230 

    +

    1231 # pylint: disable = too-many-locals 

    +

    1232 # pylint: disable = consider-using-enumerate 

    +

    1233 # pylint: disable = too-many-nested-blocks 

    +

    1234 # pylint: disable = too-many-branches 

    +

    1235 # pylint: disable = too-many-statements 

    +

    1236 

    +

    1237 with open(config_file, "r", encoding="utf-8") as conf: 

    +

    1238 conf_lines = conf.readlines() 

    +

    1239 line = 0 

    +

    1240 

    +

    1241 for i in range(0, len(conf_lines)): 

    +

    1242 if conf_lines[i].find("FUNCTION") >= 0: 

    +

    1243 line = i + 1 

    +

    1244 break 

    +

    1245 

    +

    1246 export_item_list = [] 

    +

    1247 j = 1 

    +

    1248 if line != 0: 

    +

    1249 while 1: 

    +

    1250 while 1: 

    +

    1251 for i in range(0, len(conf_lines[line])): 

    +

    1252 if conf_lines[line][i] == "<": 

    +

    1253 element_start = i + 1 

    +

    1254 if conf_lines[line][i] == ">": 

    +

    1255 element_end = i 

    +

    1256 elem = conf_lines[line][element_start:element_end] 

    +

    1257 check = conf_lines[line + j][:-1] 

    +

    1258 

    +

    1259 if check.find(elem) >= 0: 

    +

    1260 line = line + j + 1 

    +

    1261 j = 1 

    +

    1262 break 

    +

    1263 j += 1 

    +

    1264 items = check.split(" ") 

    +

    1265 pos = -1 

    +

    1266 for n in range(0, len(items)): 

    +

    1267 if items[n].startswith("!"): 

    +

    1268 msg = f"FOUND at {n}" 

    +

    1269 print(msg) 

    +

    1270 self.logger.info(msg) 

    +

    1271 pos = n 

    +

    1272 break 

    +

    1273 pos = len(items) 

    +

    1274 

    +

    1275 for n in range(0, pos): 

    +

    1276 if items[n] == "PDMX" or items[n] == "pdmx": 

    +

    1277 break 

    +

    1278 if items[n] == "PDXMX" or items[n] == "pdxmx": 

    +

    1279 break 

    +

    1280 if items[n] == "PDYMX" or items[n] == "pdymx": 

    +

    1281 break 

    +

    1282 if items[n] == "PDZMX" or items[n] == "pdzmx": 

    +

    1283 break 

    +

    1284 if items[n] == "PDIJ" or items[n] == "pdij": 

    +

    1285 break 

    +

    1286 if items[n] == "STDDEV" or items[n] == "stddev": 

    +

    1287 break 

    +

    1288 if items[n] == "NCOUNT" or items[n] == "ncount": 

    +

    1289 break 

    +

    1290 if items[n] == "MISES_MX" or items[n] == "mises_mx": 

    +

    1291 break 

    +

    1292 if items[n] == "MISES_IJ" or items[n] == "mises_ij": 

    +

    1293 break 

    +

    1294 

    +

    1295 for k in range(n, pos): 

    +

    1296 postval = None 

    +

    1297 for m in range(0, n): 

    +

    1298 if items[m] == "coordinates": 

    +

    1299 items[m] = "geometry" 

    +

    1300 if postval is None: 

    +

    1301 postval = items[m] 

    +

    1302 else: 

    +

    1303 postval = postval + "_" + items[m] 

    +

    1304 postval = postval.strip("_") 

    +

    1305 

    +

    1306 # hotfix 

    +

    1307 # sometimes the engine writes 'Geometry' instead of 'geometry' 

    +

    1308 postval = postval.lower() 

    +

    1309 

    +

    1310 items[k] = items[k].strip() 

    +

    1311 

    +

    1312 if items[k] != "" and items[k] != "\r": 

    +

    1313 if postval.lower() == "sigma": 

    +

    1314 export_item_list.append( 

    +

    1315 elem + "_" + postval + "_" + "001_" + items[k].lower() 

    +

    1316 ) 

    +

    1317 export_item_list.append( 

    +

    1318 elem + "_" + postval + "_" + "002_" + items[k].lower() 

    +

    1319 ) 

    +

    1320 export_item_list.append( 

    +

    1321 elem + "_" + postval + "_" + "003_" + items[k].lower() 

    +

    1322 ) 

    +

    1323 else: 

    +

    1324 export_item_list.append( 

    +

    1325 elem + "_" + postval + "_" + items[k].lower() 

    +

    1326 ) 

    +

    1327 if export_item_list[-1].endswith("\r"): 

    +

    1328 export_item_list[-1] = export_item_list[-1][:-1] 

    +

    1329 

    +

    1330 if conf_lines[line].find("FUNCTION") >= 0: 

    +

    1331 break 

    +

    1332 else: 

    +

    1333 export_item_list = ["NODE_geometry_pdmx", "NODE_geometry_pdij"] 

    +

    1334 

    +

    1335 return export_item_list 

    +

    1336 

    +

    1337 def check_if_logfiles_show_success(self, pattern: str) -> List[str]: 

    +

    1338 """Check if a logfiles with given pattern show success 

    +

    1339 

    +

    1340 Parameters 

    +

    1341 ---------- 

    +

    1342 pattern : `str` 

    +

    1343 file pattern used to search for logfiles 

    +

    1344 

    +

    1345 Returns 

    +

    1346 ------- 

    +

    1347 messages : `list` 

    +

    1348 list with messages of failed log checks 

    +

    1349 """ 

    +

    1350 

    +

    1351 _msg_logfile_nok = str_error("Logfile '{0}' reports no success.") 

    +

    1352 messages = [] 

    +

    1353 

    +

    1354 logfiles = glob.glob(os.path.join(self.logfile_dir, pattern)) 

    +

    1355 for filepath in logfiles: 

    +

    1356 if not self.is_logfile_successful(filepath): 

    +

    1357 messages.append(_msg_logfile_nok.format(filepath)) 

    +

    1358 

    +

    1359 return messages 

    +
    + + + diff --git a/coverage/d_d5eca2bf8c9eb372_run_py.html b/coverage/d_d5eca2bf8c9eb372_run_py.html new file mode 100644 index 0000000..c571183 --- /dev/null +++ b/coverage/d_d5eca2bf8c9eb372_run_py.html @@ -0,0 +1,210 @@ + + + + + Coverage for lasso/diffcrash/run.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/diffcrash/run.py: + 0% +

    + +

    + 39 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from concurrent import futures 

    +

    2 

    +

    3from lasso.diffcrash.diffcrash_run import ( 

    +

    4 DC_STAGE_EIGEN, 

    +

    5 DC_STAGE_EXPORT, 

    +

    6 DC_STAGE_IMPORT, 

    +

    7 DC_STAGE_MATH, 

    +

    8 DC_STAGE_MATRIX, 

    +

    9 DC_STAGE_MERGE, 

    +

    10 DC_STAGE_SETUP, 

    +

    11 DC_STAGES, 

    +

    12 DiffcrashRun, 

    +

    13 parse_diffcrash_args, 

    +

    14) 

    +

    15 

    +

    16from ..logging import str_error 

    +

    17 

    +

    18 

    +

    19def _parse_stages(start_stage: str, end_stage: str): 

    +

    20 

    +

    21 # check validity 

    +

    22 if start_stage not in DC_STAGES or end_stage not in DC_STAGES: 

    +

    23 raise ValueError( 

    +

    24 str_error(f"{start_stage} is not a valid stage. Try: {', '.join(DC_STAGES)}.") 

    +

    25 ) 

    +

    26 

    +

    27 # get indexes 

    +

    28 start_stage_index = DC_STAGES.index(start_stage) 

    +

    29 end_stage_index = DC_STAGES.index(end_stage) 

    +

    30 

    +

    31 # check if start and end are in correct order 

    +

    32 if start_stage_index > end_stage_index: 

    +

    33 raise ValueError( 

    +

    34 str_error( 

    +

    35 f"The specified end stage '{end_stage}' comes before " 

    +

    36 f"the start stage ({start_stage}). " 

    +

    37 f"Try the order: {', '.join(DC_STAGES)}" 

    +

    38 ) 

    +

    39 ) 

    +

    40 

    +

    41 return start_stage_index, end_stage_index 

    +

    42 

    +

    43 

    +

    44def main(): 

    +

    45 """Main function for running diffcrash""" 

    +

    46 

    +

    47 # parse command line stuff 

    +

    48 parser = parse_diffcrash_args() 

    +

    49 

    +

    50 # parse settings from command line 

    +

    51 diffcrash_run = DiffcrashRun( 

    +

    52 project_dir=parser.project_dir, 

    +

    53 crash_code=parser.crash_code, 

    +

    54 reference_run=parser.reference_run, 

    +

    55 exclude_runs=parser.exclude_runs, 

    +

    56 simulation_runs=parser.simulation_runs, 

    +

    57 diffcrash_home=parser.diffcrash_home, 

    +

    58 use_id_mapping=parser.use_id_mapping, 

    +

    59 config_file=parser.config_file, 

    +

    60 parameter_file=parser.parameter_file, 

    +

    61 n_processes=parser.n_processes, 

    +

    62 ) 

    +

    63 

    +

    64 # determine start and end stages 

    +

    65 start_stage_index, end_stage_index = _parse_stages(parser.start_stage, parser.end_stage) 

    +

    66 

    +

    67 # remove old stuff 

    +

    68 if start_stage_index == 0: 

    +

    69 diffcrash_run.clear_project_dir() 

    +

    70 diffcrash_run.create_project_dirs() 

    +

    71 

    +

    72 # do the thing 

    +

    73 print() 

    +

    74 print(" ---- Running Routines ---- ") 

    +

    75 print() 

    +

    76 

    +

    77 # initiate threading pool for handling jobs 

    +

    78 with futures.ThreadPoolExecutor(max_workers=diffcrash_run.n_processes) as pool: 

    +

    79 

    +

    80 # setup 

    +

    81 if start_stage_index <= DC_STAGES.index(DC_STAGE_SETUP) <= end_stage_index: 

    +

    82 diffcrash_run.run_setup(pool) 

    +

    83 

    +

    84 # import 

    +

    85 if start_stage_index <= DC_STAGES.index(DC_STAGE_IMPORT) <= end_stage_index: 

    +

    86 diffcrash_run.run_import(pool) 

    +

    87 

    +

    88 # math 

    +

    89 if start_stage_index <= DC_STAGES.index(DC_STAGE_MATH) <= end_stage_index: 

    +

    90 diffcrash_run.run_math(pool) 

    +

    91 

    +

    92 # export 

    +

    93 if start_stage_index <= DC_STAGES.index(DC_STAGE_EXPORT) <= end_stage_index: 

    +

    94 diffcrash_run.run_export(pool) 

    +

    95 

    +

    96 # matrix 

    +

    97 if start_stage_index <= DC_STAGES.index(DC_STAGE_MATRIX) <= end_stage_index: 

    +

    98 diffcrash_run.run_matrix(pool) 

    +

    99 

    +

    100 # eigen 

    +

    101 if start_stage_index <= DC_STAGES.index(DC_STAGE_EIGEN) <= end_stage_index: 

    +

    102 diffcrash_run.run_eigen(pool) 

    +

    103 

    +

    104 # merge 

    +

    105 if start_stage_index <= DC_STAGES.index(DC_STAGE_MERGE) <= end_stage_index: 

    +

    106 diffcrash_run.run_merge(pool) 

    +

    107 

    +

    108 # final spacing 

    +

    109 print() 

    +

    110 

    +

    111 

    +

    112if __name__ == "__main__": 

    +

    113 main() 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de___init___py.html b/coverage/d_ec83283597faf9de___init___py.html new file mode 100644 index 0000000..a1bb5c3 --- /dev/null +++ b/coverage/d_ec83283597faf9de___init___py.html @@ -0,0 +1,97 @@ + + + + + Coverage for lasso/dimred/svd/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/__init__.py: + 100% +

    + +

    + 0 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +
    + + + diff --git a/coverage/d_ec83283597faf9de_clustering_betas_py.html b/coverage/d_ec83283597faf9de_clustering_betas_py.html new file mode 100644 index 0000000..87509d5 --- /dev/null +++ b/coverage/d_ec83283597faf9de_clustering_betas_py.html @@ -0,0 +1,808 @@ + + + + + Coverage for lasso/dimred/svd/clustering_betas.py: 48% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/clustering_betas.py: + 48% +

    + +

    + 223 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from typing import Sequence, Tuple, Union 

    +

    2 

    +

    3import numpy as np 

    +

    4from sklearn.cluster import DBSCAN, OPTICS, KMeans, SpectralClustering 

    +

    5from sklearn.ensemble import IsolationForest 

    +

    6from sklearn.neighbors import LocalOutlierFactor 

    +

    7from sklearn.svm import OneClassSVM 

    +

    8 

    +

    9from .keyword_types import ClusterType, DetectorType 

    +

    10 

    +

    11 

    +

    12def __apply_spectral_clustering(betas, runids, datasets, idsets, random_state=11, **kwargs): 

    +

    13 """ 

    +

    14 Method to group the input Betas. 

    +

    15 Default keyword arguments: affinity='nearest_neighbors', random_state=11 

    +

    16 

    +

    17 Parameters 

    +

    18 ---------- 

    +

    19 betas: np.ndarray 

    +

    20 Betas that shall be grouped into clusters 

    +

    21 run_ids: np.ndarray 

    +

    22 Ids matching to each Beta 

    +

    23 datasets: list 

    +

    24 List where each grouped Betas will be added 

    +

    25 idsets: list 

    +

    26 List where the grouped ids corresponding to the grouped Betas will be saved 

    +

    27 **kwargs: keyword arguments 

    +

    28 Keyword arguments specific for the SpectralClustering algorythm 

    +

    29 

    +

    30 See Also 

    +

    31 -------- 

    +

    32 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    33 Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.SpectralClustering.html#sklearn.cluster.SpectralClustering 

    +

    34 """ # noqa pylint: disable = line-too-long 

    +

    35 clustering = SpectralClustering(random_state=random_state, **kwargs).fit(betas) 

    +

    36 

    +

    37 indexes = clustering.labels_ 

    +

    38 

    +

    39 clusters = np.unique(indexes) 

    +

    40 

    +

    41 for clump in clusters: 

    +

    42 clump_index = np.where(indexes == clump)[0] 

    +

    43 clump_betas = betas[clump_index] 

    +

    44 clump_runs = runids[clump_index] 

    +

    45 datasets.append(clump_betas) 

    +

    46 idsets.append(clump_runs.tolist()) 

    +

    47 

    +

    48 

    +

    49def __apply_k_means(betas, runids, datasets, idsets, random_state=11, **kwargs): 

    +

    50 """ 

    +

    51 Method to group the input Betas. 

    +

    52 Recommended keyword arguments: n_clusters=3, random_state=11 

    +

    53 

    +

    54 Parameters 

    +

    55 ---------- 

    +

    56 betas: np.ndarray 

    +

    57 Betas that shall be grouped into clusters 

    +

    58 run_ids: np.ndarray 

    +

    59 Ids matching to each Beta 

    +

    60 datasets: list 

    +

    61 List where each grouped Betas will be added 

    +

    62 idsets: list 

    +

    63 List where the grouped ids corresponding to the grouped Betas will be saved 

    +

    64 **kwargs: keyword arguments 

    +

    65 Keyword arguments specific fot the KMeans algorythm 

    +

    66 

    +

    67 See Also 

    +

    68 -------- 

    +

    69 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    70 Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn.cluster.KMeans 

    +

    71 """ # noqa: E501 pylint: disable = line-too-long 

    +

    72 kmeans = KMeans(random_state=random_state, **kwargs).fit(betas) 

    +

    73 indexes = kmeans.labels_ 

    +

    74 

    +

    75 clusters = np.unique(indexes) 

    +

    76 

    +

    77 for clump in clusters: 

    +

    78 clump_index = np.where(indexes == clump)[0] 

    +

    79 clump_betas = betas[clump_index] 

    +

    80 clump_runs = runids[clump_index] 

    +

    81 datasets.append(clump_betas) 

    +

    82 idsets.append(clump_runs.tolist()) 

    +

    83 

    +

    84 

    +

    85def __apply_dbscan(betas, runids, datasets, idsets, **kwargs): 

    +

    86 """ 

    +

    87 Method to group the input Betas. 

    +

    88 Defautl keyword arguments: eps=0.08 

    +

    89 

    +

    90 Parameters 

    +

    91 ---------- 

    +

    92 betas: np.ndarray 

    +

    93 Betas that shall be grouped into clusters 

    +

    94 run_ids: np.ndarray 

    +

    95 Ids matching to each Beta 

    +

    96 datasets: list 

    +

    97 List where each grouped Betas will be added 

    +

    98 idsets: list 

    +

    99 List where the grouped ids corresponding to the grouped Betas will be saved 

    +

    100 **kwags: keyword arguments 

    +

    101 Keyword arguments for the DBSCAN algorythm 

    +

    102 

    +

    103 See Also 

    +

    104 -------- 

    +

    105 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    106 Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html#sklearn.cluster.DBSCAN 

    +

    107 """ # noqa: E501 pylint: disable = line-too-long 

    +

    108 deutsche_bahn = DBSCAN(**kwargs).fit(betas) 

    +

    109 indexes = deutsche_bahn.labels_ 

    +

    110 

    +

    111 clusters = np.unique(indexes) 

    +

    112 

    +

    113 for clump in clusters: 

    +

    114 clump_index = np.where(indexes == clump)[0] 

    +

    115 clump_betas = betas[clump_index] 

    +

    116 clump_runs = runids[clump_index] 

    +

    117 datasets.append(clump_betas) 

    +

    118 idsets.append(clump_runs.tolist()) 

    +

    119 

    +

    120 

    +

    121def __apply_optics(betas, runids, datasets, idsets, **kwargs): 

    +

    122 """ 

    +

    123 Method to group the input Betas. 

    +

    124 Default keyword parameters: eps=0.05, min_cluster_size=10 

    +

    125 

    +

    126 Parameters 

    +

    127 ---------- 

    +

    128 betas: np.ndarray 

    +

    129 Betas that shall be grouped into clusters 

    +

    130 run_ids: np.ndarray 

    +

    131 Ids matching to each Beta 

    +

    132 datasets: list 

    +

    133 List where each grouped Betas will be added 

    +

    134 idsets: list 

    +

    135 List where the grouped ids corresponding to the grouped Betas will be saved 

    +

    136 **kwargs: keyword arguments 

    +

    137 Keyword arguments specific to the OPTICS function. 

    +

    138 

    +

    139 See Also 

    +

    140 ------- 

    +

    141 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    142 Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.OPTICS.html#sklearn.cluster.OPTICS 

    +

    143 """ # noqa: E501 pylint: disable = line-too-long 

    +

    144 lense = OPTICS(**kwargs).fit(betas) 

    +

    145 indexes = lense.labels_ 

    +

    146 

    +

    147 clusters = np.unique(indexes) 

    +

    148 

    +

    149 for clump in clusters: 

    +

    150 clump_index = np.where(indexes == clump)[0] 

    +

    151 clump_betas = betas[clump_index] 

    +

    152 clump_runs = runids[clump_index] 

    +

    153 datasets.append(clump_betas) 

    +

    154 idsets.append(clump_runs.tolist()) 

    +

    155 

    +

    156 

    +

    157def __detect_outliers_isolation_forest( 

    +

    158 betas, ids, beta_clusters, id_clusters, random_state=11, **kwargs 

    +

    159): 

    +

    160 """ 

    +

    161 Detects outliers based on the IsolationForest algorythm from sklearn. 

    +

    162 Detected outliers will be appended into the provided lists 

    +

    163 Default keyword parameters: random_state=12, behaviour="new", contamination=0.005 

    +

    164 

    +

    165 Parameters 

    +

    166 ---------- 

    +

    167 betas: np.ndarray 

    +

    168 Numpy array containing the betas 

    +

    169 ids: np.ndarray 

    +

    170 Numpy array containing the ids of each beta 

    +

    171 beta_clusters: list 

    +

    172 List where each cluster of betas will be appended 

    +

    173 id_clusters: list 

    +

    174 List where each cluster of ids will be appended 

    +

    175 **kwargs: keyword argument 

    +

    176 Keywords specific to the IsolationForest algorythm 

    +

    177 Returns 

    +

    178 ------- 

    +

    179 inlier_betas: np.array 

    +

    180 Numpy array containing the betas that are not outliers 

    +

    181 inlier_ids: np.array 

    +

    182 Numpy array containing the ids of betas that are not outliers 

    +

    183 

    +

    184 See Also 

    +

    185 -------- 

    +

    186 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    187 Link: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html 

    +

    188 """ # noqa: E501 pylint: disable = line-too-long 

    +

    189 outcasts = IsolationForest(random_state=random_state, **kwargs).fit(betas).predict(betas) 

    +

    190 

    +

    191 outlier_key = np.where(outcasts == -1)[0] 

    +

    192 inlier_key = np.where(outcasts == 1)[0] 

    +

    193 beta_clusters.append(betas[outlier_key]) 

    +

    194 id_clusters.append(ids[outlier_key].tolist()) 

    +

    195 

    +

    196 return betas[inlier_key], ids[inlier_key] 

    +

    197 

    +

    198 

    +

    199def __detect_outliers_local_outlier_factor(betas, ids, beta_clusters, id_clusters, **kwargs): 

    +

    200 """ 

    +

    201 Detects outliers based on the LocalOutlierFactor algorythm from sklearn. 

    +

    202 Detected outliers will be appended into the provided lists 

    +

    203 Default keyword parameters: contamination=0.01 

    +

    204 

    +

    205 Parameters 

    +

    206 ---------- 

    +

    207 betas: np.ndarray 

    +

    208 Numpy array containing the betas 

    +

    209 ids: np.ndarray 

    +

    210 Numpy array containing the ids of each beta 

    +

    211 beta_clusters: list 

    +

    212 List where each cluster of betas will be appended 

    +

    213 id_clusters: list 

    +

    214 List where each cluster of ids will be appended 

    +

    215 **kwargs: keyword argument 

    +

    216 Keywords specific to the LocalOutlierFactor algorythm. 

    +

    217 Returns 

    +

    218 ------- 

    +

    219 inlier_betas: np.ndarray 

    +

    220 Numpy array containing the betas that are not outliers 

    +

    221 inlier_ids: np.ndarray 

    +

    222 Numpy array containing the ids of betas that are not outliers 

    +

    223 

    +

    224 See Also 

    +

    225 -------- 

    +

    226 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    227 Link:https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.LocalOutlierFactor.html#sklearn.neighbors.LocalOutlierFactor 

    +

    228 """ # noqa pylint: disable = line-too-long 

    +

    229 outcasts = LocalOutlierFactor(**kwargs).fit_predict(betas) 

    +

    230 

    +

    231 outlier_key = np.where(outcasts == -1)[0] 

    +

    232 inlier_key = np.where(outcasts == 1)[0] 

    +

    233 beta_clusters.append(betas[outlier_key]) 

    +

    234 id_clusters.append(ids[outlier_key].tolist()) 

    +

    235 

    +

    236 return betas[inlier_key], ids[inlier_key] 

    +

    237 

    +

    238 

    +

    239def __detect_outliers_one_class_svm(betas, ids, beta_clusters, id_clusters, **kwargs): 

    +

    240 """ 

    +

    241 Detects outliers based on the OneClassSVM algorythm from sklearn. 

    +

    242 Detected outliers will be appended into the provided lists 

    +

    243 Defautl keyword arguments: gamma=0.1, nu=0.01 

    +

    244 

    +

    245 Parameters 

    +

    246 ---------- 

    +

    247 betas: np.ndarray 

    +

    248 Numpy array containing the betas 

    +

    249 ids: np.ndarray 

    +

    250 Numpy array containing the ids of each beta 

    +

    251 beta_clusters: list 

    +

    252 List where each cluster of betas will be appended 

    +

    253 id_clusters: list 

    +

    254 List where each cluster of ids will be appended 

    +

    255 **kwargs: keyword argument 

    +

    256 Keywords specific to the OneClassSVM algorythm. 

    +

    257 

    +

    258 Returns 

    +

    259 ------- 

    +

    260 inlier_betas: np.ndarray 

    +

    261 Numpy array containing the betas that are not outliers 

    +

    262 inlier_ids: np.ndarray 

    +

    263 Numpy array containing the ids of betas that are not outliers 

    +

    264 

    +

    265 See Also 

    +

    266 -------- 

    +

    267 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    268 Link: https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html#sklearn.svm.OneClassSVM 

    +

    269 """ # noqa: E501 pylint: disable = line-too-long 

    +

    270 

    +

    271 outcasts = OneClassSVM(**kwargs).fit_predict(betas) 

    +

    272 

    +

    273 outlier_key = np.where(outcasts == -1)[0] 

    +

    274 inlier_key = np.where(outcasts == 1)[0] 

    +

    275 beta_clusters.append(betas[outlier_key]) 

    +

    276 id_clusters.append(ids[outlier_key].tolist()) 

    +

    277 

    +

    278 return betas[inlier_key], ids[inlier_key] 

    +

    279 

    +

    280 

    +

    281def __experimental_outlier_detector(betas, ids, **kwargs): 

    +

    282 """ 

    +

    283 Detects outliers by applying LocalOutlierFactor algorythm from sklearn over multiple slices of betas . 

    +

    284 Detected outliers will be appended into the provided lists 

    +

    285 Default keyword arguments: contamination=0.01 

    +

    286 Parameters 

    +

    287 ---------- 

    +

    288 betas: np.ndarray 

    +

    289 Numpy array containing the betas 

    +

    290 ids: np.ndarray 

    +

    291 Numpy array containing the ids of each beta 

    +

    292 **kwargs: keyword argument 

    +

    293 Keywords specific to the LocalOutlierFactor algorythm 

    +

    294 Returns 

    +

    295 ------- 

    +

    296 outliers: np.array 

    +

    297 Numpy array containing the sample names identified as outliers 

    +

    298 outlier_index: np.array 

    +

    299 Array containing the indexes of outliers 

    +

    300 inlier_index: np.array 

    +

    301 Array of booleans to get inlier(not outliers) betas and IDs 

    +

    302 

    +

    303 See Also 

    +

    304 -------- 

    +

    305 Detailed Documentation of the function parameters can be found on sklearn. 

    +

    306 Link:https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.LocalOutlierFactor.html#sklearn.neighbors.LocalOutlierFactor 

    +

    307 """ # noqa pylint: disable = line-too-long 

    +

    308 

    +

    309 # pylint: disable = too-many-locals 

    +

    310 

    +

    311 loops = betas.shape[1] - 2 

    +

    312 alertlist = [] 

    +

    313 for dadoop in range(loops): 

    +

    314 slicer = dadoop + 3 

    +

    315 beta_slice = betas[:, dadoop:slicer] 

    +

    316 

    +

    317 sanitizer = LocalOutlierFactor(**kwargs).fit_predict(beta_slice) 

    +

    318 outlier_key = np.where(sanitizer == -1)[0] 

    +

    319 alertlist.append(outlier_key) 

    +

    320 

    +

    321 suspects = np.concatenate(alertlist) 

    +

    322 individuals = np.unique(suspects) 

    +

    323 crimecounter = np.array([np.where(suspects == tracked)[0].shape[0] for tracked in individuals]) 

    +

    324 

    +

    325 the_cases = np.where(crimecounter > 2)[0] 

    +

    326 the_judged = ids[individuals[the_cases]] 

    +

    327 

    +

    328 innocents = np.full(ids.shape, True) 

    +

    329 

    +

    330 if the_judged.shape != (0,): 

    +

    331 judged_index = np.array([np.where(ids == convict)[0] for convict in the_judged])[:, 0] 

    +

    332 

    +

    333 innocents[judged_index] = False 

    +

    334 else: 

    +

    335 return False 

    +

    336 

    +

    337 return the_judged, judged_index, innocents 

    +

    338 

    +

    339 

    +

    340def __rescale_betas(betas): 

    +

    341 """ 

    +

    342 utility function to rescale betas into the range of [0, 1]. 

    +

    343 Expects only positive betas 

    +

    344 

    +

    345 Parameters 

    +

    346 ---------- 

    +

    347 betas: np.ndarray 

    +

    348 Numpy array containing the betas to be scaled. Expects betas of shape (samples, nr_betas) 

    +

    349 

    +

    350 Returns 

    +

    351 ------- 

    +

    352 betas_scaled: np.ndarray 

    +

    353 Betas scaled to range [0, 1] 

    +

    354 maxb: np.ndarray 

    +

    355 Array to rescale betas back to original values 

    +

    356 """ 

    +

    357 assert len(betas.shape) == 2 

    +

    358 ref_betas = np.abs(betas) 

    +

    359 maxb = np.array([np.max(ref_betas[:, i]) for i in range(betas.shape[1])]) 

    +

    360 # return np.array([(betas[:, i]/maxb[i]) for i in range(betas.shape[1])]).T 

    +

    361 return betas / (maxb.T), maxb.T 

    +

    362 

    +

    363 

    +

    364def list_detectors_and_cluster(): 

    +

    365 """ 

    +

    366 Prints out all keywords for outlier detection and clustering functions 

    +

    367 

    +

    368 See Also 

    +

    369 -------- 

    +

    370 list_detectors_and_cluster(keyword)""" 

    +

    371 

    +

    372 print("Implemented Detectors:") 

    +

    373 for entry in __detector_dict: 

    +

    374 print(" " + entry) 

    +

    375 print("Implemented Clustering Functions") 

    +

    376 for entry in __cluster_dict: 

    +

    377 print(" " + entry) 

    +

    378 

    +

    379 

    +

    380def document_algorithm(keyword): 

    +

    381 """ 

    +

    382 prints out the docstring of the function related to the input keyword 

    +

    383 

    +

    384 Parameters 

    +

    385 ---------- 

    +

    386 keyword: str 

    +

    387 String keyword referencing the outlier detection or clustering function 

    +

    388 

    +

    389 See Also 

    +

    390 -------- 

    +

    391 list_detectors_and_cluster() 

    +

    392 """ 

    +

    393 print(__doc_dict[keyword]) 

    +

    394 

    +

    395 

    +

    396__doc_dict = { 

    +

    397 DetectorType.IsolationForest: __detect_outliers_isolation_forest.__doc__, 

    +

    398 DetectorType.OneClassSVM: __detect_outliers_one_class_svm.__doc__, 

    +

    399 DetectorType.LocalOutlierFactor: __detect_outliers_local_outlier_factor.__doc__, 

    +

    400 # DetectorType.Experimental: __experimental_outlier_detector.__doc__, 

    +

    401 ClusterType.OPTICS: __apply_optics.__doc__, 

    +

    402 ClusterType.DBSCAN: __apply_dbscan.__doc__, 

    +

    403 ClusterType.KMeans: __apply_k_means.__doc__, 

    +

    404 ClusterType.SpectralClustering: __apply_spectral_clustering.__doc__, 

    +

    405} 

    +

    406 

    +

    407__detector_dict = { 

    +

    408 DetectorType.IsolationForest: __detect_outliers_isolation_forest, 

    +

    409 DetectorType.OneClassSVM: __detect_outliers_one_class_svm, 

    +

    410 DetectorType.LocalOutlierFactor: __detect_outliers_local_outlier_factor, 

    +

    411 # DetectorType.Experimental: __experimental_outlier_detector 

    +

    412} 

    +

    413__cluster_dict = { 

    +

    414 ClusterType.OPTICS: __apply_optics, 

    +

    415 ClusterType.DBSCAN: __apply_dbscan, 

    +

    416 ClusterType.KMeans: __apply_k_means, 

    +

    417 ClusterType.SpectralClustering: __apply_spectral_clustering, 

    +

    418} 

    +

    419 

    +

    420 

    +

    421def create_cluster_arg_dict(args: Sequence[str]) -> Union[Tuple[str, dict], str]: 

    +

    422 """Determines which cluster to use and creates a python dictionary to use as cluster_params 

    +

    423 

    +

    424 Parameters 

    +

    425 ---------- 

    +

    426 args: Sequence[str] 

    +

    427 List of strings containing parameters and arguments 

    +

    428 

    +

    429 Returns 

    +

    430 ------- 

    +

    431 cluster_type: str 

    +

    432 determines which cluster algorithm to use 

    +

    433 cluster_arg_dict: dict 

    +

    434 dictionary containing arguments and values for specific cluster_type 

    +

    435 err_msg: str 

    +

    436 message containing error, mostly unrecognised keywords""" 

    +

    437 

    +

    438 # first argument must be cluster type 

    +

    439 cluster_key = args[0].lower() 

    +

    440 cluster_arg_dict = {} 

    +

    441 cluster_type = None 

    +

    442 param_type = [] 

    +

    443 

    +

    444 # all following arguments are a parameter, followed by their respective value 

    +

    445 parameters = [] 

    +

    446 values = [] 

    +

    447 if len(args) % 3 == 0: 

    +

    448 # check if amount of parameters is valid 

    +

    449 err_msg = ( 

    +

    450 "Invalid cluster arguments, first argument must be the chosen clustering algorithm," 

    +

    451 " and each optional subsequent parameter must be followed by its type and value" 

    +

    452 ) 

    +

    453 return err_msg 

    +

    454 if len(args) > 1: 

    +

    455 # check if we even have parameters 

    +

    456 parameters = args[1:-2:3] 

    +

    457 param_type = args[2:-1:3] 

    +

    458 values = args[3::3] 

    +

    459 

    +

    460 for cluster_option in ClusterType.get_cluster_type_name(): 

    +

    461 if cluster_key == cluster_option.lower(): 

    +

    462 cluster_type = cluster_option 

    +

    463 

    +

    464 if not cluster_type: 

    +

    465 err_msg = ( 

    +

    466 f"No existing clustering method matching {args[0]}" 

    +

    467 f"possible clustering methods are: {str(ClusterType.get_cluster_type_name())[1:-1]}" 

    +

    468 ) 

    +

    469 return err_msg 

    +

    470 

    +

    471 for ind, param in enumerate(parameters): 

    +

    472 p_t = param_type[ind] 

    +

    473 v_type = None 

    +

    474 if p_t == "str": 

    +

    475 v_type = str 

    +

    476 elif p_t == "float": 

    +

    477 v_type = float 

    +

    478 elif p_t == "int": 

    +

    479 v_type = int 

    +

    480 else: 

    +

    481 err_msg = f"Clustering: Invalid type identifier {p_t}" 

    +

    482 return err_msg 

    +

    483 

    +

    484 try: 

    +

    485 val = v_type(values[ind]) 

    +

    486 except ValueError: 

    +

    487 err_msg = ( 

    +

    488 f"Clustering: Invalid value {values[ind]} " 

    +

    489 f"for parameter {param} of type {v_type}" 

    +

    490 ) 

    +

    491 return err_msg 

    +

    492 cluster_arg_dict[param] = val 

    +

    493 

    +

    494 return cluster_type, cluster_arg_dict 

    +

    495 

    +

    496 

    +

    497def create_detector_arg_dict(args: Sequence[str]) -> Union[Tuple[str, dict], str]: 

    +

    498 """Determines which detector to use and creates a python dictionary to use as detector_params 

    +

    499 

    +

    500 Parameters 

    +

    501 ---------- 

    +

    502 args: Sequence[str] 

    +

    503 List of strings containing parameters and arguments 

    +

    504 

    +

    505 Returns 

    +

    506 ------- 

    +

    507 detector_type: str 

    +

    508 determines which cluster algorithm to use 

    +

    509 detector_arg_dict: dict 

    +

    510 dictionary containing arguments and values for specific cluster_type 

    +

    511 err_mgs: str 

    +

    512 message containing error, mostly unrecognised keywords""" 

    +

    513 

    +

    514 # first argument must be detector type: 

    +

    515 detector_key = args[0].lower() 

    +

    516 detector_arg_dict = {} 

    +

    517 detector_type = None 

    +

    518 param_type = [] 

    +

    519 

    +

    520 # all following arguments are a parameter, followed by their respective value 

    +

    521 parameters = [] 

    +

    522 values = [] 

    +

    523 if len(args) % 3 == 0: 

    +

    524 # check if amount of parameters is valid 

    +

    525 err_msg = ( 

    +

    526 "Invalid outlier detector arguments, first argument must be " 

    +

    527 "the chosen detector algorithm, and each optional subsequent " 

    +

    528 "parameter must be followed by its type and value" 

    +

    529 ) 

    +

    530 return err_msg 

    +

    531 if len(args) > 1: 

    +

    532 # check if we even have parameters 

    +

    533 parameters = args[1:-2:3] 

    +

    534 param_type = args[2:-1:3] 

    +

    535 values = args[3::3] 

    +

    536 

    +

    537 for detector_option in DetectorType.get_detector_type_name(): 

    +

    538 if detector_key == detector_option.lower(): 

    +

    539 detector_type = detector_option 

    +

    540 

    +

    541 if not detector_type: 

    +

    542 err_msg = ( 

    +

    543 f"No existing outlier detection method matching {args[0]} " 

    +

    544 f"possible outlier detection methods are: " 

    +

    545 f"{str(DetectorType.get_detector_type_name())[1:-1]}" 

    +

    546 ) 

    +

    547 return err_msg 

    +

    548 

    +

    549 for ind, param in enumerate(parameters): 

    +

    550 p_t = param_type[ind] 

    +

    551 v_type = None 

    +

    552 if p_t == "str": 

    +

    553 v_type = str 

    +

    554 elif p_t == "float": 

    +

    555 v_type = float 

    +

    556 elif p_t == "int": 

    +

    557 v_type = int 

    +

    558 else: 

    +

    559 err_msg = f"Outlier Detection: Invalid type identifier {p_t}" 

    +

    560 return err_msg 

    +

    561 

    +

    562 try: 

    +

    563 val = v_type(values[ind]) 

    +

    564 except ValueError: 

    +

    565 err_msg = ( 

    +

    566 f"Outlier Detection: Invalid value {values[ind]} " 

    +

    567 "for parameter {param} of type {v_type}" 

    +

    568 ) 

    +

    569 return err_msg 

    +

    570 detector_arg_dict[param] = val 

    +

    571 

    +

    572 return detector_type, detector_arg_dict 

    +

    573 

    +

    574 

    +

    575def group_betas( 

    +

    576 beta_index, 

    +

    577 betas, 

    +

    578 scale_betas=False, 

    +

    579 cluster=None, 

    +

    580 detector=None, 

    +

    581 cluster_params=None, 

    +

    582 detector_params=None, 

    +

    583) -> Union[Tuple[list, list], str]: 

    +

    584 """ 

    +

    585 Base function to to group betas into groups, detect outliers. Provides that all different 

    +

    586 clustering and outlier detection algorythms are implemented in an easy to access environment. 

    +

    587 To select different clustering and outlier detection algoyrthms, please use appropriate 

    +

    588 KeywordTypes. A description of each function can be accessed with document_algorythm(keyword) 

    +

    589 A list of all functions can be accessed with list_detectors_and_clusters() 

    +

    590 

    +

    591 Parameters 

    +

    592 ---------- 

    +

    593 beta_index: np.ndarray 

    +

    594 Array containing the file names specific to the betas with the same index in the beta array 

    +

    595 betas: np.ndarray 

    +

    596 Numpy array containing the betas. 

    +

    597 Betas are expected to be of shape (samples, timestep, 3) 

    +

    598 The three entries per beta can either be dimesnions (x,y,z) or any three betas/eigenvalues 

    +

    599 cluster: str, optional, default : "KMeans". 

    +

    600 String specifying which clustering algorythm shall be applied. 

    +

    601 Use ClusterTypefor easier access 

    +

    602 detector: str, optional, default: None. 

    +

    603 String specifying which outlier detection algorythm shall be applied. 

    +

    604 Use DetectorType for easier access 

    +

    605 cluster_params: dict, optional 

    +

    606 Dictionary containing parameters for the clustering algorythms. 

    +

    607 See the sklearn documentation for the function to learn more. 

    +

    608 detector_params: dict, optional 

    +

    609 Dictionary containing parameters for the outlier detection algorythms. 

    +

    610 See the sklearn documentation for the function to learn more 

    +

    611 

    +

    612 Returns 

    +

    613 ------- 

    +

    614 beta_clusters: list 

    +

    615 List containing Numpy Arrays of betas in one cluster. 

    +

    616 If a detector was selected, or the clustering algorythm has its 

    +

    617 own outlier detection, the first entry in the list will be oultier betas 

    +

    618 id_clusters: list 

    +

    619 List containing lists of beta ids. Each id corresponds to the beta in 

    +

    620 the same place in the beta_clusters list 

    +

    621 err_msg: str 

    +

    622 Error message if wrong keywords for detector or cluster algorithms were used 

    +

    623 

    +

    624 Notes 

    +

    625 -------- 

    +

    626 document_algorithm: 

    +

    627 Prints docstring of each function into console 

    +

    628 list_detectors_and_clusters: 

    +

    629 Prints out all detection and clustering algorythms into console 

    +

    630 Sklearn Userguide chapter 2.3 Clustering: 

    +

    631 https://scikit-learn.org/stable/modules/clustering.html 

    +

    632 Detailed overview of different clustering algorythms 

    +

    633 Sklearn Examples outlier detection: 

    +

    634 https://scikit-learn.org/stable/auto_examples/plot_anomaly_comparison.html 

    +

    635 Example of different used outlier detection algorythms 

    +

    636 """ 

    +

    637 

    +

    638 # pylint: disable = too-many-arguments, too-many-locals, too-many-branches 

    +

    639 

    +

    640 if cluster_params is None: 

    +

    641 cluster_params = {} 

    +

    642 

    +

    643 if detector_params is None: 

    +

    644 detector_params = {} 

    +

    645 

    +

    646 beta_clusters = [] 

    +

    647 id_clusters = [] 

    +

    648 

    +

    649 if scale_betas: 

    +

    650 betas, _ = __rescale_betas(betas) 

    +

    651 

    +

    652 if detector == "Experimental": 

    +

    653 

    +

    654 experimental_results = __detector_dict[detector](betas, beta_index, **detector_params) 

    +

    655 if not isinstance(experimental_results, bool): 

    +

    656 outlier_betas, outlier_index, inlier_index = experimental_results 

    +

    657 beta_clusters.append(betas[outlier_index]) 

    +

    658 id_clusters.append(outlier_betas.tolist()) 

    +

    659 betas = betas[inlier_index] 

    +

    660 beta_index = beta_index[inlier_index] 

    +

    661 else: 

    +

    662 empy_list = [] 

    +

    663 beta_clusters.append(empy_list) 

    +

    664 id_clusters.append(empy_list) 

    +

    665 

    +

    666 detector = None 

    +

    667 

    +

    668 if detector is not None: 

    +

    669 try: 

    +

    670 betas_det, index_det = __detector_dict[detector]( 

    +

    671 betas, beta_index, beta_clusters, id_clusters, **detector_params 

    +

    672 ) 

    +

    673 

    +

    674 except TypeError as key_err: 

    +

    675 err_msg = ( 

    +

    676 f"During Outlier Detection, a TypeError came up:\n{str(key_err)}\n" 

    +

    677 "Please check your outlier detection arguments" 

    +

    678 ) 

    +

    679 return err_msg 

    +

    680 

    +

    681 except ValueError as val_err: 

    +

    682 err_msg = ( 

    +

    683 f"During Outlier Detection, a ValueError came up:\n{str(val_err)}\n" 

    +

    684 "Please check your outlier detection arguments" 

    +

    685 ) 

    +

    686 return err_msg 

    +

    687 else: 

    +

    688 betas_det, index_det = betas, beta_index 

    +

    689 

    +

    690 if cluster is not None: 

    +

    691 try: 

    +

    692 __cluster_dict[cluster]( 

    +

    693 betas_det, index_det, beta_clusters, id_clusters, **cluster_params 

    +

    694 ) 

    +

    695 except TypeError as key_err: 

    +

    696 err_msg = ( 

    +

    697 f"During Clustering, a TypeError came up:\n{str(key_err)}\n" 

    +

    698 "Please check your outlier detection arguments" 

    +

    699 ) 

    +

    700 return err_msg 

    +

    701 

    +

    702 except ValueError as val_err: 

    +

    703 err_msg = ( 

    +

    704 f"During Clustering, a ValueError came up:\n{str(val_err)}\n" 

    +

    705 "Please check your outlier detection arguments" 

    +

    706 ) 

    +

    707 return err_msg 

    +

    708 else: 

    +

    709 beta_clusters, id_clusters = [*beta_clusters, betas_det], [*id_clusters, index_det] 

    +

    710 

    +

    711 return beta_clusters, id_clusters 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_html_str_eles_py.html b/coverage/d_ec83283597faf9de_html_str_eles_py.html new file mode 100644 index 0000000..3377ddc --- /dev/null +++ b/coverage/d_ec83283597faf9de_html_str_eles_py.html @@ -0,0 +1,915 @@ + + + + + Coverage for lasso/dimred/svd/html_str_eles.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/html_str_eles.py: + 100% +

    + +

    + 4 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1OVERHEAD_STRING = """ 

    +

    2<html> 

    +

    3 <title>3D Beta Embedding</title> 

    +

    4<head> 

    +

    5 <meta charset="utf-8"> 

    +

    6 <style> 

    +

    7 :root{--background:#cfd8dc;--menue-background:#ffffff;--menue-option-background:#ffffff;--menue-option-text-color:#000000;--menue-option-active:#e2f0fb;--content-background:#ffffff;--content-border:1px solid #9ea7aa;--content-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2),0 6px 20px 0 rgba(0, 0, 0, 0.19);--plot-option-color:#455a64}body{font-family:Lato,sans-serif;background-color:var(--background)}.inputHidden{padding:0;width:0;height:0;display:none;transition:1s}.inputSelected{padding:0 8px 8px 16px;padding-top:15px;display:block;overflow:auto;transition:1s}.menuOption{padding:8px 8px 8px 32px;background-color:var(--menue-option-background)}.navClosed{margin-top:15px;position:fixed;left:1%;transition:.2s;display:flex;min-height:100vh}.navOpen{margin-top:15px;position:fixed;transition:.2s;display:flex;min-height:100vh}.sidenav{height:100%;width:0;position:fixed;z-index:1;top:0;left:0;background-color:var(--menue-background);overflow-x:hidden;transition:.2s;padding-top:60px}.sidenav a{text-decoration:none;font-size:20px;color:var(--menue-option-text-color);display:block;opacity:.7;cursor:pointer}.slider{-webkit-appearance:none;width:90%;background:#137a94;height:5px;border-radius:5px;outline:0}.slider:hover{box-shadow:0 0 .5px .5px #2dceda}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:15px;height:15px;background:#137a94;border-radius:20px;cursor:pointer}.slider::-moz-range-thumb{width:15px;height:15px;background:#137a94;border-radius:20px;cursor:pointer}.sidenav input[type=text]{background-color:var(--menue-background);border-color:#137a94;width:100%}input[type=text]:focus{outline:1px solid #1995b4}.sidenav a:hover{opacity:.9;background-color:var(--menue-option-active)}.sidenav .closebtn{position:absolute;top:0;right:10px;font-size:36px;margin-left:50px;z-index:100}.plotDiv{border-radius:5px;box-shadow:var(--content-shadow);border:var(--content-border);position:relative;background-color:var(--content-background)}.plotDiv p{position:absolute;top:5px;right:15px}#plotOptions{position:absolute;top:5px;left:15px;font-size:30px;cursor:pointer}#downloadPlot{position:absolute;left:0;color:var(--plot-option-color);text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:5px}#resetPlot{position:absolute;margin-left:30px;color:var(--plot-option-color);font-size:35px}#sizeDrag{cursor:col-resize;width:2%}#dragLineDiv{width:0;border:var(--content-border);margin-left:45%;margin-right:49%}.imgDiv{border-radius:5px;box-shadow:var(--content-shadow);border:var(--content-border);display:flex;justify-content:center;align-items:center;background-color:var(--content-background)}.alignedIMG{width:99%;height:auto}.imgDiv :is(p,h2){margin-top:0;padding-left:15px;display:inline-block;vertical-align:middle}.noImgDescr{position:relative;display:none}.traceContainerClass{float:left;padding-bottom:5px}.traceContainerClass :is(p,canvas){float:left}.traceContainerClass p{font-size:16px;padding-left:5px;padding-right:50px;color:var(--menue-option-text-color);margin-top:15px;opacity:.7}.traceContainerClass p:hover{opacity:.9}.traceContainerClass canvas{border-radius:24px;margin-bottom:15px;margin-top:5px}.traceContainerClass canvas:hover{box-shadow:0 0 3px 2px #12678f;transition:.4s}.colorwheel{border-radius:128px!important;border-color:#f1f1f1;position:relative;z-index:10;top:0;left:0} 

    +

    8 </style> 

    +

    9</head> 

    +

    10<body onresize="resizeContents()"> 

    +

    11 <div id="mySidenav" class="sidenav"> 

    +

    12 <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a> 

    +

    13 <div class="menuOption"> 

    +

    14 <a href="#" id="imgDirBtn" onclick="showInputField('imgDirDiv', 'imgDirBtn')">Image Directory</a> 

    +

    15 <div id="imgDirDiv" class="inputHidden"> 

    +

    16 <input id="imageDir" type="text" onchange="updateIMGPath(event)" 

    +

    17 placeholder="Enter path to img directory"> 

    +

    18 </div> 

    +

    19 </div> 

    +

    20 <div class="menuOption"> 

    +

    21 <a href="#" id="imgEndBtn" onclick="showInputField('imgEndDiv', 'imgEndBtn')">Image Filetype</a> 

    +

    22 <div id="imgEndDiv" class="inputHidden"> 

    +

    23 <input id="imageEnd" type="text" onchange="updateIMGEnd(event)" 

    +

    24 placeholder="Enter img type ending"> 

    +

    25 </div> 

    +

    26 </div> 

    +

    27 <div class="menuOption"> 

    +

    28 <a href="#" id="pointSliderBtn" onclick="showInputField('sliderDiv', 'pointSliderBtn')">Point Size</a> 

    +

    29 <div id="sliderDiv" class="inputHidden"><input id="slider_pt_size" type="range" class="slider"></div> 

    +

    30 </div> 

    +

    31 <div class="menuOption"> 

    +

    32 <a href="#" id="borderSliderBtn" onclick="showInputField('borderSliderDiv', 'borderSliderBtn')">Border Size</a> 

    +

    33 <div id="borderSliderDiv" class="inputHidden"><input id="slider_border_size" type="range" class="slider"></div> 

    +

    34 </div> 

    +

    35 <div class="menuOption"> 

    +

    36 <a href="#" id="traceColorBtn" onclick="showInputField('traceColorDiv', 'traceColorBtn')">Point Color</a> 

    +

    37 <div id="traceColorDiv" class="inputHidden"></div> 

    +

    38 </div> 

    +

    39 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 

    +

    40 <svg id="lassoLogo" style="position: absolute; top: 15px; left: 32px;" height="50px" preserveAspectRatio="none" data-name="Ebene 1" version="1.1" viewBox="0 0 171.61 53.835" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink"> 

    +

    41 <metadata> 

    +

    42 <rdf:RDF> 

    +

    43 <cc:Work rdf:about=""> 

    +

    44 <dc:format>image/svg+xml</dc:format> 

    +

    45 <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> 

    +

    46 <dc:title>Zeichenfläche 1</dc:title> 

    +

    47 </cc:Work> 

    +

    48 </rdf:RDF> 

    +

    49 </metadata> 

    +

    50 <defs> 

    +

    51 <style>.cls-1{fill:url(#a);}.cls-2{fill:#328ccc;}</style> 

    +

    52 <linearGradient id="a" x1="55.32" x2="149.78" y1="73.4" y2="-21.07" gradientTransform="translate(-12 -.18)" gradientUnits="userSpaceOnUse"> 

    +

    53 <stop stop-color="#006eb7" offset="0"/> 

    +

    54 <stop stop-color="#1178be" offset=".26"/> 

    +

    55 <stop stop-color="#2987c8" offset=".72"/> 

    +

    56 <stop stop-color="#328ccc" offset="1"/> 

    +

    57 </linearGradient> 

    +

    58 <linearGradient id="b" x1="55.32" x2="149.78" y1="73.4" y2="-21.07" gradientTransform="translate(-21,-9.18)" gradientUnits="userSpaceOnUse" xlink:href="#a"/> 

    +

    59 </defs> 

    +

    60 <title>Zeichenfläche 1</title> 

    +

    61 <path class="cls-1" d="m153 1h-38.39-40.2a8.5 8.5 0 1 0 0 17h4.94a7.09 7.09 0 0 1 0 14.17h-39.53a2.5 2.5 0 1 1 0-5h12a3.89 3.89 0 0 0 3.65-5.22l-6.22-17.13a5.64 5.64 0 0 0-10.62 0l-8.95 24.59a4.25 4.25 0 0 1-4 2.8h-17.62a4.25 4.25 0 0 1-4.23-4.25v-26.92h-2.83v26.92a7.08 7.08 0 0 0 7.06 7.08h17.65a7.08 7.08 0 0 0 6.64-4.66l8.95-24.64a2.82 2.82 0 0 1 5.3 0l6.23 17.26a1.07 1.07 0 0 1-1 1.43h-12a5.31 5.31 0 0 0 0 10.62h74.82a9.915 9.915 0 0 0 0-19.83h-4.94a5.67 5.67 0 1 1 0-11.34h33.93a16.92 16.92 0 1 0 9.4-2.87zm-43.33 17h4.94a7.09 7.09 0 0 1 0 14.17h-28.4a9.91 9.91 0 0 0-6.9-17h-4.9a5.67 5.67 0 1 1 0-11.34h29a8.49 8.49 0 0 0 6.29 14.17zm43.33 14.17a14.16 14.16 0 0 1-0.77-28.3h0.79a14.17 14.17 0 0 1 0 28.34z" fill="url(#b)"/> 

    +

    62 </svg> 

    +

    63 </div> 

    +

    64 <span style="font-size: 30px; cursor: pointer;" onclick="openNav()">&#9776; <span style="font-size: 25px;">Options</span> 

    +

    65 </span> 

    +

    66 <div id="content" class="navClosed"> 

    +

    67 <div id="plotDiv" class="plotDiv"> 

    +

    68 <p id="plotInfo"></p> 

    +

    69 <div id="plotOptions"> 

    +

    70 <span id="downloadPlot" onclick="downloadPlot()" title="Download Plot as png"><a>&#8595;</a></span> 

    +

    71 <span id="resetPlot" title="Reset Plot"><a onclick="resetRenderer()">&#8634;</a></span> 

    +

    72 </div> 

    +

    73 </div> 

    +

    74 <div id="sizeDrag"> 

    +

    75 <div id="dragLineDiv"></div> 

    +

    76 </div> 

    +

    77 <div id="imgDiv" class="imgDiv"> 

    +

    78 <div><p id="messageP">Hover over points to see the corresponding image </p></div> 

    +

    79 <div style="display: none;"><img id="hoverIMG" class="alignedIMG"></div> 

    +

    80 <div id="noImgDescr" class="noImgDescr"> 

    +

    81 <h2>No Image</h2> 

    +

    82 <br> 

    +

    83 <p>You can set the image directory in the options tab.</p> 

    +

    84 <p>Every image must have a number as name which corresponds to the run id.</p> 

    +

    85 </div> 

    +

    86 </div> 

    +

    87 </div> 

    +

    88""" # noqa: E501 

    +

    89 

    +

    90TRACE_STRING = """ 

    +

    91 {_traceNr_} = 

    +

    92 {{ 

    +

    93 name: '{_name_}', 

    +

    94 color: '{_color_}', 

    +

    95 border: '#555555', 

    +

    96 text: {_runIDs_}, 

    +

    97 x: {_x_}, 

    +

    98 y: {_y_}, 

    +

    99 z: {_z_}, 

    +

    100 vertices: [] 

    +

    101 }}, 

    +

    102""" 

    +

    103 

    +

    104CONST_STRING = """ 

    +

    105 {_three_min_} 

    +

    106 <script> 

    +

    107 path = "{_path_str_}" 

    +

    108 imgType = "png" 

    +

    109 const runIDs = {_runIdEntries_} 

    +

    110""" 

    +

    111 

    +

    112SCRIPT_STRING = """ 

    +

    113 const pointSlider = document.getElementById("slider_pt_size") 

    +

    114 const borderSlider = document.getElementById("slider_border_size") 

    +

    115 const plotDiv = document.getElementById("plotDiv") 

    +

    116 const imgDiv = document.getElementById("imgDiv") 

    +

    117 const drag = document.getElementById("sizeDrag") 

    +

    118 

    +

    119 let plotDivMult = 0.7 

    +

    120 let sideNavWidthMult = 0.15 

    +

    121 

    +

    122 const camera = new THREE.PerspectiveCamera(40, 2, 0.1, 10000)//(fov, aspect, near, far); 

    +

    123 const cameraStartZ = 500 

    +

    124 camera.position.z = cameraStartZ 

    +

    125 

    +

    126 const renderer = new THREE.WebGLRenderer({alpha: true, preserveDrawingBuffer: true}) 

    +

    127 

    +

    128 const scene = new THREE.Scene() 

    +

    129 const renderObjects = new THREE.Group() 

    +

    130 const centeredGroup = new THREE.Group() 

    +

    131 centeredGroup.add(renderObjects) 

    +

    132 scene.add(centeredGroup) 

    +

    133 

    +

    134 

    +

    135 

    +

    136 mouseProps = { 

    +

    137 start_x : 0, 

    +

    138 start_y : 0, 

    +

    139 is_middle_down : false, 

    +

    140 is_left_down : false, 

    +

    141 is_right_down : false, 

    +

    142 } 

    +

    143 

    +

    144 const dragFunc = (e) => { 

    +

    145 

    +

    146 let widthModi = parseFloat(document.getElementById("mySidenav").style.width) 

    +

    147 let userWidth = window.innerWidth - widthModi 

    +

    148 

    +

    149 const startWidth = parseFloat(plotDiv.style.width) 

    +

    150 document.selection ? document.selection.empty() : window.getSelection().removeAllRanges() 

    +

    151 const newPlotWidth = (e.pageX - drag.offsetWidth / 2 - widthModi) 

    +

    152 

    +

    153 const newPlotDivMult = newPlotWidth / userWidth 

    +

    154 

    +

    155 if(!(newPlotDivMult < 0.1) && !(newPlotDivMult > 0.9)) { 

    +

    156 plotDivMult = newPlotDivMult 

    +

    157 resizeContents() 

    +

    158 } 

    +

    159 } 

    +

    160 

    +

    161 function initDocument(){ 

    +

    162 pointSlider.min = 5 

    +

    163 pointSlider.max = 35 

    +

    164 pointSlider.step = 1 

    +

    165 pointSlider.value = 20 

    +

    166 

    +

    167 borderSlider.min = 1 

    +

    168 borderSlider.max = 10 

    +

    169 borderSlider.step = 1 

    +

    170 borderSlider.value = 3 

    +

    171 

    +

    172 document.getElementById("mySidenav").style.width = 0 

    +

    173 

    +

    174 const plotDivWidth = window.innerWidth * plotDivMult 

    +

    175 const imgDivWidth = window.innerWidth * (1 - plotDivMult - 0.02) 

    +

    176 

    +

    177 plotDiv.style.width = plotDivWidth 

    +

    178 imgDiv.style.width = imgDivWidth 

    +

    179 

    +

    180 plotDiv.style.height = 0.9 * window.innerHeight 

    +

    181 imgDiv.style.height = 0.9 * window.innerHeight 

    +

    182 drag.children[0].style.height = parseFloat(plotDiv.style.height) 

    +

    183 

    +

    184 renderer.setSize(plotDivWidth, Math.min(0.9*window.innerHeight, plotDivWidth), false) 

    +

    185 plotDiv.appendChild(renderer.domElement) 

    +

    186 

    +

    187 if(path !== ""){ 

    +

    188 document.getElementById("imageDir").value = path 

    +

    189 } 

    +

    190 document.getElementById("imageEnd").value = imgType 

    +

    191 

    +

    192 drag.addEventListener("mousedown", () => { 

    +

    193 document.addEventListener("mousemove", dragFunc) 

    +

    194 }) 

    +

    195 document.addEventListener("mouseup", () => { 

    +

    196 document.removeEventListener("mousemove", dragFunc) 

    +

    197 }) 

    +

    198 traceList.forEach(trace =>{ 

    +

    199 for (let n=0; n < trace.x.length; n++){ 

    +

    200 trace.vertices.push(trace.x[n], trace.y[n], trace.z[n]) 

    +

    201 } 

    +

    202 }) 

    +

    203 } 

    +

    204 

    +

    205 function resizeContents(){ 

    +

    206 const sideNav = document.getElementById("mySidenav") 

    +

    207 if(plotDiv.parentElement.className === "navOpen"){ 

    +

    208 sideNav.style.width = Math.min(250, window.innerWidth*sideNavWidthMult) + "px"; 

    +

    209 document.getElementById("lassoLogo").style.width = parseFloat(sideNav.style.width) * 0.6 - 30 

    +

    210 } 

    +

    211 

    +

    212 let sideNavWidth = parseFloat(sideNav.style.width) 

    +

    213 let userWidth = window.innerWidth - sideNavWidth 

    +

    214 let contentBound = window.innerWidth * 0.01 

    +

    215 

    +

    216 plotDiv.parentElement.style.left = sideNavWidth + contentBound 

    +

    217 plotDiv.style.width = userWidth * plotDivMult + 'px' 

    +

    218 imgDiv.style.width = userWidth * (1-plotDivMult) - 2*contentBound + 'px'; 

    +

    219 plotDiv.style.height = 0.9 * window.innerHeight 

    +

    220 imgDiv.style.height = 0.9 * window.innerHeight 

    +

    221 plotDiv.removeChild(renderer.domElement) 

    +

    222 renderer.setSize(userWidth*plotDivMult, Math.min(0.9*window.innerHeight, userWidth*plotDivMult), false) 

    +

    223 plotDiv.appendChild(renderer.domElement) 

    +

    224 drag.children[0].style.height = parseFloat(plotDiv.style.height) 

    +

    225 } 

    +

    226 

    +

    227 function openNav(){ 

    +

    228 const sideNav = document.getElementById("mySidenav") 

    +

    229 sideNav.style.boxShadow = "var(--content-shadow)" 

    +

    230 document.getElementById("content").setAttribute("class", "navOpen"); 

    +

    231 resizeContents() 

    +

    232 } 

    +

    233 function closeNav(){ 

    +

    234 const sideNav = document.getElementById("mySidenav") 

    +

    235 sideNav.style.width = "0"; 

    +

    236 sideNav.style.boxShadow = "" 

    +

    237 document.getElementById("content").setAttribute("class", "navClosed"); 

    +

    238 hideAll(); 

    +

    239 resizeContents(); 

    +

    240 } 

    +

    241 

    +

    242 function showInputField(div, aClicked){ 

    +

    243 hideAll() 

    +

    244 document.getElementById(div).setAttribute("class", "inputSelected") 

    +

    245 document.getElementById(aClicked).setAttribute("onclick", `hideInputField('${div}', '${aClicked}')`) 

    +

    246 document.getElementById(aClicked).style.background = "var(--menue-option-active)" 

    +

    247 } 

    +

    248 

    +

    249 function hideInputField(div, aClicked){ 

    +

    250 document.getElementById(div).setAttribute("class", "inputHidden") 

    +

    251 document.getElementById(aClicked).setAttribute("onclick", `showInputField('${div}', '${aClicked}')`) 

    +

    252 document.getElementById(aClicked).style.background = "var(--menue-option-background)" 

    +

    253 } 

    +

    254 

    +

    255 function hideAll(){ 

    +

    256 document.getElementById("sliderDiv").setAttribute('class', 'inputHidden') 

    +

    257 document.getElementById("imgDirDiv").setAttribute('class', 'inputHidden') 

    +

    258 document.getElementById("imgEndDiv").setAttribute('class', 'inputHidden') 

    +

    259 document.getElementById("traceColorDiv").setAttribute('class', 'inputHidden') 

    +

    260 document.getElementById("borderSliderDiv").setAttribute('class', 'inputHidden') 

    +

    261 document.getElementById("pointSliderBtn").setAttribute("onclick", "showInputField('sliderDiv', 'pointSliderBtn')") 

    +

    262 document.getElementById("imgDirBtn").setAttribute("onclick", "showInputField('imgDirDiv', 'imgDirBtn')") 

    +

    263 document.getElementById("imgEndBtn").setAttribute("onclick", "showInputField('imgEndDiv', 'imgEndBtn')") 

    +

    264 document.getElementById("traceColorBtn").setAttribute("onclick", "showInputField('traceColorDiv', 'traceColorBtn')") 

    +

    265 document.getElementById("borderSliderBtn").setAttribute("onclick", "showInputField('borderSliderDiv','borderSliderBtn')") 

    +

    266 Array.from(document.getElementById("mySidenav").children).forEach(node => { 

    +

    267 if(node.childElementCount > 0){ 

    +

    268 node.children[0].style.background = "var(--menue-option-background)" 

    +

    269 } 

    +

    270 }) 

    +

    271 } 

    +

    272 

    +

    273 let mouseDownInWheel = false 

    +

    274 let colorWheelActive = false 

    +

    275 

    +

    276 document.addEventListener('mousedown', function(event){ 

    +

    277 if (!(event.target.id.slice(0, 5) === "color")){ 

    +

    278 if(colorWheelActive){ 

    +

    279 document.getElementById("colorwheel").remove() 

    +

    280 colorWheelActive = false 

    +

    281 } 

    +

    282 } 

    +

    283 }) 

    +

    284 

    +

    285 function openWheel(event){ 

    +

    286 if(colorWheelActive){ 

    +

    287 document.getElementById("colorwheel").remove() 

    +

    288 } 

    +

    289 const traceId = parseInt(event.target.id.slice(-1)) 

    +

    290 const wheel = makeWheel(128) 

    +

    291 wheel.className = "colorwheel" 

    +

    292 wheel.id = "colorwheel" 

    +

    293 wheel.addEventListener('mousedown', function(event){ 

    +

    294 mouseDownInWheel = true 

    +

    295 let wheelCanvas = this 

    +

    296 updateMarkerColor(event, wheelCanvas) 

    +

    297 }) 

    +

    298 wheel.addEventListener('mousemove', function(event){ 

    +

    299 let wheelCanvas = this 

    +

    300 updateMarkerColor(event, wheelCanvas) 

    +

    301 }) 

    +

    302 wheel.addEventListener('mouseup', removeColorWheel) 

    +

    303 wheel.addEventListener('mouseout', removeColorWheel) 

    +

    304 event.target.parentElement.appendChild(wheel) 

    +

    305 colorWheelActive = true 

    +

    306 } 

    +

    307 

    +

    308 function updateMarkerColor(event, wheelCanvas){ 

    +

    309 if (mouseDownInWheel) { 

    +

    310 let traceID = parseInt(event.target.parentElement.id.slice(-1)) ? parseInt(event.target.parentElement.id.slice(-1)) : 0 

    +

    311 console.log(traceID) 

    +

    312 let targetTrace = traceList[traceID] 

    +

    313 let wheelCtx = wheelCanvas.getContext('2d') 

    +

    314 let data = wheelCtx.getImageData(event.offsetX, event.offsetY, 1, 1).data 

    +

    315 let rgba = 'rgba(' + data[0] + ',' + data[1] + 

    +

    316 ',' + data[2] + ',' + (data[3] / 255) + ')' 

    +

    317 targetTrace.color = rgba 

    +

    318 const markerSize = document.getElementById("slider_pt_size").value 

    +

    319 const borderSize = document.getElementById("slider_border_size").value 

    +

    320 // renderObjects.children = [] 

    +

    321 const targetCanvas = event.target.parentElement.children[0] 

    +

    322 createMarker(16, 3, rgba, targetTrace.border, targetCanvas) 

    +

    323 // traceList.forEach(trace => { 

    +

    324 // addPoints(trace, markerSize, borderSize) 

    +

    325 // }) 

    +

    326 const newTexture = createMarker(markerSize, borderSize, rgba, targetTrace.border,document.createElement("canvas")) 

    +

    327 renderObjects.children[traceID].material.map.image = newTexture 

    +

    328 renderObjects.children[traceID].material.map.needsUpdate = true 

    +

    329 

    +

    330 

    +

    331 } 

    +

    332 } 

    +

    333 

    +

    334 function removeColorWheel(event){ 

    +

    335 if(mouseDownInWheel){ 

    +

    336 mouseDownInWheel = false 

    +

    337 let wheelCanvas = this 

    +

    338 this.remove() 

    +

    339 colorWheelActive = false 

    +

    340 } 

    +

    341 } 

    +

    342 

    +

    343 function updateIMGPath(){ 

    +

    344 path = document.getElementById("imageDir").value 

    +

    345 } 

    +

    346 

    +

    347 function updateIMGEnd(){ 

    +

    348 imgType = document.getElementById("imageEnd").value 

    +

    349 } 

    +

    350 

    +

    351 function createMarker(radius, boundary, color, border, canv){ 

    +

    352 

    +

    353 const ctx = canv.getContext('2d') 

    +

    354 ctx.canvas.height = radius * 2 + 10 

    +

    355 ctx.canvas.width = radius * 2 + 10 

    +

    356 ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height) 

    +

    357 ctx.beginPath(); 

    +

    358 ctx.arc(ctx.canvas.width / 2, ctx.canvas.height / 2, radius, 0, Math.PI * 2) 

    +

    359 ctx.fillStyle = color 

    +

    360 ctx.fill() 

    +

    361 ctx.beginPath(); 

    +

    362 ctx.arc(ctx.canvas.width / 2, ctx.canvas.height / 2, radius, 0, Math.PI * 2) 

    +

    363 ctx.strokeStyle = border 

    +

    364 ctx.lineWidth = boundary 

    +

    365 ctx.stroke() 

    +

    366 

    +

    367 return ctx.canvas 

    +

    368 } 

    +

    369 

    +

    370 function createHoverPoint(point, color) { 

    +

    371 const radius = parseFloat(document.getElementById("slider_pt_size").value)+1 

    +

    372 const outerRadius = radius+1+Math.floor(2*radius/3) 

    +

    373 vertices=[] 

    +

    374 vertices.push(point.x, point.y, point.z) 

    +

    375 

    +

    376 var geometry = new THREE.BufferGeometry() 

    +

    377 

    +

    378 const canv = document.createElement("canvas") 

    +

    379 canv.width = 2 * outerRadius 

    +

    380 canv.height = 2 * outerRadius 

    +

    381 const ctx = canv.getContext('2d') 

    +

    382 const grd = ctx.createRadialGradient(canv.width/2, canv.height/2, 0.5 * radius, canv.width/2, canv.height/2, outerRadius) 

    +

    383 grd.addColorStop(0, color) 

    +

    384 grd.addColorStop(1, "transparent") 

    +

    385 ctx.fillStyle = grd 

    +

    386 ctx.fillRect(0, 0, 2*(outerRadius)+10, 2*(outerRadius)+10) 

    +

    387 

    +

    388 const texture = new THREE.CanvasTexture(ctx.canvas) 

    +

    389 geometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3)) 

    +

    390 material = new THREE.PointsMaterial({size: outerRadius, sizeAttenuation: false, map: texture, alphaTest: 0.5, transparent: true}) 

    +

    391 var particle = new THREE.Points(geometry, material) 

    +

    392 return particle 

    +

    393 } 

    +

    394 

    +

    395 function addPoints(trace, radius, boundary){ 

    +

    396 

    +

    397 var geometry = new THREE.BufferGeometry(); 

    +

    398 

    +

    399 const newCanv = document.createElement("canvas") 

    +

    400 const texture = new THREE.CanvasTexture(createMarker(radius, boundary, trace.color, trace.border, newCanv)) 

    +

    401 

    +

    402 geometry.setAttribute('position', new THREE.Float32BufferAttribute(trace.vertices, 3)) 

    +

    403 material = new THREE.PointsMaterial({ size: radius, sizeAttenuation: false, map: texture, alphaTest: 0.5, transparent: true }) 

    +

    404 var particles = new THREE.Points(geometry, material) 

    +

    405 particles.name = trace.name 

    +

    406 renderObjects.add(particles) 

    +

    407 renderer.render(scene, camera) 

    +

    408 } 

    +

    409 

    +

    410 

    +

    411 let hsv2rgb = function(hsv) { 

    +

    412 let h = hsv.hue, s = hsv.sat, v = hsv.val; 

    +

    413 let rgb, i, data = []; 

    +

    414 if (s === 0) { 

    +

    415 rgb = [v,v,v]; 

    +

    416 } else { 

    +

    417 h = h / 60; 

    +

    418 i = Math.floor(h); 

    +

    419 data = [v*(1-s), v*(1-s*(h-i)), v*(1-s*(1-(h-i)))]; 

    +

    420 switch(i) { 

    +

    421 case 0: 

    +

    422 rgb = [v, data[2], data[0]]; 

    +

    423 break; 

    +

    424 case 1: 

    +

    425 rgb = [data[1], v, data[0]]; 

    +

    426 break; 

    +

    427 case 2: 

    +

    428 rgb = [data[0], v, data[2]]; 

    +

    429 break; 

    +

    430 case 3: 

    +

    431 rgb = [data[0], data[1], v]; 

    +

    432 break; 

    +

    433 case 4: 

    +

    434 rgb = [data[2], data[0], v]; 

    +

    435 break; 

    +

    436 default: 

    +

    437 rgb = [v, data[0], data[1]]; 

    +

    438 break; 

    +

    439 } 

    +

    440 } 

    +

    441 return rgb; 

    +

    442 }; 

    +

    443 

    +

    444 function clamp(min, max, val) 

    +

    445 { 

    +

    446 if (val < min) return min; 

    +

    447 if (val > max) return max; 

    +

    448 return val; 

    +

    449 } 

    +

    450 

    +

    451 function makeWheel(diameter) 

    +

    452 { 

    +

    453 let can = document.createElement('canvas'); 

    +

    454 let ctx = can.getContext('2d'); 

    +

    455 const divisor = 1.8 // how "zoomed in" the colorwheel is 

    +

    456 can.width = diameter; 

    +

    457 can.height = diameter; 

    +

    458 let imgData = ctx.getImageData(0,0,diameter,diameter); 

    +

    459 let maxRange = diameter / divisor; 

    +

    460 for (let y=0; y<diameter; y++) { 

    +

    461 for (let x=0; x<diameter; x++) { 

    +

    462 let xPos = x - (diameter/2); 

    +

    463 let yPos = (diameter-y) - (diameter/2); 

    +

    464 

    +

    465 let polar = pos2polar( {x:xPos, y:yPos} ); 

    +

    466 let sat = clamp(0,1,polar.len / ((maxRange/2))); 

    +

    467 let val = clamp(0,1, (maxRange-polar.len) / (maxRange/2) ); 

    +

    468 

    +

    469 let rgb = hsv2rgb( {hue:polar.ang, sat:sat, val:val} ); 

    +

    470 

    +

    471 let index = 4 * (x + y*diameter); 

    +

    472 imgData.data[index + 0] = rgb[0]*255; 

    +

    473 imgData.data[index + 1] = rgb[1]*255; 

    +

    474 imgData.data[index + 2] = rgb[2]*255; 

    +

    475 imgData.data[index + 3] = 255; 

    +

    476 } 

    +

    477 } 

    +

    478 ctx.putImageData(imgData, 0,0); 

    +

    479 return can; 

    +

    480 } 

    +

    481 

    +

    482 function rad2deg(rad) 

    +

    483 { 

    +

    484 return (rad / (Math.PI * 2)) * 360; 

    +

    485 } 

    +

    486 

    +

    487 function pos2polar(inPos) 

    +

    488 { 

    +

    489 let vecLen = Math.sqrt( inPos.x*inPos.x + inPos.y*inPos.y ); 

    +

    490 let something = Math.atan2(inPos.y,inPos.x); 

    +

    491 while (something < 0) 

    +

    492 something += 2*Math.PI; 

    +

    493 

    +

    494 return { ang: rad2deg(something), len: vecLen }; 

    +

    495 } 

    +

    496 

    +

    497 function downloadPlot(){ 

    +

    498 let downloadLink = document.createElement('a'); 

    +

    499 downloadLink.setAttribute('download', 'PointEmbedding.png'); 

    +

    500 let canvas = renderer.domElement; 

    +

    501 let dataURL = canvas.toDataURL('image/png'); 

    +

    502 let url = dataURL.replace(/^data:image\\/png/,'data:application/octet-stream'); 

    +

    503 downloadLink.setAttribute('href',url); 

    +

    504 downloadLink.click(); 

    +

    505 } 

    +

    506 

    +

    507 initDocument() 

    +

    508 

    +

    509 traceList.forEach(trace =>{ 

    +

    510 const traceDiv = document.getElementById('traceColorDiv') 

    +

    511 const borderDiv = document.getElementById('borderColorDiv') 

    +

    512 const traceContainDiv = document.createElement('div') 

    +

    513 const traceMarkCanvas = createMarker(16, 3, trace.color, trace.border, document.createElement("canvas")) 

    +

    514 const borderContainDiv = document.createElement('div') 

    +

    515 const borderMarkCanvas = createMarker(16, 3, trace.color, trace.border, document.createElement("canvas")) 

    +

    516 const traceMarkName = document.createElement('p') 

    +

    517 traceMarkName.innerHTML = trace.name 

    +

    518 traceContainDiv.id = "contain" + trace.name 

    +

    519 traceMarkCanvas.id = "color" + trace.name 

    +

    520 traceMarkCanvas.addEventListener('mousedown', openWheel) 

    +

    521 traceDiv.appendChild(traceContainDiv) 

    +

    522 traceContainDiv.appendChild(traceMarkCanvas) 

    +

    523 traceContainDiv.appendChild(traceMarkName) 

    +

    524 traceContainDiv.setAttribute("class", "traceContainerClass") 

    +

    525 

    +

    526 addPoints(trace, pointSlider.value, borderSlider.value) 

    +

    527 }) 

    +

    528 

    +

    529 const box = new THREE.BoxHelper(renderObjects) 

    +

    530 

    +

    531 function moveObjectsToBoundingBoxCenter(box) { 

    +

    532 

    +

    533 const positions = box.geometry.attributes.position.array 

    +

    534 let xValue = 0 

    +

    535 let yValue = 0 

    +

    536 let zValue = 0 

    +

    537 positions.forEach((pos, ind) => { 

    +

    538 switch(ind%3){ 

    +

    539 case 0: 

    +

    540 xValue += pos 

    +

    541 break; 

    +

    542 case 1: 

    +

    543 yValue += pos 

    +

    544 break; 

    +

    545 case 2: 

    +

    546 zValue += pos 

    +

    547 } 

    +

    548 }) 

    +

    549 renderObjects.translateX(xValue/-8) 

    +

    550 renderObjects.translateY(yValue/-8) 

    +

    551 renderObjects.translateZ(zValue/-8) 

    +

    552 

    +

    553 } 

    +

    554 

    +

    555 moveObjectsToBoundingBoxCenter(box) 

    +

    556 

    +

    557 pointSlider.oninput = event => { 

    +

    558 const marker_size = parseFloat(event.target.value) 

    +

    559 renderObjects.children = [] 

    +

    560 traceList.forEach(trace =>{ 

    +

    561 addPoints(trace, marker_size, borderSlider.value) 

    +

    562 }) 

    +

    563 } 

    +

    564 

    +

    565 borderSlider.oninput = event => { 

    +

    566 const marker_border = parseFloat(event.target.value) 

    +

    567 renderObjects.children = [] 

    +

    568 traceList.forEach(trace => { 

    +

    569 addPoints(trace, pointSlider.value, marker_border) 

    +

    570 }) 

    +

    571 } 

    +

    572 

    +

    573 class PickHelper { 

    +

    574 constructor() { 

    +

    575 this.hitIndex = null 

    +

    576 this.pickedObject = null 

    +

    577 } 

    +

    578 pick(normalizedPosition, scene, camera) { 

    +

    579 

    +

    580 // pick depending on point size and scale 

    +

    581 const hitRadius = parseFloat(document.getElementById("slider_pt_size").value) * 0.3 / centeredGroup.scale.x 

    +

    582 const raycaster = new THREE.Raycaster() 

    +

    583 raycaster.params.Points.threshold = hitRadius 

    +

    584 raycaster.setFromCamera(normalizedPosition, camera) 

    +

    585 // get the list of objects the ray intersected 

    +

    586 const intersectedObjects = raycaster.intersectObjects(renderObjects.children) 

    +

    587 

    +

    588 if (intersectedObjects.length) { 

    +

    589 // we pick the first object, as it is the closest 

    +

    590 this.hitIndex = intersectedObjects[0].index 

    +

    591 this.pickedObject = intersectedObjects[0].object 

    +

    592 } else { 

    +

    593 this.hitIndex = null 

    +

    594 this.pickedObject = null 

    +

    595 } 

    +

    596 } 

    +

    597 } 

    +

    598 const pickPosition = {x: 0, y: 0}; 

    +

    599 const pickHelper = new PickHelper(); 

    +

    600 clearPickPosition(); 

    +

    601 

    +

    602 function getCanvasRelativePosition(event) { 

    +

    603 const rect = renderer.domElement.getBoundingClientRect(); 

    +

    604 return { 

    +

    605 x: (event.clientX - rect.left) * renderer.domElement.width / rect.width, 

    +

    606 y: (event.clientY - rect.top ) * renderer.domElement.height / rect.height, 

    +

    607 }; 

    +

    608 } 

    +

    609 function setPickPosition(event) { 

    +

    610 const pos = getCanvasRelativePosition(event); 

    +

    611 pickPosition.x = (pos.x / renderer.domElement.width ) * 2 - 1; 

    +

    612 pickPosition.y = (pos.y / renderer.domElement.height) * -2 + 1; 

    +

    613 } 

    +

    614 

    +

    615 function imageExists(imgPath){ 

    +

    616 let http = new XMLHttpRequest() 

    +

    617 http.open("HEAD", imgPath, false) 

    +

    618 http.send() 

    +

    619 return http.status != 404; 

    +

    620 } 

    +

    621 

    +

    622 const hoverPointInfo = { 

    +

    623 hoverPointSet: false, 

    +

    624 currentTraceIndex: null, 

    +

    625 currentPointIndex: null 

    +

    626 } 

    +

    627 

    +

    628 function resetHoverPointInfo(){ 

    +

    629 hoverPointInfo.hoverPointSet = false, 

    +

    630 hoverPointInfo.currentTraceIndex = null, 

    +

    631 hoverPointInfo.currentPointIndex = null 

    +

    632 } 

    +

    633 

    +

    634 function checkForImageUpdate(){ 

    +

    635 if(pickHelper.pickedObject){ 

    +

    636 // first we select the trace 

    +

    637 let traceIndex 

    +

    638 let validTraceIndex = false 

    +

    639 for(let i = 0; i<traceList.length; i++){ 

    +

    640 if (traceList[i].name === pickHelper.pickedObject.name){ 

    +

    641 traceIndex = i 

    +

    642 i = traceList.length 

    +

    643 validTraceIndex = true 

    +

    644 } 

    +

    645 } 

    +

    646 if(validTraceIndex){ 

    +

    647 document.getElementById("messageP").parentElement.setAttribute("style" , "display:none") 

    +

    648 

    +

    649 const runID = runIDs[traceIndex][pickHelper.hitIndex] 

    +

    650 const img = document.getElementById("hoverIMG") 

    +

    651 img.onerror = function() { 

    +

    652 document.getElementById("noImgDescr").style.display = "block" 

    +

    653 img.parentElement.style.display = "none" 

    +

    654 } 

    +

    655 img.onload = function() { 

    +

    656 document.getElementById("noImgDescr").style.display = "none" 

    +

    657 img.parentElement.style.display = "block" 

    +

    658 } 

    +

    659 img.src = path+`/${runID}.`+imgType 

    +

    660 let infoP = document.getElementById("plotInfo") 

    +

    661 infoP.innerHTML = `${traceList[traceIndex].text[pickHelper.hitIndex]}` 

    +

    662 

    +

    663 if(!hoverPointInfo.hoverPointSet || (hoverPointInfo.currentTraceIndex != traceIndex) || (hoverPointInfo.currentPointIndex != pickHelper.hitIndex)){ 

    +

    664 if(hoverPointInfo.hoverPointSet){ 

    +

    665 renderObjects.children.pop() 

    +

    666 } 

    +

    667 renderObjects.add(createHoverPoint({ 

    +

    668 x: traceList[traceIndex].x[pickHelper.hitIndex], 

    +

    669 y: traceList[traceIndex].y[pickHelper.hitIndex], 

    +

    670 z: traceList[traceIndex].z[pickHelper.hitIndex], 

    +

    671 }, traceList[traceIndex].color)) 

    +

    672 hoverPointInfo.hoverPointSet = true 

    +

    673 hoverPointInfo.currentTraceIndex = traceIndex 

    +

    674 hoverPointInfo.currentPointIndex = pickHelper.hitIndex 

    +

    675 } 

    +

    676 } 

    +

    677 } else if(hoverPointInfo.hoverPointSet){ 

    +

    678 renderObjects.children.pop() 

    +

    679 resetHoverPointInfo() 

    +

    680 } 

    +

    681 } 

    +

    682 

    +

    683 function clearPickPosition() { 

    +

    684 pickPosition.x = -100000; 

    +

    685 pickPosition.y = -100000; 

    +

    686 } 

    +

    687 

    +

    688 function initMouseProps(event) { 

    +

    689 mouseProps.start_x = event.offsetX 

    +

    690 mouseProps.start_y = event.offsetY 

    +

    691 } 

    +

    692 

    +

    693 function mouseClickSelector(event) { 

    +

    694 event.preventDefault() 

    +

    695 if(event.button === 0){ 

    +

    696 mouseProps.is_left_down = true 

    +

    697 initMouseProps(event) 

    +

    698 } else if(event.button === 1){ 

    +

    699 mouseProps.is_middle_down = true 

    +

    700 initMouseProps(event) 

    +

    701 } else if(event.button === 2){ 

    +

    702 mouseProps.is_right_down = true 

    +

    703 initMouseProps(event) 

    +

    704 } 

    +

    705 } 

    +

    706 

    +

    707 function toRadians(angle) { 

    +

    708 return angle * (Math.PI / 180); 

    +

    709 } 

    +

    710 

    +

    711 function dragMouse(e) { 

    +

    712 

    +

    713 let delta_x = e.offsetX - mouseProps.start_x 

    +

    714 let delta_y = e.offsetY - mouseProps.start_y 

    +

    715 mouseProps.start_x = e.offsetX 

    +

    716 mouseProps.start_y = e.offsetY 

    +

    717 

    +

    718 if(mouseProps.is_left_down){ 

    +

    719 // here we rotate around x and y axis 

    +

    720 

    +

    721 var deltaQuaternion = new THREE.Quaternion().setFromEuler( 

    +

    722 new THREE.Euler( toRadians(delta_y), toRadians(delta_x), 0, 'XYZ') 

    +

    723 ) 

    +

    724 centeredGroup.quaternion.multiplyQuaternions(deltaQuaternion, centeredGroup.quaternion) 

    +

    725 

    +

    726 } else if (mouseProps.is_middle_down) { 

    +

    727 // here we rotate around z axis 

    +

    728 

    +

    729 const normPos = getCanvasRelativePosition(event) 

    +

    730 if(normPos.x > parseFloat(plotDiv.style.width) / 2){ 

    +

    731 delta_y *= -1 

    +

    732 } 

    +

    733 if(normPos.y < parseFloat(plotDiv.style.height)/2){ 

    +

    734 delta_x *= -1 

    +

    735 } 

    +

    736 let rotationRate = (delta_x + delta_y) 

    +

    737 

    +

    738 var deltaQuaternion = new THREE.Quaternion().setFromEuler( 

    +

    739 new THREE.Euler( 0, 0, toRadians(rotationRate), 'XYZ') 

    +

    740 ) 

    +

    741 centeredGroup.quaternion.multiplyQuaternions(deltaQuaternion, centeredGroup.quaternion) 

    +

    742 

    +

    743 } else if (mouseProps.is_right_down) { 

    +

    744 centeredGroup.position.x += delta_x 

    +

    745 centeredGroup.position.y -= delta_y 

    +

    746 } 

    +

    747 } 

    +

    748 

    +

    749 function mouseUpHandler(event) { 

    +

    750 if(event.button === 0){ 

    +

    751 mouseProps.is_left_down = false 

    +

    752 } else if(event.button === 1){ 

    +

    753 mouseProps.is_middle_down = false 

    +

    754 } else if(event.button === 2){ 

    +

    755 mouseProps.is_right_down = false 

    +

    756 } 

    +

    757 } 

    +

    758 

    +

    759 

    +

    760 function onMouseScroll(event) { 

    +

    761 event.preventDefault() 

    +

    762 let deltaY = event.deltaY 

    +

    763 let dirMult = 1 

    +

    764 

    +

    765 if(deltaY < 0){ 

    +

    766 deltaY *= -1 

    +

    767 dirMult = -1 

    +

    768 } 

    +

    769 

    +

    770 const newScale = 0.1 * centeredGroup.scale.x * Math.exp(3/-10) 

    +

    771 centeredGroup.scale.addScalar((newScale * dirMult)) 

    +

    772 } 

    +

    773 

    +

    774 function resetMouseProps(event) { 

    +

    775 mouseProps.is_left_down = false 

    +

    776 mouseProps.is_middle_down = false 

    +

    777 mouseProps.is_right_down = false 

    +

    778 } 

    +

    779 

    +

    780 function resetRenderer() { 

    +

    781 centeredGroup.quaternion.set(0, 0, 0, 1) 

    +

    782 centeredGroup.scale.set(1, 1, 1) 

    +

    783 centeredGroup.position.set(0, 0, 0) 

    +

    784 } 

    +

    785 

    +

    786 // events for hover image display 

    +

    787 renderer.domElement.addEventListener('mousemove', setPickPosition); 

    +

    788 renderer.domElement.addEventListener('mouseout', clearPickPosition); 

    +

    789 renderer.domElement.addEventListener('mouseleave', clearPickPosition); 

    +

    790 

    +

    791 //events for screen movement 

    +

    792 plotDiv.addEventListener('mousemove', dragMouse) 

    +

    793 plotDiv.addEventListener('mousedown', mouseClickSelector) 

    +

    794 plotDiv.addEventListener('mouseup', mouseUpHandler) 

    +

    795 plotDiv.addEventListener('wheel', onMouseScroll) 

    +

    796 plotDiv.addEventListener('contextmenu', function(event){ 

    +

    797 event.preventDefault() 

    +

    798 }) 

    +

    799 plotDiv.addEventListener('mouseout', resetMouseProps) 

    +

    800 

    +

    801 window.onresize = () => { 

    +

    802 resizeContents() 

    +

    803 } 

    +

    804 

    +

    805 function action(time){ 

    +

    806 

    +

    807 renderer.render(scene, camera) 

    +

    808 

    +

    809 requestAnimationFrame(action) 

    +

    810 pickHelper.pick(pickPosition, scene, camera); 

    +

    811 checkForImageUpdate() 

    +

    812 } 

    +

    813 

    +

    814 requestAnimationFrame(action) 

    +

    815 </script> 

    +

    816</body> 

    +

    817</html> 

    +

    818""" # noqa: E501 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_keyword_types_py.html b/coverage/d_ec83283597faf9de_keyword_types_py.html new file mode 100644 index 0000000..f3e0bfb --- /dev/null +++ b/coverage/d_ec83283597faf9de_keyword_types_py.html @@ -0,0 +1,157 @@ + + + + + Coverage for lasso/dimred/svd/keyword_types.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/keyword_types.py: + 100% +

    + +

    + 16 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import typing 

    +

    2 

    +

    3 

    +

    4class ClusterType: 

    +

    5 """Specifies names of specific clustering algorithms 

    +

    6 

    +

    7 Attributes 

    +

    8 ---------- 

    +

    9 OPTICS: str 

    +

    10 OPTICS 

    +

    11 DBSCAN: str 

    +

    12 DBSCAN 

    +

    13 KMeans: str 

    +

    14 KMeans 

    +

    15 SpectralClustering: str 

    +

    16 SpectralClustering 

    +

    17 """ 

    +

    18 

    +

    19 OPTICS = "OPTICS" 

    +

    20 DBSCAN = "DBSCAN" 

    +

    21 KMeans = "KMeans" 

    +

    22 SpectralClustering = "SpectralClustering" 

    +

    23 

    +

    24 @staticmethod 

    +

    25 def get_cluster_type_name() -> typing.List[str]: 

    +

    26 """Get the name of the clustering algorithms""" 

    +

    27 return [ 

    +

    28 ClusterType.OPTICS, 

    +

    29 ClusterType.DBSCAN, 

    +

    30 ClusterType.KMeans, 

    +

    31 ClusterType.SpectralClustering, 

    +

    32 ] 

    +

    33 

    +

    34 

    +

    35class DetectorType: 

    +

    36 """Specifies names of different outlier detector algorythms 

    +

    37 

    +

    38 Attributes 

    +

    39 ---------- 

    +

    40 IsolationForest: str 

    +

    41 IsolationForest 

    +

    42 OneClassSVM: str 

    +

    43 OneClassSVM 

    +

    44 LocalOutlierFactor: str 

    +

    45 LocalOutlierFactor 

    +

    46 """ 

    +

    47 

    +

    48 IsolationForest = "IsolationForest" 

    +

    49 OneClassSVM = "OneClassSVM" 

    +

    50 LocalOutlierFactor = "LocalOutlierFactor" 

    +

    51 # Experimental = "Experimental" 

    +

    52 

    +

    53 @staticmethod 

    +

    54 def get_detector_type_name() -> typing.List[str]: 

    +

    55 """Get the name of the detector algorithms""" 

    +

    56 return [ 

    +

    57 DetectorType.IsolationForest, 

    +

    58 DetectorType.OneClassSVM, 

    +

    59 DetectorType.LocalOutlierFactor, 

    +

    60 ] 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_plot_beta_clusters_py.html b/coverage/d_ec83283597faf9de_plot_beta_clusters_py.html new file mode 100644 index 0000000..fc83da0 --- /dev/null +++ b/coverage/d_ec83283597faf9de_plot_beta_clusters_py.html @@ -0,0 +1,269 @@ + + + + + Coverage for lasso/dimred/svd/plot_beta_clusters.py: 66% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/plot_beta_clusters.py: + 66% +

    + +

    + 65 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 19:49 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import re 

    +

    3import time 

    +

    4import webbrowser 

    +

    5from typing import Sequence, Union 

    +

    6 

    +

    7import numpy as np 

    +

    8 

    +

    9from lasso.dimred.svd.html_str_eles import ( 

    +

    10 CONST_STRING, 

    +

    11 OVERHEAD_STRING, 

    +

    12 SCRIPT_STRING, 

    +

    13 TRACE_STRING, 

    +

    14) 

    +

    15from lasso.plotting.plot_shell_mesh import _read_file 

    +

    16 

    +

    17 

    +

    18def timestamp() -> str: 

    +

    19 """ 

    +

    20 Creates a timestamp string of format yymmdd_hhmmss_ 

    +

    21 """ 

    +

    22 

    +

    23 def add_zero(in_str) -> str: 

    +

    24 if len(in_str) == 1: 

    +

    25 return "0" + in_str 

    +

    26 return in_str 

    +

    27 

    +

    28 year, month, day, hour, minute, second, _, _, _ = time.localtime() 

    +

    29 y_str = str(year)[2:] 

    +

    30 mo_str = add_zero(str(month)) 

    +

    31 d_str = add_zero(str(day)) 

    +

    32 h_str = add_zero(str(hour)) 

    +

    33 mi_str = add_zero(str(minute)) 

    +

    34 s_str = add_zero(str(second)) 

    +

    35 t_str = y_str + mo_str + d_str + "_" + h_str + mi_str + s_str + "_" 

    +

    36 return t_str 

    +

    37 

    +

    38 

    +

    39# pylint: disable = inconsistent-return-statements 

    +

    40def plot_clusters_js( 

    +

    41 beta_cluster: Sequence, 

    +

    42 id_cluster: Union[np.ndarray, Sequence], 

    +

    43 save_path: str, 

    +

    44 img_path: Union[None, str] = None, 

    +

    45 mark_outliers: bool = False, 

    +

    46 mark_timestamp: bool = True, 

    +

    47 filename: str = "3d_beta_plot", 

    +

    48 write: bool = True, 

    +

    49 show_res: bool = True, 

    +

    50) -> Union[None, str]: 

    +

    51 """ 

    +

    52 Creates a .html visualization of input data 

    +

    53 

    +

    54 Parameters 

    +

    55 ---------- 

    +

    56 beta_cluster: np.ndarray 

    +

    57 Numpy array containing beta clusters 

    +

    58 id_cluster: Union[np.ndarray, Sequence] 

    +

    59 Numpy array or sequence containing the ids samples in clusters. 

    +

    60 Must be of same structure as beta_clusters 

    +

    61 save_path: str 

    +

    62 Where to save the .html visualization 

    +

    63 img_path: Union[None, str], default: None 

    +

    64 Path to images of samples 

    +

    65 mark_outliers: bool, default: False 

    +

    66 Set to True if first entry in beta_cluster are outliers 

    +

    67 mark_timestamp: bool, default: True 

    +

    68 Set to True if name of visualization shall contain time of creation. 

    +

    69 If set to False, visualization will override previous file 

    +

    70 filename: str, default "3d_beta_plot" 

    +

    71 Name of .hmtl file 

    +

    72 write: bool, default: True 

    +

    73 Set to False to not write .html file and return as string instead 

    +

    74 show_res: bool, default: True 

    +

    75 Set to False to not open resulting page in webbrowser 

    +

    76 

    +

    77 Returns 

    +

    78 ------- 

    +

    79 html_str_formatted: str 

    +

    80 If **write=False** returns .hmtl file as string, else None 

    +

    81 """ 

    +

    82 

    +

    83 # pylint: disable = too-many-arguments, too-many-locals 

    +

    84 

    +

    85 if not isinstance(img_path, str): 

    +

    86 img_path = "" 

    +

    87 

    +

    88 colorlist = [ 

    +

    89 "#1f77b4", 

    +

    90 "#ff7f0e", 

    +

    91 "#2ca02c", 

    +

    92 "#d62728", 

    +

    93 "#9467bd", 

    +

    94 "#8c564b", 

    +

    95 "#e377c2", 

    +

    96 "#7f7f7f", 

    +

    97 "#bcbd22", 

    +

    98 "#17becf", 

    +

    99 ] 

    +

    100 tracelist = [] 

    +

    101 

    +

    102 # rescaling betas to better fit in viz 

    +

    103 scale_multiplier = 300 

    +

    104 max_val = ( 

    +

    105 max(*[max(np.max(cluster), abs(np.min(cluster))) for cluster in beta_cluster]) 

    +

    106 if len(beta_cluster) > 1 

    +

    107 else max(np.max(beta_cluster[0]), abs(np.min(beta_cluster[0]))) 

    +

    108 ) 

    +

    109 

    +

    110 beta_cluster = [cluster / max_val * scale_multiplier for cluster in beta_cluster] 

    +

    111 

    +

    112 id_nr = [] 

    +

    113 for group in id_cluster: 

    +

    114 id_group = [] 

    +

    115 for entry in group: 

    +

    116 nr = re.findall(r"\d+", entry)[0] 

    +

    117 id_group.append(nr) 

    +

    118 id_nr.append(id_group) 

    +

    119 

    +

    120 # pylint: disable = consider-using-f-string 

    +

    121 _three_min_ = '<script type="text/javascript">%s</script>' % _read_file( 

    +

    122 os.path.join( 

    +

    123 # move path to "~/lasso/" 

    +

    124 os.path.split(os.path.split(os.path.dirname(__file__))[0])[0], 

    +

    125 "plotting/resources/three_latest.min.js", 

    +

    126 ) 

    +

    127 ) 

    +

    128 

    +

    129 html_str_formatted = OVERHEAD_STRING + CONST_STRING.format( 

    +

    130 _three_min_=_three_min_, _path_str_=img_path, _runIdEntries_=id_nr 

    +

    131 ) 

    +

    132 for index, cluster in enumerate(beta_cluster): 

    +

    133 name = "Error, my bad" 

    +

    134 color = "pink" 

    +

    135 if (index == 0) and mark_outliers: 

    +

    136 name = "outliers" 

    +

    137 color = "black" 

    +

    138 else: 

    +

    139 name = "cluster {i}".format(i=index) 

    +

    140 color = colorlist[(index - 1) % 10] 

    +

    141 formated_trace = TRACE_STRING.format( 

    +

    142 _traceNr_="trace{i}".format(i=index), 

    +

    143 _name_=name, 

    +

    144 _color_=color, 

    +

    145 _runIDs_=id_cluster[index].tolist(), 

    +

    146 _x_=np.around(cluster[:, 0], decimals=5).tolist(), 

    +

    147 _y_=np.around(cluster[:, 1], decimals=5).tolist(), 

    +

    148 _z_=np.around(cluster[:, 2], decimals=5).tolist(), 

    +

    149 ) 

    +

    150 tracelist.append(f"trace{index}") 

    +

    151 html_str_formatted += formated_trace 

    +

    152 trace_list_string = " traceList = [" 

    +

    153 for trace in tracelist: 

    +

    154 trace_list_string += trace + ", " 

    +

    155 trace_list_string += "]" 

    +

    156 html_str_formatted += trace_list_string 

    +

    157 html_str_formatted += SCRIPT_STRING 

    +

    158 

    +

    159 if write: 

    +

    160 os.makedirs(save_path, exist_ok=True) 

    +

    161 

    +

    162 # Timestamp for differentiating different viz / not override previous viz 

    +

    163 stamp = timestamp() if mark_timestamp else "" 

    +

    164 

    +

    165 output_filepath = os.path.join(save_path, stamp + filename + ".html") 

    +

    166 with open(output_filepath, "w", encoding="utf-8") as f: 

    +

    167 f.write(html_str_formatted) 

    +

    168 if show_res: 

    +

    169 webbrowser.open("file://" + os.path.realpath(output_filepath)) 

    +

    170 else: 

    +

    171 # only needed for testcases 

    +

    172 return html_str_formatted 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_pod_functions_py.html b/coverage/d_ec83283597faf9de_pod_functions_py.html new file mode 100644 index 0000000..3f0a67e --- /dev/null +++ b/coverage/d_ec83283597faf9de_pod_functions_py.html @@ -0,0 +1,191 @@ + + + + + Coverage for lasso/dimred/svd/pod_functions.py: 97% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/pod_functions.py: + 97% +

    + +

    + 30 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from typing import Tuple, Union 

    +

    2 

    +

    3import numpy as np 

    +

    4from scipy.sparse import csc_matrix 

    +

    5from scipy.sparse.linalg import svds 

    +

    6from rich.progress import Progress, TaskID 

    +

    7 

    +

    8from lasso.utils.rich_progress_bars import PlaceHolderBar 

    +

    9 

    +

    10 

    +

    11def svd_step_and_dim(s_mat: np.ndarray, k=10) -> np.ndarray: 

    +

    12 """ 

    +

    13 Performs a svds operation on the two dimensional s_mat 

    +

    14 

    +

    15 Parameters 

    +

    16 ---------- 

    +

    17 s_mat: ndarray 

    +

    18 2D array on which the svds operation shall be performed 

    +

    19 k: int, 10, optinal. 

    +

    20 The size of the POD 

    +

    21 

    +

    22 Returns 

    +

    23 ------- 

    +

    24 v: ndarray 

    +

    25 Array containing the right reduced order basis 

    +

    26 """ 

    +

    27 small_mat = csc_matrix(s_mat.astype(np.float64)) 

    +

    28 

    +

    29 _, _, v = svds(small_mat, k=k) 

    +

    30 

    +

    31 v = v[::-1, :] 

    +

    32 

    +

    33 return v 

    +

    34 

    +

    35 

    +

    36def calculate_v_and_betas( 

    +

    37 stacked_sub_displ: np.ndarray, 

    +

    38 progress_bar: Union[None, Progress, PlaceHolderBar] = None, 

    +

    39 task_id: Union[None, TaskID] = None, 

    +

    40) -> Union[str, Tuple[np.ndarray, np.ndarray]]: 

    +

    41 """ 

    +

    42 Calculates the right reduced order Basis V and up to 10 eigenvalues of the subsamples 

    +

    43 

    +

    44 Parameters 

    +

    45 ---------- 

    +

    46 stacked_sub_displ: np.ndarray 

    +

    47 np.ndarray containing all subsampled displacements 

    +

    48 shape must be (samples, timesteps, nodes, dims) 

    +

    49 

    +

    50 Returns 

    +

    51 ------- 

    +

    52 v_big: np.ndarray 

    +

    53 Reduced order basis to transform betas bag into subsamples 

    +

    54 betas: np.ndarray 

    +

    55 Projected simulation runs 

    +

    56 err_msg: str 

    +

    57 Error message if not enough samples where provided 

    +

    58 """ 

    +

    59 

    +

    60 big_mat = stacked_sub_displ.reshape( 

    +

    61 ( 

    +

    62 stacked_sub_displ.shape[0], 

    +

    63 stacked_sub_displ.shape[1], 

    +

    64 stacked_sub_displ.shape[2] * stacked_sub_displ.shape[3], 

    +

    65 ) 

    +

    66 ) 

    +

    67 

    +

    68 diff_mat = np.stack([big_mat[:, 0, :] for _ in range(big_mat.shape[1])]).reshape( 

    +

    69 (big_mat.shape[0], big_mat.shape[1], big_mat.shape[2]) 

    +

    70 ) 

    +

    71 

    +

    72 # We only want the difference in displacement 

    +

    73 big_mat = big_mat - diff_mat 

    +

    74 

    +

    75 k = min(10, big_mat.shape[0] - 1) 

    +

    76 if k < 1: 

    +

    77 return "Must provide more than 1 sample" 

    +

    78 

    +

    79 if task_id is None and progress_bar: 

    +

    80 return "Progress requires a task ID" 

    +

    81 

    +

    82 v_big = np.zeros((k, big_mat.shape[1], big_mat.shape[2])) 

    +

    83 if progress_bar: 

    +

    84 progress_bar.advance(task_id) # type: ignore 

    +

    85 for step in range(big_mat.shape[1] - 1): 

    +

    86 v_big[:, step + 1] = svd_step_and_dim(big_mat[:, step + 1], k) 

    +

    87 progress_bar.advance(task_id) # type: ignore 

    +

    88 else: 

    +

    89 for step in range(big_mat.shape[1] - 1): 

    +

    90 v_big[:, step + 1] = svd_step_and_dim(big_mat[:, step + 1], k) 

    +

    91 

    +

    92 betas_big = np.einsum("stn, ktn -> stk", big_mat, v_big) 

    +

    93 

    +

    94 return v_big, betas_big 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_subsampling_methods_py.html b/coverage/d_ec83283597faf9de_subsampling_methods_py.html new file mode 100644 index 0000000..4bc0040 --- /dev/null +++ b/coverage/d_ec83283597faf9de_subsampling_methods_py.html @@ -0,0 +1,388 @@ + + + + + Coverage for lasso/dimred/svd/subsampling_methods.py: 53% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/subsampling_methods.py: + 53% +

    + +

    + 120 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import random 

    +

    3import time 

    +

    4from typing import List, Sequence, Tuple, Union 

    +

    5 

    +

    6import numpy as np 

    +

    7from sklearn.neighbors import NearestNeighbors 

    +

    8 

    +

    9from ...dyna import ArrayType, D3plot 

    +

    10 

    +

    11 

    +

    12def _mark_dead_eles(node_indexes: np.ndarray, alive_shells: np.ndarray) -> np.ndarray: 

    +

    13 """ 

    +

    14 Returns a mask to filter out elements mark as 'no alive' 

    +

    15 

    +

    16 Parameters 

    +

    17 ---------- 

    +

    18 node_indexes: ndarray 

    +

    19 Array containing node indexes 

    +

    20 alive_nodes: ndarray 

    +

    21 Array containing float value representing if element is alive. 

    +

    22 Expected for D3plot.arrays[ArrayType.element_shell_is_alive] or equivalent for beams etc 

    +

    23 

    +

    24 Returns 

    +

    25 ------- 

    +

    26 node_coordinate_mask: np.ndarray 

    +

    27 Array containing indizes of alive shells. 

    +

    28 Use node_coordinates[node_coordinate_mask] to get all nodes alive. 

    +

    29 

    +

    30 See Also 

    +

    31 -------- 

    +

    32 bury_the_dead(), also removes dead beam nodes 

    +

    33 """ 

    +

    34 

    +

    35 dead_eles_shell = np.unique(np.where(alive_shells == 0)[1]) 

    +

    36 

    +

    37 ele_filter = np.zeros(node_indexes.shape[0]) 

    +

    38 ele_filter[dead_eles_shell] = 1 

    +

    39 ele_filter_bool = ele_filter == 1 

    +

    40 

    +

    41 dead_nodes = np.unique(node_indexes[ele_filter_bool]) 

    +

    42 

    +

    43 return dead_nodes 

    +

    44 

    +

    45 

    +

    46def _extract_shell_parts( 

    +

    47 part_list: Sequence[int], d3plot: D3plot 

    +

    48) -> Union[Tuple[np.ndarray, np.ndarray], str]: 

    +

    49 """ 

    +

    50 Extracts a shell part defined by its part ID out of the given d3plot. 

    +

    51 Returns a new node index, relevant coordinates and displacement 

    +

    52 

    +

    53 Parameters 

    +

    54 ---------- 

    +

    55 part_list: list 

    +

    56 List of part IDs of the parts that shall be extracted 

    +

    57 d3plot: D3plot 

    +

    58 D3plot the part shall be extracted from 

    +

    59 

    +

    60 Returns 

    +

    61 ------- 

    +

    62 node_coordinates: ndarray 

    +

    63 Numpy array containing the node coordinates of the extracted part 

    +

    64 node_displacement: ndarray 

    +

    65 Numpy array containing the node displacement of the extracted part 

    +

    66 err_msg: str 

    +

    67 If an error occurs, a string containing the error msg is returned instead 

    +

    68 """ 

    +

    69 

    +

    70 # pylint: disable = too-many-locals, too-many-statements 

    +

    71 

    +

    72 # convert into list 

    +

    73 part_list = list(part_list) 

    +

    74 

    +

    75 shell_node_indexes = d3plot.arrays[ArrayType.element_shell_node_indexes] 

    +

    76 shell_part_indexes = d3plot.arrays[ArrayType.element_shell_part_indexes] 

    +

    77 beam_node_indexes = d3plot.arrays[ArrayType.element_beam_node_indexes] 

    +

    78 beam_part_indexes = d3plot.arrays[ArrayType.element_beam_part_indexes] 

    +

    79 solid_node_indexes = d3plot.arrays[ArrayType.element_solid_node_indexes] 

    +

    80 solid_part_indexes = d3plot.arrays[ArrayType.element_solid_part_indexes] 

    +

    81 tshell_node_indexes = d3plot.arrays[ArrayType.element_tshell_node_indexes] 

    +

    82 tshell_part_indexes = d3plot.arrays[ArrayType.element_tshell_part_indexes] 

    +

    83 

    +

    84 node_coordinates = d3plot.arrays[ArrayType.node_coordinates] 

    +

    85 node_displacement = d3plot.arrays[ArrayType.node_displacement] 

    +

    86 

    +

    87 alive_mask = np.full((node_coordinates.shape[0]), True) 

    +

    88 

    +

    89 if ArrayType.element_shell_is_alive in d3plot.arrays: 

    +

    90 dead_shell_mask = _mark_dead_eles( 

    +

    91 shell_node_indexes, d3plot.arrays[ArrayType.element_shell_is_alive] 

    +

    92 ) 

    +

    93 alive_mask[dead_shell_mask] = False 

    +

    94 if ArrayType.element_beam_is_alive in d3plot.arrays: 

    +

    95 dead_beam_mask = _mark_dead_eles( 

    +

    96 beam_node_indexes, d3plot.arrays[ArrayType.element_beam_is_alive] 

    +

    97 ) 

    +

    98 alive_mask[dead_beam_mask] = False 

    +

    99 if ArrayType.element_solid_is_alive in d3plot.arrays: 

    +

    100 dead_solid_mask = _mark_dead_eles( 

    +

    101 solid_node_indexes, d3plot.arrays[ArrayType.element_solid_is_alive] 

    +

    102 ) 

    +

    103 alive_mask[dead_solid_mask] = False 

    +

    104 if ArrayType.element_tshell_is_alive in d3plot.arrays: 

    +

    105 dead_tshell_mask = _mark_dead_eles( 

    +

    106 tshell_node_indexes, d3plot.arrays[ArrayType.element_tshell_is_alive] 

    +

    107 ) 

    +

    108 alive_mask[dead_tshell_mask] = False 

    +

    109 

    +

    110 if len(part_list) > 0: 

    +

    111 try: 

    +

    112 part_ids = d3plot.arrays[ArrayType.part_ids] 

    +

    113 except KeyError: 

    +

    114 err_msg = "KeyError: Loaded plot has no parts" 

    +

    115 return err_msg 

    +

    116 part_ids_as_list = part_ids.tolist() 

    +

    117 # check if parts exist 

    +

    118 for part in part_list: 

    +

    119 try: 

    +

    120 part_ids_as_list.index(int(part)) 

    +

    121 except ValueError: 

    +

    122 err_msg = "ValueError: Could not find part: {0}" 

    +

    123 return err_msg.format(part) 

    +

    124 

    +

    125 def mask_parts( 

    +

    126 part_list2: List[int], element_part_index: np.ndarray, element_node_index: np.ndarray 

    +

    127 ) -> np.ndarray: 

    +

    128 

    +

    129 element_part_filter = np.full(element_part_index.shape, False) 

    +

    130 proc_parts = [] 

    +

    131 

    +

    132 for pid in part_list2: 

    +

    133 part_index = part_ids_as_list.index(int(pid)) 

    +

    134 locs = np.where(element_part_index == part_index)[0] 

    +

    135 if not locs.shape == (0,): 

    +

    136 proc_parts.append(pid) 

    +

    137 element_part_filter[locs] = True 

    +

    138 

    +

    139 for part in proc_parts: 

    +

    140 part_list2.pop(part_list2.index(part)) 

    +

    141 

    +

    142 unique_element_node_indexes = np.unique(element_node_index[element_part_filter]) 

    +

    143 

    +

    144 return unique_element_node_indexes 

    +

    145 

    +

    146 # shells: 

    +

    147 unique_shell_node_indexes = mask_parts(part_list, shell_part_indexes, shell_node_indexes) 

    +

    148 

    +

    149 # beams 

    +

    150 unique_beam_node_indexes = mask_parts(part_list, beam_part_indexes, beam_node_indexes) 

    +

    151 

    +

    152 # solids: 

    +

    153 unique_solide_node_indexes = mask_parts(part_list, solid_part_indexes, solid_node_indexes) 

    +

    154 

    +

    155 # tshells 

    +

    156 unique_tshell_node_indexes = mask_parts(part_list, tshell_part_indexes, tshell_node_indexes) 

    +

    157 

    +

    158 # this check may seem redundant, but also verifies that our masking of parts works 

    +

    159 if not len(part_list) == 0: 

    +

    160 err_msg = "Value Error: Could not find parts: " + str(part_list) 

    +

    161 return err_msg 

    +

    162 

    +

    163 # New coordinate mask 

    +

    164 coord_mask = np.full((node_coordinates.shape[0]), False) 

    +

    165 coord_mask[unique_shell_node_indexes] = True 

    +

    166 coord_mask[unique_solide_node_indexes] = True 

    +

    167 coord_mask[unique_beam_node_indexes] = True 

    +

    168 coord_mask[unique_tshell_node_indexes] = True 

    +

    169 

    +

    170 inv_alive_mask = np.logical_not(alive_mask) 

    +

    171 coord_mask[inv_alive_mask] = False 

    +

    172 

    +

    173 node_coordinates = node_coordinates[coord_mask] 

    +

    174 node_displacement = node_displacement[:, coord_mask] 

    +

    175 else: 

    +

    176 node_coordinates = node_coordinates[alive_mask] 

    +

    177 node_displacement = node_displacement[:, alive_mask] 

    +

    178 

    +

    179 return node_coordinates, node_displacement 

    +

    180 

    +

    181 

    +

    182def create_reference_subsample( 

    +

    183 load_path: str, parts: Sequence[int], nr_samples=2000 

    +

    184) -> Union[Tuple[np.ndarray, float, float], str]: 

    +

    185 """ 

    +

    186 Loads the D3plot at load_path, extracts the node coordinates of part 13, returns 

    +

    187 a random subsample of these nodes 

    +

    188 

    +

    189 Parameters 

    +

    190 ---------- 

    +

    191 load_path: str 

    +

    192 Filepath of the D3plot 

    +

    193 parts: Sequence[int] 

    +

    194 List of parts to be extracted 

    +

    195 nr_samples: int 

    +

    196 How many nodes are subsampled 

    +

    197 

    +

    198 Returns 

    +

    199 ------- 

    +

    200 reference_sample: np.array 

    +

    201 Numpy array containing the reference sample 

    +

    202 t_total: float 

    +

    203 Total time required for subsampling 

    +

    204 t_load: float 

    +

    205 Time required to load plot 

    +

    206 err_msg: str 

    +

    207 If an error occurs, a string containing the error is returned instead 

    +

    208 """ 

    +

    209 t_null = time.time() 

    +

    210 try: 

    +

    211 plot = D3plot( 

    +

    212 load_path, 

    +

    213 state_array_filter=[ArrayType.node_displacement, ArrayType.element_shell_is_alive], 

    +

    214 ) 

    +

    215 except Exception: 

    +

    216 err_msg = ( 

    +

    217 f"Failed to load {load_path}! Please make sure it is a D3plot file. " 

    +

    218 f"This might be due to {os.path.split(load_path)[1]} being a timestep of a plot" 

    +

    219 ) 

    +

    220 return err_msg 

    +

    221 

    +

    222 t_load = time.time() - t_null 

    +

    223 result = _extract_shell_parts(parts, plot) 

    +

    224 if isinstance(result, str): 

    +

    225 return result 

    +

    226 

    +

    227 coordinates = result[0] 

    +

    228 if coordinates.shape[0] < nr_samples: 

    +

    229 err_msg = "Number of nodes is lower than desired samplesize" 

    +

    230 return err_msg 

    +

    231 

    +

    232 random.seed("seed") 

    +

    233 samples = random.sample(range(len(coordinates)), nr_samples) 

    +

    234 

    +

    235 reference_sample = coordinates[samples] 

    +

    236 t_total = time.time() - t_null 

    +

    237 return reference_sample, t_total, t_load 

    +

    238 

    +

    239 

    +

    240def remap_random_subsample( 

    +

    241 load_path: str, parts: list, reference_subsample: np.ndarray 

    +

    242) -> Union[Tuple[np.ndarray, float, float], str]: 

    +

    243 """ 

    +

    244 Remaps the specified sample onto a new mesh provided by reference subsampl, using knn matching 

    +

    245 

    +

    246 Parameters 

    +

    247 ---------- 

    +

    248 load_path: str 

    +

    249 Filepath of the desired D3plot 

    +

    250 parts: list of int 

    +

    251 Which parts shall be extracted from the D3plot 

    +

    252 reference_subsample: np.array 

    +

    253 Numpy array containing the reference nodes 

    +

    254 

    +

    255 Returns 

    +

    256 ------- 

    +

    257 subsampled_displacement: np.ndarray 

    +

    258 Subsampled displacement of provided sample 

    +

    259 t_total: float 

    +

    260 Total time required to perform subsampling 

    +

    261 t_load: float 

    +

    262 Time required to load D3plot 

    +

    263 err_msg: str 

    +

    264 If an error occured, a string is returned instead containing the error 

    +

    265 """ 

    +

    266 t_null = time.time() 

    +

    267 try: 

    +

    268 plot = D3plot( 

    +

    269 load_path, 

    +

    270 state_array_filter=[ArrayType.node_displacement, ArrayType.element_shell_is_alive], 

    +

    271 ) 

    +

    272 except Exception: 

    +

    273 err_msg = ( 

    +

    274 f"Failed to load {load_path}! Please make sure it is a D3plot file. " 

    +

    275 f"This might be due to {os.path.split(load_path)[1]} being a timestep of a plot" 

    +

    276 ) 

    +

    277 return err_msg 

    +

    278 

    +

    279 t_load = time.time() - t_null 

    +

    280 result = _extract_shell_parts(parts, plot) 

    +

    281 if isinstance(result, str): 

    +

    282 return result 

    +

    283 

    +

    284 coordinates, displacement = result[0], result[1] 

    +

    285 

    +

    286 quarantine_zone = NearestNeighbors(n_neighbors=1, n_jobs=4).fit(coordinates) 

    +

    287 _, quarantined_index = quarantine_zone.kneighbors(reference_subsample) 

    +

    288 

    +

    289 subsampled_displacement = displacement[:, quarantined_index[:, 0]] 

    +

    290 

    +

    291 return subsampled_displacement, time.time() - t_null, t_load 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_test_clustering_betas_py.html b/coverage/d_ec83283597faf9de_test_clustering_betas_py.html new file mode 100644 index 0000000..be0ba50 --- /dev/null +++ b/coverage/d_ec83283597faf9de_test_clustering_betas_py.html @@ -0,0 +1,154 @@ + + + + + Coverage for lasso/dimred/svd/test_clustering_betas.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/test_clustering_betas.py: + 100% +

    + +

    + 27 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from unittest import TestCase 

    +

    2import numpy as np 

    +

    3from lasso.dimred.svd.clustering_betas import group_betas 

    +

    4from lasso.dimred.svd.keyword_types import DetectorType, ClusterType 

    +

    5 

    +

    6 

    +

    7class TestClustering(TestCase): 

    +

    8 def test_group_betas(self): 

    +

    9 """tests correct function of the group_betas function 

    +

    10 in clustering_betas.py""" 

    +

    11 

    +

    12 fake_names = np.array(["betas_{i}".format(i=i) for i in range(25)]) 

    +

    13 fake_cluster_0 = np.random.rand(12, 3) + 5 

    +

    14 fake_cluster_1 = np.random.rand(12, 3) - 5 

    +

    15 fake_betas = np.stack([*fake_cluster_0, *fake_cluster_1, np.array([0, 0, 0])]) 

    +

    16 expected_clusters = 2 

    +

    17 expected_outliers = 1 

    +

    18 

    +

    19 # test with recommended settings 

    +

    20 beta_clusters, name_clusters = group_betas( 

    +

    21 fake_names, 

    +

    22 fake_betas, 

    +

    23 cluster=ClusterType.KMeans, 

    +

    24 detector=DetectorType.LocalOutlierFactor, 

    +

    25 cluster_params=dict( 

    +

    26 n_clusters=expected_clusters, 

    +

    27 ), 

    +

    28 ) 

    +

    29 

    +

    30 # verify correct type of output 

    +

    31 self.assertIsInstance(beta_clusters, list) 

    +

    32 self.assertIsInstance(name_clusters, list) 

    +

    33 

    +

    34 # verify that beta_clusters and name_clusters correspond to each other 

    +

    35 self.assertEqual(len(beta_clusters), len(name_clusters)) 

    +

    36 # verify that beta_clusters contains as many clusters as searched for 

    +

    37 # inkluding one outlier 

    +

    38 self.assertEqual(len(beta_clusters), expected_clusters + expected_outliers) 

    +

    39 

    +

    40 # verify that entries correspond to each other 

    +

    41 for c, cluster in enumerate(name_clusters): 

    +

    42 for e, entry in enumerate(cluster): 

    +

    43 index = np.where(fake_names == entry)[0] 

    +

    44 self.assertTrue((fake_betas[index] - beta_clusters[c][e]).max() == 0) 

    +

    45 

    +

    46 # verify differen keyword kombinations 

    +

    47 

    +

    48 for cluster_type in ClusterType.get_cluster_type_name(): 

    +

    49 for detector_type in DetectorType.get_detector_type_name(): 

    +

    50 beta_clusters, name_clusters = group_betas( 

    +

    51 fake_names, fake_betas, cluster=cluster_type, detector=detector_type 

    +

    52 ) 

    +

    53 

    +

    54 # verify correct output 

    +

    55 self.assertIsInstance(beta_clusters, list) 

    +

    56 self.assertIsInstance(name_clusters, list) 

    +

    57 self.assertEqual(len(beta_clusters), len(name_clusters)) 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_test_plot_betas_clusters_py.html b/coverage/d_ec83283597faf9de_test_plot_betas_clusters_py.html new file mode 100644 index 0000000..c131ee4 --- /dev/null +++ b/coverage/d_ec83283597faf9de_test_plot_betas_clusters_py.html @@ -0,0 +1,129 @@ + + + + + Coverage for lasso/dimred/svd/test_plot_betas_clusters.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/test_plot_betas_clusters.py: + 100% +

    + +

    + 18 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import hashlib 

    +

    2from unittest import TestCase 

    +

    3 

    +

    4import numpy as np 

    +

    5from lasso.dimred.svd.plot_beta_clusters import plot_clusters_js 

    +

    6 

    +

    7 

    +

    8def hash_str(data: str) -> str: 

    +

    9 """hashes a string""" 

    +

    10 

    +

    11 hasher1 = hashlib.sha256() 

    +

    12 hasher1.update(data.encode("utf-8")) 

    +

    13 return hasher1.hexdigest() 

    +

    14 

    +

    15 

    +

    16class TestBetaViz(TestCase): 

    +

    17 def test_plot_clusters_js(self): 

    +

    18 """Veryfies correct output .html file""" 

    +

    19 

    +

    20 betas = [np.array([[1, 1, 1], [1, 2, 3]])] 

    +

    21 ids = np.array([["sample0", "sample1"]]) 

    +

    22 

    +

    23 html_page_str = plot_clusters_js( 

    +

    24 betas, ids, "", mark_timestamp=False, filename="testpage", write=False, show_res=False 

    +

    25 ) 

    +

    26 

    +

    27 self.assertIsInstance(html_page_str, str) 

    +

    28 if isinstance(html_page_str, str): 

    +

    29 html_page_hash = hash_str(html_page_str) 

    +

    30 

    +

    31 desired_hash = "0af9f14ded18d4ac479ac2a07d46eb773ae93a61245e57e650115cc51522c54f" 

    +

    32 self.assertEqual(html_page_hash, desired_hash) 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_test_pod_functions_py.html b/coverage/d_ec83283597faf9de_test_pod_functions_py.html new file mode 100644 index 0000000..2227693 --- /dev/null +++ b/coverage/d_ec83283597faf9de_test_pod_functions_py.html @@ -0,0 +1,151 @@ + + + + + Coverage for lasso/dimred/svd/test_pod_functions.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/test_pod_functions.py: + 100% +

    + +

    + 24 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from unittest import TestCase 

    +

    2from lasso.dimred.svd.pod_functions import calculate_v_and_betas 

    +

    3import numpy as np 

    +

    4from typing import Tuple 

    +

    5 

    +

    6 

    +

    7class PodFunctionsTest(TestCase): 

    +

    8 def test_calculate_v_and_betas(self): 

    +

    9 """Verify svd works 

    +

    10 Test for: 

    +

    11 - returns V and B of correct shape 

    +

    12 - failes if dataset to small (1 sample)""" 

    +

    13 

    +

    14 # random input for 1 sample, 5 timesteps, 100 nodes, 3 dimensions 

    +

    15 rand_samples = np.random.rand(1, 5, 100, 3) 

    +

    16 

    +

    17 # should return error message string 

    +

    18 err_msg = calculate_v_and_betas(rand_samples) 

    +

    19 self.assertTrue(isinstance(err_msg, str)) 

    +

    20 

    +

    21 # random input for 5 samples, 5 timesteps, 100 nodes, 3 dimensions 

    +

    22 test_shape = (5, 5, 100, 3) 

    +

    23 samples, timesteps, nodes, dimensions = test_shape 

    +

    24 rand_samples = np.random.rand(samples, timesteps, nodes, dimensions) 

    +

    25 result = calculate_v_and_betas(rand_samples) 

    +

    26 

    +

    27 # returns Tuple containing v_rob and betas 

    +

    28 self.assertTrue(isinstance(result, Tuple)) 

    +

    29 

    +

    30 v_rob, betas = result 

    +

    31 

    +

    32 # v_rob and betas should both be numpy arrays 

    +

    33 self.assertTrue(isinstance(v_rob, np.ndarray)) 

    +

    34 self.assertTrue(isinstance(betas, np.ndarray)) 

    +

    35 

    +

    36 # v_rob should be of shape (k_eigen, timesteps, nodes*dimensions) 

    +

    37 # k_eigen should be min(10, samples-1), so in this case k_eigen = samples-1 = 4 

    +

    38 k_eigen = min(10, samples - 1) 

    +

    39 self.assertEqual(v_rob.shape, (k_eigen, timesteps, nodes * dimensions)) 

    +

    40 

    +

    41 # betas should be of shape (samples, timesteps, k_eigen) 

    +

    42 self.assertEqual(betas.shape, (samples, timesteps, k_eigen)) 

    +

    43 

    +

    44 # v_rob and betas should result in difference in displacements of original result 

    +

    45 reshaped_samples = rand_samples.reshape(samples, timesteps, nodes * dimensions) 

    +

    46 

    +

    47 delta_displ = reshaped_samples[:, :] - np.stack( 

    +

    48 [reshaped_samples[0, :] for _ in range(timesteps)] 

    +

    49 ) 

    +

    50 

    +

    51 recacl_displ = np.einsum("ktn, stk -> stn", v_rob, betas) 

    +

    52 

    +

    53 # check if both original and recalc have the same shape 

    +

    54 self.assertEqual(delta_displ.shape, recacl_displ.shape) 

    +
    + + + diff --git a/coverage/d_ec83283597faf9de_test_subsampling_methods_py.html b/coverage/d_ec83283597faf9de_test_subsampling_methods_py.html new file mode 100644 index 0000000..cdadfb0 --- /dev/null +++ b/coverage/d_ec83283597faf9de_test_subsampling_methods_py.html @@ -0,0 +1,193 @@ + + + + + Coverage for lasso/dimred/svd/test_subsampling_methods.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/svd/test_subsampling_methods.py: + 100% +

    + +

    + 46 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import tempfile 

    +

    3from typing import Tuple 

    +

    4from unittest import TestCase 

    +

    5 

    +

    6import numpy as np 

    +

    7 

    +

    8from lasso.dimred.svd.subsampling_methods import create_reference_subsample, remap_random_subsample 

    +

    9from lasso.dimred.test_plot_creator import create_2_fake_plots 

    +

    10 

    +

    11 

    +

    12class TestSubsampling(TestCase): 

    +

    13 def test_create_reference_sample(self): 

    +

    14 """Tests the creation of reference sample""" 

    +

    15 

    +

    16 with tempfile.TemporaryDirectory() as tmp_dir: 

    +

    17 

    +

    18 create_2_fake_plots(tmp_dir, 500, 10) 

    +

    19 load_path = os.path.join(tmp_dir, "SVDTestPlot00/plot") 

    +

    20 n_nodes = 200 

    +

    21 

    +

    22 result = create_reference_subsample(load_path, parts=[], nr_samples=n_nodes) 

    +

    23 

    +

    24 # result should be tuple containing subsample, load time and total process time 

    +

    25 self.assertTrue(isinstance(result, Tuple)) 

    +

    26 

    +

    27 ref_sample, t_total, t_load = result 

    +

    28 

    +

    29 # check for correct types 

    +

    30 self.assertTrue(isinstance(ref_sample, np.ndarray)) 

    +

    31 self.assertTrue(isinstance(t_total, float)) 

    +

    32 self.assertTrue(isinstance(t_load, float)) 

    +

    33 

    +

    34 # t_total should be greater than t_load 

    +

    35 self.assertTrue(t_total - t_load >= 0) 

    +

    36 

    +

    37 # check for correct dimensions of ref_sample 

    +

    38 self.assertEqual(ref_sample.shape, (n_nodes, 3)) 

    +

    39 

    +

    40 # should return string error message if desired samplesize is greater 

    +

    41 # than avaiable nodes 

    +

    42 n_nodes = 5500 

    +

    43 result = create_reference_subsample(load_path, parts=[], nr_samples=n_nodes) 

    +

    44 

    +

    45 self.assertTrue(isinstance(result, str)) 

    +

    46 

    +

    47 # should return string error message for nonexitant parts: 

    +

    48 n_nodes = 200 

    +

    49 result = create_reference_subsample(load_path, parts=[1], nr_samples=n_nodes) 

    +

    50 

    +

    51 self.assertTrue(isinstance(result, str)) 

    +

    52 

    +

    53 def test_remap_random_subsample(self): 

    +

    54 """Verifies correct subsampling""" 

    +

    55 

    +

    56 with tempfile.TemporaryDirectory() as tmp_dir: 

    +

    57 

    +

    58 create_2_fake_plots(tmp_dir, 500, 10) 

    +

    59 ref_path = os.path.join(tmp_dir, "SVDTestPlot00/plot") 

    +

    60 sample_path = os.path.join(tmp_dir, "SVDTestPlot01/plot") 

    +

    61 n_nodes = 200 

    +

    62 

    +

    63 ref_result = create_reference_subsample(ref_path, parts=[], nr_samples=n_nodes) 

    +

    64 

    +

    65 ref_sample = ref_result[0] 

    +

    66 

    +

    67 sub_result = remap_random_subsample( 

    +

    68 sample_path, parts=[], reference_subsample=ref_sample 

    +

    69 ) 

    +

    70 

    +

    71 # sub_result should be Tuple containing subsample, total process time, 

    +

    72 # and plot load time 

    +

    73 self.assertTrue(isinstance(sub_result, Tuple)) 

    +

    74 

    +

    75 subsample, t_total, t_load = sub_result 

    +

    76 

    +

    77 # confirm correct types 

    +

    78 self.assertTrue(isinstance(subsample, np.ndarray)) 

    +

    79 self.assertTrue(isinstance(t_total, float)) 

    +

    80 self.assertTrue(isinstance(t_load, float)) 

    +

    81 

    +

    82 # t_total should be greater t_load 

    +

    83 self.assertTrue(t_total - t_load >= 0) 

    +

    84 

    +

    85 # correct shape of subsample 

    +

    86 self.assertEqual(subsample.shape, (5, n_nodes, 3)) 

    +

    87 

    +

    88 # entries of subsmaple at timestep 0 should be the same as the reference sample 

    +

    89 # this is only true for for the dimredTestPlots, this might not be the case 

    +

    90 # with real plots we check if the difference is 0 

    +

    91 self.assertTrue((ref_sample - subsample[0]).max() == 0) 

    +

    92 

    +

    93 # should return string error message for nonexistant parts: 

    +

    94 err_msg = remap_random_subsample(sample_path, parts=[1], reference_subsample=ref_sample) 

    +

    95 

    +

    96 self.assertTrue(isinstance(err_msg, str)) 

    +
    + + + diff --git a/coverage/d_f6cb54d84c129274___init___py.html b/coverage/d_f6cb54d84c129274___init___py.html new file mode 100644 index 0000000..98f3567 --- /dev/null +++ b/coverage/d_f6cb54d84c129274___init___py.html @@ -0,0 +1,100 @@ + + + + + Coverage for lasso/femzip/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/femzip/__init__.py: + 100% +

    + +

    + 2 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from .femzip_api import FemzipAPI 

    +

    2 

    +

    3__all__ = ["FemzipAPI"] 

    +
    + + + diff --git a/coverage/d_f6cb54d84c129274_femzip_api_py.html b/coverage/d_f6cb54d84c129274_femzip_api_py.html new file mode 100644 index 0000000..1b554c7 --- /dev/null +++ b/coverage/d_f6cb54d84c129274_femzip_api_py.html @@ -0,0 +1,1499 @@ + + + + + Coverage for lasso/femzip/femzip_api.py: 35% + + + + + +
    +
    +

    + Coverage for lasso/femzip/femzip_api.py: + 35% +

    + +

    + 417 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import logging 

    +

    2import os 

    +

    3import re 

    +

    4import stat 

    +

    5import sys 

    +

    6import time 

    +

    7from ctypes import ( 

    +

    8 CDLL, 

    +

    9 POINTER, 

    +

    10 Structure, 

    +

    11 byref, 

    +

    12 c_char_p, 

    +

    13 c_float, 

    +

    14 c_int, 

    +

    15 c_int32, 

    +

    16 c_int64, 

    +

    17 c_uint64, 

    +

    18 sizeof, 

    +

    19) 

    +

    20from typing import Any, Dict, List, Set, Tuple, Union 

    +

    21 

    +

    22import numpy as np 

    +

    23 

    +

    24from .fz_config import FemzipArrayType, FemzipVariableCategory, get_last_int_of_line 

    +

    25 

    +

    26# During next refactoring we should take a look at reducing the file size. 

    +

    27# pylint: disable = too-many-lines 

    +

    28 

    +

    29# The c-structs python wrappers set variables outside of the init method which 

    +

    30# is okay. 

    +

    31# pylint: disable = attribute-defined-outside-init 

    +

    32 

    +

    33 

    +

    34class FemzipException(Exception): 

    +

    35 """Custom exception specifically for anything going wrong in femzip""" 

    +

    36 

    +

    37 

    +

    38class FemzipError(Structure): 

    +

    39 """Struct representing femzip errors in c-code 

    +

    40 

    +

    41 Attributes 

    +

    42 ---------- 

    +

    43 ier: c_int32 

    +

    44 Error code 

    +

    45 msg: c_char_p 

    +

    46 Error message 

    +

    47 """ 

    +

    48 

    +

    49 _fields_ = [ 

    +

    50 ("ier", c_int32), 

    +

    51 ("msg", c_char_p), 

    +

    52 ] 

    +

    53 

    +

    54 

    +

    55class VariableInfo(Structure): 

    +

    56 """Struct for details about a single femzip variable 

    +

    57 

    +

    58 Attributes 

    +

    59 ---------- 

    +

    60 var_index: c_int32 

    +

    61 Index of the variable 

    +

    62 name: c_char_p 

    +

    63 Name from femzip 

    +

    64 var_type: c_int32 

    +

    65 Variable type. See FemzipVariableCategory for translation. 

    +

    66 var_size: c_int32 

    +

    67 Array size of the field variable. 

    +

    68 """ 

    +

    69 

    +

    70 _fields_ = [ 

    +

    71 ("var_index", c_int32), 

    +

    72 ("name", c_char_p), 

    +

    73 ("var_type", c_int32), 

    +

    74 ("var_size", c_int32), 

    +

    75 ] 

    +

    76 

    +

    77 

    +

    78class FemzipFileMetadata(Structure): 

    +

    79 """This struct contains metadata about femzip files. 

    +

    80 

    +

    81 Attributes 

    +

    82 ---------- 

    +

    83 version_zip: c_float 

    +

    84 activity_flag: c_int32 

    +

    85 number_of_variables: c_int32 

    +

    86 number_of_nodes: c_int32 

    +

    87 number_of_solid_elements: c_int32 

    +

    88 number_of_thick_shell_elements: c_int32 

    +

    89 number_of_1D_elements: c_int32 

    +

    90 number_of_tool_elements: c_int32 

    +

    91 number_of_shell_elements: c_int32 

    +

    92 number_of_solid_element_neighbors: c_int32 

    +

    93 number_of_rbe_element_neighbors: c_int32 

    +

    94 number_of_bar_elements: c_int32 

    +

    95 number_of_beam_elements: c_int32 

    +

    96 number_of_plotel_elements: c_int32 

    +

    97 number_of_spring_elements: c_int32 

    +

    98 number_of_damper_elements: c_int32 

    +

    99 number_of_joint_elements: c_int32 

    +

    100 number_of_joint_element_neighbors: c_int32 

    +

    101 number_of_bar_element_neighbors: c_int32 

    +

    102 number_of_beamcross_elements: c_int32 

    +

    103 number_of_spotweld_elements: c_int32 

    +

    104 number_of_rbe_elements: c_int32 

    +

    105 number_of_hexa20_elements: c_int32 

    +

    106 number_of_rigid_shell_elements: c_int32 

    +

    107 number_of_timesteps: c_int32 

    +

    108 variable_infos: POINTER(VariableInfo) 

    +

    109 """ 

    +

    110 

    +

    111 _fields_ = [ 

    +

    112 ("version_zip", c_float), 

    +

    113 ("activity_flag", c_int32), 

    +

    114 ("number_of_variables", c_int32), 

    +

    115 ("number_of_nodes", c_int32), 

    +

    116 ("number_of_solid_elements", c_int32), 

    +

    117 ("number_of_thick_shell_elements", c_int32), 

    +

    118 ("number_of_1D_elements", c_int32), 

    +

    119 ("number_of_tool_elements", c_int32), 

    +

    120 ("number_of_shell_elements", c_int32), 

    +

    121 ("number_of_solid_element_neighbors", c_int32), 

    +

    122 ("number_of_rbe_element_neighbors", c_int32), 

    +

    123 ("number_of_bar_elements", c_int32), 

    +

    124 ("number_of_beam_elements", c_int32), 

    +

    125 ("number_of_plotel_elements", c_int32), # NOTE typo? 

    +

    126 ("number_of_spring_elements", c_int32), 

    +

    127 ("number_of_damper_elements", c_int32), 

    +

    128 ("number_of_joint_elements", c_int32), 

    +

    129 ("number_of_joint_element_neighbors", c_int32), 

    +

    130 ("number_of_bar_element_neighbors", c_int32), 

    +

    131 ("number_of_beamcross_elements", c_int32), 

    +

    132 ("number_of_spotweld_elements", c_int32), 

    +

    133 ("number_of_rbe_elements", c_int32), 

    +

    134 ("number_of_hexa20_elements", c_int32), 

    +

    135 ("number_of_rigid_shell_elements", c_int32), 

    +

    136 ("number_of_timesteps", c_int32), 

    +

    137 ("variable_infos", POINTER(VariableInfo)), 

    +

    138 ] 

    +

    139 

    +

    140 

    +

    141class FemzipBufferInfo(Structure): 

    +

    142 """This struct describes necessary buffer sizes for reading the file 

    +

    143 

    +

    144 Attributes 

    +

    145 ---------- 

    +

    146 n_timesteps: c_uint64 

    +

    147 Number of timesteps 

    +

    148 timesteps: POINTER(c_float) 

    +

    149 Time for each timestep 

    +

    150 size_geometry: c_uint64 

    +

    151 Size of the geometry buffer 

    +

    152 size_state: c_uint64 

    +

    153 Size of the state buffer 

    +

    154 size_displacement: c_uint64 

    +

    155 Size for displacement array 

    +

    156 size_activity: c_uint64 

    +

    157 Size for activity array (deletion stuff) 

    +

    158 size_post: c_uint64 

    +

    159 Size of the post region of which I currently don't know anymore what it 

    +

    160 was. 

    +

    161 size_titles: c_uint64 

    +

    162 Size of the titles region behind the geomtry. 

    +

    163 """ 

    +

    164 

    +

    165 _fields_ = [ 

    +

    166 ("n_timesteps", c_uint64), 

    +

    167 ("timesteps", POINTER(c_float)), 

    +

    168 ("size_geometry", c_uint64), 

    +

    169 ("size_state", c_uint64), 

    +

    170 ("size_displacement", c_uint64), 

    +

    171 ("size_activity", c_uint64), 

    +

    172 ("size_post", c_uint64), 

    +

    173 ("size_titles", c_uint64), 

    +

    174 ] 

    +

    175 

    +

    176 

    +

    177class FemzipAPIStatus(Structure): 

    +

    178 """This struct summarizes the state of the femzip API library. The library 

    +

    179 has a shared, global state which is stored in static variables. The state 

    +

    180 of the gloval vars is tracked by this struct. 

    +

    181 

    +

    182 Attributes 

    +

    183 ---------- 

    +

    184 is_file_open: c_int32 

    +

    185 Whether a femzip file is opened and being processed. 

    +

    186 is_geometry_read: c_int32 

    +

    187 Whether the geometry was already read. 

    +

    188 is_states_open: c_int32 

    +

    189 Whether processing of the states was started. 

    +

    190 i_timestep_state: c_int32 

    +

    191 Counter of timestep processing. 

    +

    192 i_timestep_activity: c_int32 

    +

    193 Counter of activity data for timesteps. 

    +

    194 """ 

    +

    195 

    +

    196 _fields_ = [ 

    +

    197 ("is_file_open", c_int32), 

    +

    198 ("is_geometry_read", c_int32), 

    +

    199 ("is_states_open", c_int32), 

    +

    200 ("i_timestep_state", c_int32), 

    +

    201 ("i_timestep_activity", c_int32), 

    +

    202 ] 

    +

    203 

    +

    204 

    +

    205class FemzipAPI: 

    +

    206 """FemzipAPI contains wrapper functions around the femzip library.""" 

    +

    207 

    +

    208 _api: Union[None, CDLL] = None 

    +

    209 

    +

    210 @staticmethod 

    +

    211 def load_dynamic_library(path: str) -> CDLL: 

    +

    212 """Load a library and check for correct execution 

    +

    213 

    +

    214 Parameters 

    +

    215 ---------- 

    +

    216 path: str 

    +

    217 path to the library 

    +

    218 

    +

    219 Returns 

    +

    220 ------- 

    +

    221 library: CDLL 

    +

    222 loaded library 

    +

    223 """ 

    +

    224 

    +

    225 # check executable rights 

    +

    226 if not os.access(path, os.X_OK) or not os.access(path, os.R_OK): 

    +

    227 os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC | stat.S_IREAD) 

    +

    228 if not os.access(path, os.X_OK) or not os.access(path, os.R_OK): 

    +

    229 err_msg = "Library '{0}' is not executable and couldn't change execution rights." 

    +

    230 raise RuntimeError(err_msg.format(path)) 

    +

    231 

    +

    232 return CDLL(path) 

    +

    233 

    +

    234 @property 

    +

    235 def api(self) -> CDLL: 

    +

    236 """Returns the loaded, shared object library of the native interface 

    +

    237 

    +

    238 Returns 

    +

    239 ------- 

    +

    240 shared_object_lib: CDLL 

    +

    241 Loaded shared object library. 

    +

    242 """ 

    +

    243 

    +

    244 # pylint: disable = too-many-statements 

    +

    245 

    +

    246 if self._api is None: 

    +

    247 

    +

    248 bin_dirpath = ( 

    +

    249 os.path.abspath(os.path.dirname(sys.executable)) 

    +

    250 if hasattr(sys, "frozen") 

    +

    251 else os.path.dirname(os.path.abspath(__file__)) 

    +

    252 ) 

    +

    253 

    +

    254 # Flexlm Settings 

    +

    255 # prevent flexlm gui to pop up 

    +

    256 os.environ["FLEXLM_BATCH"] = "1" 

    +

    257 # set a low timeout from originally 10 seconds 

    +

    258 if "FLEXLM_TIMEOUT" not in os.environ: 

    +

    259 os.environ["FLEXLM_TIMEOUT"] = "200000" 

    +

    260 

    +

    261 # windows 

    +

    262 if "win32" in sys.platform: 

    +

    263 

    +

    264 shared_lib_name = "api_extended.dll" 

    +

    265 self.load_dynamic_library(os.path.join(bin_dirpath, "libmmd.dll")) 

    +

    266 self.load_dynamic_library(os.path.join(bin_dirpath, "libifcoremd.dll")) 

    +

    267 self.load_dynamic_library(os.path.join(bin_dirpath, "libifportmd.dll")) 

    +

    268 self.load_dynamic_library(os.path.join(bin_dirpath, "libiomp5md.dll")) 

    +

    269 self.load_dynamic_library( 

    +

    270 os.path.join(bin_dirpath, "femzip_a_dyna_sidact_generic.dll") 

    +

    271 ) 

    +

    272 self.load_dynamic_library( 

    +

    273 os.path.join(bin_dirpath, "libfemzip_post_licgenerator_ext_flexlm.dll") 

    +

    274 ) 

    +

    275 # linux hopefully 

    +

    276 else: 

    +

    277 shared_lib_name = "api_extended.so" 

    +

    278 self.load_dynamic_library(os.path.join(bin_dirpath, "libiomp5.so")) 

    +

    279 self.load_dynamic_library(os.path.join(bin_dirpath, "libintlc.so.5")) 

    +

    280 self.load_dynamic_library(os.path.join(bin_dirpath, "libirng.so")) 

    +

    281 self.load_dynamic_library(os.path.join(bin_dirpath, "libimf.so")) 

    +

    282 self.load_dynamic_library(os.path.join(bin_dirpath, "libsvml.so")) 

    +

    283 self.load_dynamic_library( 

    +

    284 os.path.join(bin_dirpath, "libfemzip_a_dyna_sidact_generic.so") 

    +

    285 ) 

    +

    286 self.load_dynamic_library( 

    +

    287 os.path.join(bin_dirpath, "libfemzip_post_licgenerator_ext_flexlm.so") 

    +

    288 ) 

    +

    289 

    +

    290 filepath = os.path.join(bin_dirpath, shared_lib_name) 

    +

    291 self._api = self.load_dynamic_library(filepath) 

    +

    292 

    +

    293 # license check 

    +

    294 self._api.has_femunziplib_license.restype = c_int 

    +

    295 

    +

    296 # file check 

    +

    297 self._api.is_sidact_file.argtypes = (c_char_p,) 

    +

    298 self._api.is_sidact_file.restype = c_int 

    +

    299 

    +

    300 # content infos 

    +

    301 self._api.get_file_metadata.argtypes = (c_char_p, POINTER(FemzipFileMetadata)) 

    +

    302 self._api.get_file_metadata.restype = FemzipError 

    +

    303 

    +

    304 # free 

    +

    305 self._api.free_variable_array.argtypes = (POINTER(FemzipFileMetadata),) 

    +

    306 self._api.free_variable_array.restype = c_int32 

    +

    307 

    +

    308 # get buffer dims 

    +

    309 self._api.get_buffer_info.argtypes = (c_char_p, POINTER(FemzipBufferInfo)) 

    +

    310 self._api.get_buffer_info.restype = FemzipError 

    +

    311 

    +

    312 # read geom 

    +

    313 self._api.read_geometry.argtypes = ( 

    +

    314 c_char_p, 

    +

    315 POINTER(FemzipBufferInfo), 

    +

    316 POINTER(c_int32), 

    +

    317 c_int32, 

    +

    318 ) 

    +

    319 self._api.read_geometry.restype = FemzipError 

    +

    320 

    +

    321 # read var 

    +

    322 self._api.read_variables.argtypes = ( 

    +

    323 POINTER(c_float), 

    +

    324 c_int, 

    +

    325 c_int, 

    +

    326 POINTER(FemzipFileMetadata), 

    +

    327 ) 

    +

    328 self._api.read_variables.restype = FemzipError 

    +

    329 

    +

    330 # femunzip version 

    +

    331 self._api.is_femunzip_version_ok.argtypes = (c_char_p, POINTER(c_int)) 

    +

    332 self._api.is_femunzip_version_ok.restype = FemzipError 

    +

    333 

    +

    334 # femzip status 

    +

    335 self._api.get_femzip_status.argtypes = tuple() 

    +

    336 self._api.get_femzip_status.restype = FemzipAPIStatus 

    +

    337 

    +

    338 # get part titles 

    +

    339 self._api.get_part_titles.argtypes = (c_char_p, POINTER(c_int32), c_int32) 

    +

    340 self._api.get_part_titles.restype = FemzipError 

    +

    341 

    +

    342 # finish reading states 

    +

    343 self._api.finish_reading_states.argtypes = (POINTER(c_int32), c_int64) 

    +

    344 self._api.finish_reading_states.restype = FemzipError 

    +

    345 

    +

    346 # close file 

    +

    347 self._api.close_current_file.argtypes = tuple() 

    +

    348 self._api.close_current_file.restype = FemzipError 

    +

    349 

    +

    350 # read single state 

    +

    351 self._api.read_single_state.argtypes = (c_int32, c_int32, POINTER(c_float), c_int64) 

    +

    352 self._api.read_single_state.restype = FemzipError 

    +

    353 

    +

    354 # read state activity 

    +

    355 self._api.read_activity.argtypes = (c_int32, c_int32, POINTER(c_float)) 

    +

    356 self._api.read_activity.restype = FemzipError 

    +

    357 

    +

    358 # free buffer info 

    +

    359 self._api.free_buffer_info.argtypes = (POINTER(FemzipBufferInfo),) 

    +

    360 self._api.free_buffer_info.restype = c_int32 

    +

    361 

    +

    362 return self._api 

    +

    363 

    +

    364 @staticmethod 

    +

    365 def _parse_state_filter(state_filter: Union[Set[int], None], n_timesteps: int) -> Set[int]: 

    +

    366 

    +

    367 # convert negative indexes 

    +

    368 state_filter_parsed = ( 

    +

    369 {entry if entry >= 0 else entry + n_timesteps for entry in state_filter} 

    +

    370 if state_filter is not None 

    +

    371 else set(range(n_timesteps)) 

    +

    372 ) 

    +

    373 

    +

    374 # filter invalid indexes 

    +

    375 state_filter_valid = {entry for entry in state_filter_parsed if 0 <= entry < n_timesteps} 

    +

    376 

    +

    377 return state_filter_valid 

    +

    378 

    +

    379 @staticmethod 

    +

    380 def _check_femzip_error(err: FemzipError) -> None: 

    +

    381 """Checks a femzip error coming from C (usually) 

    +

    382 

    +

    383 Parameters 

    +

    384 ---------- 

    +

    385 err: FemzipError 

    +

    386 c struct error 

    +

    387 

    +

    388 Raises 

    +

    389 ------ 

    +

    390 FemzipException 

    +

    391 If the error flag is set with the corresponding 

    +

    392 error message. 

    +

    393 """ 

    +

    394 if err.ier != 0: 

    +

    395 fz_error_msg = "Unknown" 

    +

    396 try: 

    +

    397 fz_error_msg = err.msg.decode("ascii") 

    +

    398 except ValueError: 

    +

    399 pass 

    +

    400 

    +

    401 err_msg = "Error Code '{0}': {1}" 

    +

    402 raise FemzipException(err_msg.format(err.ier, fz_error_msg)) 

    +

    403 

    +

    404 @staticmethod 

    +

    405 def struct_to_dict(struct: Structure) -> Dict[str, Any]: 

    +

    406 """Converts a ctypes struct into a dict 

    +

    407 

    +

    408 Parameters 

    +

    409 ---------- 

    +

    410 struct: Structure 

    +

    411 

    +

    412 Returns 

    +

    413 ------- 

    +

    414 fields: Dict[str, Any] 

    +

    415 struct as dict 

    +

    416 

    +

    417 Examples 

    +

    418 -------- 

    +

    419 >>> api.struct_to_dict(api.get_femzip_status()) 

    +

    420 {'is_file_open': 1, 'is_geometry_read': 1, 'is_states_open': 0, 

    +

    421 'i_timestep_state': -1, 'i_timestep_activity': -1} 

    +

    422 """ 

    +

    423 # We access some internal members to do some magic. 

    +

    424 # pylint: disable = protected-access 

    +

    425 return {field_name: getattr(struct, field_name) for field_name, _ in struct._fields_} 

    +

    426 

    +

    427 @staticmethod 

    +

    428 def copy_struct(src: Structure, dest: Structure): 

    +

    429 """Copies all fields from src struct to dest 

    +

    430 

    +

    431 Parameters 

    +

    432 ---------- 

    +

    433 src: Structure 

    +

    434 src struct 

    +

    435 src: Structure 

    +

    436 destination struct 

    +

    437 

    +

    438 Examples 

    +

    439 -------- 

    +

    440 >>> err1 = FemzipError() 

    +

    441 >>> err1.ier = -1 

    +

    442 >>> err1.msg = b"Oops" 

    +

    443 >>> err2 = FemzipError() 

    +

    444 >>> api.copy_struct(err1, err2) 

    +

    445 >>> err2.ier 

    +

    446 -1 

    +

    447 >>> err2.msg 

    +

    448 b'Oops' 

    +

    449 """ 

    +

    450 # We access some internal members to do some magic. 

    +

    451 # pylint: disable = protected-access 

    +

    452 assert src._fields_ == dest._fields_ 

    +

    453 

    +

    454 for field_name, _ in src._fields_: 

    +

    455 setattr(dest, field_name, getattr(src, field_name)) 

    +

    456 

    +

    457 def get_part_titles( 

    +

    458 self, filepath: str, buffer_info: Union[None, FemzipBufferInfo] = None 

    +

    459 ) -> memoryview: 

    +

    460 """Get the part title section 

    +

    461 

    +

    462 Parameters 

    +

    463 ---------- 

    +

    464 filepath: str 

    +

    465 path to femzip file 

    +

    466 buffer_info: Union[None, FemzipBufferInfo] 

    +

    467 buffer info if previously fetched 

    +

    468 

    +

    469 Returns 

    +

    470 ------- 

    +

    471 mview: memoryview 

    +

    472 memory of the part title section 

    +

    473 """ 

    +

    474 

    +

    475 # find out how much memory to allocate 

    +

    476 buffer_info_parsed = self.get_buffer_info(filepath) if buffer_info is None else buffer_info 

    +

    477 

    +

    478 # allocate memory 

    +

    479 # pylint: disable = invalid-name 

    +

    480 BufferType = c_int32 * (buffer_info_parsed.size_titles) 

    +

    481 buffer = BufferType() 

    +

    482 

    +

    483 # do the thing 

    +

    484 err = self.api.get_part_titles( 

    +

    485 filepath.encode("utf-8"), 

    +

    486 buffer, 

    +

    487 buffer_info_parsed.size_titles, 

    +

    488 ) 

    +

    489 self._check_femzip_error(err) 

    +

    490 

    +

    491 return memoryview(buffer).cast("B") 

    +

    492 

    +

    493 def read_state_deletion_info( 

    +

    494 self, buffer_info: FemzipBufferInfo, state_filter: Union[Set[int], None] = None 

    +

    495 ) -> np.ndarray: 

    +

    496 """Get information which elements are alive 

    +

    497 

    +

    498 Parameters 

    +

    499 ---------- 

    +

    500 buffer_info: FemzipBufferInfo 

    +

    501 infos about buffer sizes 

    +

    502 state_filter: Union[Set[int], None] 

    +

    503 usable to read only specific states 

    +

    504 

    +

    505 Notes 

    +

    506 ----- 

    +

    507 The `buffer` must have the size of at least 

    +

    508 `buffer_info.size_activity`. 

    +

    509 

    +

    510 Examples 

    +

    511 -------- 

    +

    512 >>> # get info about required memory 

    +

    513 >>> buffer_info = api.get_buffer_info(filepath) 

    +

    514 

    +

    515 >>> # first read geometry and leave file open! 

    +

    516 >>> mview_geom = api.read_geometry(filepath, buffer_info, False) 

    +

    517 

    +

    518 >>> # now read deletion info 

    +

    519 >>> array_deletion = api.read_state_activity(buffer_info) 

    +

    520 

    +

    521 >>> # close file 

    +

    522 >>> api.close_current_file() 

    +

    523 """ 

    +

    524 

    +

    525 logging.debug("FemzipAPI.read_state_deletion_info start") 

    +

    526 

    +

    527 # filter timesteps 

    +

    528 state_filter_valid = self._parse_state_filter(state_filter, buffer_info.n_timesteps) 

    +

    529 logging.debug("state filter: %s", state_filter_valid) 

    +

    530 

    +

    531 # allocate memory 

    +

    532 # pylint: disable = invalid-name 

    +

    533 StateBufferType = c_float * buffer_info.size_activity 

    +

    534 BufferType = c_float * (buffer_info.size_activity * len(state_filter_valid)) 

    +

    535 buffer_c = BufferType() 

    +

    536 

    +

    537 # major looping 

    +

    538 n_timesteps_read = 0 

    +

    539 for i_timestep in range(buffer_info.n_timesteps): 

    +

    540 logging.debug("i_timestep %d", i_timestep) 

    +

    541 

    +

    542 # walk forward in buffer 

    +

    543 state_buffer_ptr = StateBufferType.from_buffer( 

    +

    544 buffer_c, sizeof(c_float) * buffer_info.size_activity * n_timesteps_read 

    +

    545 ) 

    +

    546 

    +

    547 # do the thing 

    +

    548 err = self.api.read_activity(i_timestep, buffer_info.size_activity, state_buffer_ptr) 

    +

    549 self._check_femzip_error(err) 

    +

    550 

    +

    551 # increment buffer ptr if we needed this one 

    +

    552 if i_timestep in state_filter_valid: 

    +

    553 logging.debug("saved") 

    +

    554 n_timesteps_read += 1 

    +

    555 state_filter_valid.remove(i_timestep) 

    +

    556 

    +

    557 # we processe what we need 

    +

    558 if not state_filter_valid: 

    +

    559 break 

    +

    560 

    +

    561 # convert buffer into array 

    +

    562 array = np.frombuffer(buffer_c, dtype=np.float32).reshape( 

    +

    563 (n_timesteps_read, buffer_info.size_activity) 

    +

    564 ) 

    +

    565 

    +

    566 logging.debug("FemzipAPI.read_state_deletion_info end") 

    +

    567 

    +

    568 return array 

    +

    569 

    +

    570 # return memoryview(buffer_c).cast('B') 

    +

    571 

    +

    572 def read_single_state( 

    +

    573 self, 

    +

    574 i_timestep: int, 

    +

    575 buffer_info: FemzipBufferInfo, 

    +

    576 state_buffer: Union[None, memoryview] = None, 

    +

    577 ) -> memoryview: 

    +

    578 """Read a single state 

    +

    579 

    +

    580 Parameters 

    +

    581 ---------- 

    +

    582 i_timestep: int 

    +

    583 timestep to be read 

    +

    584 buffer_info: FemzipBufferInfo 

    +

    585 infos about buffer sizes 

    +

    586 state_buffer: Union[None, memoryview] 

    +

    587 buffer in which the states are stored 

    +

    588 

    +

    589 Notes 

    +

    590 ----- 

    +

    591 It is unclear to us why the state buffer needs to be given 

    +

    592 in order to terminate state reading. 

    +

    593 

    +

    594 Examples 

    +

    595 -------- 

    +

    596 >>> # get info about required memory 

    +

    597 >>> buffer_info = api.get_buffer_info(filepath) 

    +

    598 

    +

    599 >>> # first read geometry and leave file open 

    +

    600 >>> mview_geom = api.read_geometry(filepath, buffer_info, False) 

    +

    601 

    +

    602 >>> # now read a state 

    +

    603 >>> mview_state = api.read_single_state(0, buffer_info=buffer_info) 

    +

    604 

    +

    605 >>> # close file 

    +

    606 >>> api.close_current_file() 

    +

    607 """ 

    +

    608 

    +

    609 if state_buffer is not None and "f" not in state_buffer.format: 

    +

    610 err_msg = "The state buffer must have a float format '<f' instead of '{0}'." 

    +

    611 raise ValueError(err_msg.format(state_buffer.format)) 

    +

    612 

    +

    613 # pylint: disable = invalid-name 

    +

    614 StateBufferType = c_float * buffer_info.size_state 

    +

    615 state_buffer_c = ( 

    +

    616 StateBufferType() if state_buffer is None else StateBufferType.from_buffer(state_buffer) 

    +

    617 ) 

    +

    618 

    +

    619 err = self.api.read_single_state( 

    +

    620 i_timestep, buffer_info.n_timesteps, state_buffer_c, buffer_info.size_state 

    +

    621 ) 

    +

    622 self._check_femzip_error(err) 

    +

    623 

    +

    624 return memoryview(state_buffer_c).cast("B") 

    +

    625 

    +

    626 def close_current_file(self) -> None: 

    +

    627 """Closes the current file handle(use not recommended) 

    +

    628 

    +

    629 Notes 

    +

    630 ----- 

    +

    631 Closes a currently opened file by the API. There 

    +

    632 is no arg because femzip can process only one file 

    +

    633 at a time. 

    +

    634 This can also be used in case of bugs. 

    +

    635 

    +

    636 Examples 

    +

    637 -------- 

    +

    638 >>> api.close_current_file() 

    +

    639 """ 

    +

    640 err = self.api.close_current_file() 

    +

    641 self._check_femzip_error(err) 

    +

    642 

    +

    643 def get_femzip_status(self) -> FemzipAPIStatus: 

    +

    644 """Check the status of the femzip api 

    +

    645 

    +

    646 Returns 

    +

    647 ------- 

    +

    648 femzip_status: FemzipAPIStatus 

    +

    649 c struct with info about femzip API 

    +

    650 

    +

    651 Notes 

    +

    652 ----- 

    +

    653 This reports whether a file is currently 

    +

    654 opened and how far it was processed. This 

    +

    655 internal state is used to avoid internal 

    +

    656 conflicts and crashes, thus is useful for 

    +

    657 debugging. 

    +

    658 

    +

    659 Examples 

    +

    660 -------- 

    +

    661 >>> print(api.struct_to_dict(api.get_femzip_status())) 

    +

    662 {'is_file_open': 0, 'is_geometry_read': 0, 'is_states_open': 0, 

    +

    663 'i_timestep_state': -1, 'i_timestep_activity': -1} 

    +

    664 """ 

    +

    665 return self.api.get_femzip_status() 

    +

    666 

    +

    667 def is_femunzip_version_ok(self, filepath: str) -> bool: 

    +

    668 """Checks if the femunzip version can be handled 

    +

    669 

    +

    670 Parameters 

    +

    671 ---------- 

    +

    672 filepath: str 

    +

    673 path to the femzpi file 

    +

    674 

    +

    675 Returns 

    +

    676 ------- 

    +

    677 version_ok: bool 

    +

    678 

    +

    679 Examples 

    +

    680 -------- 

    +

    681 >>> api.is_femunzip_version_ok("path/to/d3plot.fz") 

    +

    682 True 

    +

    683 """ 

    +

    684 is_ok = c_int(-1) 

    +

    685 err = self.api.is_femunzip_version_ok(filepath.encode("ascii"), byref(is_ok)) 

    +

    686 self._check_femzip_error(err) 

    +

    687 return is_ok.value == 1 

    +

    688 

    +

    689 def has_femunziplib_license(self) -> bool: 

    +

    690 """Checks whether the extended libraries are available 

    +

    691 

    +

    692 Returns 

    +

    693 ------- 

    +

    694 has_license: bool 

    +

    695 

    +

    696 Examples 

    +

    697 -------- 

    +

    698 >>> api.has_femunziplib_license() 

    +

    699 False 

    +

    700 """ 

    +

    701 start_time = time.time() 

    +

    702 has_license = self.api.has_femunziplib_license() == 1 

    +

    703 logging.debug("License check duration: %fs", (time.time() - start_time)) 

    +

    704 return has_license 

    +

    705 

    +

    706 def is_sidact_file(self, filepath: str) -> bool: 

    +

    707 """Tests if a filepath points at a sidact file 

    +

    708 

    +

    709 Parameters 

    +

    710 ---------- 

    +

    711 filepath: path to file 

    +

    712 

    +

    713 Returns 

    +

    714 ------- 

    +

    715 is_sidact_file: bool 

    +

    716 

    +

    717 Examples 

    +

    718 -------- 

    +

    719 >>> api.is_sidact_file("path/to/d3plot.fz") 

    +

    720 True 

    +

    721 >>> api.is_sidact_file("path/to/d3plot") 

    +

    722 False 

    +

    723 >>> api.is_sidact_file("path/to/non/existing/file") 

    +

    724 False 

    +

    725 """ 

    +

    726 return self.api.is_sidact_file(filepath.encode("ascii")) == 1 

    +

    727 

    +

    728 def get_buffer_info(self, filepath: str) -> FemzipBufferInfo: 

    +

    729 """Get the dimensions of the buffers for femzip 

    +

    730 

    +

    731 Parameters 

    +

    732 ---------- 

    +

    733 filepath: str 

    +

    734 path to femzip file 

    +

    735 

    +

    736 Returns 

    +

    737 ------- 

    +

    738 buffer_info: FemzipBufferInfo 

    +

    739 c struct with infos about the memory required by femzip 

    +

    740 

    +

    741 Examples 

    +

    742 -------- 

    +

    743 >>> # read memory demand info first 

    +

    744 >>> buffer_info = api.get_buffer_info(filepath) 

    +

    745 >>> # buffer info is a c struct, but we can print it 

    +

    746 >>> api.struct_to_dict(buffer_info) 

    +

    747 {'n_timesteps': 12, 

    +

    748 'timesteps': <lasso.femzip.femzip_api.LP_c_float object at 0x0000028A8F6B21C0>, 

    +

    749 'size_geometry': 537125, 'size_state': 1462902, 'size_displacement': 147716, 

    +

    750 'size_activity': 47385, 'size_post': 1266356, 'size_titles': 1448} 

    +

    751 >>> for i_timestep in range(buffer_info.n_timesteps): 

    +

    752 >>> print(buffer_info.timesteps[i_timestep]) 

    +

    753 0.0 

    +

    754 0.9998100399971008 

    +

    755 1.9998900890350342 

    +

    756 2.9999701976776123 

    +

    757 3.9997801780700684 

    +

    758 """ 

    +

    759 buffer_info = FemzipBufferInfo() 

    +

    760 

    +

    761 err = self.api.get_buffer_info( 

    +

    762 filepath.encode("ascii"), 

    +

    763 byref(buffer_info), 

    +

    764 ) 

    +

    765 self._check_femzip_error(err) 

    +

    766 

    +

    767 # we need to copy the timesteps from C to Python 

    +

    768 buffer_info_2 = FemzipBufferInfo() 

    +

    769 

    +

    770 # pylint: disable = invalid-name 

    +

    771 TimestepsType = c_float * buffer_info.n_timesteps 

    +

    772 timesteps_buffer = TimestepsType() 

    +

    773 for i_timestep in range(buffer_info.n_timesteps): 

    +

    774 timesteps_buffer[i_timestep] = buffer_info.timesteps[i_timestep] 

    +

    775 buffer_info_2.timesteps = timesteps_buffer 

    +

    776 

    +

    777 self.copy_struct(buffer_info, buffer_info_2) 

    +

    778 buffer_info_2.timesteps = timesteps_buffer 

    +

    779 

    +

    780 # free C controlled memory 

    +

    781 self.api.free_buffer_info(byref(buffer_info)) 

    +

    782 

    +

    783 return buffer_info_2 

    +

    784 

    +

    785 def read_geometry( 

    +

    786 self, 

    +

    787 filepath: str, 

    +

    788 buffer_info: Union[FemzipBufferInfo, None] = None, 

    +

    789 close_file: bool = True, 

    +

    790 ) -> memoryview: 

    +

    791 """Read the geometry buffer from femzip 

    +

    792 

    +

    793 Parameters 

    +

    794 ---------- 

    +

    795 filepath: str 

    +

    796 path to femzpi file 

    +

    797 buffer_info: Union[FemzipBufferInfo, None] 

    +

    798 struct with info regarding required memory for femzip 

    +

    799 close_file: bool 

    +

    800 it is useful to leave the file open if 

    +

    801 states are processed right afterwards 

    +

    802 

    +

    803 Returns 

    +

    804 ------- 

    +

    805 buffer: memoryview 

    +

    806 memoryview of buffer 

    +

    807 

    +

    808 Notes 

    +

    809 ----- 

    +

    810 If the file isn't closed appropriately bugs and crashes 

    +

    811 might occur. 

    +

    812 

    +

    813 Examples 

    +

    814 -------- 

    +

    815 >>> mview = api.read_geometry(filepath, buffer_info) 

    +

    816 """ 

    +

    817 

    +

    818 # find out how much memory to allocate 

    +

    819 buffer_info = self.get_buffer_info(filepath) if buffer_info is None else buffer_info 

    +

    820 

    +

    821 # allocate memory 

    +

    822 # pylint: disable = invalid-name 

    +

    823 GeomBufferType = c_int * (buffer_info.size_geometry + buffer_info.size_titles) 

    +

    824 buffer = GeomBufferType() 

    +

    825 

    +

    826 # read geometry 

    +

    827 err = self.api.read_geometry( 

    +

    828 filepath.encode("ascii"), 

    +

    829 byref(buffer_info), 

    +

    830 buffer, 

    +

    831 c_int32(close_file), 

    +

    832 ) 

    +

    833 

    +

    834 self._check_femzip_error(err) 

    +

    835 

    +

    836 return memoryview(buffer).cast("B") 

    +

    837 

    +

    838 def read_states( 

    +

    839 self, 

    +

    840 filepath: str, 

    +

    841 buffer_info: Union[FemzipBufferInfo, None] = None, 

    +

    842 state_filter: Union[Set[int], None] = None, 

    +

    843 ) -> np.ndarray: 

    +

    844 """Reads all femzip state information 

    +

    845 

    +

    846 Parameters 

    +

    847 ---------- 

    +

    848 filepath: str 

    +

    849 path to femzip file 

    +

    850 buffer_info: Union[FemzipBufferInfo, None] 

    +

    851 struct with info regarding required memory for femzip 

    +

    852 state_filter: Union[Set[int], None] 

    +

    853 usable to load only specific states 

    +

    854 

    +

    855 Returns 

    +

    856 ------- 

    +

    857 buffer: memoryview 

    +

    858 buffer containing all state data 

    +

    859 

    +

    860 Examples 

    +

    861 -------- 

    +

    862 >>> buffer_info = api.get_buffer_info("path/to/d3plot.fz") 

    +

    863 >>> array_states = api.read_states("path/to/d3plot.fz", buffer_info) 

    +

    864 """ 

    +

    865 

    +

    866 buffer_info_parsed = self.get_buffer_info(filepath) if buffer_info is None else buffer_info 

    +

    867 

    +

    868 # filter invalid indexes 

    +

    869 state_filter_valid = self._parse_state_filter(state_filter, buffer_info_parsed.n_timesteps) 

    +

    870 

    +

    871 n_states_to_allocate = ( 

    +

    872 buffer_info_parsed.n_timesteps if state_filter is None else len(state_filter_valid) 

    +

    873 ) 

    +

    874 

    +

    875 # allocate buffer 

    +

    876 # pylint: disable = invalid-name 

    +

    877 BufferType = c_float * (buffer_info_parsed.size_state * n_states_to_allocate) 

    +

    878 buffer = BufferType() 

    +

    879 

    +

    880 n_timesteps_read = 0 

    +

    881 for i_timestep in range(buffer_info_parsed.n_timesteps): 

    +

    882 

    +

    883 # forward pointer in buffer 

    +

    884 buffer_state = buffer[buffer_info.size_state * n_timesteps_read] 

    +

    885 

    +

    886 # read state data 

    +

    887 self.read_single_state(i_timestep, buffer_info_parsed, buffer_state) 

    +

    888 

    +

    889 if i_timestep in state_filter_valid: 

    +

    890 n_timesteps_read += 1 

    +

    891 state_filter_valid.remove(i_timestep) 

    +

    892 

    +

    893 if not state_filter_valid: 

    +

    894 break 

    +

    895 

    +

    896 array = np.from_buffer(buffer, dtype=np.float32).reshape( 

    +

    897 (n_timesteps_read, buffer_info_parsed.size_state) 

    +

    898 ) 

    +

    899 

    +

    900 return array 

    +

    901 

    +

    902 def get_file_metadata(self, filepath: str) -> FemzipFileMetadata: 

    +

    903 """Get infos about the femzip variables in the file 

    +

    904 

    +

    905 Parameters 

    +

    906 ---------- 

    +

    907 filepath: str 

    +

    908 path to femzip file 

    +

    909 

    +

    910 Returns 

    +

    911 ------- 

    +

    912 file_metadata: FemzipFileMetadata 

    +

    913 c struct with infos about the femzip file 

    +

    914 

    +

    915 Notes 

    +

    916 ----- 

    +

    917 This is for direct interaction with the C-API, thus should 

    +

    918 not be used by users. 

    +

    919 

    +

    920 Examples 

    +

    921 -------- 

    +

    922 >>> file_metadata = api.get_file_metadata("path/to/d3plot.fz") 

    +

    923 >>> # print general internals 

    +

    924 >>> api.struct_to_dict(file_metadata) 

    +

    925 {'version_zip': 605.0, 'activity_flag': 1, 'number_of_variables': 535, ...} 

    +

    926 

    +

    927 >>> # We can iterate the variable names contained in the file 

    +

    928 >>> print( 

    +

    929 [file_metadata.variable_infos[i_var].name.decode("utf8").strip() 

    +

    930 for i_var in range(file_metadata.number_of_variables)] 

    +

    931 ) 

    +

    932 ['global', 'Parts: Energies and others', 'coordinates', 'velocities', ...] 

    +

    933 """ 

    +

    934 file_metadata = FemzipFileMetadata() 

    +

    935 

    +

    936 # get variable infos 

    +

    937 err = self.api.get_file_metadata(filepath.encode("ascii"), byref(file_metadata)) 

    +

    938 self._check_femzip_error(err) 

    +

    939 

    +

    940 # transfer memory to python 

    +

    941 file_metadata2 = self._copy_variable_info_array(file_metadata) 

    +

    942 

    +

    943 # release c memory 

    +

    944 self.api.free_variable_array(byref(file_metadata)) 

    +

    945 

    +

    946 return file_metadata2 

    +

    947 

    +

    948 def _get_variables_state_buffer_size( 

    +

    949 self, 

    +

    950 n_parts: int, 

    +

    951 n_rigid_walls: int, 

    +

    952 n_rigid_wall_vars: int, 

    +

    953 n_airbag_particles: int, 

    +

    954 n_airbags: int, 

    +

    955 file_metadata: FemzipFileMetadata, 

    +

    956 ) -> int: 

    +

    957 # pylint: disable=too-many-arguments 

    +

    958 # pylint: disable=too-many-locals 

    +

    959 # pylint: disable=too-many-branches 

    +

    960 # pylint: disable=too-many-statements 

    +

    961 

    +

    962 buffer_size_state = 0 

    +

    963 var_indexes_to_remove: Set[int] = set() 

    +

    964 for i_var in range(file_metadata.number_of_variables): 

    +

    965 var_info = file_metadata.variable_infos[i_var] 

    +

    966 variable_name = var_info.name.decode("utf-8") 

    +

    967 variable_category = FemzipVariableCategory.from_int(var_info.var_type) 

    +

    968 if variable_category == FemzipVariableCategory.NODE: 

    +

    969 

    +

    970 variable_multiplier = 1 

    +

    971 if ( 

    +

    972 FemzipArrayType.NODE_DISPLACEMENT.value in variable_name 

    +

    973 or FemzipArrayType.NODE_VELOCITIES.value in variable_name 

    +

    974 or FemzipArrayType.NODE_ACCELERATIONS.value in variable_name 

    +

    975 ): 

    +

    976 variable_multiplier = 3 

    +

    977 

    +

    978 array_size = file_metadata.number_of_nodes * variable_multiplier 

    +

    979 buffer_size_state += array_size 

    +

    980 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    981 

    +

    982 elif variable_category == FemzipVariableCategory.SHELL: 

    +

    983 array_size = ( 

    +

    984 file_metadata.number_of_shell_elements 

    +

    985 - file_metadata.number_of_rigid_shell_elements 

    +

    986 ) 

    +

    987 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    988 buffer_size_state += array_size 

    +

    989 elif variable_category == FemzipVariableCategory.SOLID: 

    +

    990 array_size = file_metadata.number_of_solid_elements 

    +

    991 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    992 buffer_size_state += array_size 

    +

    993 elif variable_category == FemzipVariableCategory.BEAM: 

    +

    994 array_size = file_metadata.number_of_1D_elements 

    +

    995 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    996 buffer_size_state += file_metadata.number_of_1D_elements 

    +

    997 elif variable_category == FemzipVariableCategory.THICK_SHELL: 

    +

    998 array_size = file_metadata.number_of_thick_shell_elements 

    +

    999 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    1000 buffer_size_state += file_metadata.number_of_thick_shell_elements 

    +

    1001 elif variable_category == FemzipVariableCategory.GLOBAL: 

    +

    1002 array_size = 6 

    +

    1003 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    1004 buffer_size_state += array_size 

    +

    1005 elif variable_category == FemzipVariableCategory.PART: 

    +

    1006 logging.debug("n_parts: %d", n_parts) 

    +

    1007 array_size = n_parts * 7 + n_rigid_walls * n_rigid_wall_vars 

    +

    1008 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    1009 buffer_size_state += array_size 

    +

    1010 elif variable_category == FemzipVariableCategory.CPM_FLOAT_VAR: 

    +

    1011 array_size = n_airbag_particles 

    +

    1012 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    1013 buffer_size_state += array_size 

    +

    1014 elif variable_category == FemzipVariableCategory.CPM_INT_VAR: 

    +

    1015 array_size = n_airbag_particles 

    +

    1016 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    1017 buffer_size_state += array_size 

    +

    1018 elif variable_category == FemzipVariableCategory.CPM_AIRBAG: 

    +

    1019 array_size = n_airbags * 2 

    +

    1020 file_metadata.variable_infos[i_var].var_size = array_size 

    +

    1021 buffer_size_state += array_size 

    +

    1022 else: 

    +

    1023 warn_msg = "Femzip variable category '%s' is not supported" 

    +

    1024 logging.warning(warn_msg, variable_category) 

    +

    1025 var_indexes_to_remove.add(i_var) 

    +

    1026 

    +

    1027 # one more for end marker 

    +

    1028 buffer_size_state += 1 

    +

    1029 

    +

    1030 return buffer_size_state 

    +

    1031 

    +

    1032 def _decompose_read_variables_array( 

    +

    1033 self, 

    +

    1034 n_parts: int, 

    +

    1035 n_rigid_walls: int, 

    +

    1036 n_rigid_wall_vars: int, 

    +

    1037 n_airbag_particles: int, 

    +

    1038 n_airbags: int, 

    +

    1039 all_vars_array: np.ndarray, 

    +

    1040 n_timesteps_read: int, 

    +

    1041 file_metadata: FemzipFileMetadata, 

    +

    1042 ) -> Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray]: 

    +

    1043 

    +

    1044 # pylint: disable=too-many-arguments 

    +

    1045 # pylint: disable=too-many-locals 

    +

    1046 # pylint: disable=too-many-branches 

    +

    1047 # pylint: disable=too-many-statements 

    +

    1048 

    +

    1049 # decompose array 

    +

    1050 result_arrays: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] = {} 

    +

    1051 var_pos = 0 

    +

    1052 for i_var in range(file_metadata.number_of_variables): 

    +

    1053 

    +

    1054 var_info: VariableInfo = file_metadata.variable_infos[i_var] 

    +

    1055 variable_name: str = var_info.name.decode("utf-8") 

    +

    1056 variable_index: int = var_info.var_index 

    +

    1057 variable_type = FemzipArrayType.from_string(variable_name) 

    +

    1058 variable_category = FemzipVariableCategory.from_int(var_info.var_type) 

    +

    1059 

    +

    1060 if variable_category == FemzipVariableCategory.NODE: 

    +

    1061 if variable_type.value in ( 

    +

    1062 FemzipArrayType.NODE_DISPLACEMENT.value, 

    +

    1063 FemzipArrayType.NODE_VELOCITIES.value, 

    +

    1064 FemzipArrayType.NODE_ACCELERATIONS.value, 

    +

    1065 ): 

    +

    1066 array_size = file_metadata.number_of_nodes * 3 

    +

    1067 var_array = all_vars_array[:, var_pos : var_pos + array_size].reshape( 

    +

    1068 (n_timesteps_read, file_metadata.number_of_nodes, 3) 

    +

    1069 ) 

    +

    1070 var_pos += array_size 

    +

    1071 result_arrays[ 

    +

    1072 (variable_index, variable_name, FemzipVariableCategory.NODE) 

    +

    1073 ] = var_array 

    +

    1074 else: 

    +

    1075 array_size = file_metadata.number_of_nodes 

    +

    1076 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1077 var_pos += array_size 

    +

    1078 result_arrays[ 

    +

    1079 (variable_index, variable_name, FemzipVariableCategory.NODE) 

    +

    1080 ] = var_array 

    +

    1081 

    +

    1082 elif variable_category == FemzipVariableCategory.SHELL: 

    +

    1083 array_size = ( 

    +

    1084 file_metadata.number_of_shell_elements 

    +

    1085 - file_metadata.number_of_rigid_shell_elements 

    +

    1086 ) 

    +

    1087 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1088 var_pos += array_size 

    +

    1089 result_arrays[ 

    +

    1090 (variable_index, variable_name, FemzipVariableCategory.SHELL) 

    +

    1091 ] = var_array 

    +

    1092 elif variable_category == FemzipVariableCategory.SOLID: 

    +

    1093 array_size = file_metadata.number_of_solid_elements 

    +

    1094 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1095 var_pos += array_size 

    +

    1096 result_arrays[ 

    +

    1097 (variable_index, variable_name, FemzipVariableCategory.SOLID) 

    +

    1098 ] = var_array 

    +

    1099 elif variable_category == FemzipVariableCategory.BEAM: 

    +

    1100 array_size = file_metadata.number_of_1D_elements 

    +

    1101 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1102 var_pos += array_size 

    +

    1103 result_arrays[ 

    +

    1104 variable_index, variable_name, FemzipVariableCategory.BEAM 

    +

    1105 ] = var_array 

    +

    1106 elif variable_category == FemzipVariableCategory.THICK_SHELL: 

    +

    1107 array_size = file_metadata.number_of_thick_shell_elements 

    +

    1108 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1109 var_pos += array_size 

    +

    1110 result_arrays[ 

    +

    1111 variable_index, variable_name, FemzipVariableCategory.THICK_SHELL 

    +

    1112 ] = var_array 

    +

    1113 elif variable_category == FemzipVariableCategory.GLOBAL: 

    +

    1114 array_size = 6 

    +

    1115 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1116 var_pos += array_size 

    +

    1117 result_arrays[ 

    +

    1118 variable_index, variable_name, FemzipVariableCategory.GLOBAL 

    +

    1119 ] = var_array 

    +

    1120 elif variable_category == FemzipVariableCategory.PART: 

    +

    1121 array_size = n_parts * 7 + n_rigid_walls * n_rigid_wall_vars 

    +

    1122 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1123 var_pos += array_size 

    +

    1124 result_arrays[ 

    +

    1125 variable_index, variable_name, FemzipVariableCategory.PART 

    +

    1126 ] = var_array 

    +

    1127 elif variable_category == FemzipVariableCategory.CPM_FLOAT_VAR: 

    +

    1128 array_size = n_airbag_particles 

    +

    1129 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1130 var_pos += array_size 

    +

    1131 result_arrays[variable_index, variable_name, variable_category] = var_array 

    +

    1132 elif variable_category == FemzipVariableCategory.CPM_INT_VAR: 

    +

    1133 array_size = n_airbag_particles 

    +

    1134 var_array = all_vars_array[:, var_pos : var_pos + array_size].view(np.int32) 

    +

    1135 var_pos += array_size 

    +

    1136 result_arrays[variable_index, variable_name, variable_category] = var_array 

    +

    1137 elif variable_category == FemzipVariableCategory.CPM_AIRBAG: 

    +

    1138 n_airbag_vars = 2 

    +

    1139 array_size = n_airbags * n_airbag_vars 

    +

    1140 var_array = all_vars_array[:, var_pos : var_pos + array_size] 

    +

    1141 var_array = var_array.reshape((var_array.shape[0], n_airbags, n_airbag_vars)) 

    +

    1142 var_pos += array_size 

    +

    1143 result_arrays[variable_index, variable_name, variable_category] = var_array 

    +

    1144 else: 

    +

    1145 err_msg = "Femzip variable category '{0}' is not supported" 

    +

    1146 raise RuntimeError(err_msg) 

    +

    1147 

    +

    1148 return result_arrays 

    +

    1149 

    +

    1150 def read_variables( 

    +

    1151 self, 

    +

    1152 file_metadata: FemzipFileMetadata, 

    +

    1153 n_parts: int, 

    +

    1154 n_rigid_walls: int, 

    +

    1155 n_rigid_wall_vars: int, 

    +

    1156 n_airbag_particles: int, 

    +

    1157 n_airbags: int, 

    +

    1158 state_filter: Union[Set[int], None] = None, 

    +

    1159 ) -> Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray]: 

    +

    1160 """Read specific variables from Femzip 

    +

    1161 

    +

    1162 Parameters 

    +

    1163 ---------- 

    +

    1164 file_metadata: FemzipFileMetadata 

    +

    1165 metadata of file including which variables to read 

    +

    1166 n_parts: int 

    +

    1167 number of parts in the file 

    +

    1168 n_rigid_walls: int 

    +

    1169 number of rigid walls 

    +

    1170 n_rigid_wall_vars: int 

    +

    1171 number of rigid wall variables 

    +

    1172 n_airbag_particles: int 

    +

    1173 number of airbag particles in the file 

    +

    1174 n_airbags: int 

    +

    1175 state_filter: Union[Set[int], None] 

    +

    1176 used to read specific arrays 

    +

    1177 

    +

    1178 Returns 

    +

    1179 ------- 

    +

    1180 arrays: dict 

    +

    1181 dictionary with d3plot arrays 

    +

    1182 """ 

    +

    1183 

    +

    1184 # pylint: disable = too-many-arguments 

    +

    1185 # pylint: disable = too-many-locals 

    +

    1186 

    +

    1187 # fetch metadata if required 

    +

    1188 n_timesteps = file_metadata.number_of_timesteps 

    +

    1189 logging.info("file_metadata: %s", self.struct_to_dict(file_metadata)) 

    +

    1190 

    +

    1191 # log variable names 

    +

    1192 for i_var in range(file_metadata.number_of_variables): 

    +

    1193 var_info = file_metadata.variable_infos[i_var] 

    +

    1194 logging.debug("%s", self.struct_to_dict(var_info)) 

    +

    1195 

    +

    1196 # estimate float buffer size 

    +

    1197 buffer_size_state = self._get_variables_state_buffer_size( 

    +

    1198 n_parts=n_parts, 

    +

    1199 n_rigid_walls=n_rigid_walls, 

    +

    1200 n_rigid_wall_vars=n_rigid_wall_vars, 

    +

    1201 n_airbag_particles=n_airbag_particles, 

    +

    1202 n_airbags=n_airbags, 

    +

    1203 file_metadata=file_metadata, 

    +

    1204 ) 

    +

    1205 logging.info("buffer_size_state: %s", buffer_size_state) 

    +

    1206 

    +

    1207 # specify which states to read 

    +

    1208 states_to_copy = ( 

    +

    1209 {i_timestep for i_timestep in state_filter if i_timestep < n_timesteps + 1} 

    +

    1210 if state_filter is not None 

    +

    1211 else set(range(n_timesteps)) 

    +

    1212 ) 

    +

    1213 logging.info("states_to_copy: %s", states_to_copy) 

    +

    1214 

    +

    1215 # take timesteps into account 

    +

    1216 buffer_size = len(states_to_copy) * buffer_size_state 

    +

    1217 logging.info("buffer_size: %s", buffer_size) 

    +

    1218 

    +

    1219 # allocate memory 

    +

    1220 # pylint: disable = invalid-name 

    +

    1221 BufferType = c_float * buffer_size 

    +

    1222 buffer = BufferType() 

    +

    1223 

    +

    1224 # do the thing 

    +

    1225 # pylint: disable = invalid-name 

    +

    1226 BufferStateType = c_float * buffer_size_state 

    +

    1227 n_timesteps_read = 0 

    +

    1228 for i_timestep in range(n_timesteps): 

    +

    1229 logging.info("timestep: %d", i_timestep) 

    +

    1230 

    +

    1231 buffer_ptr_state = BufferStateType.from_buffer( 

    +

    1232 buffer, sizeof(c_float) * n_timesteps_read * buffer_size_state 

    +

    1233 ) 

    +

    1234 

    +

    1235 # read the variables into the buffer 

    +

    1236 fortran_offset = 1 

    +

    1237 err = self.api.read_variables( 

    +

    1238 buffer_ptr_state, 

    +

    1239 buffer_size_state, 

    +

    1240 i_timestep + fortran_offset, 

    +

    1241 byref(file_metadata), 

    +

    1242 ) 

    +

    1243 self._check_femzip_error(err) 

    +

    1244 

    +

    1245 # check if there is nothing to read anymore 

    +

    1246 # thus we can terminate earlier 

    +

    1247 if i_timestep in states_to_copy: 

    +

    1248 states_to_copy.remove(i_timestep) 

    +

    1249 n_timesteps_read += 1 

    +

    1250 

    +

    1251 if not states_to_copy: 

    +

    1252 logging.info("All states processed") 

    +

    1253 break 

    +

    1254 

    +

    1255 array = np.ctypeslib.as_array(buffer, shape=(buffer_size,)).reshape((n_timesteps_read, -1)) 

    +

    1256 

    +

    1257 # decompose total array into array pieces again 

    +

    1258 result_arrays = self._decompose_read_variables_array( 

    +

    1259 n_parts=n_parts, 

    +

    1260 n_rigid_walls=n_rigid_walls, 

    +

    1261 n_rigid_wall_vars=n_rigid_wall_vars, 

    +

    1262 n_airbag_particles=n_airbag_particles, 

    +

    1263 n_airbags=n_airbags, 

    +

    1264 all_vars_array=array, 

    +

    1265 n_timesteps_read=n_timesteps_read, 

    +

    1266 file_metadata=file_metadata, 

    +

    1267 ) 

    +

    1268 

    +

    1269 return result_arrays 

    +

    1270 

    +

    1271 def _copy_variable_info_array(self, file_metadata: FemzipFileMetadata) -> FemzipFileMetadata: 

    +

    1272 """Copies a variable info array into python memory 

    +

    1273 

    +

    1274 Parameters 

    +

    1275 ---------- 

    +

    1276 file_metadata: FemzipFileMetadata 

    +

    1277 metadata object for femzip file 

    +

    1278 

    +

    1279 Returns 

    +

    1280 ------- 

    +

    1281 file_metadata2: FemzipFileMetadata 

    +

    1282 very same data object but the data in 

    +

    1283 variable_infos is now managed by python and 

    +

    1284 not C anymore 

    +

    1285 """ 

    +

    1286 file_metadata2 = FemzipFileMetadata() 

    +

    1287 

    +

    1288 # allocate memory on python side 

    +

    1289 data2 = (VariableInfo * file_metadata.number_of_variables)() 

    +

    1290 

    +

    1291 # copy data 

    +

    1292 for i_var in range(file_metadata.number_of_variables): 

    +

    1293 var1 = file_metadata.variable_infos[i_var] 

    +

    1294 var2 = data2[i_var] 

    +

    1295 self.copy_struct(var1, var2) 

    +

    1296 

    +

    1297 # assign 

    +

    1298 self.copy_struct(file_metadata, file_metadata2) 

    +

    1299 file_metadata2.variable_infos = data2 

    +

    1300 return file_metadata2 

    +

    1301 

    +

    1302 

    +

    1303class FemzipD3plotArrayMapping: 

    +

    1304 """Contains information about how to map femzip arrays to d3plot arrays""" 

    +

    1305 

    +

    1306 d3plot_array_type: str 

    +

    1307 i_integration_point: Union[int, None] 

    +

    1308 i_var_index: Union[int, None] 

    +

    1309 

    +

    1310 fz_array_slices = Tuple[slice] 

    +

    1311 

    +

    1312 def __init__( 

    +

    1313 self, 

    +

    1314 d3plot_array_type: str, 

    +

    1315 fz_array_slices: Tuple[slice] = (slice(None),), 

    +

    1316 i_integration_point: Union[int, None] = None, 

    +

    1317 i_var_index: Union[int, None] = None, 

    +

    1318 ): 

    +

    1319 self.d3plot_array_type = d3plot_array_type 

    +

    1320 self.fz_array_slices = fz_array_slices 

    +

    1321 self.i_integration_point = i_integration_point 

    +

    1322 self.i_var_index = i_var_index 

    +

    1323 

    +

    1324 

    +

    1325class FemzipArrayMetadata: 

    +

    1326 """Contains metadata about femzip arrays""" 

    +

    1327 

    +

    1328 array_type: FemzipArrayType 

    +

    1329 category: FemzipVariableCategory 

    +

    1330 d3plot_mappings: List[FemzipD3plotArrayMapping] 

    +

    1331 # set when parsed 

    +

    1332 fz_var_index: Union[int, None] = None 

    +

    1333 

    +

    1334 def __init__( 

    +

    1335 self, 

    +

    1336 array_type: FemzipArrayType, 

    +

    1337 category: FemzipVariableCategory, 

    +

    1338 d3plot_mappings: List[FemzipD3plotArrayMapping], 

    +

    1339 ): 

    +

    1340 self.array_type = array_type 

    +

    1341 self.category = category 

    +

    1342 self.d3plot_mappings = d3plot_mappings 

    +

    1343 

    +

    1344 def match(self, fz_name: str) -> bool: 

    +

    1345 """Checks if the given name matches the array 

    +

    1346 

    +

    1347 Parameters 

    +

    1348 ---------- 

    +

    1349 fz_name: str 

    +

    1350 femzip array name 

    +

    1351 

    +

    1352 Returns 

    +

    1353 ------- 

    +

    1354 match: bool 

    +

    1355 If the array metadata instance matches the given array 

    +

    1356 """ 

    +

    1357 return self.array_type.value in fz_name 

    +

    1358 

    +

    1359 def parse(self, fz_var_name: str, fz_var_index: int) -> None: 

    +

    1360 """Parses the incoming femzip variable name and extracts infos 

    +

    1361 

    +

    1362 Parameters 

    +

    1363 ---------- 

    +

    1364 fz_var_name: str 

    +

    1365 variable name from femzip 

    +

    1366 fz_var_index: int 

    +

    1367 variable index from femzip 

    +

    1368 """ 

    +

    1369 # matches anything until brackets start 

    +

    1370 pattern = re.compile(r"(^[^\(\n]+)(\([^\)]+\))*") 

    +

    1371 

    +

    1372 matches = pattern.findall(fz_var_name) 

    +

    1373 

    +

    1374 if not len(matches) == 1: 

    +

    1375 err_msg = f"Could not match femzip array name: {fz_var_name}" 

    +

    1376 raise RuntimeError(err_msg) 

    +

    1377 if not len(matches[0]) == 2: 

    +

    1378 err_msg = f"Could not match femzip array name: {fz_var_name}" 

    +

    1379 raise RuntimeError(err_msg) 

    +

    1380 

    +

    1381 # first group contains 

    +

    1382 # - var name 

    +

    1383 # - var index (if existing) 

    +

    1384 # second group contains 

    +

    1385 # - integration layer index 

    +

    1386 (first_grp, second_grp) = matches[0] 

    +

    1387 _, var_index = get_last_int_of_line(first_grp) 

    +

    1388 

    +

    1389 # the slice 1:-1 leaves out the brackets '(' and ')' 

    +

    1390 second_grp = second_grp[1:-1] 

    +

    1391 if "inner" in second_grp: 

    +

    1392 i_integration_point = 0 

    +

    1393 elif "outer" in second_grp: 

    +

    1394 i_integration_point = 1 

    +

    1395 else: 

    +

    1396 _, i_integration_point = get_last_int_of_line(second_grp) 

    +

    1397 

    +

    1398 # setters 

    +

    1399 self.fz_var_index = fz_var_index 

    +

    1400 for mapping in self.d3plot_mappings: 

    +

    1401 mapping.i_integration_point = i_integration_point 

    +

    1402 mapping.i_var_index = var_index 

    +
    + + + diff --git a/coverage/d_f6cb54d84c129274_fz_config_py.html b/coverage/d_f6cb54d84c129274_fz_config_py.html new file mode 100644 index 0000000..b2a0787 --- /dev/null +++ b/coverage/d_f6cb54d84c129274_fz_config_py.html @@ -0,0 +1,324 @@ + + + + + Coverage for lasso/femzip/fz_config.py: 95% + + + + + +
    +
    +

    + Coverage for lasso/femzip/fz_config.py: + 95% +

    + +

    + 113 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from typing import Dict, Union, Tuple 

    +

    2 

    +

    3import enum 

    +

    4 

    +

    5 

    +

    6def get_last_int_of_line(line: str) -> Tuple[str, Union[None, int]]: 

    +

    7 """Searches an integer in the line 

    +

    8 

    +

    9 Parameters 

    +

    10 ---------- 

    +

    11 line: str 

    +

    12 line to be searched 

    +

    13 

    +

    14 Returns 

    +

    15 ------- 

    +

    16 rest_line: str 

    +

    17 rest of line before match 

    +

    18 number: Union[int, None] 

    +

    19 number or None if not found 

    +

    20 """ 

    +

    21 for entry in line.split(): 

    +

    22 if entry.isdigit(): 

    +

    23 return line[: line.rfind(entry)], int(entry) 

    +

    24 return line, None 

    +

    25 

    +

    26 

    +

    27class FemzipVariableCategory(enum.Enum): 

    +

    28 """Enum for femzip variable categories 

    +

    29 

    +

    30 Attributes 

    +

    31 ---------- 

    +

    32 GEOMETRY: int 

    +

    33 -5 

    +

    34 PART: int 

    +

    35 -2 

    +

    36 GLOBAL: int 

    +

    37 -1 

    +

    38 NODE: int 

    +

    39 0 

    +

    40 SOLID: int 

    +

    41 1 

    +

    42 THICK_SHELL: int 

    +

    43 2 

    +

    44 BEAM: int 

    +

    45 3 

    +

    46 TOOLS: int 

    +

    47 4 

    +

    48 SHELL: int 

    +

    49 5 

    +

    50 SPH: int 

    +

    51 6 

    +

    52 FPM: int 

    +

    53 7 

    +

    54 CFD: int 

    +

    55 8 

    +

    56 CPM_FLOAT_VAR: int 

    +

    57 9 

    +

    58 CPM_AIRBAG: int 

    +

    59 10 

    +

    60 CPM_INT_VAR: int 

    +

    61 11 

    +

    62 RADIOSS_STATE_DATA: int 

    +

    63 12 

    +

    64 HEXA20: int 

    +

    65 13 

    +

    66 """ 

    +

    67 

    +

    68 GEOMETRY = -5 

    +

    69 # REST_OF_HEADER_AND_GEOMETRY_UNCOMPRESSED = -3 

    +

    70 # ALL_STATE_EXCEPT_GEOMETRY_POSITION = -2 

    +

    71 # REST_OF_HEADER_AND_GEOMETRY_COMPRESSED = -1 

    +

    72 # EXTERNAL_NODE_IDS = 1 

    +

    73 # NODE_COORDINATES = 2 

    +

    74 # SOLID_ELEMENT_IDS = 3 

    +

    75 # SOLID_NEIGHBORS = 4 

    +

    76 # SOLID_MATERIALS = 5 

    +

    77 # THICK_SHELLS = (6, 7, 8) 

    +

    78 # BEAMS = (9, 10, 11) 

    +

    79 # TOOL_ELEMENTS = (12, 13, 14) 

    +

    80 # SHELL_ELEMENTS = (15, 16, 17) 

    +

    81 # HEADER_AND_PART_TITLES = -4 

    +

    82 # TIME = -3 

    +

    83 PART = -2 

    +

    84 GLOBAL = -1 

    +

    85 NODE = 0 

    +

    86 SOLID = 1 

    +

    87 THICK_SHELL = 2 

    +

    88 BEAM = 3 

    +

    89 TOOLS = 4 

    +

    90 SHELL = 5 

    +

    91 SPH = 6 

    +

    92 FPM = 7 

    +

    93 CFD = 8 

    +

    94 CPM_FLOAT_VAR = 9 

    +

    95 CPM_AIRBAG = 10 

    +

    96 CPM_INT_VAR = 11 

    +

    97 RADIOSS_STATE_DATA = 12 

    +

    98 HEXA20 = 13 

    +

    99 

    +

    100 @staticmethod 

    +

    101 def from_int(number: int) -> "FemzipVariableCategory": 

    +

    102 """Deserializes an integer into an enum 

    +

    103 

    +

    104 Parameters 

    +

    105 ---------- 

    +

    106 number: int 

    +

    107 number to turn into an enum 

    +

    108 

    +

    109 Returns 

    +

    110 ------- 

    +

    111 enum_value: FemzipVariableCategory 

    +

    112 """ 

    +

    113 if number not in FEMZIP_CATEGORY_TRANSL_DICT: 

    +

    114 err_msg = f"Error: Unknown femzip variable category: '{number}'" 

    +

    115 raise RuntimeError(err_msg) 

    +

    116 

    +

    117 return FEMZIP_CATEGORY_TRANSL_DICT[number] 

    +

    118 

    +

    119 

    +

    120FEMZIP_CATEGORY_TRANSL_DICT: Dict[int, FemzipVariableCategory] = { 

    +

    121 entry.value: entry for entry in FemzipVariableCategory.__members__.values() 

    +

    122} 

    +

    123 

    +

    124 

    +

    125class FemzipArrayType(enum.Enum): 

    +

    126 """Enum for femzip array types""" 

    +

    127 

    +

    128 GLOBAL_DATA = "global" 

    +

    129 PART_RESULTS = "Parts: Energies and others" 

    +

    130 # nodes 

    +

    131 NODE_DISPLACEMENT = "coordinates" 

    +

    132 NODE_TEMPERATURES = "temperatures" 

    +

    133 NODE_ACCELERATIONS = "accelerations" 

    +

    134 NODE_HEAT_FLUX = "heat_flux" 

    +

    135 NODE_MASS_SCALING = "mass_scaling" 

    +

    136 NODE_TEMPERATURE_GRADIENT = "dtdt" 

    +

    137 NODE_VELOCITIES = "velocities" 

    +

    138 

    +

    139 # beam 

    +

    140 BEAM_S_SHEAR_RESULTANT = "s_shear_resultant" 

    +

    141 BEAM_T_SHEAR_RESULTANT = "t_shear_resultant" 

    +

    142 BEAM_S_BENDING_MOMENT = "s_bending_moment" 

    +

    143 BEAM_T_BENDING_MOMENT = "t_bending_moment" 

    +

    144 BEAM_AXIAL_FORCE = "axial_force" 

    +

    145 BEAM_TORSIONAL_MOMENT = "torsional_resultant" 

    +

    146 BEAM_AXIAL_STRESS = "axial_stress" 

    +

    147 BEAM_SHEAR_STRESS_RS = "RS_shear_stress" 

    +

    148 BEAM_SHEAR_STRESS_TR = "TR_shear_stress" 

    +

    149 BEAM_PLASTIC_STRAIN = "plastic_strain" 

    +

    150 BEAM_AXIAL_STRAIN = "axial_strain" 

    +

    151 

    +

    152 # airbag 

    +

    153 AIRBAG_STATE_GEOM = "CPMs_state_geometry" 

    +

    154 AIRBAG_PARTICLE_POS_X = "Pos x" 

    +

    155 AIRBAG_PARTICLE_POS_Y = "Pos y" 

    +

    156 AIRBAG_PARTICLE_POS_Z = "Pos z" 

    +

    157 AIRBAG_PARTICLE_VEL_X = "Vel x" 

    +

    158 AIRBAG_PARTICLE_VEL_Y = "Vel y" 

    +

    159 AIRBAG_PARTICLE_VEL_Z = "Vel z" 

    +

    160 AIRBAG_PARTICLE_MASS = "Mass" 

    +

    161 AIRBAG_PARTICLE_RADIUS = "Radius" 

    +

    162 AIRBAG_PARTICLE_SPIN_ENERGY = "Spin En" 

    +

    163 AIRBAG_PARTICLE_TRAN_ENERGY = "Tran En" 

    +

    164 AIRBAG_PARTICLE_NEIGHBOR_DIST = "NS dist" 

    +

    165 AIRBAG_PARTICLE_GAS_CHAMBER_ID = "GasC ID" 

    +

    166 AIRBAG_PARTICLE_CHAMBER_ID = "Cham ID" 

    +

    167 AIRBAG_PARTICLE_LEAKAGE = "Leakage" 

    +

    168 

    +

    169 STRESS_X = "Sigma-x" 

    +

    170 STRESS_Y = "Sigma-y" 

    +

    171 STRESS_Z = "Sigma-z" 

    +

    172 STRESS_XY = "Sigma-xy" 

    +

    173 STRESS_YZ = "Sigma-yz" 

    +

    174 STRESS_XZ = "Sigma-zx" 

    +

    175 EFF_PSTRAIN = "Effective plastic strain" 

    +

    176 HISTORY_VARS = "extra_value_per_element" 

    +

    177 BENDING_MOMENT_MX = "bending_moment Mx" 

    +

    178 BENDING_MOMENT_MY = "bending_moment My" 

    +

    179 BENDING_MOMENT_MXY = "bending_moment Mxy" 

    +

    180 SHEAR_FORCE_X = "shear_resultant Qx" 

    +

    181 SHEAR_FORCE_Y = "shear_resultant Qy" 

    +

    182 NORMAL_FORCE_X = "normal_resultant Nx" 

    +

    183 NORMAL_FORCE_Y = "normal_resultant Ny" 

    +

    184 NORMAL_FORCE_XY = "normal_resultant Nxy" 

    +

    185 THICKNESS = "thickness" 

    +

    186 UNKNOWN_1 = "element_dependent_variable_1" 

    +

    187 UNKNOWN_2 = "element_dependent_variable_2" 

    +

    188 STRAIN_INNER_X = "Epsilon-x (inner)" 

    +

    189 STRAIN_INNER_Y = "Epsilon-y (inner)" 

    +

    190 STRAIN_INNER_Z = "Epsilon-z (inner)" 

    +

    191 STRAIN_INNER_XY = "Epsilon-xy (inner)" 

    +

    192 STRAIN_INNER_YZ = "Epsilon-yz (inner)" 

    +

    193 STRAIN_INNER_XZ = "Epsilon-zx (inner)" 

    +

    194 STRAIN_OUTER_X = "Epsilon-x (outer)" 

    +

    195 STRAIN_OUTER_Y = "Epsilon-y (outer)" 

    +

    196 STRAIN_OUTER_Z = "Epsilon-z (outer)" 

    +

    197 STRAIN_OUTER_XY = "Epsilon-xy (outer)" 

    +

    198 STRAIN_OUTER_YZ = "Epsilon-yz (outer)" 

    +

    199 STRAIN_OUTER_XZ = "Epsilon-zx (outer)" 

    +

    200 INTERNAL_ENERGY = "internal_energy" 

    +

    201 

    +

    202 STRAIN_X = "Epsilon-x (IP 1)" 

    +

    203 STRAIN_Y = "Epsilon-y (IP 1)" 

    +

    204 STRAIN_Z = "Epsilon-z (IP 1)" 

    +

    205 STRAIN_XY = "Epsilon-xy (IP 1)" 

    +

    206 STRAIN_YZ = "Epsilon-yz (IP 1)" 

    +

    207 STRAIN_XZ = "Epsilon-zx (IP 1)" 

    +

    208 

    +

    209 @staticmethod 

    +

    210 def from_string(femzip_name: str) -> "FemzipArrayType": 

    +

    211 """Converts a variable name to an array type string 

    +

    212 

    +

    213 Parameters 

    +

    214 ---------- 

    +

    215 femzip_name: str 

    +

    216 name of the variable given by femzip 

    +

    217 

    +

    218 Returns 

    +

    219 ------- 

    +

    220 femzip_array_type: FemzipArrayType 

    +

    221 """ 

    +

    222 for fz_array_type in FemzipArrayType.__members__.values(): 

    +

    223 if fz_array_type.value in femzip_name.strip(): 

    +

    224 return fz_array_type 

    +

    225 

    +

    226 err_msg = "Unknown femzip variable name: '{0}'" 

    +

    227 raise ValueError(err_msg.format(femzip_name)) 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6___init___py.html b/coverage/d_febbda7c1df641f6___init___py.html new file mode 100644 index 0000000..190dee5 --- /dev/null +++ b/coverage/d_febbda7c1df641f6___init___py.html @@ -0,0 +1,100 @@ + + + + + Coverage for lasso/dimred/__init__.py: 100% + + + + + +
    +
    +

    + Coverage for lasso/dimred/__init__.py: + 100% +

    + +

    + 2 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from .dimred_run import DimredRun, DimredStage 

    +

    2 

    +

    3__all__ = ["DimredRun", "DimredStage"] 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6_dimred_run_py.html b/coverage/d_febbda7c1df641f6_dimred_run_py.html new file mode 100644 index 0000000..ee28de1 --- /dev/null +++ b/coverage/d_febbda7c1df641f6_dimred_run_py.html @@ -0,0 +1,1177 @@ + + + + + Coverage for lasso/dimred/dimred_run.py: 65% + + + + + +
    +
    +

    + Coverage for lasso/dimred/dimred_run.py: + 65% +

    + +

    + 451 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import argparse 

    +

    2import enum 

    +

    3import glob 

    +

    4import os 

    +

    5import re 

    +

    6import shutil 

    +

    7import sys 

    +

    8import time 

    +

    9from concurrent.futures.process import ProcessPoolExecutor 

    +

    10from typing import Sequence, Tuple, Union 

    +

    11 

    +

    12import h5py 

    +

    13import numpy as np 

    +

    14import psutil 

    +

    15from rich.console import Console 

    +

    16from rich.progress import BarColumn, Progress 

    +

    17from rich.table import Table 

    +

    18from rich.text import Text 

    +

    19 

    +

    20from ..utils.rich_progress_bars import PlaceHolderBar, WorkingDots 

    +

    21from .svd.clustering_betas import create_cluster_arg_dict, create_detector_arg_dict, group_betas 

    +

    22from .svd.plot_beta_clusters import plot_clusters_js 

    +

    23from .svd.pod_functions import calculate_v_and_betas 

    +

    24from .svd.subsampling_methods import create_reference_subsample, remap_random_subsample 

    +

    25 

    +

    26# pylint: disable = too-many-lines 

    +

    27 

    +

    28 

    +

    29class DimredRunError(Exception): 

    +

    30 """Custom exception for errors during the dimensionality reduction""" 

    +

    31 

    +

    32 def __init__(self, msg): 

    +

    33 self.message = msg 

    +

    34 

    +

    35 

    +

    36def get_application_header(): 

    +

    37 """Prints the header of the command line tool""" 

    +

    38 

    +

    39 return """ 

    +

    40 

    +

    41 ==== LASSO - AI ==== 

    +

    42 

    +

    43 visit us: [link=http://www.lasso.de/en]www.lasso.de/en[/link] 

    +

    44 mail: lasso@lasso.de 

    +

    45 """ 

    +

    46 

    +

    47 

    +

    48def timestamp() -> str: 

    +

    49 """Get current timestamp as string 

    +

    50 

    +

    51 Returns 

    +

    52 ------- 

    +

    53 timestamp : str 

    +

    54 current timestamp as string 

    +

    55 """ 

    +

    56 

    +

    57 def add_zero(in_str) -> str: 

    +

    58 if len(in_str) == 1: 

    +

    59 return "0" + in_str 

    +

    60 return in_str 

    +

    61 

    +

    62 loc_time = time.localtime()[3:6] 

    +

    63 h_str = add_zero(str(loc_time[0])) 

    +

    64 m_str = add_zero(str(loc_time[1])) 

    +

    65 s_str = add_zero(str(loc_time[2])) 

    +

    66 t_str = "[" + h_str + ":" + m_str + ":" + s_str + "]" 

    +

    67 return t_str 

    +

    68 

    +

    69 

    +

    70def parse_dimred_args(): 

    +

    71 """Parse the arguments from the command line 

    +

    72 

    +

    73 Returns 

    +

    74 ------- 

    +

    75 args : `argparse.Namespace` 

    +

    76 parsed arguments 

    +

    77 """ 

    +

    78 

    +

    79 parser = argparse.ArgumentParser( 

    +

    80 description="Python utility script for dimensionality reduction written by LASSO GmbH." 

    +

    81 ) 

    +

    82 

    +

    83 parser.add_argument( 

    +

    84 "simulation_runs", 

    +

    85 type=str, 

    +

    86 nargs="*", 

    +

    87 help="Simulation runs or patterns used to search for simulation runs.", 

    +

    88 ) 

    +

    89 parser.add_argument( 

    +

    90 "--reference-run", 

    +

    91 type=str, 

    +

    92 help="Optional. Set the reference run instead of using the first entry in simulation runs.", 

    +

    93 ) 

    +

    94 parser.add_argument( 

    +

    95 "--exclude-runs", 

    +

    96 type=str, 

    +

    97 nargs="*", 

    +

    98 default=[], 

    +

    99 help="Optional. Runs to exclude from the analysis.", 

    +

    100 ) 

    +

    101 parser.add_argument( 

    +

    102 "--start-stage", 

    +

    103 type=str, 

    +

    104 nargs="?", 

    +

    105 default=DIMRED_STAGES[0], 

    +

    106 help="Optional. " 

    +

    107 f"At which specific stage to start the analysis ({', '.join(DIMRED_STAGES)}).", 

    +

    108 ) 

    +

    109 parser.add_argument( 

    +

    110 "--end-stage", 

    +

    111 type=str, 

    +

    112 nargs="?", 

    +

    113 default=DIMRED_STAGES[-1], 

    +

    114 help="Optional. " 

    +

    115 f"At which specific stage to stop the analysis ({', '.join(DIMRED_STAGES)}).", 

    +

    116 ) 

    +

    117 parser.add_argument( 

    +

    118 "--project-dir", 

    +

    119 type=str, 

    +

    120 required=True, 

    +

    121 help="Project dir for temporary files. Must be specified to allow" 

    +

    122 + " restart at specific steps", 

    +

    123 ) 

    +

    124 parser.add_argument( 

    +

    125 "--embedding-images", 

    +

    126 type=str, 

    +

    127 default="", 

    +

    128 help="Optional. Path to folder containing images of runs. Sample names must be numbers", 

    +

    129 ) 

    +

    130 parser.add_argument( 

    +

    131 "--logfile-filepath", 

    +

    132 type=str, 

    +

    133 nargs="?", 

    +

    134 default="", 

    +

    135 help="Optional. Path for the logfile. A file will be created automatically" 

    +

    136 + "in the project dir if not specified.", 

    +

    137 ) 

    +

    138 parser.add_argument( 

    +

    139 "--n-processes", 

    +

    140 type=int, 

    +

    141 nargs="?", 

    +

    142 default=max(1, psutil.cpu_count() - 1), 

    +

    143 help="Optional. Number of processes to use (default: n_cpu-1).", 

    +

    144 ) 

    +

    145 parser.add_argument( 

    +

    146 "--part-ids", 

    +

    147 type=str, 

    +

    148 nargs="*", 

    +

    149 default=[], 

    +

    150 help="Optional. Part ids to process. By default all are taken.", 

    +

    151 ) 

    +

    152 parser.add_argument( 

    +

    153 "--timestep", 

    +

    154 type=int, 

    +

    155 default="-1", 

    +

    156 help="Optional. Sets timestep to analyse. Uses last timestep if not set.", 

    +

    157 ) 

    +

    158 parser.add_argument( 

    +

    159 "--html-name", 

    +

    160 type=str, 

    +

    161 default="3d-beta-plot", 

    +

    162 help="Optional. Sets the name of the generated 3D visualization. " 

    +

    163 + "Default is '3d_beta_plot'", 

    +

    164 ) 

    +

    165 parser.add_argument( 

    +

    166 "--html-timestamp", 

    +

    167 action="store_true", 

    +

    168 help="""Optional. If set, the visualization will include a timestamp of yymmdd_hhmmss, 

    +

    169 else the previous file will be overwritten""", 

    +

    170 ) 

    +

    171 parser.add_argument( 

    +

    172 "--cluster-args", 

    +

    173 type=str, 

    +

    174 nargs="*", 

    +

    175 help="Optional. Arguments for clustering algorithms. " 

    +

    176 + "If not set, clustering will be skipped.", 

    +

    177 ) 

    +

    178 parser.add_argument( 

    +

    179 "--outlier-args", 

    +

    180 type=str, 

    +

    181 nargs="*", 

    +

    182 help="Optional. Arguments for outlier detection before clustering.", 

    +

    183 ) 

    +

    184 

    +

    185 if len(sys.argv) < 2: 

    +

    186 parser.print_help() 

    +

    187 sys.exit(0) 

    +

    188 

    +

    189 return parser.parse_args(sys.argv[1:]) 

    +

    190 

    +

    191 

    +

    192class DimredStage(enum.Enum): 

    +

    193 """Enum for all stages of the dimenstionality reduction""" 

    +

    194 

    +

    195 REFERENCE_RUN = "REFERENCE_RUN" 

    +

    196 IMPORT_RUNS = "IMPORT_RUNS" 

    +

    197 REDUCTION = "REDUCTION" 

    +

    198 CLUSTERING = "CLUSTERING" 

    +

    199 EXPORT_PLOT = "EXPORT_PLOT" 

    +

    200 

    +

    201 

    +

    202DIMRED_STAGES = ( 

    +

    203 DimredStage.REFERENCE_RUN.value, 

    +

    204 DimredStage.IMPORT_RUNS.value, 

    +

    205 DimredStage.REDUCTION.value, 

    +

    206 DimredStage.CLUSTERING.value, 

    +

    207 DimredStage.EXPORT_PLOT.value, 

    +

    208) 

    +

    209 

    +

    210 

    +

    211class HDF5FileNames(enum.Enum): 

    +

    212 """Enum for arrays in the hdf5 file""" 

    +

    213 

    +

    214 SUBSAMPLE_SAVE_NAME = "subsample" 

    +

    215 SUBSAMPLED_GROUP_NAME = "subsampled_runs" 

    +

    216 BETAS_GROUP_NAME = "betas" 

    +

    217 V_ROB_SAVE_NAME = "v_rob" 

    +

    218 PLOT_LOAD_TIME = "t_load" 

    +

    219 SUBSAMPLE_PROCESS_TIME = "t_total" 

    +

    220 NR_CLUSTER = "nr_clusters" 

    +

    221 HAS_OUTLIERS = "has_outliers" 

    +

    222 OUTLIERS = "outlier" 

    +

    223 CLUSTER = "cluster" 

    +

    224 

    +

    225 

    +

    226class DimredRun: 

    +

    227 """Class to control and run the dimensionality reduction process""" 

    +

    228 

    +

    229 # pylint: disable = too-many-instance-attributes 

    +

    230 

    +

    231 reference_run: str 

    +

    232 simulation_runs: Sequence[str] 

    +

    233 exclude_runs: Sequence[str] 

    +

    234 project_dir: str 

    +

    235 img_path: Union[None, str] 

    +

    236 logfile_filepath: str 

    +

    237 n_processes: int 

    +

    238 part_ids: Sequence[int] 

    +

    239 timestep: int 

    +

    240 start_stage_index: int 

    +

    241 end_stage_index: int 

    +

    242 skip_valid: bool 

    +

    243 html_name: str 

    +

    244 html_set_timestamp: bool 

    +

    245 show_output: bool 

    +

    246 cluster_type: Union[None, str] 

    +

    247 detector_type: Union[None, str] 

    +

    248 cluster_args: Union[None, dict] 

    +

    249 detector_args: Union[None, dict] 

    +

    250 h5file: Union[None, h5py.File] 

    +

    251 use_folder_name: bool 

    +

    252 

    +

    253 def __init__( 

    +

    254 self, 

    +

    255 simulation_runs: Sequence[str], 

    +

    256 start_stage: str, 

    +

    257 end_stage: str, 

    +

    258 project_dir: str, 

    +

    259 html_name: str = "3d-beta-plot", 

    +

    260 html_set_timestamp: bool = False, 

    +

    261 reference_run: Union[str, None] = None, 

    +

    262 console: Union[Console, None] = None, 

    +

    263 img_path: Union[None, str] = None, 

    +

    264 exclude_runs: Union[None, Sequence[str]] = None, 

    +

    265 logfile_filepath: Union[str, None] = None, 

    +

    266 n_processes: int = 1, 

    +

    267 part_id_filter: Union[None, Sequence[int]] = None, 

    +

    268 timestep: int = -1, 

    +

    269 show_output: bool = True, 

    +

    270 cluster_args: Union[None, Sequence[str]] = None, 

    +

    271 outlier_args: Union[None, Sequence[str]] = None, 

    +

    272 ): 

    +

    273 """Class handling a dimensionality reduction 

    +

    274 

    +

    275 Parameters 

    +

    276 ---------- 

    +

    277 simulation_runs : Sequence[str] 

    +

    278 simulation runs to analyze 

    +

    279 start_stage: str 

    +

    280 where to start 

    +

    281 end_stage: str 

    +

    282 where to stop 

    +

    283 project_dir : Union[None, str] 

    +

    284 required project directory for creation of buffer files. Allows restart in between. 

    +

    285 html_name: str 

    +

    286 Name of the output .html file 

    +

    287 html_set_timestamp: bool 

    +

    288 If true, the output .html will include a timestamp (hh_mm_ss) at the end of the filename 

    +

    289 reference_run : str 

    +

    290 filepath to the reference run. 

    +

    291 If not set, first entry in simulation_runs will be used as reference run. 

    +

    292 console: Union[rich.console.Console, None], default: None 

    +

    293 Console for information printing and logging. 

    +

    294 Rich offers pretty text printing, syntax highlighting etc. 

    +

    295 img_path: Union[None, str] 

    +

    296 optional image directory to show images in visualization. 

    +

    297 exclude_runs: Union[Sequence[str], None] 

    +

    298 optional list of runs to exclude from processing 

    +

    299 logfile_filepath : Union[str, None] 

    +

    300 path of the log file (always appends) 

    +

    301 n_processes: int 

    +

    302 number of processes to use during execution 

    +

    303 part_id_filter: Union[Sequence[int], None] 

    +

    304 which part ids to process 

    +

    305 timestep: int, default: -1 

    +

    306 specifies timestep to analyze in clustering and show in output visualization 

    +

    307 show_output: bool, default: True 

    +

    308 Set to false not to show the output html in the browser 

    +

    309 cluster_args: Union[None, [str]], default: None 

    +

    310 Arguments for cluster algorithm 

    +

    311 outlier_args: Union[None, [str]], default: None 

    +

    312 Arguments for outlier detection algorithm 

    +

    313 

    +

    314 Notes 

    +

    315 ----- 

    +

    316 Using a project directory allows to restart stages of the entire 

    +

    317 process. 

    +

    318 """ 

    +

    319 

    +

    320 # pylint: disable = too-many-arguments, too-many-locals 

    +

    321 

    +

    322 # settings 

    +

    323 # Set up Rich Console and Rich logging 

    +

    324 self.console = console 

    +

    325 if self.console: 

    +

    326 self.console.print(get_application_header(), style="success", highlight=True) 

    +

    327 

    +

    328 self.logfile_filepath = ( 

    +

    329 logfile_filepath 

    +

    330 if logfile_filepath 

    +

    331 else os.path.join(project_dir, "logfile") 

    +

    332 if project_dir 

    +

    333 else "" 

    +

    334 ) 

    +

    335 

    +

    336 self._msg_option = "{:16s}: {}" 

    +

    337 

    +

    338 # run variables 

    +

    339 # table is a rich format containing information of the variables 

    +

    340 table = Table(show_header=False) 

    +

    341 self.n_processes = self._parse_n_processes(n_processes, table) 

    +

    342 

    +

    343 # check for correctly parsed simulation-runs 

    +

    344 if len(simulation_runs) == 0: 

    +

    345 err_msg = "No entries in positional argument 'simulation-runs'." 

    +

    346 err_msg += "\nIt is recommended to set the 'simulation-runs' arguments first!" 

    +

    347 self.raise_error(err_msg) 

    +

    348 

    +

    349 # parse simulation and reference run 

    +

    350 # if no reference run was set use first simulation run 

    +

    351 ( 

    +

    352 self.simulation_runs, 

    +

    353 self.reference_run, 

    +

    354 self.exclude_runs, 

    +

    355 ) = self._parse_simulation_and_reference_runs( 

    +

    356 simulation_runs, reference_run, tuple() if not exclude_runs else exclude_runs, table 

    +

    357 ) 

    +

    358 

    +

    359 # check if basename or foldername serves as unique identifier 

    +

    360 self.use_folder_name = os.path.basename(self.simulation_runs[0]) == os.path.basename( 

    +

    361 self.simulation_runs[1] 

    +

    362 ) 

    +

    363 

    +

    364 # set project dir and simulation runs 

    +

    365 self.project_dir = self._parse_project_dir(project_dir, table) 

    +

    366 self.part_ids = part_id_filter if part_id_filter is not None else tuple() 

    +

    367 if self.part_ids is not None and len(self.part_ids) != 0: 

    +

    368 table.add_row("selected parts", ",".join(str(entry) for entry in self.part_ids)) 

    +

    369 self.timestep = timestep 

    +

    370 if timestep != -1: 

    +

    371 table.add_row("Timestep: ", str(timestep)) 

    +

    372 

    +

    373 # check if start_stage_index and end_stage_index are valid 

    +

    374 self.start_stage_index, self.end_stage_index = self._parse_stages(start_stage, end_stage) 

    +

    375 if self.console: 

    +

    376 self.console.print(table) 

    +

    377 

    +

    378 # check valid image path 

    +

    379 self.img_path = self._check_img_path(img_path) if img_path else None 

    +

    380 

    +

    381 # set cluster and outlier arguments 

    +

    382 self._parse_cluster_and_outlier_args(cluster_args, outlier_args) 

    +

    383 

    +

    384 self.html_name = self._parse_html_name(html_name) 

    +

    385 self.html_set_timestamp = html_set_timestamp 

    +

    386 self.show_output = show_output 

    +

    387 

    +

    388 self.pool = None 

    +

    389 

    +

    390 def log(self, msg: str, style: Union[str, None] = None, highlight: bool = False): 

    +

    391 """Log a message 

    +

    392 

    +

    393 Parameters 

    +

    394 ---------- 

    +

    395 msg : str 

    +

    396 message to log 

    +

    397 style : Union[str, None] 

    +

    398 style of the message 

    +

    399 highlight : bool 

    +

    400 whether to highlight the message or not 

    +

    401 """ 

    +

    402 if self.console: 

    +

    403 self.console.print(timestamp() + msg, style=style, highlight=highlight) 

    +

    404 

    +

    405 def raise_error(self, err_msg: str): 

    +

    406 """ 

    +

    407 Parameters 

    +

    408 ---------- 

    +

    409 err_msg : str 

    +

    410 error message to be raised 

    +

    411 

    +

    412 Raises 

    +

    413 ------ 

    +

    414 RuntimeError 

    +

    415 raises an exception with error msg 

    +

    416 

    +

    417 Notes 

    +

    418 ----- 

    +

    419 Logs correctly and deals with open file handles. 

    +

    420 """ 

    +

    421 

    +

    422 err_msg_text = Text(err_msg, style="error") 

    +

    423 

    +

    424 if not self.console: 

    +

    425 raise DimredRunError(err_msg) 

    +

    426 

    +

    427 try: 

    +

    428 self.h5file.close() 

    +

    429 self.console.print("closed hdf5 file") 

    +

    430 except AttributeError: 

    +

    431 self.console.print("no hdf5 file to close") 

    +

    432 

    +

    433 self.console.print(err_msg_text, style="error") 

    +

    434 if self.logfile_filepath: 

    +

    435 self.console.save_html(self.logfile_filepath) 

    +

    436 

    +

    437 raise DimredRunError(err_msg) 

    +

    438 

    +

    439 # pylint believes this function has different return statements 

    +

    440 # whereas it only has one. 

    +

    441 # pylint: disable = inconsistent-return-statements 

    +

    442 def _check_img_path(self, img_path: str) -> str: 

    +

    443 """checks if provided image path is valid""" 

    +

    444 

    +

    445 if os.path.isdir(img_path): 

    +

    446 abs_path = os.path.abspath(img_path) 

    +

    447 js_path = re.sub(r"\\", "/", abs_path) 

    +

    448 return js_path 

    +

    449 

    +

    450 err_msg = "provided argument --embedding.images is not a folder" 

    +

    451 self.raise_error(err_msg) 

    +

    452 

    +

    453 def _parse_stages(self, start_stage: str, end_stage: str): 

    +

    454 

    +

    455 # check validity 

    +

    456 if start_stage not in DIMRED_STAGES: 

    +

    457 err_msg = f"{start_stage} is not a valid stage. Try: {', '.join(DIMRED_STAGES)}." 

    +

    458 self.raise_error(err_msg) 

    +

    459 

    +

    460 if end_stage not in DIMRED_STAGES: 

    +

    461 err_msg = f"{end_stage} is not a valid stage. Try: {', '.join(DIMRED_STAGES)}." 

    +

    462 self.raise_error(err_msg) 

    +

    463 

    +

    464 # get indexes 

    +

    465 start_stage_index = DIMRED_STAGES.index(start_stage) 

    +

    466 end_stage_index = DIMRED_STAGES.index(end_stage) 

    +

    467 

    +

    468 # check if start and end are in correct order 

    +

    469 if start_stage_index > end_stage_index: 

    +

    470 err_msg = ( 

    +

    471 f"The specified end stage '{end_stage}' " 

    +

    472 f"comes before the start stage ({start_stage}). " 

    +

    473 f"Try the order: {', '.join(DIMRED_STAGES)}" 

    +

    474 ) 

    +

    475 self.raise_error(err_msg) 

    +

    476 

    +

    477 return start_stage_index, end_stage_index 

    +

    478 

    +

    479 def _check_valid_stage_skip(self): 

    +

    480 # check if stage skip is valid 

    +

    481 if self.start_stage_index == DIMRED_STAGES.index(DimredStage.IMPORT_RUNS.value): 

    +

    482 self.log("Skipped setup stage", style="warning") 

    +

    483 if HDF5FileNames.SUBSAMPLE_SAVE_NAME.value not in self.h5file: # type: ignore 

    +

    484 msg = "no reference sample found" 

    +

    485 self.raise_error(msg) 

    +

    486 elif self.start_stage_index == DIMRED_STAGES.index(DimredStage.REDUCTION.value): 

    +

    487 self.log("Skipped import stage", style="warning") 

    +

    488 if HDF5FileNames.SUBSAMPLED_GROUP_NAME.value not in self.h5file: # type: ignore 

    +

    489 msg = "no subsampled samples found" 

    +

    490 self.raise_error(msg) 

    +

    491 elif self.start_stage_index == DIMRED_STAGES.index(DimredStage.CLUSTERING.value): 

    +

    492 self.log("Skipped reduction stage", style="warning") 

    +

    493 if ( 

    +

    494 HDF5FileNames.V_ROB_SAVE_NAME.value not in self.h5file # type: ignore 

    +

    495 or HDF5FileNames.BETAS_GROUP_NAME.value not in self.h5file 

    +

    496 ): # type: ignore 

    +

    497 err_msg = "Could not find reduced betas and V_ROB" 

    +

    498 self.raise_error(err_msg) 

    +

    499 elif self.start_stage_index == DIMRED_STAGES.index(DimredStage.CLUSTERING.value): 

    +

    500 self.log("Skipped clustering stage", style="warning") 

    +

    501 

    +

    502 def _parse_part_ids(self, part_ids: Union[Sequence[int], None]) -> Sequence[int]: 

    +

    503 

    +

    504 if not part_ids: 

    +

    505 return tuple() 

    +

    506 

    +

    507 assert all(isinstance(pid, int) for pid in part_ids), "All part ids must be of type 'int'" 

    +

    508 

    +

    509 return part_ids 

    +

    510 

    +

    511 def _parse_project_dir(self, project_dir: Union[str, None], table: Table): 

    +

    512 

    +

    513 if not project_dir: 

    +

    514 return "" 

    +

    515 

    +

    516 project_dir = os.path.abspath(project_dir) 

    +

    517 

    +

    518 if os.path.isfile(project_dir): 

    +

    519 err_msg = ( 

    +

    520 f"The project path '{project_dir}' is pointing at an existing file." 

    +

    521 " Change either the project path or move the file." 

    +

    522 ) 

    +

    523 self.raise_error(err_msg) 

    +

    524 

    +

    525 if not os.path.exists(project_dir): 

    +

    526 os.makedirs(project_dir, exist_ok=True) 

    +

    527 

    +

    528 table.add_row("project-dir", project_dir) 

    +

    529 return project_dir 

    +

    530 

    +

    531 def _parse_simulation_and_reference_runs( 

    +

    532 self, 

    +

    533 simulation_run_patterns: Sequence[str], 

    +

    534 reference_run_pattern: Union[None, str], 

    +

    535 exclude_runs: Sequence[str], 

    +

    536 table: Table, 

    +

    537 ) -> Tuple[Sequence[str], str, Sequence[str]]: 

    +

    538 

    +

    539 # pylint: disable = too-many-locals 

    +

    540 

    +

    541 # search all denoted runs 

    +

    542 simulation_runs = [] 

    +

    543 for pattern in simulation_run_patterns: 

    +

    544 simulation_runs += glob.glob(pattern) 

    +

    545 simulation_runs = [ 

    +

    546 os.path.normpath(filepath) for filepath in simulation_runs if os.path.isfile(filepath) 

    +

    547 ] 

    +

    548 

    +

    549 # search all excluded runs 

    +

    550 runs_to_exclude = [] 

    +

    551 for pattern in exclude_runs: 

    +

    552 runs_to_exclude += glob.glob(pattern) 

    +

    553 runs_to_exclude = [ 

    +

    554 os.path.normpath(filepath) for filepath in runs_to_exclude if os.path.isfile(filepath) 

    +

    555 ] 

    +

    556 

    +

    557 n_runs_before_filtering = len(simulation_runs) 

    +

    558 simulation_runs = [ 

    +

    559 filepath for filepath in simulation_runs if filepath not in runs_to_exclude 

    +

    560 ] 

    +

    561 n_runs_after_filtering = len(simulation_runs) 

    +

    562 

    +

    563 # check if simulation runs are valid 

    +

    564 

    +

    565 simulation_runs_ok = len(simulation_runs) != 0 

    +

    566 

    +

    567 if not simulation_runs_ok: 

    +

    568 err_msg = ( 

    +

    569 "No simulation files could be found with the specified patterns. " 

    +

    570 "Check the argument 'simulation_runs'." 

    +

    571 ) 

    +

    572 self.raise_error(err_msg) 

    +

    573 

    +

    574 table.add_row("# simul.-files", str(len(simulation_runs))) 

    +

    575 

    +

    576 table.add_row("# excluded files", f"{n_runs_before_filtering - n_runs_after_filtering}") 

    +

    577 

    +

    578 # check for valid reference run 

    +

    579 reference_run = "" 

    +

    580 if reference_run_pattern: 

    +

    581 

    +

    582 reference_run_ok = os.path.isfile(reference_run_pattern) 

    +

    583 if not reference_run_ok: 

    +

    584 err_msg = f"Filepath '{reference_run_pattern}' is not a file." 

    +

    585 self.raise_error(err_msg) 

    +

    586 

    +

    587 reference_run = os.path.normpath(reference_run_pattern) 

    +

    588 else: 

    +

    589 # use first simulation run if no reference run was provided 

    +

    590 # check if enough simulation runs remain 

    +

    591 if len(simulation_runs) > 1: 

    +

    592 reference_run = simulation_runs[0] 

    +

    593 else: 

    +

    594 err_msg = "Number of Simulation runs after using first as reference run is zero." 

    +

    595 self.raise_error(err_msg) 

    +

    596 

    +

    597 # add to table 

    +

    598 table.add_row("reference-run", reference_run) 

    +

    599 

    +

    600 # remove the reference run from simulation runs 

    +

    601 if reference_run and reference_run in simulation_runs: 

    +

    602 simulation_runs.remove(reference_run) 

    +

    603 

    +

    604 # sort it because we can! 

    +

    605 def atoi(text): 

    +

    606 return int(text) if text.isdigit() else text 

    +

    607 

    +

    608 def natural_keys(text): 

    +

    609 return [atoi(c) for c in re.split(r"(\d+)", text)] 

    +

    610 

    +

    611 simulation_runs = sorted(simulation_runs, key=natural_keys) 

    +

    612 

    +

    613 return simulation_runs, reference_run, runs_to_exclude 

    +

    614 

    +

    615 def _parse_cluster_and_outlier_args( 

    +

    616 self, cluster_args: Union[Sequence[str], None], outlier_args: Union[Sequence[str], None] 

    +

    617 ): 

    +

    618 """verifies correct oultier and cluster args, if provided""" 

    +

    619 

    +

    620 # creates a valid argument dict for clustering arguments 

    +

    621 if cluster_args is None: 

    +

    622 self.cluster_type = None 

    +

    623 self.cluster_args = None 

    +

    624 else: 

    +

    625 result = create_cluster_arg_dict(cluster_args) 

    +

    626 

    +

    627 # check for errors 

    +

    628 if isinstance(result, str): 

    +

    629 self.raise_error(result) 

    +

    630 else: 

    +

    631 self.cluster_type, self.cluster_args = result[0], result[1] 

    +

    632 

    +

    633 # creates a valid argument dict for outlier detection arguments 

    +

    634 self.detector_type = None 

    +

    635 self.detector_args = {} 

    +

    636 

    +

    637 if outlier_args: 

    +

    638 result = create_detector_arg_dict(outlier_args) 

    +

    639 # check for errors 

    +

    640 if isinstance(result, str): 

    +

    641 self.raise_error(result) 

    +

    642 self.detector_type = result[0] 

    +

    643 self.detector_args = result[1] 

    +

    644 

    +

    645 def _parse_n_processes(self, n_processes: int, table: Table) -> int: 

    +

    646 

    +

    647 if n_processes <= 0: 

    +

    648 err_msg = f"n-processes is '{n_processes}' but must be at least 1." 

    +

    649 self.raise_error(err_msg) 

    +

    650 

    +

    651 table.add_row("n-processes", str(n_processes)) 

    +

    652 return n_processes 

    +

    653 

    +

    654 def _parse_html_name(self, html_name_string: str) -> str: 

    +

    655 

    +

    656 html_name, replace_count = re.subn(r"[!§$%&/()=?\"\[\]{}\\.,;:<>|]", "", html_name_string) 

    +

    657 html_name = html_name.replace(" ", "-") 

    +

    658 

    +

    659 if replace_count > 0: 

    +

    660 msg = ( 

    +

    661 f"Replaced {replace_count} invalid characters for the html file name. " 

    +

    662 f"The new hmtl name is: {html_name}" 

    +

    663 ) 

    +

    664 self.log(msg) 

    +

    665 

    +

    666 return html_name 

    +

    667 

    +

    668 def __enter__(self): 

    +

    669 self.pool = ProcessPoolExecutor(max_workers=self.n_processes) 

    +

    670 self.h5file = h5py.File(os.path.join(self.project_dir, "project_buffer.hdf5"), "a") 

    +

    671 self._check_valid_stage_skip() 

    +

    672 return self 

    +

    673 

    +

    674 def __exit__(self, exception_type, exception_value, traceback): 

    +

    675 self.pool = None 

    +

    676 self.h5file.close() 

    +

    677 self.h5file = None 

    +

    678 

    +

    679 def _perform_context_check(self): 

    +

    680 if self.pool is None: 

    +

    681 msg = "The class function can only be used in a 'with' block on the instance itself." 

    +

    682 self.raise_error(msg) 

    +

    683 

    +

    684 def reset_project_dir(self): 

    +

    685 """resets the project directory entirely""" 

    +

    686 

    +

    687 # delete folder 

    +

    688 if os.path.exists(self.project_dir): 

    +

    689 shutil.rmtree(self.project_dir) 

    +

    690 

    +

    691 if self.project_dir: 

    +

    692 os.makedirs(self.project_dir, exist_ok=True) 

    +

    693 

    +

    694 def process_reference_run(self): 

    +

    695 """Process the reference run""" 

    +

    696 

    +

    697 # is a process pool up 

    +

    698 self._perform_context_check() 

    +

    699 

    +

    700 msg = "Reference Subsample" 

    +

    701 self.log(msg) 

    +

    702 

    +

    703 # init progress bar 

    +

    704 if self.console: 

    +

    705 prog = Progress("", WorkingDots()) 

    +

    706 else: 

    +

    707 prog = PlaceHolderBar() 

    +

    708 with prog: 

    +

    709 ref_task = prog.add_task("", total=1) 

    +

    710 

    +

    711 # Delete existing reference subsample 

    +

    712 if HDF5FileNames.SUBSAMPLE_SAVE_NAME.value in self.h5file: # type: ignore 

    +

    713 del self.h5file[HDF5FileNames.SUBSAMPLE_SAVE_NAME.value] 

    +

    714 

    +

    715 reference_sample = create_reference_subsample(self.reference_run, self.part_ids) 

    +

    716 

    +

    717 prog.advance(ref_task) # type: ignore 

    +

    718 

    +

    719 if isinstance(reference_sample, str): 

    +

    720 self.raise_error(reference_sample) 

    +

    721 

    +

    722 # create dataset in h5file 

    +

    723 h5_ref = self.h5file.create_dataset( 

    +

    724 HDF5FileNames.SUBSAMPLE_SAVE_NAME.value, data=reference_sample[0] 

    +

    725 ) 

    +

    726 h5_ref.attrs[HDF5FileNames.PLOT_LOAD_TIME.value] = reference_sample[2] 

    +

    727 h5_ref.attrs[HDF5FileNames.SUBSAMPLE_PROCESS_TIME.value] = reference_sample[1] 

    +

    728 

    +

    729 # log time and success 

    +

    730 self.log("Loadtime Reference subsample: " + str(reference_sample[2])[:5]) 

    +

    731 self.log("Total time for Reference subsample: " + str(reference_sample[1])[:5]) 

    +

    732 self.log("Reference subsample completed", style="success") 

    +

    733 

    +

    734 def subsample_to_reference_run(self): 

    +

    735 """Subsamples all runs""" 

    +

    736 

    +

    737 # pylint: disable = too-many-branches,too-many-locals 

    +

    738 

    +

    739 self._perform_context_check() 

    +

    740 self.log("Subsampling") 

    +

    741 

    +

    742 # init progress bar 

    +

    743 if self.console: 

    +

    744 prog = Progress( 

    +

    745 "[progress.description]{task.description}", 

    +

    746 WorkingDots(), 

    +

    747 BarColumn(), 

    +

    748 "{task.completed} of {task.total};", 

    +

    749 # SubsamplingWaitTime(self.n_processes) 

    +

    750 ) 

    +

    751 else: 

    +

    752 prog = PlaceHolderBar() 

    +

    753 

    +

    754 with prog: 

    +

    755 

    +

    756 # define progressbar task 

    +

    757 task1 = prog.add_task( 

    +

    758 "[cyan]Subsampling plots [/cyan]", total=len(self.simulation_runs) 

    +

    759 ) 

    +

    760 h5_ref = self.h5file[HDF5FileNames.SUBSAMPLE_SAVE_NAME.value] 

    +

    761 # prog.columns[4].update_avrg(h5_ref.attrs[HDF5FileNames.plot_load_time.value]) 

    +

    762 

    +

    763 submitted_samples = [] 

    +

    764 

    +

    765 # delete previous subsample entries 

    +

    766 if HDF5FileNames.SUBSAMPLED_GROUP_NAME.value in self.h5file: # type: ignore 

    +

    767 del self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value] 

    +

    768 

    +

    769 # submit all simulation runs 

    +

    770 for _, entry in enumerate(self.simulation_runs): 

    +

    771 name = "overwrite_this" 

    +

    772 if self.use_folder_name: 

    +

    773 name = os.path.basename(os.path.split(entry)[0]) 

    +

    774 else: 

    +

    775 name = os.path.basename(entry) 

    +

    776 

    +

    777 try: 

    +

    778 future = self.pool.submit( 

    +

    779 remap_random_subsample, entry, self.part_ids, h5_ref[:] 

    +

    780 ) 

    +

    781 

    +

    782 submitted_samples.append(np.array([name, future])) 

    +

    783 except Exception: 

    +

    784 break 

    +

    785 

    +

    786 # check if an error occurred 

    +

    787 # pylint: disable = protected-access, undefined-loop-variable 

    +

    788 if self.pool._broken and "entry" in locals(): 

    +

    789 msg = f"Failed to load file: {entry}" 

    +

    790 self.raise_error(msg) 

    +

    791 

    +

    792 # we measure required time here 

    +

    793 t_cum = 0 

    +

    794 t_cum_io = 0 

    +

    795 

    +

    796 # prepare hdf5 file 

    +

    797 self.h5file.create_group(HDF5FileNames.SUBSAMPLED_GROUP_NAME.value) 

    +

    798 # This isn't very elegant, there must be a better way 

    +

    799 while not prog.finished: 

    +

    800 for i, sub in enumerate(submitted_samples): 

    +

    801 if sub[1].done(): 

    +

    802 try: 

    +

    803 if isinstance(sub[1].result()[0], str): 

    +

    804 self.raise_error(sub[1].result()) 

    +

    805 h5_sample = self.h5file[ 

    +

    806 HDF5FileNames.SUBSAMPLED_GROUP_NAME.value 

    +

    807 ].create_dataset(sub[0], data=sub[1].result()[0]) 

    +

    808 h5_sample.attrs[HDF5FileNames.PLOT_LOAD_TIME.value] = sub[1].result()[2] 

    +

    809 h5_sample.attrs[HDF5FileNames.SUBSAMPLE_PROCESS_TIME.value] = sub[ 

    +

    810 1 

    +

    811 ].result()[1] 

    +

    812 submitted_samples.pop(i) 

    +

    813 prog.advance(task1) # type: ignore 

    +

    814 t_cum_io += sub[1].result()[2] 

    +

    815 t_cum += sub[1].result()[1] 

    +

    816 except RuntimeError: 

    +

    817 err_msg = f"Error while loading {sub}" 

    +

    818 self.raise_error(err_msg) 

    +

    819 time.sleep(0.5) 

    +

    820 

    +

    821 # calculate required time 

    +

    822 t_avrg = t_cum / len(self.simulation_runs) 

    +

    823 t_avrg_io = t_cum_io / len(self.simulation_runs) 

    +

    824 

    +

    825 # log results 

    +

    826 self.log("Average Time per Subsampling Process: " + str(t_avrg)[0:5]) 

    +

    827 self.log("Average Loadtime per sample: " + str(t_avrg_io)[0:5]) 

    +

    828 

    +

    829 self.log("Subsampling completed", style="success") 

    +

    830 

    +

    831 # Finished: We either have all sub-sampled runs in the project_dir, 

    +

    832 # or a list containing all sub-sampled runs 

    +

    833 # Problem: we might be running into issues with available RAM? 

    +

    834 # 1000 runs, 30 timesteps, sub-sampled onto 2000 points -> 1,34GB 

    +

    835 

    +

    836 def dimension_reduction_svd(self): 

    +

    837 """Calculate V_ROB and Betas""" 

    +

    838 

    +

    839 # pylint: disable = too-many-locals 

    +

    840 

    +

    841 # applying pod_functions.py 

    +

    842 # (TODO: lots of stuff in the pod_functions.py has to be overhauled) 

    +

    843 # save if appropriate into project_dir 

    +

    844 self.log("Dimension Reduction") 

    +

    845 

    +

    846 if self.console: 

    +

    847 # prog = Progress("", WorkingDots()) 

    +

    848 prog = Progress( 

    +

    849 "[progress.description]{task.description}", 

    +

    850 WorkingDots(), 

    +

    851 BarColumn(), 

    +

    852 "{task.completed} of {task.total} timesteps;", 

    +

    853 # SubsamplingWaitTime(self.n_processes) 

    +

    854 ) 

    +

    855 else: 

    +

    856 prog = PlaceHolderBar() 

    +

    857 with prog: 

    +

    858 # deletes old files 

    +

    859 if HDF5FileNames.BETAS_GROUP_NAME.value in self.h5file: # type: ignore 

    +

    860 del self.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] 

    +

    861 if HDF5FileNames.V_ROB_SAVE_NAME.value in self.h5file: # type: ignore 

    +

    862 del self.h5file[HDF5FileNames.V_ROB_SAVE_NAME.value] 

    +

    863 

    +

    864 beta_group = self.h5file.create_group(HDF5FileNames.BETAS_GROUP_NAME.value) 

    +

    865 

    +

    866 excluded_entries = [ 

    +

    867 os.path.basename(os.path.split(entry)[0]) 

    +

    868 if self.use_folder_name 

    +

    869 else os.path.basename(entry) 

    +

    870 for entry in self.exclude_runs 

    +

    871 ] 

    +

    872 

    +

    873 valid_entries = [ 

    +

    874 entry 

    +

    875 for entry in self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value].keys() 

    +

    876 if entry not in excluded_entries 

    +

    877 ] 

    +

    878 

    +

    879 run_timesteps = np.array( 

    +

    880 [ 

    +

    881 self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value][entry].shape[0] 

    +

    882 for entry in valid_entries 

    +

    883 ] 

    +

    884 ) 

    +

    885 

    +

    886 min_step = np.min(run_timesteps) 

    +

    887 max_step = np.max(run_timesteps) 

    +

    888 

    +

    889 if min_step != max_step: 

    +

    890 warn_msg = ( 

    +

    891 "The timesteps fo the samples don't match, only " 

    +

    892 + "processing up to timestep {}. Skipped {} timesteps" 

    +

    893 ) 

    +

    894 warn_msg = warn_msg.format(min_step, max_step - min_step) 

    +

    895 self.log(warn_msg, style="warning") 

    +

    896 

    +

    897 # add task after checking condition, else output looks wonky 

    +

    898 beta_task = prog.add_task("[cyan]Reducing Plots [/cyan]", total=int(min_step)) 

    +

    899 

    +

    900 sub_displ = np.stack( 

    +

    901 [ 

    +

    902 self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value][entry][:min_step, :] 

    +

    903 for entry in valid_entries 

    +

    904 ] 

    +

    905 ) 

    +

    906 

    +

    907 result = calculate_v_and_betas( 

    +

    908 sub_displ, progress_bar=prog, task_id=beta_task 

    +

    909 ) # type: ignore 

    +

    910 # returns string if samplesize to small 

    +

    911 if isinstance(result, str): 

    +

    912 self.raise_error(result) 

    +

    913 

    +

    914 v_rob, betas = result 

    +

    915 for i, sample in enumerate( 

    +

    916 self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value].keys() 

    +

    917 ): 

    +

    918 beta_group.create_dataset(sample, data=betas[i]) 

    +

    919 

    +

    920 self.h5file.create_dataset(HDF5FileNames.V_ROB_SAVE_NAME.value, data=v_rob) 

    +

    921 

    +

    922 self.log("Dimension Reduction completed", style="success") 

    +

    923 

    +

    924 def clustering_results(self): 

    +

    925 """clustering results""" 

    +

    926 

    +

    927 # pylint: disable = too-many-locals 

    +

    928 

    +

    929 self._perform_context_check() 

    +

    930 # delete old entries 

    +

    931 betas_group = self.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] 

    +

    932 if HDF5FileNames.HAS_OUTLIERS.value in betas_group.attrs: 

    +

    933 del betas_group.attrs[HDF5FileNames.HAS_OUTLIERS.value] 

    +

    934 

    +

    935 if HDF5FileNames.NR_CLUSTER.value in betas_group.attrs: 

    +

    936 del betas_group.attrs[HDF5FileNames.NR_CLUSTER.value] 

    +

    937 

    +

    938 if not self.cluster_type and not self.detector_type: 

    +

    939 msg = "No arguments provided for clustering, clustering aborted" 

    +

    940 self.log(msg) 

    +

    941 return 

    +

    942 

    +

    943 self.log("Clustering") 

    +

    944 

    +

    945 # init progress bar 

    +

    946 if self.console: 

    +

    947 prog = Progress("", WorkingDots()) 

    +

    948 else: 

    +

    949 prog = PlaceHolderBar() 

    +

    950 with prog: 

    +

    951 cluster_task = prog.add_task("", total=1) 

    +

    952 

    +

    953 # performs clustering with provided arguments 

    +

    954 

    +

    955 excluded_entries = [ 

    +

    956 os.path.basename(os.path.split(entry)[0]) 

    +

    957 if self.use_folder_name 

    +

    958 else os.path.basename(entry) 

    +

    959 for entry in self.exclude_runs 

    +

    960 ] 

    +

    961 

    +

    962 beta_index = np.stack( 

    +

    963 [key for key in betas_group.keys() if key not in excluded_entries] 

    +

    964 ) 

    +

    965 try: 

    +

    966 betas = np.stack( 

    +

    967 [betas_group[entry][self.timestep, :3] for entry in beta_index] 

    +

    968 ) # betas_group.keys()]) 

    +

    969 except ValueError: 

    +

    970 log_msg = ( 

    +

    971 "Invalid parameter for timestep. Set a valid timestep with --timestep.\n" 

    +

    972 "To save time, you can restart the tool with --start-stage CLUSTERING." 

    +

    973 ) 

    +

    974 self.log(log_msg, style="warning") 

    +

    975 t_max = betas_group[beta_index[0]][:].shape[0] 

    +

    976 err_msg = ( 

    +

    977 f"Timestep {self.timestep} is not a valid timestep. " 

    +

    978 f"Samples have {t_max} timesteps. " 

    +

    979 f"Choose a timestep between 0 and {t_max - 1}" 

    +

    980 ) 

    +

    981 self.raise_error(err_msg) 

    +

    982 

    +

    983 result = group_betas( 

    +

    984 beta_index, 

    +

    985 betas, 

    +

    986 cluster=self.cluster_type, 

    +

    987 cluster_params=self.cluster_args, 

    +

    988 detector=self.detector_type, 

    +

    989 detector_params=self.detector_args, 

    +

    990 ) 

    +

    991 

    +

    992 if isinstance(result, str): 

    +

    993 self.raise_error(result) 

    +

    994 

    +

    995 id_cluster = result[1] 

    +

    996 

    +

    997 # Save clusters 

    +

    998 if len(id_cluster) > 1: 

    +

    999 betas_group.attrs.create(HDF5FileNames.NR_CLUSTER.value, len(id_cluster)) 

    +

    1000 if self.detector_type is not None: 

    +

    1001 # if attribute has_outliers is set, the first cluster contains the outliers 

    +

    1002 # so all outliers can be found by searching for the cluster attribute "0" 

    +

    1003 betas_group.attrs.create(HDF5FileNames.HAS_OUTLIERS.value, len(id_cluster[0])) 

    +

    1004 for index, cluster in enumerate(id_cluster): 

    +

    1005 for entry in cluster: 

    +

    1006 # Enter appropriate cluster as attribute 

    +

    1007 sample = betas_group[entry] 

    +

    1008 sample.attrs.create(HDF5FileNames.CLUSTER.value, index) 

    +

    1009 

    +

    1010 prog.advance(cluster_task) # type: ignore 

    +

    1011 

    +

    1012 self.log("Clustering completed", style="success") 

    +

    1013 

    +

    1014 def visualize_results(self): 

    +

    1015 """creates an output .html file""" 

    +

    1016 

    +

    1017 self._perform_context_check() 

    +

    1018 self.log("Creating .html viz") 

    +

    1019 betas_group = self.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] 

    +

    1020 mark_outliers = False 

    +

    1021 

    +

    1022 excluded_entries = [ 

    +

    1023 os.path.basename(os.path.split(entry)[0]) 

    +

    1024 if self.use_folder_name 

    +

    1025 else os.path.basename(entry) 

    +

    1026 for entry in self.exclude_runs 

    +

    1027 ] 

    +

    1028 

    +

    1029 # check if clustering was performed, else load all betas into one pseudo-cluster 

    +

    1030 if HDF5FileNames.NR_CLUSTER.value not in betas_group.attrs: 

    +

    1031 

    +

    1032 # plotfunction expects list of cluster 

    +

    1033 # we have no clusters -> we claim all is in one cluster 

    +

    1034 

    +

    1035 # Create and load ids 

    +

    1036 id_cluster = [ 

    +

    1037 np.stack([key for key in betas_group.keys() if key not in excluded_entries]) 

    +

    1038 ] 

    +

    1039 

    +

    1040 # Create and load betas 

    +

    1041 beta_cluster = [np.stack([betas_group[entry][-1] for entry in id_cluster[0]])] 

    +

    1042 

    +

    1043 else: 

    +

    1044 # check if outlier where detected 

    +

    1045 if HDF5FileNames.HAS_OUTLIERS.value in betas_group.attrs: 

    +

    1046 mark_outliers = True 

    +

    1047 

    +

    1048 # index of all runs 

    +

    1049 id_data = np.stack([key for key in betas_group.keys() if key not in excluded_entries]) 

    +

    1050 

    +

    1051 # create an index referencing each run to a cluster 

    +

    1052 cluster_index = np.stack( 

    +

    1053 [betas_group[entry].attrs[HDF5FileNames.CLUSTER.value] for entry in id_data] 

    +

    1054 ) 

    +

    1055 

    +

    1056 # load betas & ids 

    +

    1057 beta_data = np.stack([betas_group[entry][-1] for entry in id_data]) 

    +

    1058 

    +

    1059 # create list containing list of clusters 

    +

    1060 beta_cluster = [] 

    +

    1061 id_cluster = [] 

    +

    1062 for i, cluster in enumerate(range(betas_group.attrs[HDF5FileNames.NR_CLUSTER.value])): 

    +

    1063 chosen = np.where(cluster_index == cluster)[0] 

    +

    1064 if len(chosen) > 0: 

    +

    1065 beta_cluster.append(beta_data[chosen]) 

    +

    1066 id_cluster.append(id_data[chosen]) 

    +

    1067 elif len(chosen) == 0 and i == 0: 

    +

    1068 mark_outliers = False 

    +

    1069 

    +

    1070 plot_clusters_js( 

    +

    1071 beta_cluster, 

    +

    1072 id_cluster, 

    +

    1073 save_path=self.project_dir, 

    +

    1074 img_path=self.img_path, 

    +

    1075 mark_outliers=mark_outliers, 

    +

    1076 mark_timestamp=self.html_set_timestamp, 

    +

    1077 filename=self.html_name, 

    +

    1078 show_res=self.show_output, 

    +

    1079 ) 

    +

    1080 self.log("Finished creating viz", style="success") 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6_graph_laplacian_py.html b/coverage/d_febbda7c1df641f6_graph_laplacian_py.html new file mode 100644 index 0000000..d4442c5 --- /dev/null +++ b/coverage/d_febbda7c1df641f6_graph_laplacian_py.html @@ -0,0 +1,255 @@ + + + + + Coverage for lasso/dimred/graph_laplacian.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/dimred/graph_laplacian.py: + 0% +

    + +

    + 47 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from typing import Union 

    +

    2 

    +

    3import numpy as np 

    +

    4from scipy.sparse import csgraph, dok_matrix 

    +

    5from scipy.sparse.linalg import eigsh 

    +

    6from sklearn.neighbors import KDTree 

    +

    7 

    +

    8 

    +

    9def run_graph_laplacian( 

    +

    10 points: np.ndarray, 

    +

    11 n_eigenmodes: int = 5, 

    +

    12 min_neighbors: Union[int, None] = None, 

    +

    13 sigma: Union[float, None] = None, 

    +

    14 search_radius: Union[float, None] = None, 

    +

    15): 

    +

    16 """ 

    +

    17 Compute a graph laplacian. 

    +

    18 

    +

    19 Parameters 

    +

    20 ---------- 

    +

    21 points : np.ndarray 

    +

    22 points with features 

    +

    23 n_eigenmodes : int 

    +

    24 number of eigenmodes to compute 

    +

    25 min_neighbors : int 

    +

    26 The minimum number of neighbors of a point to be considered for the laplacian 

    +

    27 weights. Can be used to avoid unconnected points. 

    +

    28 sigma : float 

    +

    29 The standard deviation of the gaussian normal distribution function used to 

    +

    30 transform the distances for the inverse distance based weighting. 

    +

    31 search_radius: 

    +

    32 

    +

    33 

    +

    34 Returns 

    +

    35 ------- 

    +

    36 eigenvalues : np.ndarray 

    +

    37 eigenvalues from the graph 

    +

    38 eigenvectors : np.ndarray 

    +

    39 eigenvectors with shape (n_points x n_eigenvectors) 

    +

    40 """ 

    +

    41 with np.warnings.catch_warnings(): 

    +

    42 regex_string = ( 

    +

    43 r"the matrix subclass is not the recommended way to represent" 

    +

    44 + r"matrices or deal with linear algebra" 

    +

    45 ) 

    +

    46 np.warnings.filterwarnings("ignore", regex_string) 

    +

    47 lapl = _laplacian_gauss_idw(points, min_neighbors, sigma, search_radius) 

    +

    48 return _laplacian(lapl, n_eigenmodes) 

    +

    49 

    +

    50 

    +

    51def _laplacian_gauss_idw( 

    +

    52 points: np.ndarray, 

    +

    53 min_neighbors: Union[int, None] = None, 

    +

    54 sigma: Union[float, None] = None, 

    +

    55 search_radius: Union[float, None] = None, 

    +

    56): 

    +

    57 """ 

    +

    58 Calculates the laplacian matrix for the sample points of a manifold. The inverse 

    +

    59 of the gauss-transformed distance is used as weighting of the neighbors. 

    +

    60 

    +

    61 Parameters 

    +

    62 ---------- 

    +

    63 points: array-like, shape (n_points, n_components) : 

    +

    64 The sampling points of a manifold. 

    +

    65 min_neighbors: int 

    +

    66 The minimum number of neighbors of a point to be considered for the laplacian 

    +

    67 weights. Can be used to avoid unconnected points. 

    +

    68 sigma: float 

    +

    69 The standard deviation of the gaussian normal distribution function used to 

    +

    70 transform the distances for the inverse distance based weighting. 

    +

    71 search_radius : float 

    +

    72 radius search parameter for nearest neighbors 

    +

    73 

    +

    74 Returns 

    +

    75 ------- 

    +

    76 L: array-like, shape (n_points, n_points) 

    +

    77 The laplacian matrix for manifold given by its sampling `points`. 

    +

    78 """ 

    +

    79 assert 2 == points.ndim 

    +

    80 

    +

    81 if min_neighbors is None: 

    +

    82 min_neighbors = points.shape[1] 

    +

    83 

    +

    84 tree = KDTree(points) 

    +

    85 

    +

    86 if sigma is None: 

    +

    87 d, _ = tree.query(points, 2 + 2 * points.shape[1], return_distance=True) 

    +

    88 sigma = np.sum(d[:, -2:]) 

    +

    89 sigma /= 3 * len(points) 

    +

    90 

    +

    91 if search_radius is None: 

    +

    92 search_radius = 3 * sigma 

    +

    93 

    +

    94 graph = dok_matrix((len(points), len(points)), dtype=np.double) 

    +

    95 

    +

    96 for i, (j, d, e, k) in enumerate( 

    +

    97 zip( 

    +

    98 *tree.query_radius(points, return_distance=True, r=search_radius), 

    +

    99 *tree.query(points, return_distance=True, k=1 + min_neighbors) 

    +

    100 ) 

    +

    101 ): 

    +

    102 # Always search for k neighbors, this prevents strongly connected local areas 

    +

    103 # a little, attracting the eigenfield 

    +

    104 

    +

    105 d, j = e, k 

    +

    106 k = j != i 

    +

    107 d, j = d[k], j[k] 

    +

    108 d **= 2 

    +

    109 d /= -2 * sigma**2 

    +

    110 graph[i, j] = d = np.exp(d) 

    +

    111 graph[j, i] = d[:, np.newaxis] 

    +

    112 

    +

    113 assert 0 == (graph != graph.T).sum() 

    +

    114 

    +

    115 return csgraph.laplacian(graph, normed=True) 

    +

    116 

    +

    117 

    +

    118def _laplacian(lapl: csgraph, n_eigenmodes: int = 5): 

    +

    119 """ 

    +

    120 Compute the laplacian of a graph L 

    +

    121 

    +

    122 Parameters 

    +

    123 ---------- 

    +

    124 L : csgraph 

    +

    125 sparse cs graph from scipy 

    +

    126 n_eigenmodes : int 

    +

    127 number of eigenmodes to compute 

    +

    128 points : np.ndarray 

    +

    129 coordintes of graph nodes (only for plotting) 

    +

    130 

    +

    131 Returns 

    +

    132 ------- 

    +

    133 eigen_values : np.ndarray 

    +

    134 eingenvalues of the graph 

    +

    135 eigen_vecs : np.ndarray 

    +

    136 eigenvectors of each graph vector (iNode x nEigenmodes) 

    +

    137 """ 

    +

    138 

    +

    139 n_nonzero_eigenvalues = 0 

    +

    140 n_eigenvalues = int(n_eigenmodes * 1.5) 

    +

    141 

    +

    142 eigen_vals = np.empty((0,)) 

    +

    143 eigen_vecs = np.empty((0, 0)) 

    +

    144 

    +

    145 while n_nonzero_eigenvalues < n_eigenmodes: 

    +

    146 

    +

    147 eigen_vals, eigen_vecs = map(np.real, eigsh(lapl, n_eigenvalues, which="SA")) 

    +

    148 

    +

    149 i_start = np.argmax(eigen_vals > 1e-7) 

    +

    150 n_nonzero_eigenvalues = len(eigen_vals) - i_start 

    +

    151 

    +

    152 if n_nonzero_eigenvalues >= n_eigenmodes: 

    +

    153 eigen_vecs = eigen_vecs[:, i_start : i_start + n_eigenmodes] 

    +

    154 eigen_vals = eigen_vals[i_start : i_start + n_eigenmodes] 

    +

    155 

    +

    156 n_eigenvalues = int(n_eigenvalues * 1.5) 

    +

    157 

    +

    158 return eigen_vals, eigen_vecs 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6_hashing_py.html b/coverage/d_febbda7c1df641f6_hashing_py.html new file mode 100644 index 0000000..03b0b62 --- /dev/null +++ b/coverage/d_febbda7c1df641f6_hashing_py.html @@ -0,0 +1,755 @@ + + + + + Coverage for lasso/dimred/hashing.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/dimred/hashing.py: + 0% +

    + +

    + 217 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import multiprocessing 

    +

    2import os 

    +

    3import time 

    +

    4from typing import List, Tuple, Union, Sequence 

    +

    5 

    +

    6import h5py 

    +

    7import numpy as np 

    +

    8from scipy import integrate 

    +

    9from sklearn.neighbors import KDTree 

    +

    10 

    +

    11 

    +

    12from ..math.stochastic import jensen_shannon_entropy 

    +

    13 

    +

    14 

    +

    15def _match_modes( 

    +

    16 hashes1: np.ndarray, 

    +

    17 hashes2: np.ndarray, 

    +

    18 eigenvectors_sub1: np.ndarray, 

    +

    19 eigenvectors_sub2: np.ndarray, 

    +

    20): 

    +

    21 """Match the eigenvalue modes 

    +

    22 

    +

    23 Parameters 

    +

    24 ---------- 

    +

    25 hashes1 : np.ndarray 

    +

    26 hashes of first model 

    +

    27 hashes2 : np.ndarray 

    +

    28 hashes of second model 

    +

    29 eigenvectors_sub1 : np.ndarray 

    +

    30 eigenvector field of first model 

    +

    31 eigenvectors_sub2 : np.ndarray 

    +

    32 eigenvector field of second model 

    +

    33 

    +

    34 Returns 

    +

    35 ------- 

    +

    36 matches : list(tuple(int.int)) 

    +

    37 indexes of the matched modes 

    +

    38 """ 

    +

    39 

    +

    40 matches = [] 

    +

    41 mode1_hash_indexes = list(range(len(hashes1))) 

    +

    42 mode2_hash_indexes = list(range(len(hashes2))) 

    +

    43 

    +

    44 for i_hash in mode1_hash_indexes: 

    +

    45 

    +

    46 field1 = eigenvectors_sub1[:, i_hash] 

    +

    47 

    +

    48 found_match = False 

    +

    49 for j_entry, j_hash in enumerate(mode2_hash_indexes): 

    +

    50 

    +

    51 field2 = eigenvectors_sub2[:, j_hash] 

    +

    52 

    +

    53 if is_mode_match(field1, field2): 

    +

    54 matches.append((i_hash, j_hash)) 

    +

    55 del mode2_hash_indexes[j_entry] 

    +

    56 found_match = True 

    +

    57 break 

    +

    58 

    +

    59 if not found_match: 

    +

    60 break 

    +

    61 

    +

    62 return matches 

    +

    63 

    +

    64 

    +

    65def is_orientation_flip_required(eigenvectors1: np.ndarray, eigenvectors2: np.ndarray): 

    +

    66 """Checks whether the eigenfields require to be flipped 

    +

    67 

    +

    68 Parameters 

    +

    69 ---------- 

    +

    70 eigenvectors1 : np.ndarray 

    +

    71 eigenvector_field of mesh1. 

    +

    72 eigenvectors2 : np.ndarray 

    +

    73 eigenvector_field of mesh2. 

    +

    74 

    +

    75 Returns 

    +

    76 ------- 

    +

    77 flip_required : bool or list(bool) 

    +

    78 whether a flip of the eigenvector field is required. 

    +

    79 

    +

    80 Note 

    +

    81 ---- 

    +

    82 If the eigenvector field has multiple modes (e.g. shape n_nodes,n_modes) 

    +

    83 then for every mode a flip value is returned 

    +

    84 

    +

    85 The eigenmodes require switching if the dot product of the knn-eigenfields yield 

    +

    86 a negative result. 

    +

    87 """ 

    +

    88 assert eigenvectors1.shape == eigenvectors2.shape 

    +

    89 

    +

    90 # one eigenmode only 

    +

    91 if eigenvectors1.ndim == 1: 

    +

    92 knn_error_basic = np.dot(eigenvectors1, eigenvectors2) 

    +

    93 return knn_error_basic < 0 

    +

    94 

    +

    95 # multiple eigenmodes 

    +

    96 n_modes = min(eigenvectors1.shape[1], eigenvectors2.shape[1]) 

    +

    97 errors = [ 

    +

    98 np.dot(eigenvectors1[:, i_mode], eigenvectors2[:, i_mode]) for i_mode in range(n_modes) 

    +

    99 ] 

    +

    100 

    +

    101 return np.array([err < 0 for err in errors]) 

    +

    102 

    +

    103 

    +

    104def _compute_mode_similarities( 

    +

    105 hashes1: np.ndarray, 

    +

    106 hashes2: np.ndarray, 

    +

    107 eigenvectors_sub1: np.ndarray, 

    +

    108 eigenvectors_sub2: np.ndarray, 

    +

    109 matches: List[Tuple[int, int]], 

    +

    110) -> List[float]: 

    +

    111 """Compute the mode similarity between different meshes 

    +

    112 

    +

    113 Parameters 

    +

    114 ---------- 

    +

    115 hashes1 : np.ndarray 

    +

    116 hashes of first model 

    +

    117 hashes2 : np.ndarray 

    +

    118 hashes of second model 

    +

    119 eigenvectors_sub1 : np.ndarray 

    +

    120 eigenvector field of first model 

    +

    121 eigenvectors_sub2 : np.ndarray 

    +

    122 eigenvector field of second model 

    +

    123 matches : list(tuple(int, int)) 

    +

    124 matches of modes (every match will be computed) 

    +

    125 

    +

    126 Returns 

    +

    127 ------- 

    +

    128 mode_similarities : list(float) 

    +

    129 similarities of the matched modes 

    +

    130 

    +

    131 Notes 

    +

    132 ----- 

    +

    133 This function cannot deal with unequal sampling of the input hashes. 

    +

    134 """ 

    +

    135 

    +

    136 mode_similarities = [] 

    +

    137 for i_hash, j_hash in matches: 

    +

    138 

    +

    139 assert hashes1.shape[2] == hashes2.shape[2] 

    +

    140 

    +

    141 field1 = eigenvectors_sub1[:, i_hash] 

    +

    142 field2 = eigenvectors_sub2[:, j_hash] 

    +

    143 

    +

    144 # flip orientation of eigenvector field and hash if required 

    +

    145 if is_orientation_flip_required(field1, field2): 

    +

    146 field2 *= -1 

    +

    147 # hdf5 can not handle negative slicing 

    +

    148 mode_ = np.array(hashes2[j_hash, 1], copy=True) 

    +

    149 mode_ = mode_[::-1] 

    +

    150 else: 

    +

    151 mode_ = hashes2[j_hash, 1, :] 

    +

    152 

    +

    153 # Warning: x is usually originally hashes[i_mode, 0] 

    +

    154 x = np.linspace(0, 1, hashes1.shape[2]) 

    +

    155 norm1 = curve_normalizer(x, hashes1[i_hash, 1]) 

    +

    156 norm2 = curve_normalizer(x, mode_) 

    +

    157 if norm1 != 0 and norm2 != 0: 

    +

    158 mode_similarities.append( 

    +

    159 integrate.simps(hashes1[i_hash, 1] * mode_ / np.sqrt(norm1 * norm2), x=x) 

    +

    160 ) 

    +

    161 else: 

    +

    162 mode_similarities.append(0) 

    +

    163 

    +

    164 return mode_similarities 

    +

    165 

    +

    166 

    +

    167def _join_hash_comparison_thread_files( 

    +

    168 comparison_filepath: str, thread_filepaths: Sequence[str], n_runs: int 

    +

    169): 

    +

    170 # pylint: disable = too-many-locals 

    +

    171 

    +

    172 if os.path.exists(comparison_filepath): 

    +

    173 if os.path.isfile(comparison_filepath): 

    +

    174 os.remove(comparison_filepath) 

    +

    175 else: 

    +

    176 raise OSError("Can not delete directory", comparison_filepath) 

    +

    177 

    +

    178 with h5py.File(comparison_filepath, "w") as hdf5_file: 

    +

    179 smatrix = hdf5_file.create_dataset( 

    +

    180 "similarity_matrix", 

    +

    181 shape=(n_runs, n_runs, 25), 

    +

    182 maxshape=(n_runs, n_runs, None), 

    +

    183 dtype="float64", 

    +

    184 compression="gzip", 

    +

    185 ) 

    +

    186 ds_matches = hdf5_file.create_dataset( 

    +

    187 "matches", 

    +

    188 shape=(n_runs, n_runs, 25, 2), 

    +

    189 maxshape=(n_runs, n_runs, None, 2), 

    +

    190 dtype="int64", 

    +

    191 compression="gzip", 

    +

    192 ) 

    +

    193 ds_weights = hdf5_file.create_dataset( 

    +

    194 "weights", 

    +

    195 shape=(n_runs, n_runs, 25), 

    +

    196 maxshape=(n_runs, n_runs, None), 

    +

    197 dtype="float64", 

    +

    198 compression="gzip", 

    +

    199 ) 

    +

    200 

    +

    201 for thread_filepath in thread_filepaths: 

    +

    202 

    +

    203 # open thread file 

    +

    204 with h5py.File(thread_filepath, "r") as thread_file: 

    +

    205 

    +

    206 # insert matrix entries 

    +

    207 matrix_indexes = thread_file["matrix_indexes"] 

    +

    208 matrix_similarities = thread_file["matrix_similarities"] 

    +

    209 matrix_matches = thread_file["matrix_matches"] 

    +

    210 thread_weights = thread_file["weights"] 

    +

    211 

    +

    212 for (i_row, i_col), values, matches in zip( 

    +

    213 matrix_indexes, matrix_similarities, matrix_matches 

    +

    214 ): 

    +

    215 smatrix[i_row, i_col] = values 

    +

    216 ds_matches[i_row, i_col] = matches 

    +

    217 ds_weights[i_row, i_col] = (thread_weights[i_row] + thread_weights[i_col]) / 2 

    +

    218 

    +

    219 # delete thread file 

    +

    220 os.remove(thread_filepath) 

    +

    221 

    +

    222 

    +

    223def run_hash_comparison( 

    +

    224 comparison_filepath: str, 

    +

    225 hashes_filepaths: List[str], 

    +

    226 n_threads: int = 1, 

    +

    227 print_progress: bool = False, 

    +

    228): 

    +

    229 """Compare two hashes of a simulation run part 

    +

    230 

    +

    231 Parameters 

    +

    232 ---------- 

    +

    233 comparison_filepath: str 

    +

    234 filepath to the hdf5 in which the result of the comparison will be 

    +

    235 stored 

    +

    236 hashes_filepaths: List[str] 

    +

    237 filepath to the stored hashes 

    +

    238 n_threads: int 

    +

    239 number of threads used for the comparison 

    +

    240 print_progress: bool 

    +

    241 whether to print the progress 

    +

    242 """ 

    +

    243 

    +

    244 # pylint: disable = too-many-locals, too-many-statements 

    +

    245 

    +

    246 assert n_threads > 0 

    +

    247 

    +

    248 # fixed settings 

    +

    249 hdf5_dataset_compression = "gzip" 

    +

    250 

    +

    251 # ! this is an inlined function ! 

    +

    252 # the actual function starts way much down 

    +

    253 

    +

    254 def _threading_run_comparison(run_indices, comparison_filepath, comm_q): 

    +

    255 # pylint: disable = too-many-statements 

    +

    256 

    +

    257 n_comparisons_thread = len(run_indices) 

    +

    258 

    +

    259 # setup storage file 

    +

    260 if os.path.exists(comparison_filepath): 

    +

    261 if os.path.isfile(comparison_filepath): 

    +

    262 os.remove(comparison_filepath) 

    +

    263 else: 

    +

    264 raise OSError("Can not delete directory", comparison_filepath) 

    +

    265 

    +

    266 hdf5_file = h5py.File(comparison_filepath, "w") 

    +

    267 

    +

    268 max_len = np.max([len(entry) for entry in hashes_filepaths]) 

    +

    269 hashes_filepaths_ascii = [entry.encode("ascii", "ignore") for entry in hashes_filepaths] 

    +

    270 

    +

    271 hdf5_file.require_dataset( 

    +

    272 "filepaths", 

    +

    273 data=hashes_filepaths_ascii, 

    +

    274 shape=(len(hashes_filepaths_ascii), 1), 

    +

    275 dtype=f"S{max_len}", 

    +

    276 ) 

    +

    277 

    +

    278 n_modes_estimated = 25 

    +

    279 

    +

    280 # could be compressed to one per run only! 

    +

    281 ds_weights = hdf5_file.create_dataset( 

    +

    282 "weights", 

    +

    283 (n_runs, n_modes_estimated), 

    +

    284 maxshape=(n_runs, None), 

    +

    285 dtype="float64", 

    +

    286 compression=hdf5_dataset_compression, 

    +

    287 ) 

    +

    288 ds_matrix_indexes = hdf5_file.create_dataset( 

    +

    289 "matrix_indexes", 

    +

    290 (n_comparisons_thread, 2), 

    +

    291 dtype="float64", 

    +

    292 compression=hdf5_dataset_compression, 

    +

    293 ) 

    +

    294 ds_matrix_values = hdf5_file.create_dataset( 

    +

    295 "matrix_similarities", 

    +

    296 (n_comparisons_thread, n_modes_estimated), 

    +

    297 maxshape=(n_comparisons_thread, None), 

    +

    298 dtype="float64", 

    +

    299 compression=hdf5_dataset_compression, 

    +

    300 ) 

    +

    301 

    +

    302 # info only! 

    +

    303 ds_matrix_matches = hdf5_file.create_dataset( 

    +

    304 "matrix_matches", 

    +

    305 (n_comparisons_thread, n_modes_estimated, 2), 

    +

    306 maxshape=(n_comparisons_thread, None, 2), 

    +

    307 dtype="int64", 

    +

    308 compression=hdf5_dataset_compression, 

    +

    309 ) 

    +

    310 

    +

    311 def _save_data(computed_results, counter): 

    +

    312 

    +

    313 start = counter + 1 - len(computed_results) 

    +

    314 for i_result, result in enumerate(computed_results): 

    +

    315 

    +

    316 i_run, j_run = result["matrix_index"] 

    +

    317 similarities = result["similarities"] 

    +

    318 matches_tmp = result["matches"] 

    +

    319 

    +

    320 ds_matrix_indexes[start + i_result, :] = i_run, j_run 

    +

    321 ds_matrix_values[start + i_result, : len(similarities)] = similarities 

    +

    322 ds_matrix_matches[start + i_result, : len(matches_tmp)] = matches_tmp 

    +

    323 weights1 = result["weights1"] 

    +

    324 n_weights1 = len(weights1) 

    +

    325 ds_weights[i_run, :n_weights1] = weights1 

    +

    326 weights2 = result["weights2"] 

    +

    327 n_weights2 = len(weights2) 

    +

    328 ds_weights[j_run, :n_weights2] = weights2 

    +

    329 

    +

    330 computed_results.clear() 

    +

    331 

    +

    332 # log 

    +

    333 computation_times = [] 

    +

    334 io_times = [] 

    +

    335 

    +

    336 counter = None # bugfix 

    +

    337 computed_results = [] 

    +

    338 for counter, (i_run, j_run) in enumerate(run_indices): 

    +

    339 

    +

    340 start = time.time() 

    +

    341 

    +

    342 # get data (io) 

    +

    343 fp1 = h5py.File(hashes_filepaths[i_run], "r") 

    +

    344 fp2 = h5py.File(hashes_filepaths[j_run], "r") 

    +

    345 hashes1 = fp1["hashes"] 

    +

    346 hashes2 = fp2["hashes"] 

    +

    347 xyz1, xyz2 = fp1["subsample_xyz"], fp2["subsample_xyz"] 

    +

    348 eigenvalues1, eigenvalues2 = fp1["eigenvalues"], fp2["eigenvalues"] 

    +

    349 

    +

    350 # hdf5 can only handle increasing indexes ... thus we need to copy the field 

    +

    351 eigenvectors_sub1 = np.array(fp1["eigenvectors"], copy=True) 

    +

    352 eigenvectors_sub2 = np.array(fp2["eigenvectors"], copy=True) 

    +

    353 

    +

    354 # time 

    +

    355 io_times.append(time.time() - start) 

    +

    356 start = time.time() 

    +

    357 

    +

    358 # match points roughly in xyz 

    +

    359 tree = KDTree(xyz1) 

    +

    360 knn_indexes = tree.query(xyz2, return_distance=False, k=1) 

    +

    361 eigenvectors_sub1 = np.squeeze(eigenvectors_sub1[knn_indexes]) 

    +

    362 

    +

    363 # match modes 

    +

    364 matches = _match_modes(hashes1, hashes2, eigenvectors_sub1, eigenvectors_sub2) 

    +

    365 

    +

    366 # mode weights 

    +

    367 weights1 = get_mode_weights_inv(eigenvalues1) 

    +

    368 weights2 = get_mode_weights_inv(eigenvalues2) 

    +

    369 

    +

    370 # compute mode similarity 

    +

    371 mode_similarities = _compute_mode_similarities( 

    +

    372 hashes1, hashes2, eigenvectors_sub1, eigenvectors_sub2, matches 

    +

    373 ) 

    +

    374 

    +

    375 # time 

    +

    376 computation_times.append(time.time() - start) 

    +

    377 

    +

    378 # assemble computations 

    +

    379 computation_result = { 

    +

    380 "matrix_index": [i_run, j_run], 

    +

    381 "matches": matches, # info only 

    +

    382 "similarities": mode_similarities, 

    +

    383 "weights1": weights1.tolist(), 

    +

    384 "weights2": weights2.tolist(), 

    +

    385 } 

    +

    386 computed_results.append(computation_result) 

    +

    387 

    +

    388 # save to file occasionally 

    +

    389 if counter % 500 == 0: 

    +

    390 _save_data(computed_results, counter) 

    +

    391 

    +

    392 # print status 

    +

    393 if comm_q and not comm_q.full(): 

    +

    394 comm_q.put( 

    +

    395 { 

    +

    396 "i_entry": counter + 1, 

    +

    397 "n_entries": len(run_indices), 

    +

    398 "io_time": np.mean(io_times), 

    +

    399 "computation_time": np.mean(computation_times), 

    +

    400 }, 

    +

    401 False, 

    +

    402 ) 

    +

    403 

    +

    404 # dump at end (if anything was computed) 

    +

    405 if counter: 

    +

    406 _save_data(computed_results, counter) 

    +

    407 

    +

    408 # <-- FUNCTION STARTS HERE 

    +

    409 

    +

    410 # helper vars 

    +

    411 n_runs = len(hashes_filepaths) 

    +

    412 

    +

    413 # THREADS 

    +

    414 if n_threads == 1: 

    +

    415 matrix_entries = [] 

    +

    416 for i_run in range(n_runs): 

    +

    417 for j_run in range(i_run + 1, n_runs): 

    +

    418 matrix_entries.append((i_run, j_run)) 

    +

    419 _threading_run_comparison(matrix_entries, comparison_filepath, None) 

    +

    420 else: 

    +

    421 # enlist runs 

    +

    422 thread_matrix_entries = [[] for i_thread in range(n_threads)] 

    +

    423 i_thread = 0 

    +

    424 for i_run in range(n_runs): 

    +

    425 for j_run in range(i_run + 1, n_runs): 

    +

    426 thread_matrix_entries[i_thread % n_threads].append((i_run, j_run)) 

    +

    427 i_thread += 1 

    +

    428 

    +

    429 # comm queues 

    +

    430 queues = [multiprocessing.Queue(1) for i_thread in range(n_threads)] 

    +

    431 

    +

    432 # run threads 

    +

    433 thread_filepaths = [ 

    +

    434 comparison_filepath + f"_thread{i_thread}" for i_thread in range(n_threads) 

    +

    435 ] 

    +

    436 threads = [ 

    +

    437 multiprocessing.Process( 

    +

    438 target=_threading_run_comparison, 

    +

    439 args=(matrix_indexes, thread_filepaths[i_thread], queues[i_thread]), 

    +

    440 ) 

    +

    441 for i_thread, matrix_indexes in enumerate(thread_matrix_entries) 

    +

    442 ] 

    +

    443 for thread in threads: 

    +

    444 thread.start() 

    +

    445 

    +

    446 # logging 

    +

    447 if print_progress: 

    +

    448 thread_stats = [ 

    +

    449 { 

    +

    450 "i_entry": 0, 

    +

    451 "n_entries": len(thread_matrix_entries[i_thread]), 

    +

    452 "io_time": 0, 

    +

    453 "computation_time": 0, 

    +

    454 } 

    +

    455 for i_thread in range(n_threads) 

    +

    456 ] 

    +

    457 

    +

    458 while any(thread.is_alive() for thread in threads): 

    +

    459 

    +

    460 # fetch data from channel 

    +

    461 for i_thread, comm_q in enumerate(queues): 

    +

    462 if not comm_q.empty(): 

    +

    463 thread_stats[i_thread] = comm_q.get(False) 

    +

    464 

    +

    465 # print msg 

    +

    466 # pylint: disable = consider-using-f-string 

    +

    467 thread_msg_list = [ 

    +

    468 ( 

    +

    469 f"Thread {i_thread}: " 

    +

    470 f"{(100 * stats['i_entry'] / stats['n_entries']):.1f}% " 

    +

    471 f"({stats['i_entry']}/{stats['n_entries']}) " 

    +

    472 f"{stats['computation_time']:.2f}s | " 

    +

    473 ) 

    +

    474 for i_thread, stats in enumerate(thread_stats) 

    +

    475 ] 

    +

    476 msg = "| " + "".join(thread_msg_list) + "\r" 

    +

    477 print(msg, end="") 

    +

    478 time.sleep(0.35) 

    +

    479 

    +

    480 # print completion message 

    +

    481 thread_msg_list = [ 

    +

    482 ( 

    +

    483 f"Thread {i_thread}: " 

    +

    484 f"{(100 * stats['i_entry'] / stats['n_entries']):.1f}% " 

    +

    485 f"({stats['i_entry']}/{stats['n_entries']}) " 

    +

    486 f"{stats['computation_time']:.2f}s | " 

    +

    487 ) 

    +

    488 for i_thread, stats in enumerate(thread_stats) 

    +

    489 ] 

    +

    490 msg = "| " + "".join(thread_msg_list) + "\r" 

    +

    491 print(msg, end="") 

    +

    492 

    +

    493 print("") 

    +

    494 print("done.") 

    +

    495 

    +

    496 # join thread worker files 

    +

    497 for thread in threads: 

    +

    498 thread.join() 

    +

    499 _join_hash_comparison_thread_files(comparison_filepath, thread_filepaths, n_runs) 

    +

    500 

    +

    501 

    +

    502def is_mode_match( 

    +

    503 eigenvectors1: np.ndarray, 

    +

    504 eigenvectors2: np.ndarray, 

    +

    505 knn_indexes: Union[np.ndarray, None] = None, 

    +

    506): 

    +

    507 """Detect a mode match from the eigenvector field 

    +

    508 

    +

    509 Parameters 

    +

    510 ---------- 

    +

    511 eigenvectors1 : np.ndarray 

    +

    512 subsample eigenvector field from model 1 

    +

    513 eigenvectors2 : np.ndarray 

    +

    514 subsample eigenvector field from model 2 

    +

    515 knn_indexes : np.ndarray 

    +

    516 kdd_indexes obtained for matching xyz1 and xyz2 of the eigenvectorfields 

    +

    517 so that only the coordinates of near points will be compared 

    +

    518 

    +

    519 Returns 

    +

    520 ------- 

    +

    521 is_matched : bool 

    +

    522 

    +

    523 Notes 

    +

    524 ----- 

    +

    525 A mode match is detected by watching the distribution 

    +

    526 of the eigenvector field errors. In case of a mode switch 

    +

    527 a correct orientation of the field is (obviously) not possible. 

    +

    528 In such a case will the probability distribution of the 

    +

    529 basic error and inverted error be quite similar, since both are wrong. 

    +

    530 

    +

    531 A matching orientation (empirically) seems to have a normal 

    +

    532 distribution like character. A non-matching orientation 

    +

    533 is more like a uniform distribution (constantly wrong across 

    +

    534 the entire model). 

    +

    535 """ 

    +

    536 

    +

    537 # pylint: disable = too-many-locals 

    +

    538 

    +

    539 # if the jensen-shannon-divergence is below this value 

    +

    540 # then a mode switch is assumed 

    +

    541 distance_limit = 0.1 

    +

    542 

    +

    543 # number of bins for probability distribution 

    +

    544 n_bins = 25 

    +

    545 

    +

    546 # (1) match sub-samples in xyz 

    +

    547 # tree = KDTree(xyz1) 

    +

    548 # indexes = tree.query(xyz2, return_distance=False, k=1) 

    +

    549 

    +

    550 # (2) compute field errors of normal field and inverted field 

    +

    551 if knn_indexes: 

    +

    552 tmp1 = eigenvectors1[knn_indexes].flatten() - eigenvectors2 

    +

    553 tmp2 = eigenvectors1[knn_indexes].flatten() + eigenvectors2 

    +

    554 else: 

    +

    555 tmp1 = eigenvectors1 - eigenvectors2 

    +

    556 tmp2 = eigenvectors1 + eigenvectors2 

    +

    557 

    +

    558 # (3) create a probability distribution for each error vector 

    +

    559 

    +

    560 # bin the values 

    +

    561 xmin = min(tmp1.min(), tmp2.min()) 

    +

    562 xmax = max(tmp1.max(), tmp2.max()) 

    +

    563 bins = np.linspace(xmin, xmax, n_bins) 

    +

    564 indexes_p1 = np.digitize(tmp1, bins) 

    +

    565 indexes_p2 = np.digitize(tmp2, bins) 

    +

    566 p1 = np.bincount(indexes_p1) / len(tmp1) 

    +

    567 p2 = np.bincount(indexes_p2) / len(tmp2) 

    +

    568 

    +

    569 # align bin vector size 

    +

    570 p1_tmp = np.zeros(max(len(p1), len(p2))) 

    +

    571 p2_tmp = np.zeros(max(len(p1), len(p2))) 

    +

    572 p1_tmp[: len(p1)] = p1 

    +

    573 p2_tmp[: len(p2)] = p2 

    +

    574 p1 = p1_tmp 

    +

    575 p2 = p2_tmp 

    +

    576 

    +

    577 # compute similarity 

    +

    578 similarity_js = jensen_shannon_entropy(p1, p2) 

    +

    579 

    +

    580 return similarity_js > distance_limit 

    +

    581 

    +

    582 

    +

    583def get_mode_weights_inv(vec: np.ndarray): 

    +

    584 """Inverse value weights (higher decay than softmax)""" 

    +

    585 val = 1.0 / (vec[:]) 

    +

    586 return val / np.sum(val) 

    +

    587 

    +

    588 

    +

    589def curve_normalizer(x: np.ndarray, y: np.ndarray): 

    +

    590 """Compute the curve normalizer for a curve dot product 

    +

    591 

    +

    592 Parameters 

    +

    593 ---------- 

    +

    594 x : np.ndarray 

    +

    595 array of x values 

    +

    596 y : np.ndarray 

    +

    597 array of y values 

    +

    598 

    +

    599 Returns 

    +

    600 ------- 

    +

    601 norm : float 

    +

    602 normalizing factor 

    +

    603 """ 

    +

    604 return integrate.simps(y**2, x=x) 

    +

    605 

    +

    606 

    +

    607def compute_hashes( 

    +

    608 eig_vecs: np.ndarray, 

    +

    609 result_field: np.ndarray, 

    +

    610 n_points: int = 100, 

    +

    611 bandwidth: float = 0.05, 

    +

    612) -> List[Tuple[np.ndarray, np.ndarray]]: 

    +

    613 """Compute hashes for a result field 

    +

    614 

    +

    615 Parameters 

    +

    616 ---------- 

    +

    617 eig_vecs : np.ndarray 

    +

    618 eigenvector field of the component with (n_samples, n_modes) 

    +

    619 result_field : np.ndarray 

    +

    620 result field to hash 

    +

    621 n_points : resolution of the hash 

    +

    622 Number of equidistant points to use for smoothing. 

    +

    623 Should be determined from the mesh size (2.5 times average elem size). 

    +

    624 bandwidth : float 

    +

    625 Bandwidth in percent of the kernel. 

    +

    626 Recommended as 5 times global element size median. 

    +

    627 

    +

    628 Returns 

    +

    629 ------- 

    +

    630 hash_functions : list(tuple(np.ndarray, np.ndarray)) 

    +

    631 list of the computed hash functions. Every item is the hash for 

    +

    632 an eigenmode. The hash consists of a pair of two functions: (x,y). 

    +

    633 For comparison, only y is usually used. 

    +

    634 """ 

    +

    635 

    +

    636 assert eig_vecs.shape[0] == len(result_field), f"{eig_vecs.shape[0]} != {len(result_field)}" 

    +

    637 

    +

    638 # Note: needs to be vectorized to speed it up 

    +

    639 

    +

    640 hash_functions = [] 

    +

    641 for i_eigen in range(eig_vecs.shape[1]): 

    +

    642 

    +

    643 xmin = eig_vecs[:, i_eigen].min() 

    +

    644 xmax = eig_vecs[:, i_eigen].max() 

    +

    645 

    +

    646 x = np.linspace(xmin, xmax, n_points) 

    +

    647 y = np.zeros(n_points) 

    +

    648 

    +

    649 local_bandwidth = bandwidth * (xmax - xmin) 

    +

    650 c = -0.5 / local_bandwidth**2 

    +

    651 

    +

    652 for ii, point in enumerate(x): 

    +

    653 y[ii] = np.dot(result_field, np.exp(c * np.square(point - eig_vecs[:, i_eigen]))) 

    +

    654 y /= np.sqrt(2 * np.pi) * bandwidth 

    +

    655 

    +

    656 hash_functions.append((x, y)) 

    +

    657 

    +

    658 return hash_functions 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6_hashing_sphere_py.html b/coverage/d_febbda7c1df641f6_hashing_sphere_py.html new file mode 100644 index 0000000..f47a4ce --- /dev/null +++ b/coverage/d_febbda7c1df641f6_hashing_sphere_py.html @@ -0,0 +1,355 @@ + + + + + Coverage for lasso/dimred/hashing_sphere.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/dimred/hashing_sphere.py: + 0% +

    + +

    + 85 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:45 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import typing 

    +

    3import warnings 

    +

    4 

    +

    5import h5py 

    +

    6import numpy as np 

    +

    7 

    +

    8# scipy is C-code which causes invalid linter warning about ConvexHull not 

    +

    9# being around. 

    +

    10# pylint: disable = no-name-in-module 

    +

    11from scipy.spatial import ConvexHull 

    +

    12from scipy.stats import binned_statistic_2d 

    +

    13from sklearn.preprocessing import normalize 

    +

    14 

    +

    15warnings.simplefilter(action="ignore", category=FutureWarning) 

    +

    16 

    +

    17 

    +

    18def _create_sphere_mesh(diameter: np.ndarray) -> typing.Tuple[np.ndarray, np.ndarray]: 

    +

    19 """Compute the alpha and beta increments for a 

    +

    20 meshed sphere for binning the projected values 

    +

    21 

    +

    22 Parameters 

    +

    23 ---------- 

    +

    24 diameter : np.ndarray 

    +

    25 sphere diameter 

    +

    26 

    +

    27 Returns 

    +

    28 ------- 

    +

    29 bin_alpha : np.ndarray 

    +

    30 alpha bin boundaries 

    +

    31 bin_beta : np.ndarray 

    +

    32 beta bin boundaries 

    +

    33 """ 

    +

    34 

    +

    35 assert diameter.dtype == float 

    +

    36 

    +

    37 # partition latitude 

    +

    38 n_alpha = 145 

    +

    39 

    +

    40 # sphere radius 

    +

    41 r = diameter / 2 

    +

    42 

    +

    43 # sphere area 

    +

    44 a_sphere = 4 * np.pi * r**2 

    +

    45 

    +

    46 # number of elements 

    +

    47 n_ele = 144**2 

    +

    48 

    +

    49 # area of one element 

    +

    50 a_ele = a_sphere / n_ele 

    +

    51 

    +

    52 # bin values for alpha and the increment 

    +

    53 bin_alpha, delt_alpha = np.linspace(0, 2 * np.pi, n_alpha, retstep=True) 

    +

    54 

    +

    55 # for beta axis binning 

    +

    56 count = np.linspace(0.0, 144.0, 145) 

    +

    57 # compute required bin boundaries to ensure area of each element is the same 

    +

    58 tmp = count * a_ele 

    +

    59 tmp /= r**2 * delt_alpha 

    +

    60 bin_beta = 1 - tmp 

    +

    61 

    +

    62 # In case of trailing floats (-1.00000004 for example) 

    +

    63 if bin_beta[-1] < -1: 

    +

    64 bin_beta[-1] = -1 

    +

    65 

    +

    66 bin_beta = np.arccos(bin_beta) 

    +

    67 

    +

    68 return bin_alpha, bin_beta 

    +

    69 

    +

    70 

    +

    71def _project_to_sphere( 

    +

    72 points: np.ndarray, centroid: np.ndarray, axis: str = "Z" 

    +

    73) -> typing.Tuple[np.ndarray, np.ndarray]: 

    +

    74 """compute the projection vectors of centroid to each point in terms of spherical coordinates 

    +

    75 

    +

    76 Parameters 

    +

    77 ---------- 

    +

    78 points : np.ndarray 

    +

    79 hashes of first model 

    +

    80 centroid : np.ndarray 

    +

    81 hashes of first model 

    +

    82 AXIS : str 

    +

    83 global axis position 

    +

    84 

    +

    85 Returns 

    +

    86 ------- 

    +

    87 proj_alpha : np.ndarray 

    +

    88 alpha angles of all points 

    +

    89 proj_beta : np.ndarray 

    +

    90 beta angle of all points 

    +

    91 """ 

    +

    92 # standard global axis 

    +

    93 indexes = [0, 1, 2] 

    +

    94 

    +

    95 # correct the indexes based on user input 

    +

    96 if axis == "Z": 

    +

    97 indexes = [0, 1, 2] # z axis aligned with global z-axis 

    +

    98 elif axis == "Y": 

    +

    99 indexes = [0, 2, 1] # z axis aligned with global y-axis 

    +

    100 elif axis == "X": 

    +

    101 indexes = [2, 1, 0] # z axis aligned with global x-axis 

    +

    102 

    +

    103 # projection 

    +

    104 vec = points - centroid 

    +

    105 

    +

    106 # normalize 

    +

    107 vec = normalize(vec, axis=1, norm="l2") 

    +

    108 

    +

    109 # alpha based on sphere axis alignment 

    +

    110 ang = np.arctan2(vec[:, indexes[1]], vec[:, indexes[0]]) 

    +

    111 

    +

    112 # atan2 returns neg angles for values greater than 180 

    +

    113 neg_indexes = np.where(ang < 0) 

    +

    114 ang[neg_indexes] += 2 * np.pi 

    +

    115 

    +

    116 proj_alpha = ang 

    +

    117 proj_beta = np.arccos(vec[:, indexes[2]]) 

    +

    118 

    +

    119 return proj_alpha, proj_beta 

    +

    120 

    +

    121 

    +

    122def sphere_hashing( 

    +

    123 bin_numbers: np.ndarray, bin_counts: np.ndarray, field: np.ndarray 

    +

    124) -> np.ndarray: 

    +

    125 """Compute average field values for all the binned values 

    +

    126 

    +

    127 Parameters 

    +

    128 ---------- 

    +

    129 bin_numbers : np.ndarray 

    +

    130 bin numbers for the respective index for the x and y-axis 

    +

    131 bin_counts : np.ndarray 

    +

    132 number of points that fall into each bin 

    +

    133 field : np.ndarray 

    +

    134 a fields value (p_strain,velocity etc..) 

    +

    135 

    +

    136 Returns 

    +

    137 ------- 

    +

    138 binned_field : np.ndarray 

    +

    139 the averaged field values for each field 

    +

    140 """ 

    +

    141 # bin_numbers holds the bin_number for its respective index and must have 

    +

    142 # same length as the number of points 

    +

    143 assert len(bin_numbers[0] == len(field)) 

    +

    144 # check data types 

    +

    145 assert bin_numbers.dtype == int 

    +

    146 assert bin_counts.dtype == float 

    +

    147 

    +

    148 n_rows = bin_counts.shape[0] 

    +

    149 n_cols = bin_counts.shape[1] 

    +

    150 

    +

    151 # bin x and y indexes for each point in field 

    +

    152 binx = np.asarray(bin_numbers[0]) - 1 

    +

    153 biny = np.asarray(bin_numbers[1]) - 1 

    +

    154 

    +

    155 # bincout for averaging 

    +

    156 bin_count = np.zeros((n_rows, n_cols)) 

    +

    157 

    +

    158 # averaged result to return 

    +

    159 binned_field = np.zeros((n_rows, n_cols)) 

    +

    160 

    +

    161 # bin the field values 

    +

    162 binned_field[binx[:], biny[:]] += field[:] 

    +

    163 # count 

    +

    164 bin_count[binx[:], biny[:]] += 1 

    +

    165 

    +

    166 binned_field = binned_field.flatten() 

    +

    167 bin_count = bin_count.flatten() 

    +

    168 

    +

    169 # exclude all zero entries 

    +

    170 nonzero_inds = np.where(bin_count != 0) 

    +

    171 # average the fields 

    +

    172 binned_field[nonzero_inds] /= bin_count[nonzero_inds] 

    +

    173 

    +

    174 return binned_field 

    +

    175 

    +

    176 

    +

    177def compute_hashes( 

    +

    178 source_path: str, target_path: str = None, n_files: int = None, ret_vals: bool = False 

    +

    179): 

    +

    180 """Compute the hashes using spherical projection of the field values 

    +

    181 

    +

    182 Parameters 

    +

    183 ---------- 

    +

    184 source_path : str 

    +

    185 path to source directory from which the displacements/strains are 

    +

    186 loaded, this directory should contain HDF5 files of the data 

    +

    187 target_path : str (optional) 

    +

    188 directory in which the hashes are to be written to 

    +

    189 n_files : int (optional) 

    +

    190 number of files to process, useful for verification and quick visualization 

    +

    191 ret_vals : bool (optional) 

    +

    192 return the hashes, setting this to true, be aware that the hash list can 

    +

    193 take up a lot of ram 

    +

    194 

    +

    195 Returns 

    +

    196 ------- 

    +

    197 hashes : np.ndarray 

    +

    198 hashed field values 

    +

    199 

    +

    200 Notes 

    +

    201 ----- 

    +

    202 Key for node_displacements for all timesteps: 'xyz' 

    +

    203 Key for field values for all timesteps: 'fields' 

    +

    204 """ 

    +

    205 

    +

    206 # pylint: disable = too-many-locals 

    +

    207 

    +

    208 node_displacement_key = "xyz" 

    +

    209 fields_key = "fields" 

    +

    210 file_name = "run_" 

    +

    211 counter = 0 

    +

    212 

    +

    213 hashed_data = [] 

    +

    214 # if n_files is none get total number of files in directory 

    +

    215 if n_files is None: 

    +

    216 n_files = len(os.listdir(source_path)) 

    +

    217 

    +

    218 # load the displacements and compute the hashes for each run and consider 

    +

    219 # the last time step only 

    +

    220 for ii in range(n_files): 

    +

    221 with h5py.File(source_path + file_name + str(ii) + ".h5", "r") as hf: 

    +

    222 node_displacements = hf[node_displacement_key] 

    +

    223 fields = hf[fields_key] 

    +

    224 

    +

    225 xyz = node_displacements[:, 0, :] 

    +

    226 

    +

    227 # centorid of point cloud 

    +

    228 centroid = np.mean(xyz, axis=0) 

    +

    229 

    +

    230 # convex hull of point cloud 

    +

    231 hull = ConvexHull(xyz) 

    +

    232 dist = np.linalg.norm(hull.max_bound - hull.min_bound) 

    +

    233 

    +

    234 # compute the bin intervals for alpha and beta split into 144 elements 

    +

    235 bins_a, bins_b = _create_sphere_mesh(dist) 

    +

    236 

    +

    237 # compute the point projections 

    +

    238 proj_alpha, proj_beta = _project_to_sphere(xyz, centroid, axis="Y") 

    +

    239 

    +

    240 # bin the spherical coordinates in terms of alpha and beta 

    +

    241 histo = binned_statistic_2d( 

    +

    242 proj_alpha, proj_beta, None, "count", bins=[bins_a, bins_b], expand_binnumbers=True 

    +

    243 ) 

    +

    244 # get the field value 

    +

    245 p_strains = fields[:, -1] 

    +

    246 

    +

    247 # compute hashes 

    +

    248 hashes = sphere_hashing(histo.binnumber, histo.statistic, p_strains) 

    +

    249 

    +

    250 if target_path: 

    +

    251 # write the hashes for each timestep to file 

    +

    252 with h5py.File(target_path + "hashes_sphere_" + str(counter) + ".h5", "w") as hf: 

    +

    253 hf.create_dataset("hashes", data=hashes) 

    +

    254 

    +

    255 if ret_vals: 

    +

    256 hashed_data.append(hashes) 

    +

    257 

    +

    258 return np.asarray(hashed_data) 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6_run_py.html b/coverage/d_febbda7c1df641f6_run_py.html new file mode 100644 index 0000000..4bd1dfe --- /dev/null +++ b/coverage/d_febbda7c1df641f6_run_py.html @@ -0,0 +1,198 @@ + + + + + Coverage for lasso/dimred/run.py: 0% + + + + + +
    +
    +

    + Coverage for lasso/dimred/run.py: + 0% +

    + +

    + 28 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1from rich.console import Console 

    +

    2from rich.theme import Theme 

    +

    3 

    +

    4from lasso.dimred.dimred_run import ( 

    +

    5 DIMRED_STAGES, 

    +

    6 DimredRun, 

    +

    7 DimredRunError, 

    +

    8 DimredStage, 

    +

    9 parse_dimred_args, 

    +

    10) 

    +

    11 

    +

    12 

    +

    13def main(): 

    +

    14 """Runs the dimensionality reduction CLI""" 

    +

    15 

    +

    16 # parse command line stuff 

    +

    17 parser = parse_dimred_args() 

    +

    18 log_theme = Theme( 

    +

    19 {"info": "royal_blue1", "success": "green", "warning": "dark_orange3", "error": "bold red"} 

    +

    20 ) 

    +

    21 console = Console(theme=log_theme, record=True, highlight=False) 

    +

    22 

    +

    23 try: 

    +

    24 # parse settings from command line 

    +

    25 dimred_run = DimredRun( 

    +

    26 reference_run=parser.reference_run, 

    +

    27 simulation_runs=parser.simulation_runs, 

    +

    28 console=console, 

    +

    29 exclude_runs=parser.exclude_runs, 

    +

    30 project_dir=parser.project_dir, 

    +

    31 html_name=parser.html_name, 

    +

    32 html_set_timestamp=parser.html_timestamp, 

    +

    33 img_path=parser.embedding_images, 

    +

    34 logfile_filepath=parser.logfile_filepath, 

    +

    35 n_processes=parser.n_processes, 

    +

    36 part_id_filter=parser.part_ids, 

    +

    37 start_stage=parser.start_stage, 

    +

    38 end_stage=parser.end_stage, 

    +

    39 timestep=parser.timestep, 

    +

    40 cluster_args=parser.cluster_args, 

    +

    41 outlier_args=parser.outlier_args, 

    +

    42 ) 

    +

    43 

    +

    44 # do the thing 

    +

    45 console.print() 

    +

    46 console.print(" ---- Running Routines ---- ") 

    +

    47 console.print() 

    +

    48 

    +

    49 # initiate threading pool for handling jobs 

    +

    50 with dimred_run: 

    +

    51 

    +

    52 # setup 

    +

    53 if ( 

    +

    54 dimred_run.start_stage_index 

    +

    55 <= DIMRED_STAGES.index(DimredStage.REFERENCE_RUN.value) 

    +

    56 <= dimred_run.end_stage_index 

    +

    57 ): 

    +

    58 dimred_run.process_reference_run() 

    +

    59 

    +

    60 # import 

    +

    61 if ( 

    +

    62 dimred_run.start_stage_index 

    +

    63 <= DIMRED_STAGES.index(DimredStage.IMPORT_RUNS.value) 

    +

    64 <= dimred_run.end_stage_index 

    +

    65 ): 

    +

    66 dimred_run.subsample_to_reference_run() 

    +

    67 

    +

    68 # math 

    +

    69 if ( 

    +

    70 dimred_run.start_stage_index 

    +

    71 <= DIMRED_STAGES.index(DimredStage.REDUCTION.value) 

    +

    72 <= dimred_run.end_stage_index 

    +

    73 ): 

    +

    74 dimred_run.dimension_reduction_svd() 

    +

    75 

    +

    76 # clustering 

    +

    77 if ( 

    +

    78 dimred_run.start_stage_index 

    +

    79 <= DIMRED_STAGES.index(DimredStage.CLUSTERING.value) 

    +

    80 <= dimred_run.end_stage_index 

    +

    81 ): 

    +

    82 dimred_run.clustering_results() 

    +

    83 

    +

    84 # export 

    +

    85 if ( 

    +

    86 dimred_run.start_stage_index 

    +

    87 <= DIMRED_STAGES.index(DimredStage.EXPORT_PLOT.value) 

    +

    88 <= dimred_run.end_stage_index 

    +

    89 ): 

    +

    90 dimred_run.visualize_results() 

    +

    91 

    +

    92 # print logfile 

    +

    93 console.save_html(dimred_run.logfile_filepath) 

    +

    94 

    +

    95 # Catch if DimredrunError was called 

    +

    96 except DimredRunError as err: 

    +

    97 print(err) 

    +

    98 

    +

    99 

    +

    100if __name__ == "__main__": 

    +

    101 main() 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6_test_dimred_run_py.html b/coverage/d_febbda7c1df641f6_test_dimred_run_py.html new file mode 100644 index 0000000..ff8d413 --- /dev/null +++ b/coverage/d_febbda7c1df641f6_test_dimred_run_py.html @@ -0,0 +1,359 @@ + + + + + Coverage for lasso/dimred/test_dimred_run.py: 99% + + + + + +
    +
    +

    + Coverage for lasso/dimred/test_dimred_run.py: + 99% +

    + +

    + 73 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import os 

    +

    2import tempfile 

    +

    3from unittest import TestCase 

    +

    4 

    +

    5import h5py 

    +

    6import numpy as np 

    +

    7 

    +

    8from lasso.dimred.dimred_run import DIMRED_STAGES, DimredRun, DimredRunError, HDF5FileNames 

    +

    9from lasso.dimred.test_plot_creator import create_50_fake_plots 

    +

    10 

    +

    11 

    +

    12class TestDimredRun(TestCase): 

    +

    13 def test_run(self): 

    +

    14 """Verifies correct function of DimredRun.py""" 

    +

    15 verification_hdf5_file = h5py.File("test/DimredRunTest/verificationFile.hdf5", "r") 

    +

    16 

    +

    17 with tempfile.TemporaryDirectory() as tmpdir: 

    +

    18 

    +

    19 # create simulation runs 

    +

    20 create_50_fake_plots(folder=tmpdir, n_nodes_x=500, n_nodes_y=10) 

    +

    21 

    +

    22 # collect all simulation runs 

    +

    23 # sim_dir = "test/dimredTestPlots" 

    +

    24 sim_files = os.listdir(tmpdir) 

    +

    25 # sim_files.pop(sim_files.index("htmlTestPage.html")) 

    +

    26 sim_runs = [] 

    +

    27 for sim in sim_files: 

    +

    28 sim_runs.append(os.path.join(tmpdir, sim, "plot")) 

    +

    29 

    +

    30 test_run = DimredRun( 

    +

    31 reference_run=os.path.join(tmpdir, "SVDTestPlot00/plot"), 

    +

    32 simulation_runs=sim_runs, 

    +

    33 start_stage=DIMRED_STAGES[0], 

    +

    34 end_stage="CLUSTERING", 

    +

    35 console=None, 

    +

    36 project_dir="test/DimredRunTest", 

    +

    37 n_processes=5, 

    +

    38 cluster_args=["kmeans"], 

    +

    39 ) 

    +

    40 

    +

    41 with test_run: 

    +

    42 # verify creation of reference_subsample 

    +

    43 # to be able to reproduce results, each DimredRun must return same results 

    +

    44 test_run.process_reference_run() 

    +

    45 

    +

    46 # check if reference subsamples match 

    +

    47 test_refsample = test_run.h5file[HDF5FileNames.SUBSAMPLE_SAVE_NAME.value] 

    +

    48 verification_refsample = verification_hdf5_file[ 

    +

    49 HDF5FileNames.SUBSAMPLE_SAVE_NAME.value 

    +

    50 ] 

    +

    51 self.assertEqual(test_refsample.shape, verification_refsample.shape) 

    +

    52 self.assertTrue((test_refsample[:] - verification_refsample[:]).max() == 0) 

    +

    53 

    +

    54 # check if the expected reference run is chosen 

    +

    55 self.assertEqual( 

    +

    56 os.path.abspath(os.path.join(tmpdir, "SVDTestPlot00/plot")), 

    +

    57 test_run.reference_run, 

    +

    58 ) 

    +

    59 

    +

    60 # check if subsampled samples match 

    +

    61 test_run.subsample_to_reference_run() 

    +

    62 

    +

    63 # get subsampled samples 

    +

    64 test_sub_group = test_run.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value] 

    +

    65 test_subs = np.stack([test_sub_group[key][:] for key in test_sub_group.keys()]) 

    +

    66 

    +

    67 # check if shape is equal to (n_samples, timesteps, subsampled nodes, dims) 

    +

    68 # we have 50 sample, minus ref_run is 49 

    +

    69 # we have 5 timesteps 

    +

    70 # we subsample to 2000 nodes 

    +

    71 # we always have 3 spatial dimensions 

    +

    72 self.assertEqual(test_subs.shape, (49, 5, 2000, 3)) 

    +

    73 

    +

    74 # check if svd yields consistent results 

    +

    75 test_run.dimension_reduction_svd() 

    +

    76 

    +

    77 # get test betas 

    +

    78 test_betas_group = test_run.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] 

    +

    79 test_ids = np.stack([key for key in test_betas_group.keys()]) 

    +

    80 test_betas = np.stack([test_betas_group[key][:] for key in test_betas_group.keys()]) 

    +

    81 

    +

    82 # we check if test_ids and test_betas are of correct shape 

    +

    83 # we have 44 samples, 5 timesteps and save the first 10 betas 

    +

    84 self.assertEqual(test_ids.shape, (49,)) 

    +

    85 self.assertEqual(test_betas.shape, (49, 5, 10)) 

    +

    86 

    +

    87 test_v_rob = test_run.h5file[HDF5FileNames.V_ROB_SAVE_NAME.value][:] 

    +

    88 # shape of v_rob must be (eigen, timesteps, nodes) 

    +

    89 self.assertEqual(test_v_rob.shape, (10, 5, 2000 * 3)) 

    +

    90 

    +

    91 # verify that calculated betas are reproducable as expected 

    +

    92 # first, create displ mat containing difference in displ over time 

    +

    93 verify_displ_stacked = test_subs.reshape(49, 5, 2000 * 3) 

    +

    94 verify_diff_mat = np.stack( 

    +

    95 [verify_displ_stacked[:, 0, :] for _ in range(5)] 

    +

    96 ).reshape(49, 5, 2000 * 3) 

    +

    97 verify_displ_stacked = verify_displ_stacked - verify_diff_mat 

    +

    98 

    +

    99 # calculate betas and check if they are similar 

    +

    100 verify_betas = np.einsum("stn, ktn -> stk", verify_displ_stacked, test_v_rob) 

    +

    101 self.assertTrue(np.allclose(verify_betas, test_betas)) 

    +

    102 

    +

    103 # recalculate displ 

    +

    104 recalc_displ_stacked = np.einsum("stk, ktn -> stn", test_betas, test_v_rob) 

    +

    105 

    +

    106 # Due to projection into eigenspace and back not using all avaiable eigenvectors, 

    +

    107 # a small error margin is inevitable 

    +

    108 self.assertTrue((verify_displ_stacked - recalc_displ_stacked).max() <= 1e-5) 

    +

    109 

    +

    110 # checking clustering and html output makes little sense here, 

    +

    111 # but we know how the created plots are laid out: 25 bending up, 25 bending down 

    +

    112 # this should be presented in the betas 

    +

    113 # We will only look at the last timestep 

    +

    114 # We only check the first beta 

    +

    115 

    +

    116 # first 24 betas point one direction (reference run is run 0 and points up) 

    +

    117 betas_up = test_betas[:24, -1] 

    +

    118 # other 25 betas point down 

    +

    119 betas_down = test_betas[24:, -1] 

    +

    120 

    +

    121 # check that first beta has the same sign as others bending up 

    +

    122 is_pos_up = betas_up[0, 0] > 0 

    +

    123 for b in betas_up: 

    +

    124 self.assertEqual(is_pos_up, b[0] > 0) 

    +

    125 

    +

    126 # check that 25th betas has same sign as other bending down 

    +

    127 is_pos_down = betas_down[0, 0] > 0 

    +

    128 for b in betas_down: 

    +

    129 self.assertEqual(is_pos_down, b[0] > 0) 

    +

    130 

    +

    131 # verify that one group has negative and other group positive direction 

    +

    132 self.assertFalse(is_pos_down and is_pos_up) 

    +

    133 

    +

    134 test_run.clustering_results() 

    +

    135 

    +

    136 # check if glob pattern works correctly 

    +

    137 DimredRun( 

    +

    138 simulation_runs=os.path.join(tmpdir, "SVDTestPlot*/plot"), 

    +

    139 start_stage=DIMRED_STAGES[0], 

    +

    140 end_stage=DIMRED_STAGES[0], 

    +

    141 project_dir="test/DimredRunTest", 

    +

    142 console=None, 

    +

    143 ) 

    +

    144 

    +

    145 def test_for_errors(self): 

    +

    146 """Verifies correct error behaviour when facing incorrect parser arguments""" 

    +

    147 

    +

    148 with tempfile.TemporaryDirectory() as tmpdir: 

    +

    149 # collect all simulation runs 

    +

    150 sim_files = os.listdir(tmpdir) 

    +

    151 sim_runs = [] 

    +

    152 for sim in sim_files: 

    +

    153 sim_runs.append(os.path.join(tmpdir, sim, "plot")) 

    +

    154 

    +

    155 # check invalid start_stage 

    +

    156 self.assertRaises( 

    +

    157 DimredRunError, 

    +

    158 DimredRun, 

    +

    159 reference_run="test/dimredTestPlots/SVDTestPlot0/plot", 

    +

    160 simulation_runs=sim_runs, 

    +

    161 start_stage="INVALID_START", 

    +

    162 end_stage=DIMRED_STAGES[-1], 

    +

    163 console=None, 

    +

    164 project_dir="test/DimredRunTest", 

    +

    165 n_processes=5, 

    +

    166 ) 

    +

    167 

    +

    168 # check invalid end_stage 

    +

    169 self.assertRaises( 

    +

    170 DimredRunError, 

    +

    171 DimredRun, 

    +

    172 reference_run="test/dimredTestPlots/SVDTestPlot0/plot", 

    +

    173 simulation_runs=sim_runs, 

    +

    174 start_stage=DIMRED_STAGES[0], 

    +

    175 end_stage="INVALID_END", 

    +

    176 console=None, 

    +

    177 project_dir="test/DimredRunTest", 

    +

    178 n_processes=5, 

    +

    179 ) 

    +

    180 

    +

    181 # check invalid start_stage after end_stage 

    +

    182 self.assertRaises( 

    +

    183 DimredRunError, 

    +

    184 DimredRun, 

    +

    185 reference_run="test/dimredTestPlots/SVDTestPlot0/plot", 

    +

    186 simulation_runs=sim_runs, 

    +

    187 start_stage=DIMRED_STAGES[-1], 

    +

    188 end_stage=DIMRED_STAGES[0], 

    +

    189 console=None, 

    +

    190 project_dir="test/DimredRunTest", 

    +

    191 n_processes=5, 

    +

    192 ) 

    +

    193 

    +

    194 # check invalid simulation runs 

    +

    195 self.assertRaises( 

    +

    196 DimredRunError, 

    +

    197 DimredRun, 

    +

    198 simulation_runs="test/dimredTestPlots200/plot", 

    +

    199 start_stage=DIMRED_STAGES[0], 

    +

    200 end_stage=DIMRED_STAGES[-1], 

    +

    201 console=None, 

    +

    202 project_dir="test/DimredRunTest", 

    +

    203 n_processes=5, 

    +

    204 ) 

    +

    205 

    +

    206 # check invalid cluster_args 

    +

    207 self.assertRaises( 

    +

    208 DimredRunError, 

    +

    209 DimredRun, 

    +

    210 simulation_runs=sim_runs, 

    +

    211 start_stage=DIMRED_STAGES[0], 

    +

    212 end_stage=DIMRED_STAGES[-1], 

    +

    213 console=None, 

    +

    214 project_dir="test/DimredRunTest", 

    +

    215 n_processes=5, 

    +

    216 cluster_args=["noMeans"], 

    +

    217 ) 

    +

    218 

    +

    219 # check invalid outlier-args 

    +

    220 self.assertRaises( 

    +

    221 DimredRunError, 

    +

    222 DimredRun, 

    +

    223 simulation_runs=sim_runs, 

    +

    224 start_stage=DIMRED_STAGES[0], 

    +

    225 end_stage=DIMRED_STAGES[-1], 

    +

    226 console=None, 

    +

    227 project_dir="test/DimredRunTest", 

    +

    228 n_processes=5, 

    +

    229 cluster_args=["kmeans"], 

    +

    230 outlier_args=["DoesNotExist"], 

    +

    231 ) 

    +

    232 

    +

    233 # check inexistent reference run 

    +

    234 self.assertRaises( 

    +

    235 DimredRunError, 

    +

    236 DimredRun, 

    +

    237 reference_run=os.path.join(tmpdir, "IDontExist"), 

    +

    238 simulation_runs=sim_runs, 

    +

    239 start_stage=DIMRED_STAGES[0], 

    +

    240 end_stage=DIMRED_STAGES[-1], 

    +

    241 console=None, 

    +

    242 project_dir="test/DimredRunTest", 

    +

    243 n_processes=5, 

    +

    244 ) 

    +

    245 # check for empty simulation runs 

    +

    246 self.assertRaises( 

    +

    247 DimredRunError, 

    +

    248 DimredRun, 

    +

    249 simulation_runs="", 

    +

    250 start_stage=DIMRED_STAGES[0], 

    +

    251 end_stage=DIMRED_STAGES[-1], 

    +

    252 console=None, 

    +

    253 project_dir="test/DimredRunTest", 

    +

    254 n_processes=5, 

    +

    255 ) 

    +

    256 

    +

    257 def tearDown(self): 

    +

    258 # cleanup of created files 

    +

    259 test_files = os.listdir("test/DimredRunTest") 

    +

    260 test_files.pop(test_files.index("verificationFile.hdf5")) 

    +

    261 for entry in test_files: 

    +

    262 os.remove(os.path.join("test/DimredRunTest", entry)) 

    +
    + + + diff --git a/coverage/d_febbda7c1df641f6_test_plot_creator_py.html b/coverage/d_febbda7c1df641f6_test_plot_creator_py.html new file mode 100644 index 0000000..42de317 --- /dev/null +++ b/coverage/d_febbda7c1df641f6_test_plot_creator_py.html @@ -0,0 +1,304 @@ + + + + + Coverage for lasso/dimred/test_plot_creator.py: 94% + + + + + +
    +
    +

    + Coverage for lasso/dimred/test_plot_creator.py: + 94% +

    + +

    + 52 statements   + + + +

    +

    + « prev     + ^ index     + » next +       + coverage.py v7.2.4, + created at 2023-04-28 18:42 +0100 +

    + +
    +
    +
    +

    1import math 

    +

    2import os 

    +

    3import random 

    +

    4 

    +

    5import numpy as np 

    +

    6import plotly.graph_objects as go 

    +

    7 

    +

    8from lasso.dyna.d3plot import ArrayType, D3plot 

    +

    9 

    +

    10 

    +

    11def create_fake_d3plots( 

    +

    12 path: str, 

    +

    13 element_shell_node_indexes: np.ndarray, 

    +

    14 bend_multiplicator: float, 

    +

    15 n_nodes_x: int = 500, 

    +

    16 n_nodes_y: int = 10, 

    +

    17 n_timesteps: int = 5, 

    +

    18): 

    +

    19 """ 

    +

    20 Creates a number of artificial D3plots to be used in testing 

    +

    21 """ 

    +

    22 

    +

    23 # if bend_multiplicator > 0: 

    +

    24 # bend_loc_x = int(n_nodes_x/10) 

    +

    25 # bend_start = bend_loc_x - int(bend_loc_x/2) 

    +

    26 # bend_end = bend_loc_x + int(bend_loc_x/2) 

    +

    27 # else: 

    +

    28 # bend_loc_x = n_nodes_x - int(n_nodes_x/10) 

    +

    29 # bend_start = bend_loc_x - int(n_nodes_x/20) 

    +

    30 # bend_end = bend_loc_x + int(n_nodes_x/20) 

    +

    31 

    +

    32 x_coords = np.arange(n_nodes_x) 

    +

    33 y_coords = np.arange(n_nodes_y) 

    +

    34 # z_bend_mat = np.stack( 

    +

    35 # [np.array([1+math.sin(x*2*math.pi/(bend_end - bend_start)) 

    +

    36 # for x in range(bend_end - bend_start)] 

    +

    37 # ) 

    +

    38 # for _ in range(n_nodes_y)]).reshape(((bend_end - bend_start)*n_nodes_y)) 

    +

    39 

    +

    40 z_bend_mat = np.stack( 

    +

    41 [ 

    +

    42 np.array([1 + math.sin(x * math.pi / n_nodes_x) for x in range(n_nodes_x)]) 

    +

    43 for _ in range(n_nodes_y) 

    +

    44 ] 

    +

    45 ).reshape((n_nodes_x * n_nodes_y,)) 

    +

    46 node_coordinates = np.zeros((n_nodes_x * n_nodes_y, 3)) 

    +

    47 

    +

    48 # fill in y coords 

    +

    49 for n in range(n_nodes_y): 

    +

    50 node_coordinates[n * n_nodes_x : n_nodes_x + n * n_nodes_x, 1] = y_coords[n] 

    +

    51 node_coordinates[n * n_nodes_x : n_nodes_x + n * n_nodes_x, 0] = x_coords 

    +

    52 # fill in x coords 

    +

    53 # for n in range(n_nodes_x): 

    +

    54 # node_coordinates[n*n_nodes_y:n_nodes_y+n*n_nodes_y, 0] = x_coords[n] 

    +

    55 

    +

    56 node_displacement = np.zeros((n_timesteps, n_nodes_x * n_nodes_y, 3)) 

    +

    57 

    +

    58 for t in range(n_timesteps): 

    +

    59 node_displacement[t] = node_coordinates 

    +

    60 # node_displacement[t, bend_start*n_nodes_y:bend_end*n_nodes_y, 2] = \ 

    +

    61 # z_bend_mat * bend_multiplicator * t 

    +

    62 node_displacement[t, :, 2] = z_bend_mat * bend_multiplicator * t 

    +

    63 

    +

    64 # print(node_displacement.shape) 

    +

    65 

    +

    66 plot = D3plot() 

    +

    67 plot.arrays[ArrayType.node_displacement] = node_displacement 

    +

    68 plot.arrays[ArrayType.node_coordinates] = node_coordinates 

    +

    69 plot.arrays[ArrayType.element_shell_node_indexes] = element_shell_node_indexes 

    +

    70 plot.arrays[ArrayType.element_shell_part_indexes] = np.full( 

    +

    71 (element_shell_node_indexes.shape[0]), 0 

    +

    72 ) 

    +

    73 

    +

    74 # we could create an artificial array element_shell_is_alive to test the 

    +

    75 # correct part extraction process not neccessary currently 

    +

    76 

    +

    77 os.makedirs(path, exist_ok=True) 

    +

    78 plot.write_d3plot(os.path.join(path, "plot")) 

    +

    79 # plotUtilFunc(node_displacement) 

    +

    80 

    +

    81 

    +

    82def plot_util_func(xyz_array: np.array): 

    +

    83 trace = go.Scatter3d( 

    +

    84 x=xyz_array[-1, :, 0], 

    +

    85 y=xyz_array[-1, :, 1], 

    +

    86 z=xyz_array[-1, :, 2], 

    +

    87 mode="markers", 

    +

    88 text=np.arange(xyz_array.shape[1]), 

    +

    89 ) 

    +

    90 fig = go.Figure([trace]) 

    +

    91 fig.show() 

    +

    92 

    +

    93 

    +

    94def create_element_shell_node_indexes(n_nodes_x: int = 500, n_nodes_y: int = 10) -> np.ndarray: 

    +

    95 """ 

    +

    96 returns a element_shell_node_indexes array 

    +

    97 """ 

    +

    98 

    +

    99 new_shell_node_indexes = np.full( 

    +

    100 ((n_nodes_x - 1) * (n_nodes_y - 1), 4), np.array([0, 1, n_nodes_x + 1, n_nodes_x]) 

    +

    101 ) 

    +

    102 mod = np.full((4, n_nodes_x - 1), np.arange(n_nodes_x - 1)) 

    +

    103 for i in range(n_nodes_y - 1): 

    +

    104 new_shell_node_indexes[(n_nodes_x - 1) * i : (n_nodes_x - 1) + ((n_nodes_x - 1) * i)] += ( 

    +

    105 mod + i * n_nodes_x 

    +

    106 ).T 

    +

    107 

    +

    108 return new_shell_node_indexes 

    +

    109 

    +

    110 

    +

    111def create_2_fake_plots(folder: str, n_nodes_x: int, n_nodes_y: int, n_timesteps=5): 

    +

    112 """ 

    +

    113 creates 2 faked plots 

    +

    114 

    +

    115 Parameters 

    +

    116 ---------- 

    +

    117 folder: str 

    +

    118 folder path 

    +

    119 n_nodes_x: int 

    +

    120 how many nodes in x 

    +

    121 n_nodes_y: int 

    +

    122 how many nodes in y 

    +

    123 n_timesteps: int, default: 5 

    +

    124 how many timesteps 

    +

    125 """ 

    +

    126 

    +

    127 randy_random = random.Random("The_Seed") 

    +

    128 plot_name = "SVDTestPlot{i}" 

    +

    129 

    +

    130 element_shell_node_indexes = create_element_shell_node_indexes( 

    +

    131 n_nodes_x=n_nodes_x, n_nodes_y=n_nodes_y 

    +

    132 ) 

    +

    133 

    +

    134 create_fake_d3plots( 

    +

    135 path=os.path.join(folder, plot_name.format(i="00")), 

    +

    136 element_shell_node_indexes=element_shell_node_indexes, 

    +

    137 bend_multiplicator=5 * (1 + randy_random.random()), 

    +

    138 n_nodes_x=n_nodes_x, 

    +

    139 n_nodes_y=n_nodes_y, 

    +

    140 n_timesteps=n_timesteps, 

    +

    141 ) 

    +

    142 

    +

    143 create_fake_d3plots( 

    +

    144 path=os.path.join(folder, plot_name.format(i="01")), 

    +

    145 element_shell_node_indexes=element_shell_node_indexes, 

    +

    146 bend_multiplicator=5 * (1 + randy_random.random()), 

    +

    147 n_nodes_x=n_nodes_x, 

    +

    148 n_nodes_y=n_nodes_y, 

    +

    149 n_timesteps=n_timesteps, 

    +

    150 ) 

    +

    151 

    +

    152 

    +

    153def create_50_fake_plots(folder: str, n_nodes_x: int, n_nodes_y: int, n_timesteps=5): 

    +

    154 """ 

    +

    155 creates 50 faked plots, 25 bending up, 25 bending down 

    +

    156 

    +

    157 Parameters 

    +

    158 ---------- 

    +

    159 folder: str 

    +

    160 folder path 

    +

    161 n_nodes_x: int 

    +

    162 how many nodes in x 

    +

    163 n_nodes_y: int 

    +

    164 how many nodes in y 

    +

    165 n_timesteps: int, default: 5 

    +

    166 how many timesteps 

    +

    167 """ 

    +

    168 

    +

    169 # init random 

    +

    170 randy_random = random.Random("The_Seed") 

    +

    171 

    +

    172 plot_name = "SVDTestPlot{i}" 

    +

    173 

    +

    174 # doesn't change for each plot with same dimensions, so only created once 

    +

    175 element_shell_node_indexes = create_element_shell_node_indexes( 

    +

    176 n_nodes_x=n_nodes_x, n_nodes_y=n_nodes_y 

    +

    177 ) 

    +

    178 

    +

    179 # 25 plots bending up 

    +

    180 for i in range(25): 

    +

    181 nr = str(i) 

    +

    182 if i < 10: 

    +

    183 nr = "0" + str(i) 

    +

    184 create_fake_d3plots( 

    +

    185 path=os.path.join(folder, plot_name.format(i=nr)), 

    +

    186 element_shell_node_indexes=element_shell_node_indexes, 

    +

    187 bend_multiplicator=5 * (1 + randy_random.random()), 

    +

    188 n_nodes_x=n_nodes_x, 

    +

    189 n_nodes_y=n_nodes_y, 

    +

    190 n_timesteps=n_timesteps, 

    +

    191 ) 

    +

    192 

    +

    193 # 25 plots bending down 

    +

    194 for i in range(25): 

    +

    195 create_fake_d3plots( 

    +

    196 path=os.path.join(folder, plot_name.format(i=i + 25)), 

    +

    197 element_shell_node_indexes=element_shell_node_indexes, 

    +

    198 bend_multiplicator=-5 * (1 + randy_random.random()), 

    +

    199 n_nodes_x=n_nodes_x, 

    +

    200 n_nodes_y=n_nodes_y, 

    +

    201 n_timesteps=n_timesteps, 

    +

    202 ) 

    +

    203 

    +

    204 

    +

    205# TODO: Remove after fixing D3plot writing two files issue 

    +

    206# if __name__ == "__main__": 

    +

    207# create_2_fake_plots("../delteThisPlease/", 200, 10) 

    +
    + + + diff --git a/coverage/favicon_32.png b/coverage/favicon_32.png new file mode 100644 index 0000000..8649f04 Binary files /dev/null and b/coverage/favicon_32.png differ diff --git a/coverage/index.html b/coverage/index.html new file mode 100644 index 0000000..163b15e --- /dev/null +++ b/coverage/index.html @@ -0,0 +1,1027 @@ + + + + + + + + + + + + + + + + + + Code Coverage Report - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Code Coverage Report

    + + + +

    +

    + + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/coverage/keybd_closed.png b/coverage/keybd_closed.png new file mode 100644 index 0000000..ba119c4 Binary files /dev/null and b/coverage/keybd_closed.png differ diff --git a/coverage/keybd_open.png b/coverage/keybd_open.png new file mode 100644 index 0000000..a8bac6c Binary files /dev/null and b/coverage/keybd_open.png differ diff --git a/coverage/status.json b/coverage/status.json new file mode 100644 index 0000000..051fa53 --- /dev/null +++ b/coverage/status.json @@ -0,0 +1 @@ +{"format":2,"version":"7.2.4","globals":"a5c36a7ac3d11e81051bb1a6fe4932ba","files":{"d_306dfaf9bde54f34___init___py":{"hash":"3c77fc9ef7f887ac2508d4109cf92472","index":{"nums":[0,1,0,0,0,0,0,0],"html_filename":"d_306dfaf9bde54f34___init___py.html","relative_filename":"lasso/__init__.py"}},"d_d5eca2bf8c9eb372___init___py":{"hash":"b7f27e5db90b91351cb2b35b33be0b9c","index":{"nums":[0,1,2,0,2,0,0,0],"html_filename":"d_d5eca2bf8c9eb372___init___py.html","relative_filename":"lasso/diffcrash/__init__.py"}},"d_d5eca2bf8c9eb372_diffcrash_run_py":{"hash":"ceaafdd21776e1e0f1361f622f02fff8","index":{"nums":[0,1,587,0,587,0,0,0],"html_filename":"d_d5eca2bf8c9eb372_diffcrash_run_py.html","relative_filename":"lasso/diffcrash/diffcrash_run.py"}},"d_d5eca2bf8c9eb372_run_py":{"hash":"64530f90647138e819cb96419f30ed09","index":{"nums":[0,1,39,0,39,0,0,0],"html_filename":"d_d5eca2bf8c9eb372_run_py.html","relative_filename":"lasso/diffcrash/run.py"}},"d_febbda7c1df641f6___init___py":{"hash":"0d4269242f6d0ba0f164cb6b69c5e066","index":{"nums":[0,1,2,0,0,0,0,0],"html_filename":"d_febbda7c1df641f6___init___py.html","relative_filename":"lasso/dimred/__init__.py"}},"d_febbda7c1df641f6_dimred_run_py":{"hash":"2257def1194997025c2facb8efd25baa","index":{"nums":[0,1,451,0,158,0,0,0],"html_filename":"d_febbda7c1df641f6_dimred_run_py.html","relative_filename":"lasso/dimred/dimred_run.py"}},"d_febbda7c1df641f6_graph_laplacian_py":{"hash":"061170c1e84084d5e3a0987ba2a6c8ed","index":{"nums":[0,1,47,0,47,0,0,0],"html_filename":"d_febbda7c1df641f6_graph_laplacian_py.html","relative_filename":"lasso/dimred/graph_laplacian.py"}},"d_febbda7c1df641f6_hashing_py":{"hash":"c99c1b17f2f55ad1785eb40490b03d03","index":{"nums":[0,1,217,0,217,0,0,0],"html_filename":"d_febbda7c1df641f6_hashing_py.html","relative_filename":"lasso/dimred/hashing.py"}},"d_febbda7c1df641f6_hashing_sphere_py":{"hash":"478ce4b3d8893a98aff3c00d73ac8c32","index":{"nums":[0,1,85,0,85,0,0,0],"html_filename":"d_febbda7c1df641f6_hashing_sphere_py.html","relative_filename":"lasso/dimred/hashing_sphere.py"}},"d_febbda7c1df641f6_run_py":{"hash":"19d86afd3d4f333ee8c04aba36b17abc","index":{"nums":[0,1,28,0,28,0,0,0],"html_filename":"d_febbda7c1df641f6_run_py.html","relative_filename":"lasso/dimred/run.py"}},"d_9d33c8608d0cbf05___init___py":{"hash":"5b818bf033327b3bd1124591623d83d5","index":{"nums":[0,1,0,0,0,0,0,0],"html_filename":"d_9d33c8608d0cbf05___init___py.html","relative_filename":"lasso/dimred/sphere/__init__.py"}},"d_9d33c8608d0cbf05_algorithms_py":{"hash":"37c1added0e162a0f5f88b1a8b83e456","index":{"nums":[0,1,67,0,67,0,0,0],"html_filename":"d_9d33c8608d0cbf05_algorithms_py.html","relative_filename":"lasso/dimred/sphere/algorithms.py"}},"d_ec83283597faf9de___init___py":{"hash":"3c77fc9ef7f887ac2508d4109cf92472","index":{"nums":[0,1,0,0,0,0,0,0],"html_filename":"d_ec83283597faf9de___init___py.html","relative_filename":"lasso/dimred/svd/__init__.py"}},"d_ec83283597faf9de_clustering_betas_py":{"hash":"1c85df2c0946129167574ede59737865","index":{"nums":[0,1,223,0,115,0,0,0],"html_filename":"d_ec83283597faf9de_clustering_betas_py.html","relative_filename":"lasso/dimred/svd/clustering_betas.py"}},"d_ec83283597faf9de_html_str_eles_py":{"hash":"3b73bf766ec57860214df079c3d3a3dd","index":{"nums":[0,1,4,0,0,0,0,0],"html_filename":"d_ec83283597faf9de_html_str_eles_py.html","relative_filename":"lasso/dimred/svd/html_str_eles.py"}},"d_ec83283597faf9de_keyword_types_py":{"hash":"f5e8431a5140269112e67f98a6f8ed58","index":{"nums":[0,1,16,0,0,0,0,0],"html_filename":"d_ec83283597faf9de_keyword_types_py.html","relative_filename":"lasso/dimred/svd/keyword_types.py"}},"d_ec83283597faf9de_plot_beta_clusters_py":{"hash":"5c4ed145f9b32e47541779e27bc34e6e","index":{"nums":[0,1,65,0,22,0,0,0],"html_filename":"d_ec83283597faf9de_plot_beta_clusters_py.html","relative_filename":"lasso/dimred/svd/plot_beta_clusters.py"}},"d_ec83283597faf9de_pod_functions_py":{"hash":"513a6ae1dc0ea6b1f39cd49280020a39","index":{"nums":[0,1,30,0,1,0,0,0],"html_filename":"d_ec83283597faf9de_pod_functions_py.html","relative_filename":"lasso/dimred/svd/pod_functions.py"}},"d_ec83283597faf9de_subsampling_methods_py":{"hash":"83113ade8828fe10c686c9be24b84b42","index":{"nums":[0,1,120,0,56,0,0,0],"html_filename":"d_ec83283597faf9de_subsampling_methods_py.html","relative_filename":"lasso/dimred/svd/subsampling_methods.py"}},"d_ec83283597faf9de_test_clustering_betas_py":{"hash":"9a7d5ca66a6f4ab154e8f47fdb197600","index":{"nums":[0,1,27,0,0,0,0,0],"html_filename":"d_ec83283597faf9de_test_clustering_betas_py.html","relative_filename":"lasso/dimred/svd/test_clustering_betas.py"}},"d_ec83283597faf9de_test_plot_betas_clusters_py":{"hash":"b03db77394babb03584606f419aff373","index":{"nums":[0,1,18,0,0,0,0,0],"html_filename":"d_ec83283597faf9de_test_plot_betas_clusters_py.html","relative_filename":"lasso/dimred/svd/test_plot_betas_clusters.py"}},"d_ec83283597faf9de_test_pod_functions_py":{"hash":"1ca9c51c3996c14ac918843fd41f0eeb","index":{"nums":[0,1,24,0,0,0,0,0],"html_filename":"d_ec83283597faf9de_test_pod_functions_py.html","relative_filename":"lasso/dimred/svd/test_pod_functions.py"}},"d_ec83283597faf9de_test_subsampling_methods_py":{"hash":"1895106600355d2c786ff7194c595dd9","index":{"nums":[0,1,46,0,0,0,0,0],"html_filename":"d_ec83283597faf9de_test_subsampling_methods_py.html","relative_filename":"lasso/dimred/svd/test_subsampling_methods.py"}},"d_febbda7c1df641f6_test_dimred_run_py":{"hash":"a802229c7cf376fbe01e3933eb119379","index":{"nums":[0,1,73,0,1,0,0,0],"html_filename":"d_febbda7c1df641f6_test_dimred_run_py.html","relative_filename":"lasso/dimred/test_dimred_run.py"}},"d_febbda7c1df641f6_test_plot_creator_py":{"hash":"c6d62cd8c2ea02450af264479f0e6deb","index":{"nums":[0,1,52,0,3,0,0,0],"html_filename":"d_febbda7c1df641f6_test_plot_creator_py.html","relative_filename":"lasso/dimred/test_plot_creator.py"}},"d_233c5ceebba6ed8d___init___py":{"hash":"568469db8c8be213664f7cfd57b84833","index":{"nums":[0,1,6,0,0,0,0,0],"html_filename":"d_233c5ceebba6ed8d___init___py.html","relative_filename":"lasso/dyna/__init__.py"}},"d_233c5ceebba6ed8d_array_type_py":{"hash":"aec6ec60e0098eb1bbb934f0bf690fd6","index":{"nums":[0,1,157,0,0,0,0,0],"html_filename":"d_233c5ceebba6ed8d_array_type_py.html","relative_filename":"lasso/dyna/array_type.py"}},"d_233c5ceebba6ed8d_binout_py":{"hash":"01d24650d4602c9e0ce20d9a93472d1d","index":{"nums":[0,1,112,0,93,0,0,0],"html_filename":"d_233c5ceebba6ed8d_binout_py.html","relative_filename":"lasso/dyna/binout.py"}},"d_233c5ceebba6ed8d_d3plot_py":{"hash":"4fe459cef20fb16881626a5be2476b98","index":{"nums":[0,1,3907,0,1941,0,0,0],"html_filename":"d_233c5ceebba6ed8d_d3plot_py.html","relative_filename":"lasso/dyna/d3plot.py"}},"d_233c5ceebba6ed8d_d3plot_header_py":{"hash":"ba2c8dc58e268e6ddfff5c6c4dade689","index":{"nums":[0,1,415,0,47,0,0,0],"html_filename":"d_233c5ceebba6ed8d_d3plot_header_py.html","relative_filename":"lasso/dyna/d3plot_header.py"}},"d_233c5ceebba6ed8d_femzip_mapper_py":{"hash":"bbe0da55dd68bd86e8ab40249cd1db4a","index":{"nums":[0,1,228,0,61,0,0,0],"html_filename":"d_233c5ceebba6ed8d_femzip_mapper_py.html","relative_filename":"lasso/dyna/femzip_mapper.py"}},"d_233c5ceebba6ed8d_filter_type_py":{"hash":"1989213c8216d15893b5788aa6c22927","index":{"nums":[0,1,8,0,0,0,0,0],"html_filename":"d_233c5ceebba6ed8d_filter_type_py.html","relative_filename":"lasso/dyna/filter_type.py"}},"d_233c5ceebba6ed8d_lsda_py3_py":{"hash":"40c623de1197d42bfbc152f15d32983c","index":{"nums":[0,1,424,0,363,0,0,0],"html_filename":"d_233c5ceebba6ed8d_lsda_py3_py.html","relative_filename":"lasso/dyna/lsda_py3.py"}},"d_233c5ceebba6ed8d_test_d3plot_py":{"hash":"aa239d55526e6cabd7ca446665e92849","index":{"nums":[0,1,198,0,7,0,0,0],"html_filename":"d_233c5ceebba6ed8d_test_d3plot_py.html","relative_filename":"lasso/dyna/test_d3plot.py"}},"d_233c5ceebba6ed8d_test_d3plot_header_py":{"hash":"f78770119777bafd6b93d4a99d7db9f5","index":{"nums":[0,1,42,0,0,0,0,0],"html_filename":"d_233c5ceebba6ed8d_test_d3plot_header_py.html","relative_filename":"lasso/dyna/test_d3plot_header.py"}},"d_233c5ceebba6ed8d_test_mapper_py":{"hash":"a4ba5c979fff1e33ac6abbebec2f170a","index":{"nums":[0,1,102,0,8,0,0,0],"html_filename":"d_233c5ceebba6ed8d_test_mapper_py.html","relative_filename":"lasso/dyna/test_mapper.py"}},"d_f6cb54d84c129274___init___py":{"hash":"8036588c355cba1d2993b01cd44f1489","index":{"nums":[0,1,2,0,0,0,0,0],"html_filename":"d_f6cb54d84c129274___init___py.html","relative_filename":"lasso/femzip/__init__.py"}},"d_f6cb54d84c129274_femzip_api_py":{"hash":"33358c47c4b40b07d79ef54464337b64","index":{"nums":[0,1,417,0,269,0,0,0],"html_filename":"d_f6cb54d84c129274_femzip_api_py.html","relative_filename":"lasso/femzip/femzip_api.py"}},"d_f6cb54d84c129274_fz_config_py":{"hash":"0ae22b85e7bc8fcaa9ca551da5d2de1d","index":{"nums":[0,1,113,0,6,0,0,0],"html_filename":"d_f6cb54d84c129274_fz_config_py.html","relative_filename":"lasso/femzip/fz_config.py"}},"d_8c1f8dfb65cd62c9___init___py":{"hash":"3c77fc9ef7f887ac2508d4109cf92472","index":{"nums":[0,1,0,0,0,0,0,0],"html_filename":"d_8c1f8dfb65cd62c9___init___py.html","relative_filename":"lasso/io/__init__.py"}},"d_8c1f8dfb65cd62c9_binary_buffer_py":{"hash":"359ebae840ee3f5030800896287ad4d2","index":{"nums":[0,1,78,0,10,0,0,0],"html_filename":"d_8c1f8dfb65cd62c9_binary_buffer_py.html","relative_filename":"lasso/io/binary_buffer.py"}},"d_8c1f8dfb65cd62c9_files_py":{"hash":"b08d6b314cae69870d5409b25d057c17","index":{"nums":[0,1,31,0,0,0,0,0],"html_filename":"d_8c1f8dfb65cd62c9_files_py.html","relative_filename":"lasso/io/files.py"}},"d_8c1f8dfb65cd62c9_test_binary_buffer_py":{"hash":"b453d2dbbf0d04583142a1489837ecfa","index":{"nums":[0,1,44,0,0,0,0,0],"html_filename":"d_8c1f8dfb65cd62c9_test_binary_buffer_py.html","relative_filename":"lasso/io/test_binary_buffer.py"}},"d_8c1f8dfb65cd62c9_test_files_py":{"hash":"654887f6177cf31a85da857a5ebb50ff","index":{"nums":[0,1,14,0,0,0,0,0],"html_filename":"d_8c1f8dfb65cd62c9_test_files_py.html","relative_filename":"lasso/io/test_files.py"}},"d_306dfaf9bde54f34_logging_py":{"hash":"8a3bf5a73c738320be55cfab2582f907","index":{"nums":[0,1,22,0,5,0,0,0],"html_filename":"d_306dfaf9bde54f34_logging_py.html","relative_filename":"lasso/logging.py"}},"d_542c2d228fe7f497___init___py":{"hash":"3c77fc9ef7f887ac2508d4109cf92472","index":{"nums":[0,1,0,0,0,0,0,0],"html_filename":"d_542c2d228fe7f497___init___py.html","relative_filename":"lasso/math/__init__.py"}},"d_542c2d228fe7f497_sampling_py":{"hash":"cbb989464e2e9711bd11486f60b3388b","index":{"nums":[0,1,22,0,9,0,0,0],"html_filename":"d_542c2d228fe7f497_sampling_py.html","relative_filename":"lasso/math/sampling.py"}},"d_542c2d228fe7f497_stochastic_py":{"hash":"b5848cdf86cbbdb319d55217849a97fe","index":{"nums":[0,1,9,0,0,0,0,0],"html_filename":"d_542c2d228fe7f497_stochastic_py.html","relative_filename":"lasso/math/stochastic.py"}},"d_542c2d228fe7f497_test_sampling_py":{"hash":"abf50e993383297908928b6436219852","index":{"nums":[0,1,6,0,0,0,0,0],"html_filename":"d_542c2d228fe7f497_test_sampling_py.html","relative_filename":"lasso/math/test_sampling.py"}},"d_542c2d228fe7f497_test_stochastic_py":{"hash":"e27b5629205959f80b2493464b359529","index":{"nums":[0,1,9,0,0,0,0,0],"html_filename":"d_542c2d228fe7f497_test_stochastic_py.html","relative_filename":"lasso/math/test_stochastic.py"}},"d_a84314dfc0388a73___init___py":{"hash":"c7ed0a21386f645f76a18bf569041297","index":{"nums":[0,1,2,0,0,0,0,0],"html_filename":"d_a84314dfc0388a73___init___py.html","relative_filename":"lasso/plotting/__init__.py"}},"d_a84314dfc0388a73_plot_shell_mesh_py":{"hash":"cbf893a6e45ba4ab49ad7de2052b839a","index":{"nums":[0,1,80,0,68,0,0,0],"html_filename":"d_a84314dfc0388a73_plot_shell_mesh_py.html","relative_filename":"lasso/plotting/plot_shell_mesh.py"}},"d_9912f5017dc9b562___init___py":{"hash":"8f96e0487d400bed7b4c91e861310773","index":{"nums":[0,1,0,0,0,0,0,0],"html_filename":"d_9912f5017dc9b562___init___py.html","relative_filename":"lasso/plotting/resources/__init__.py"}},"d_2a4fb047d150a06c___init___py":{"hash":"3c77fc9ef7f887ac2508d4109cf92472","index":{"nums":[0,1,0,0,0,0,0,0],"html_filename":"d_2a4fb047d150a06c___init___py.html","relative_filename":"lasso/utils/__init__.py"}},"d_2a4fb047d150a06c_console_coloring_py":{"hash":"026ceb230c4265fdaadacbb6ac11b25d","index":{"nums":[0,1,34,0,5,0,0,0],"html_filename":"d_2a4fb047d150a06c_console_coloring_py.html","relative_filename":"lasso/utils/console_coloring.py"}},"d_2a4fb047d150a06c_decorators_py":{"hash":"938a0e71ae94130e77bbd3212024c2ec","index":{"nums":[0,1,28,0,28,0,0,0],"html_filename":"d_2a4fb047d150a06c_decorators_py.html","relative_filename":"lasso/utils/decorators.py"}},"d_2a4fb047d150a06c_language_py":{"hash":"90e5e2a5b8c0b2e4ccf76ca8da86eaed","index":{"nums":[0,1,21,0,21,0,0,0],"html_filename":"d_2a4fb047d150a06c_language_py.html","relative_filename":"lasso/utils/language.py"}},"d_2a4fb047d150a06c_rich_progress_bars_py":{"hash":"ac03c005a3e7639baa6fedaa8a3e6858","index":{"nums":[0,1,78,0,45,0,0,0],"html_filename":"d_2a4fb047d150a06c_rich_progress_bars_py.html","relative_filename":"lasso/utils/rich_progress_bars.py"}}}} \ No newline at end of file diff --git a/coverage/style.css b/coverage/style.css new file mode 100644 index 0000000..11b24c4 --- /dev/null +++ b/coverage/style.css @@ -0,0 +1,309 @@ +@charset "UTF-8"; +/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ +/* Don't edit this .css file. Edit the .scss file instead! */ +html, body, h1, h2, h3, p, table, td, th { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } + +body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1em; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { body { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { body { color: #eee; } } + +html > body { font-size: 16px; } + +a:active, a:focus { outline: 2px dashed #007acc; } + +p { font-size: .875em; line-height: 1.4em; } + +table { border-collapse: collapse; } + +td { vertical-align: top; } + +table tr.hidden { display: none !important; } + +p#no_rows { display: none; font-size: 1.2em; } + +a.nav { text-decoration: none; color: inherit; } + +a.nav:hover { text-decoration: underline; color: inherit; } + +.hidden { display: none; } + +header { background: #f8f8f8; width: 100%; z-index: 2; border-bottom: 1px solid #ccc; } + +@media (prefers-color-scheme: dark) { header { background: black; } } + +@media (prefers-color-scheme: dark) { header { border-color: #333; } } + +header .content { padding: 1rem 3.5rem; } + +header h2 { margin-top: .5em; font-size: 1em; } + +header p.text { margin: .5em 0 -.5em; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { header p.text { color: #aaa; } } + +header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; } + +header.sticky .text { display: none; } + +header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; } + +header.sticky .content { padding: 0.5rem 3.5rem; } + +header.sticky .content p { font-size: 1em; } + +header.sticky ~ #source { padding-top: 6.5em; } + +main { position: relative; z-index: 1; } + +footer { margin: 1rem 3.5rem; } + +footer .content { padding: 0; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { footer .content { color: #aaa; } } + +#index { margin: 1rem 0 0 3.5rem; } + +h1 { font-size: 1.25em; display: inline-block; } + +#filter_container { float: right; margin: 0 2em 0 0; } + +#filter_container input { width: 10em; padding: 0.2em 0.5em; border: 2px solid #ccc; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { #filter_container input { border-color: #444; } } + +@media (prefers-color-scheme: dark) { #filter_container input { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #filter_container input { color: #eee; } } + +#filter_container input:focus { border-color: #007acc; } + +header button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; color: inherit; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header button { border-color: #444; } } + +header button:active, header button:focus { outline: 2px dashed #007acc; } + +header button.run { background: #eeffee; } + +@media (prefers-color-scheme: dark) { header button.run { background: #373d29; } } + +header button.run.show_run { background: #dfd; border: 2px solid #00dd00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.run.show_run { background: #373d29; } } + +header button.mis { background: #ffeeee; } + +@media (prefers-color-scheme: dark) { header button.mis { background: #4b1818; } } + +header button.mis.show_mis { background: #fdd; border: 2px solid #ff0000; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.mis.show_mis { background: #4b1818; } } + +header button.exc { background: #f7f7f7; } + +@media (prefers-color-scheme: dark) { header button.exc { background: #333; } } + +header button.exc.show_exc { background: #eee; border: 2px solid #808080; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.exc.show_exc { background: #333; } } + +header button.par { background: #ffffd5; } + +@media (prefers-color-scheme: dark) { header button.par { background: #650; } } + +header button.par.show_par { background: #ffa; border: 2px solid #bbbb00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.par.show_par { background: #650; } } + +#help_panel, #source p .annotate.long { display: none; position: absolute; z-index: 999; background: #ffffcc; border: 1px solid #888; border-radius: .2em; color: #333; padding: .25em .5em; } + +#source p .annotate.long { white-space: normal; float: right; top: 1.75em; right: 1em; height: auto; } + +#help_panel_wrapper { float: right; position: relative; } + +#keyboard_icon { margin: 5px; } + +#help_panel_state { display: none; } + +#help_panel { top: 25px; right: 0; padding: .75em; border: 1px solid #883; color: #333; } + +#help_panel .keyhelp p { margin-top: .75em; } + +#help_panel .legend { font-style: italic; margin-bottom: 1em; } + +.indexfile #help_panel { width: 25em; } + +.pyfile #help_panel { width: 18em; } + +#help_panel_state:checked ~ #help_panel { display: block; } + +kbd { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; border-radius: 3px; } + +#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } + +#source p { position: relative; white-space: pre; } + +#source p * { box-sizing: border-box; } + +#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n { color: #777; } } + +#source p .n.highlight { background: #ffdd00; } + +#source p .n a { margin-top: -4em; padding-top: 4em; text-decoration: none; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a { color: #777; } } + +#source p .n a:hover { text-decoration: underline; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a:hover { color: #777; } } + +#source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; } + +@media (prefers-color-scheme: dark) { #source p .t { border-color: #1e1e1e; } } + +#source p .t:hover { background: #f2f2f2; } + +@media (prefers-color-scheme: dark) { #source p .t:hover { background: #282828; } } + +#source p .t:hover ~ .r .annotate.long { display: block; } + +#source p .t .com { color: #008000; font-style: italic; line-height: 1px; } + +@media (prefers-color-scheme: dark) { #source p .t .com { color: #6a9955; } } + +#source p .t .key { font-weight: bold; line-height: 1px; } + +#source p .t .str { color: #0451a5; } + +@media (prefers-color-scheme: dark) { #source p .t .str { color: #9cdcfe; } } + +#source p.mis .t { border-left: 0.2em solid #ff0000; } + +#source p.mis.show_mis .t { background: #fdd; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t { background: #4b1818; } } + +#source p.mis.show_mis .t:hover { background: #f2d2d2; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t:hover { background: #532323; } } + +#source p.run .t { border-left: 0.2em solid #00dd00; } + +#source p.run.show_run .t { background: #dfd; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t { background: #373d29; } } + +#source p.run.show_run .t:hover { background: #d2f2d2; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t:hover { background: #404633; } } + +#source p.exc .t { border-left: 0.2em solid #808080; } + +#source p.exc.show_exc .t { background: #eee; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t { background: #333; } } + +#source p.exc.show_exc .t:hover { background: #e2e2e2; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t:hover { background: #3c3c3c; } } + +#source p.par .t { border-left: 0.2em solid #bbbb00; } + +#source p.par.show_par .t { background: #ffa; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t { background: #650; } } + +#source p.par.show_par .t:hover { background: #f2f2a2; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t:hover { background: #6d5d0c; } } + +#source p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +#source p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; } + +@media (prefers-color-scheme: dark) { #source p .annotate { color: #ddd; } } + +#source p .annotate.short:hover ~ .long { display: block; } + +#source p .annotate.long { width: 30em; right: 2.5em; } + +#source p input { display: none; } + +#source p input ~ .r label.ctx { cursor: pointer; border-radius: .25em; } + +#source p input ~ .r label.ctx::before { content: "โ–ถ "; } + +#source p input ~ .r label.ctx:hover { background: #e8f4ff; color: #666; } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #d0e8ff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } + +#source p input:checked ~ .r label.ctx::before { content: "โ–ผ "; } + +#source p input:checked ~ .ctxs { padding: .25em .5em; overflow-y: scroll; max-height: 10.5em; } + +#source p label.ctx { color: #999; display: inline-block; padding: 0 .5em; font-size: .8333em; } + +@media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } + +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #d0e8ff; border-radius: .25em; margin-right: 1.75em; text-align: right; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } + +#index { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.875em; } + +#index table.index { margin-left: -.5em; } + +#index td, #index th { text-align: right; width: 5em; padding: .25em .5em; border-bottom: 1px solid #eee; } + +@media (prefers-color-scheme: dark) { #index td, #index th { border-color: #333; } } + +#index td.name, #index th.name { text-align: left; width: auto; } + +#index th { font-style: italic; color: #333; cursor: pointer; } + +@media (prefers-color-scheme: dark) { #index th { color: #ddd; } } + +#index th:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index th:hover { background: #333; } } + +#index th[aria-sort="ascending"], #index th[aria-sort="descending"] { white-space: nowrap; background: #eee; padding-left: .5em; } + +@media (prefers-color-scheme: dark) { #index th[aria-sort="ascending"], #index th[aria-sort="descending"] { background: #333; } } + +#index th[aria-sort="ascending"]::after { font-family: sans-serif; content: " โ†‘"; } + +#index th[aria-sort="descending"]::after { font-family: sans-serif; content: " โ†“"; } + +#index td.name a { text-decoration: none; color: inherit; } + +#index tr.total td, #index tr.total_dynamic td { font-weight: bold; border-top: 1px solid #ccc; border-bottom: none; } + +#index tr.file:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index tr.file:hover { background: #333; } } + +#index tr.file:hover td.name { text-decoration: underline; color: inherit; } + +#scroll_marker { position: fixed; z-index: 3; right: 0; top: 0; width: 16px; height: 100%; background: #fff; border-left: 1px solid #eee; will-change: transform; } + +@media (prefers-color-scheme: dark) { #scroll_marker { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #scroll_marker { border-color: #333; } } + +#scroll_marker .marker { background: #ccc; position: absolute; min-height: 3px; width: 100%; } + +@media (prefers-color-scheme: dark) { #scroll_marker .marker { background: #444; } } diff --git a/docs/css/video.css b/css/video.css similarity index 100% rename from docs/css/video.css rename to css/video.css diff --git a/diffcrash/diffcrash/index.html b/diffcrash/diffcrash/index.html new file mode 100644 index 0000000..491b974 --- /dev/null +++ b/diffcrash/diffcrash/index.html @@ -0,0 +1,1023 @@ + + + + + + + + + + + + + + + + + + Overview - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    lasso.diffcrash

    +

    This is the diffcrash module, which consists of a command line utility +as well as a class for writing scripts. +Diffcrash is a software from Sidact which is designed for robustness +analysis of simulation runs. +It can be used as a set of independent executables or as a postprocessor plugin. +Diffcrash itself must be licensed. +Please therefore contact Sidact directly. +This module makes running a Diffcrash analysis much easier.

    +
      +
    • Command Line Utility
    • +
    • Code
    • +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/diffcrash/diffcrash_run/index.html b/diffcrash/diffcrash_run/index.html new file mode 100644 index 0000000..6310058 --- /dev/null +++ b/diffcrash/diffcrash_run/index.html @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + Code - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    DiffcrashRun

    +

    This class can be used in order to automate diffcrash runs in a hopefully +comfortable manner.

    + + +
    + + + +
    + + +

    Class for handling the settings of a diffcrash run

    + + + + + +
    + + + + + + + + + +
    + + + +

    +__init__(project_dir, crash_code, reference_run, simulation_runs, exclude_runs, diffcrash_home='', use_id_mapping=False, config_file=None, parameter_file=None, n_processes=1, logfile_dir=None) + +

    + + +
    + +

    Object handling a diffcrash run

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    project_dir + str +

    directory to put all buffer files etc., in

    + required +
    crash_code + str +

    crash code to use.

    + required +
    reference_run + str +

    filepath to the reference run

    + required +
    simulation_runs + typing.Sequence[str] +

    patterns used to search for simulation runs

    + required +
    diffcrash_home + str +

    home directory of diffcrash installation. Uses environment +variable DIFFCRASHHOME if not set.

    + '' +
    use_id_mapping + bool +

    whether to use id mapping instead of nearest neighbor mapping

    + False +
    config_file + str +

    filepath to a config file

    + None +
    parameter_file + str +

    filepath to the parameter file

    + None +
    n_processes + int +

    number of processes to spawn for worker pool

    + 1 +
    logfile_dir + str +

    directory to put logfiles in

    + None +
    + +
    + +
    + +
    + + + +

    +check_if_logfiles_show_success(pattern) + +

    + + +
    + +

    Check if a logfiles with given pattern show success

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pattern + str +

    file pattern used to search for logfiles

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    messages + List[str] +

    list with messages of failed log checks

    + +
    + +
    + +
    + + + +

    +clear_project_dir() + +

    + + +
    + +

    Clears the entire project dir

    + +
    + +
    + +
    + + + +

    +create_project_dirs() + +

    + + +
    + +

    Creates all project relevant directores

    +

    Notes

    +
    Created dirs:
    + - logfile_dir
    + - project_dir
    +
    + +
    + +
    + +
    + + + +

    +is_logfile_successful(logfile) + +

    + + +
    + +

    Checks if a logfile indicates a success

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    logfile + str +

    filepath to the logfile

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    success + bool +
    + +
    + +
    + +
    + + + +

    +read_config_file(config_file) + +

    + + +
    + +

    Read a diffcrash config file

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    config_file + str +

    path to the config file

    + required +
    +

    Notes

    +
    From the official diffcrash docs ... seriously.
    +
    + +
    + +
    + +
    + + + +

    +run_eigen(pool) + +

    + + +
    + +

    Run diffcrash eigen

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pool + futures.ThreadPoolExecutor +

    multiprocessing pool

    + required +
    + +
    + +
    + +
    + + + +

    +run_export(pool) + +

    + + +
    + +

    Run diffcrash export

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pool + futures.ThreadPoolExecutor +

    multiprocessing pool

    + required +
    + +
    + +
    + +
    + + + +

    +run_import(pool) + +

    + + +
    + +

    Run diffcrash import of runs

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pool + futures.ThreadPoolExecutor +

    multiprocessing pool

    + required +
    + +
    + +
    + +
    + + + +

    +run_math(pool) + +

    + + +
    + +

    Run diffcrash math

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pool + futures.ThreadPoolExecutor +

    multiprocessing pool

    + required +
    + +
    + +
    + +
    + + + +

    +run_matrix(pool) + +

    + + +
    + +

    Run diffcrash matrix

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pool + futures.ThreadPoolExecutor +

    multiprocessing pool

    + required +
    + +
    + +
    + +
    + + + +

    +run_merge(pool) + +

    + + +
    + +

    Run diffcrash merge

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pool + futures.ThreadPoolExecutor +

    multiprocessing pool

    + required +
    + +
    + +
    + +
    + + + +

    +run_setup(pool) + +

    + + +
    + +

    Run diffcrash setup

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    pool + futures.ThreadPoolExecutor +

    multiprocessing pool

    + required +
    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/diffcrash/run/index.html b/diffcrash/run/index.html new file mode 100644 index 0000000..5dea634 --- /dev/null +++ b/diffcrash/run/index.html @@ -0,0 +1,1191 @@ + + + + + + + + + + + + + + + + + + Command Line Tool - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Command Line Tool

    +

    What is Diffcrash?

    +

    Diffcrash is a software from Sidact which is designed for robustness +analysis of simulation runs. +It can be used as a set of independent executables or as a postprocessor plugin. +Diffcrash itself must be licensed. +Please therefore contact Sidact directly. +This commmand line utility makes running a Diffcrash analysis much +easier.

    +

    How to use the utility?

    +

    You can get the run info by performing:

    +
    $ python -m lasso.diffcrash.run --help
    +
    +==== D I F F C R A S H ====
    +
    +an open lasso utility script
    +
    +usage: run.py [-h] --reference-run REFERENCE_RUN
    +            [--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]] --crash-code
    +            CRASH_CODE [--start-stage [START_STAGE]]
    +            [--end-stage [END_STAGE]] [--diffcrash-home [DIFFCRASH_HOME]]
    +            [--use-id-mapping [USE_ID_MAPPING]]
    +            [--project-dir [PROJECT_DIR]] [--config-file [CONFIG_FILE]]
    +            [--parameter-file [PARAMETER_FILE]]
    +            [--n-processes [N_PROCESSES]]
    +            [simulation_runs [simulation_runs ...]]
    +
    +Python utility script for Diffcrash.
    +
    +positional arguments:
    +simulation_runs       Simulation runs or patterns used to search for
    +                        simulation runs.
    +
    +optional arguments:
    +-h, --help            show this help message and exit
    +--reference-run REFERENCE_RUN
    +                        filepath of the reference run.
    +--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]
    +                        Runs to exclude from the analysis.
    +--crash-code CRASH_CODE
    +                        Which crash code is used ('dyna', 'pam' or 'radioss').
    +--start-stage [START_STAGE]
    +                        At which specific stage to start the analysis (SETUP,
    +                        IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE).
    +--end-stage [END_STAGE]
    +                        At which specific stage to stop the analysis (SETUP,
    +                        IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE).
    +--diffcrash-home [DIFFCRASH_HOME]
    +                        Home directory where Diffcrash is installed. Uses
    +                        environment variable 'DIFFCRASHHOME' if unspecified.
    +--use-id-mapping [USE_ID_MAPPING]
    +                        Whether to use id-based mapping (default is nearest
    +                        neighbour).
    +--project-dir [PROJECT_DIR]
    +                        Project dir to use for femzip.
    +--config-file [CONFIG_FILE]
    +                        Path to the config file.
    +--parameter-file [PARAMETER_FILE]
    +                        Path to the parameter file.
    +--n-processes [N_PROCESSES]
    +                        Number of processes to use (default: max-1).
    +
    +

    It is important to specify a --reference-run for the +analysis. If the reference run is contained within the rest of the +simulation_runs, it is automatically removed from that +list. simulation_runs can be either tagged individually +or by using placeholders for entire directories (e.g. '*.fz') and +subdirectories (e.g. '/**/*.fz').

    +
    +

    Warning

    +

    Every run clears the project directory entirely!

    +
    +

    Example

    +
    $ python -m lasso.diffcrash.run \
    +$    --reference-run ./runs/run_1.fz \ 
    +$    --crash-code dyna \
    +$    --project-dir diffcrash_project \  
    +$    ./runs/*.fz
    +
    +
    +==== D I F F C R A S H ==== 
    +
    +an open lasso utility script
    +
    +[/] diffcrash-home  : /sw/Linux/diffcrash/V6.1.24
    +[/] project-dir     : test-example-project
    +[/] crash-code      : dyna
    +[/] reference-run   : bus/run_1.fz
    +[/] use-id-mapping  : False
    +[/] # simul.-files  : 37
    +[/] # excluded files: 0
    +[/] config-file     : None
    +[!] Config file missing. Consider specifying the path with the option '--config-file'.
    +[/] parameter-file  : None
    +[!] Parameter file missing. Consider specifying the path with the option '--parameter-file'.
    +[/] n-processes     : 4
    +
    +---- Running Routines ----   
    +
    +[โœ”] Running Setup ... done in 3.88s
    +[โœ”] Running Imports ... done in 58.20s   
    +[โœ”] Running Math ... done in 56.22s   
    +[โœ”] Running Export ... done in 2.22s   
    +[โœ”] Running Matrix ... done in 9.78s   
    +[โœ”] Running Eigen ... done in 0.46s   
    +[โœ”] Running Merge ... done in 23.29s
    +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dimred/DimredRun/index.html b/dimred/DimredRun/index.html new file mode 100644 index 0000000..183a0f1 --- /dev/null +++ b/dimred/DimredRun/index.html @@ -0,0 +1,1515 @@ + + + + + + + + + + + + + + + + + + DimredRun - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    DimredRun

    +

    This class can be used in order to comfortably represent multiple D3plot samples +in a 3D graph through dimensionality reduction. +In the 3D graph every simulation is a data point and the closeness of the data +points represents the similarity of the result field. +It offers functions to:

    +
      +
    • Subsample simulations to reduce the computational effort and account for + different meshing.
    • +
    • Reduce order which is the black magic reducing complex field results to + a few numbers which can then be plotted in 3D.
    • +
    • Clustering with sklearn to group simulations semi-automatically + (mostly just a visual feature).
    • +
    • Output 3D similarity plot as a webpage
    • +
    +

    For ease of use, check out the Tool section, which explains the command line +tool for this dimensionality reduction feature.

    + + +
    + + + +
    + + +

    Class to control and run the dimensionality reduction process

    + + + + + +
    + + + + + + + + + +
    + + + +

    +__init__(simulation_runs, start_stage, end_stage, project_dir, html_name='3d-beta-plot', html_set_timestamp=False, reference_run=None, console=None, img_path=None, exclude_runs=None, logfile_filepath=None, n_processes=1, part_id_filter=None, timestep=-1, show_output=True, cluster_args=None, outlier_args=None) + +

    + + +
    + +

    Class handling a dimensionality reduction

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    simulation_runs + Sequence[str] +

    simulation runs to analyze

    + required +
    start_stage + str +

    where to start

    + required +
    end_stage + str +

    where to stop

    + required +
    project_dir + Union[None, str] +

    required project directory for creation of buffer files. Allows restart in between.

    + required +
    html_name + str +

    Name of the output .html file

    + '3d-beta-plot' +
    html_set_timestamp + bool +

    If true, the output .html will include a timestamp (hh_mm_ss) at the end of the filename

    + False +
    reference_run + str +

    filepath to the reference run. +If not set, first entry in simulation_runs will be used as reference run.

    + None +
    console + Union[Console, None] +

    Console for information printing and logging. +Rich offers pretty text printing, syntax highlighting etc.

    + None +
    img_path + Union[None, str] +

    optional image directory to show images in visualization.

    + None +
    exclude_runs + Union[None, Sequence[str]] +

    optional list of runs to exclude from processing

    + None +
    logfile_filepath + Union[str, None] +

    path of the log file (always appends)

    + None +
    n_processes + int +

    number of processes to use during execution

    + 1 +
    part_id_filter + Union[None, Sequence[int]] +

    which part ids to process

    + None +
    timestep + int +

    specifies timestep to analyze in clustering and show in output visualization

    + -1 +
    show_output + bool +

    Set to false not to show the output html in the browser

    + True +
    cluster_args + Union[None, Sequence[str]] +

    Arguments for cluster algorithm

    + None +
    outlier_args + Union[None, Sequence[str]] +

    Arguments for outlier detection algorithm

    + None +
    +

    Notes

    +
    Using a project directory allows to restart stages of the entire
    +process.
    +
    + +
    + +
    + +
    + + + +

    +process_reference_run() + +

    + + +
    + +

    Process the reference run

    + +
    + +
    + +
    + + + +

    +subsample_to_reference_run() + +

    + + +
    + +

    Subsamples all runs

    + +
    + +
    + +
    + + + +

    +dimension_reduction_svd() + +

    + + +
    + +

    Calculate V_ROB and Betas

    + +
    + +
    + +
    + + + +

    +clustering_results() + +

    + + +
    + +

    clustering results

    + +
    + +
    + +
    + + + +

    +visualize_results() + +

    + + +
    + +

    creates an output .html file

    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dimred/KeywordTypes/index.html b/dimred/KeywordTypes/index.html new file mode 100644 index 0000000..bf577df --- /dev/null +++ b/dimred/KeywordTypes/index.html @@ -0,0 +1,1365 @@ + + + + + + + + + + + + + + + + + + KeywordTypes - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Keyword Types

    +

    Keywords for using the clustering_betas{.interpreted-text role="doc"} +functions.

    + + +
    + + + +
    + + + +
    + + + + + + + + +
    + + + +

    + ClusterType + + +

    + + +
    + + +

    Specifies names of specific clustering algorithms

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    OPTICS + str +

    OPTICS

    DBSCAN + str +

    DBSCAN

    KMeans + str +

    KMeans

    SpectralClustering + str +

    SpectralClustering

    + + + + + +
    + + + + + + + + + +
    + + + +

    +get_cluster_type_name() + + + staticmethod + + +

    + + +
    + +

    Get the name of the clustering algorithms

    + +
    + +
    + + + +
    + +
    + +
    + +
    + + + +

    + DetectorType + + +

    + + +
    + + +

    Specifies names of different outlier detector algorythms

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    IsolationForest + str +

    IsolationForest

    OneClassSVM + str +

    OneClassSVM

    LocalOutlierFactor + str +

    LocalOutlierFactor

    + + + + + +
    + + + + + + + + + +
    + + + +

    +get_detector_type_name() + + + staticmethod + + +

    + + +
    + +

    Get the name of the detector algorithms

    + +
    + +
    + + + +
    + +
    + +
    + + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dimred/clustering_betas/index.html b/dimred/clustering_betas/index.html new file mode 100644 index 0000000..7a4003e --- /dev/null +++ b/dimred/clustering_betas/index.html @@ -0,0 +1,1447 @@ + + + + + + + + + + + + + + + + + + clustering_betas - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Clustering Betas

    +

    Methods that apply different clustering and outlier detection algorithms. +Offers additional functions to convert console command arguments into variables +to use in the function.

    +
    +

    Warning

    +

    This function is optimized to be used by the console commandline tool

    +
    + + +
    + + + +
    + + + +
    + + + + + + + + + +
    + + + +

    +group_betas(beta_index, betas, scale_betas=False, cluster=None, detector=None, cluster_params=None, detector_params=None) + +

    + + +
    + +

    Base function to to group betas into groups, detect outliers. Provides that all different +clustering and outlier detection algorythms are implemented in an easy to access environment. +To select different clustering and outlier detection algoyrthms, please use appropriate +KeywordTypes. A description of each function can be accessed with document_algorythm(keyword) +A list of all functions can be accessed with list_detectors_and_clusters()

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    beta_index +

    Array containing the file names specific to the betas with the same index in the beta array

    + required +
    betas +

    Numpy array containing the betas. +Betas are expected to be of shape (samples, timestep, 3) +The three entries per beta can either be dimesnions (x,y,z) or any three betas/eigenvalues

    + required +
    cluster +

    String specifying which clustering algorythm shall be applied. +Use ClusterTypefor easier access

    + None +
    detector +

    String specifying which outlier detection algorythm shall be applied. +Use DetectorType for easier access

    + None +
    cluster_params +

    Dictionary containing parameters for the clustering algorythms. +See the sklearn documentation for the function to learn more.

    + None +
    detector_params +

    Dictionary containing parameters for the outlier detection algorythms. +See the sklearn documentation for the function to learn more

    + None +
    + +

    Returns:

    + + + + + + + + + + + + + + + + + + + + + +
    Name TypeDescription
    beta_clusters + list +

    List containing Numpy Arrays of betas in one cluster. +If a detector was selected, or the clustering algorythm has its +own outlier detection, the first entry in the list will be oultier betas

    id_clusters + list +

    List containing lists of beta ids. Each id corresponds to the beta in +the same place in the beta_clusters list

    err_msg + str +

    Error message if wrong keywords for detector or cluster algorithms were used

    +

    Notes

    +

    document_algorithm: + Prints docstring of each function into console +list_detectors_and_clusters: + Prints out all detection and clustering algorythms into console +Sklearn Userguide chapter 2.3 Clustering: + https://scikit-learn.org/stable/modules/clustering.html + Detailed overview of different clustering algorythms +Sklearn Examples outlier detection: + https://scikit-learn.org/stable/auto_examples/plot_anomaly_comparison.html + Example of different used outlier detection algorythms

    + +
    + +
    + +
    + + + +

    +create_cluster_arg_dict(args) + +

    + + +
    + +

    Determines which cluster to use and creates a python dictionary to use as cluster_params

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    args + Sequence[str] +

    List of strings containing parameters and arguments

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + + + + + + + + + +
    Name TypeDescription
    cluster_type + str +

    determines which cluster algorithm to use

    cluster_arg_dict + dict +

    dictionary containing arguments and values for specific cluster_type

    err_msg + str +

    message containing error, mostly unrecognised keywords

    + +
    + +
    + +
    + + + +

    +create_detector_arg_dict(args) + +

    + + +
    + +

    Determines which detector to use and creates a python dictionary to use as detector_params

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    args + Sequence[str] +

    List of strings containing parameters and arguments

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + + + + + + + + + +
    Name TypeDescription
    detector_type + str +

    determines which cluster algorithm to use

    detector_arg_dict + dict +

    dictionary containing arguments and values for specific cluster_type

    err_mgs + str +

    message containing error, mostly unrecognised keywords

    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/docs/dimred/command_line_interface.md b/dimred/command_line_interface/index.html similarity index 53% rename from docs/dimred/command_line_interface.md rename to dimred/command_line_interface/index.html index afebea8..bd97eb6 100644 --- a/docs/dimred/command_line_interface.md +++ b/dimred/command_line_interface/index.html @@ -1,8 +1,1116 @@ -# Command-Line Tool -## What does this command-line tool do? - -This command-line tool creates compact overviews over tens, hundreds + + + + + + + + + + + + + + + + + Command Line Tool - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + + + + + +
    +
    + + + + + + + + + +

    Command-Line Tool

    +

    What does this command-line tool do?

    +

    This command-line tool creates compact overviews over tens, hundreds or even thousands of simulation runs. This is done by performing an unsupervised learning method on the displacement field of the simulations. @@ -10,28 +1118,31 @@ plot is a simulation result. If two points are very close their simulation results are also expected to be very similar. One can confirm by using images from every simulation (there is an option to -specify the path to a folder with those images). - -## Example Visualization Report - -This is a plot for dimensionality reduction of a rail getting crushed. -This plot has many detail levels. - -Check out the following facts: - -- There are two groups. - - The small group stands for samples buckling bottom . - - The big group represents buckling in the top area. -- There are two outliers - - Sample 143 is folding in the top and bottom. - - Sample 99 is folding in the middle. -- Similarity Axis - - The similarity axis X describes buckling top or bottom - - The similarity axis Y describes how much a sample gets compressed - - The samples are basically in a plane. - The out of plane axis represents buckling not strictly top but also - slightly in the lower end (zoom in). - +specify the path to a folder with those images).

    +

    Example Visualization Report

    +

    This is a plot for dimensionality reduction of a rail getting crushed. +This plot has many detail levels.

    +

    Check out the following facts:

    +
      +
    • There are two groups.
        +
      • The small group stands for samples buckling bottom .
      • +
      • The big group represents buckling in the top area.
      • +
      +
    • +
    • There are two outliers
        +
      • Sample 143 is folding in the top and bottom.
      • +
      • Sample 99 is folding in the middle.
      • +
      +
    • +
    • Similarity Axis
        +
      • The similarity axis X describes buckling top or bottom
      • +
      • The similarity axis Y describes how much a sample gets compressed
      • +
      • The samples are basically in a plane. + The out of plane axis represents buckling not strictly top but also + slightly in the lower end (zoom in).
      • +
      +
    • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    lasso.dimred

    +

    The dimred module consists of a command line utility as well as several +classes to reduce the dimensionality of D3plots and visualize the +results.

    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dimred/plot_beta_clusters/index.html b/dimred/plot_beta_clusters/index.html new file mode 100644 index 0000000..0320f8f --- /dev/null +++ b/dimred/plot_beta_clusters/index.html @@ -0,0 +1,1246 @@ + + + + + + + + + + + + + + + + + + plot_beta_clusters - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Plot beta clusters

    +

    Functions converting input list of clusters and corresponding ids into a +.html page visualizing the results as a 3D Plot

    + + +
    + + + +
    + + + +
    + + + + + + + + + +
    + + + +

    +plot_clusters_js(beta_cluster, id_cluster, save_path, img_path=None, mark_outliers=False, mark_timestamp=True, filename='3d_beta_plot', write=True, show_res=True) + +

    + + +
    + +

    Creates a .html visualization of input data

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    beta_cluster + Sequence +

    Numpy array containing beta clusters

    + required +
    id_cluster + Union[np.ndarray, Sequence] +

    Numpy array or sequence containing the ids samples in clusters. +Must be of same structure as beta_clusters

    + required +
    save_path + str +

    Where to save the .html visualization

    + required +
    img_path + Union[None, str] +

    Path to images of samples

    + None +
    mark_outliers + bool +

    Set to True if first entry in beta_cluster are outliers

    + False +
    mark_timestamp + bool +

    Set to True if name of visualization shall contain time of creation. +If set to False, visualization will override previous file

    + True +
    filename + str +

    Name of .hmtl file

    + '3d_beta_plot' +
    write + bool +

    Set to False to not write .html file and return as string instead

    + True +
    show_res + bool +

    Set to False to not open resulting page in webbrowser

    + True +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    html_str_formatted + str +

    If write=False returns .hmtl file as string, else None

    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dimred/pod_functions/index.html b/dimred/pod_functions/index.html new file mode 100644 index 0000000..f2c326d --- /dev/null +++ b/dimred/pod_functions/index.html @@ -0,0 +1,1260 @@ + + + + + + + + + + + + + + + + + + pod_functions - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    POD Functions

    +

    These functions are used for the proper orthogonal decomposition of +samples

    + + +
    + + + +
    + + + +
    + + + + + + + + + +
    + + + +

    +calculate_v_and_betas(stacked_sub_displ, progress_bar=None, task_id=None) + +

    + + +
    + +

    Calculates the right reduced order Basis V and up to 10 eigenvalues of the subsamples

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    stacked_sub_displ + np.ndarray +

    np.ndarray containing all subsampled displacements +shape must be (samples, timesteps, nodes, dims)

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + + + + + + + + + +
    Name TypeDescription
    v_big + np.ndarray +

    Reduced order basis to transform betas bag into subsamples

    betas + np.ndarray +

    Projected simulation runs

    err_msg + str +

    Error message if not enough samples where provided

    + +
    + +
    + +
    + + + +

    +svd_step_and_dim(s_mat, k=10) + +

    + + +
    + +

    Performs a svds operation on the two dimensional s_mat

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    s_mat + np.ndarray +

    2D array on which the svds operation shall be performed

    + required +
    k +

    The size of the POD

    + 10 +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    v + ndarray +

    Array containing the right reduced order basis

    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dimred/subsampling_methods/index.html b/dimred/subsampling_methods/index.html new file mode 100644 index 0000000..486088f --- /dev/null +++ b/dimred/subsampling_methods/index.html @@ -0,0 +1,1313 @@ + + + + + + + + + + + + + + + + + + subsampling_methods - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Subsampling Methods

    +

    Methods used to perform subsampling of simulation runs.

    + + +
    + + + +
    + + + +
    + + + + + + + + + +
    + + + +

    +create_reference_subsample(load_path, parts, nr_samples=2000) + +

    + + +
    + +

    Loads the D3plot at load_path, extracts the node coordinates of part 13, returns +a random subsample of these nodes

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    load_path + str +

    Filepath of the D3plot

    + required +
    parts + Sequence[int] +

    List of parts to be extracted

    + required +
    nr_samples +

    How many nodes are subsampled

    + 2000 +
    + +

    Returns:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Name TypeDescription
    reference_sample + np.array +

    Numpy array containing the reference sample

    t_total + float +

    Total time required for subsampling

    t_load + float +

    Time required to load plot

    err_msg + str +

    If an error occurs, a string containing the error is returned instead

    + +
    + +
    + +
    + + + +

    +remap_random_subsample(load_path, parts, reference_subsample) + +

    + + +
    + +

    Remaps the specified sample onto a new mesh provided by reference subsampl, using knn matching

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    load_path + str +

    Filepath of the desired D3plot

    + required +
    parts + list +

    Which parts shall be extracted from the D3plot

    + required +
    reference_subsample + np.ndarray +

    Numpy array containing the reference nodes

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Name TypeDescription
    subsampled_displacement + np.ndarray +

    Subsampled displacement of provided sample

    t_total + float +

    Total time required to perform subsampling

    t_load + float +

    Time required to load D3plot

    err_msg + str +

    If an error occured, a string is returned instead containing the error

    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dimred/svd/index.html b/dimred/svd/index.html new file mode 100644 index 0000000..3a0be67 --- /dev/null +++ b/dimred/svd/index.html @@ -0,0 +1,1023 @@ + + + + + + + + + + + + + + + + + + Description - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Module lasso.dimred.svd

    +

    Module containing the methods and functions used by DimredRun

    +
      +
    • subsampling_methods
    • +
    • pod_functions
    • +
    • clustering_betas
    • +
    • plot_beta_clusters
    • +
    • KeywordTypes
    • +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index 52d30d2..0000000 --- a/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ ---8<-- "./CHANGELOG.md" diff --git a/docs/contributing.md b/docs/contributing.md deleted file mode 100644 index 3d8e4d5..0000000 --- a/docs/contributing.md +++ /dev/null @@ -1 +0,0 @@ ---8<-- "./CONTRIBUTING.md" diff --git a/docs/diffcrash/diffcrash_run.md b/docs/diffcrash/diffcrash_run.md deleted file mode 100644 index 67859ea..0000000 --- a/docs/diffcrash/diffcrash_run.md +++ /dev/null @@ -1,6 +0,0 @@ -# DiffcrashRun - -This class can be used in order to automate diffcrash runs in a hopefully -comfortable manner. - -::: lasso.diffcrash.DiffcrashRun diff --git a/docs/diffcrash/index.md b/docs/diffcrash/index.md deleted file mode 100644 index 6f1e12b..0000000 --- a/docs/diffcrash/index.md +++ /dev/null @@ -1,16 +0,0 @@ -# lasso.diffcrash - -This is the diffcrash module, which consists of a command line utility -as well as a class for writing scripts. -[Diffcrash] is a software from [Sidact] which is designed for robustness -analysis of simulation runs. -It can be used as a set of independent executables or as a postprocessor plugin. -[Diffcrash] itself must be licensed. -Please therefore contact [Sidact] directly. -This module makes running a Diffcrash analysis much easier. - -- Command Line Utility -- Code - -[diffcrash]: https://www.sidact.de/diffcrash -[sidact]: https://www.sidact.de/ diff --git a/docs/diffcrash/run.md b/docs/diffcrash/run.md deleted file mode 100644 index da767d2..0000000 --- a/docs/diffcrash/run.md +++ /dev/null @@ -1,119 +0,0 @@ -# Command Line Tool - -## What is Diffcrash? - -[Diffcrash] is a software from [Sidact] which is designed for robustness -analysis of simulation runs. -It can be used as a set of independent executables or as a postprocessor plugin. -[Diffcrash] itself must be licensed. -Please therefore contact [Sidact] directly. -This command line utility makes running a Diffcrash analysis much -easier. - -[diffcrash]: https://www.sidact.de/diffcrash -[sidact]: https://www.sidact.de/ - -## How to use the utility? - -You can get the run info by performing: - -```console -$ diffcrash --help - -==== D I F F C R A S H ==== - -an open lasso utility script - -usage: run.py [-h] --reference-run REFERENCE_RUN - [--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]] --crash-code - CRASH_CODE [--start-stage [START_STAGE]] - [--end-stage [END_STAGE]] [--diffcrash-home [DIFFCRASH_HOME]] - [--use-id-mapping [USE_ID_MAPPING]] - [--project-dir [PROJECT_DIR]] [--config-file [CONFIG_FILE]] - [--parameter-file [PARAMETER_FILE]] - [--n-processes [N_PROCESSES]] - [simulation_runs [simulation_runs ...]] - -Python utility script for Diffcrash. - -positional arguments: -simulation_runs Simulation runs or patterns used to search for - simulation runs. - -optional arguments: --h, --help show this help message and exit ---reference-run REFERENCE_RUN - filepath of the reference run. ---exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]] - Runs to exclude from the analysis. ---crash-code CRASH_CODE - Which crash code is used ('dyna', 'pam' or 'radioss'). ---start-stage [START_STAGE] - At which specific stage to start the analysis (SETUP, - IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE). ---end-stage [END_STAGE] - At which specific stage to stop the analysis (SETUP, - IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE). ---diffcrash-home [DIFFCRASH_HOME] - Home directory where Diffcrash is installed. Uses - environment variable 'DIFFCRASHHOME' if unspecified. ---use-id-mapping [USE_ID_MAPPING] - Whether to use id-based mapping (default is nearest - neighbour). ---project-dir [PROJECT_DIR] - Project dir to use for femzip. ---config-file [CONFIG_FILE] - Path to the config file. ---parameter-file [PARAMETER_FILE] - Path to the parameter file. ---n-processes [N_PROCESSES] - Number of processes to use (default: max-1). -``` - -It is important to specify a `--reference-run` for the -analysis. If the reference run is contained within the rest of the -`simulation_runs`, it is automatically removed from that -list. `simulation_runs` can be either tagged individually -or by using placeholders for entire directories (e.g. '\*.fz') and -subdirectories (e.g. '/\*\*/\*.fz'). - -!!! warning - Every run clears the project directory entirely! - -## Example - -```console -$ python -m lasso.diffcrash.run \ -$ --reference-run ./runs/run_1.fz \ -$ --crash-code dyna \ -$ --project-dir diffcrash_project \ -$ ./runs/*.fz - - -==== D I F F C R A S H ==== - -an open lasso utility script - -[/] diffcrash-home : /sw/Linux/diffcrash/V6.1.24 -[/] project-dir : test-example-project -[/] crash-code : dyna -[/] reference-run : bus/run_1.fz -[/] use-id-mapping : False -[/] # simul.-files : 37 -[/] # excluded files: 0 -[/] config-file : None -[!] Config file missing. Consider specifying the path with the option '--config-file'. -[/] parameter-file : None -[!] Parameter file missing. Consider specifying the path with the option '--parameter-file'. -[/] n-processes : 4 - ----- Running Routines ---- - -[โœ”] Running Setup ... done in 3.88s -[โœ”] Running Imports ... done in 58.20s -[โœ”] Running Math ... done in 56.22s -[โœ”] Running Export ... done in 2.22s -[โœ”] Running Matrix ... done in 9.78s -[โœ”] Running Eigen ... done in 0.46s -[โœ”] Running Merge ... done in 23.29s -``` diff --git a/docs/dimred/DimredRun.md b/docs/dimred/DimredRun.md deleted file mode 100644 index a18d562..0000000 --- a/docs/dimred/DimredRun.md +++ /dev/null @@ -1,28 +0,0 @@ -# DimredRun - -This class can be used in order to comfortably represent multiple D3plot samples -in a 3D graph through dimensionality reduction. -In the 3D graph every simulation is a data point and the closeness of the data -points represents the similarity of the result field. -It offers functions to: - -- Subsample simulations to reduce the computational effort and account for - different meshing. -- Reduce order which is the black magic reducing complex field results to - a few numbers which can then be plotted in 3D. -- Clustering with sklearn to group simulations semi-automatically - (mostly just a visual feature). -- Output 3D similarity plot as a webpage - -For ease of use, check out the `Tool` section, which explains the command line -tool for this dimensionality reduction feature. - -::: lasso.dimred.dimred_run.DimredRun - options: - members: - - __init__ - - process_reference_run - - subsample_to_reference_run - - dimension_reduction_svd - - clustering_results - - visualize_results diff --git a/docs/dimred/KeywordTypes.md b/docs/dimred/KeywordTypes.md deleted file mode 100644 index 690b43f..0000000 --- a/docs/dimred/KeywordTypes.md +++ /dev/null @@ -1,6 +0,0 @@ -# Keyword Types - -Keywords for using the `clustering_betas`{.interpreted-text role="doc"} -functions. - -::: lasso.dimred.svd.keyword_types diff --git a/docs/dimred/clustering_betas.md b/docs/dimred/clustering_betas.md deleted file mode 100644 index 222ccdf..0000000 --- a/docs/dimred/clustering_betas.md +++ /dev/null @@ -1,15 +0,0 @@ -# Clustering Betas - -Methods that apply different clustering and outlier detection algorithms. -Offers additional functions to convert console command arguments into variables -to use in the function. - -!!! warning - This function is optimized to be used by the console commandline tool - -::: lasso.dimred.svd.clustering_betas - options: - members: - - group_betas - - create_cluster_arg_dict - - create_detector_arg_dict diff --git a/docs/dimred/index.md b/docs/dimred/index.md deleted file mode 100644 index 7fc8747..0000000 --- a/docs/dimred/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# lasso.dimred - -The dimred module consists of a command line utility as well as several -classes to reduce the dimensionality of D3plots and visualize the -results. diff --git a/docs/dimred/plot_beta_clusters.md b/docs/dimred/plot_beta_clusters.md deleted file mode 100644 index 6305cff..0000000 --- a/docs/dimred/plot_beta_clusters.md +++ /dev/null @@ -1,10 +0,0 @@ -# Plot beta clusters - -Functions converting input list of clusters and corresponding ids into a -.html page visualizing the results as a 3D Plot - -::: lasso.dimred.svd.plot_beta_clusters - options: - members: - - __init__ - - plot_clusters_js diff --git a/docs/dimred/pod_functions.md b/docs/dimred/pod_functions.md deleted file mode 100644 index a5e8231..0000000 --- a/docs/dimred/pod_functions.md +++ /dev/null @@ -1,6 +0,0 @@ -# POD Functions - -These functions are used for the proper orthogonal decomposition of -samples - -::: lasso.dimred.svd.pod_functions diff --git a/docs/dimred/subsampling_methods.md b/docs/dimred/subsampling_methods.md deleted file mode 100644 index eda1497..0000000 --- a/docs/dimred/subsampling_methods.md +++ /dev/null @@ -1,5 +0,0 @@ -# Subsampling Methods - -Methods used to perform subsampling of simulation runs. - -::: lasso.dimred.svd.subsampling_methods diff --git a/docs/dimred/svd.md b/docs/dimred/svd.md deleted file mode 100644 index f0b0d8a..0000000 --- a/docs/dimred/svd.md +++ /dev/null @@ -1,9 +0,0 @@ -# Module `lasso.dimred.svd` - -Module containing the methods and functions used by DimredRun - -- subsampling_methods -- pod_functions -- clustering_betas -- plot_beta_clusters -- KeywordTypes diff --git a/docs/dyna/ArrayType.md b/docs/dyna/ArrayType.md deleted file mode 100644 index 4f5d3c6..0000000 --- a/docs/dyna/ArrayType.md +++ /dev/null @@ -1,3 +0,0 @@ -# ArrayType - -::: lasso.dyna.array_type.ArrayType diff --git a/docs/dyna/Binout.md b/docs/dyna/Binout.md deleted file mode 100644 index 39c047f..0000000 --- a/docs/dyna/Binout.md +++ /dev/null @@ -1,9 +0,0 @@ -# Binout - -There is a youtube tutorial available for this class: - -
    - -
    - -::: lasso.dyna.binout.Binout diff --git a/docs/dyna/D3plot.md b/docs/dyna/D3plot.md deleted file mode 100644 index 4e9d35c..0000000 --- a/docs/dyna/D3plot.md +++ /dev/null @@ -1,9 +0,0 @@ -# D3plot - -There is a youtube tutorial available for this class: - -
    - -
    - -::: lasso.dyna.d3plot.D3plot diff --git a/docs/dyna/D3plotHeader.md b/docs/dyna/D3plotHeader.md deleted file mode 100644 index bb6e910..0000000 --- a/docs/dyna/D3plotHeader.md +++ /dev/null @@ -1,8 +0,0 @@ -# D3plotHeader - -::: lasso.dyna.d3plot_header.D3plotHeader - options: - members: - - __init__ - - load_file - - compare diff --git a/docs/dyna/FilterType.md b/docs/dyna/FilterType.md deleted file mode 100644 index afaaeac..0000000 --- a/docs/dyna/FilterType.md +++ /dev/null @@ -1,3 +0,0 @@ -# FilterType - -::: lasso.dyna.filter_type.FilterType diff --git a/docs/dyna/index.md b/docs/dyna/index.md deleted file mode 100644 index 9839b06..0000000 --- a/docs/dyna/index.md +++ /dev/null @@ -1,65 +0,0 @@ -# lasso.dyna - -The dyna module contains classes to read, write and display LS-Dyna result -files. -For a detailed list of features, see the following list: - -- D3plot - - Read & Write - - Beam, Shell, Solid, TShell Results - - Element/Node deletion - - Part Metadata - - Material Type Data - - Rigid Body Data - - Rigid Road Data - - SPH - - Particles - - Plot shell-based parts as 3D HTML -- Binout - - Read & Write - -!!! note - - The D3plot reader can process almost every structural result or results - connected to it such as airbag results. Multi-Solver data though and - connected results are not supported. - -## D3plot Example - -``` python ->>> from lasso.dyna import D3plot, ArrayType, FilterType - ->>> # read a file (zero-copy reading of everything) ->>> d3plot = D3plot("path/to/d3plot") - ->>> # read file ->>> # - buffered (less memory usage) ->>> # - only node displacements (safes memory) ->>> # - read only first and last state ->>> d3plot = D3plot("path/to/d3plot", ->>> state_array_filter=["node_displacement"], ->>> buffered_reading=True, ->>> state_filter={0, -1}) - ->>> # and of course femzipped files ->>> d3plot = D3plot("path/to/d3plot.fz") - ->>> # get arrays (see docs of ArrayType for shape info) ->>> disp = d3plot.arrays["node_displacement"] ->>> disp.shape -(34, 51723, 3) ->>> # this is safer and has auto-completion ->>> disp = d3plot.arrays[ArrayType.node_displacement] - ->>> # filter elements for certain parts ->>> pstrain = d3plot.arrays[ArrayType.element_shell_effective_plastic_strain] ->>> pstrain.shape -(34, 56372, 3) ->>> mask = d3plot.get_part_filter(FilterType.SHELL, [44, 45]) ->>> # filter elements with mask ->>> pstrain[:, mask].shape -(34, 17392, 3) - ->>> # create a standalone html plot ->>> d3plot.plot() -``` diff --git a/docs/dyna/performance_info.md b/docs/dyna/performance_info.md deleted file mode 100644 index 151b868..0000000 --- a/docs/dyna/performance_info.md +++ /dev/null @@ -1,73 +0,0 @@ -# Performance Info - -## D3plot - -Benchmark: - -The d3plot reader is blazingly fast by using several memory tricks. -While postprocessors build up an internal datastructure during reading, this -reader avoids this and simply references memory within the files. -In consequence performance benchmarks show that the runtime of the code is -solely dominated by pulling the files into memory. - -```text -2108 function calls (2099 primitive calls) in 43.017 seconds -Ordered by: internal time -ncalls tottime percall cumtime percall filename:lineno(function) - 35 38.960 1.113 38.960 1.113 {method 'readinto' of '_io.BufferedReader' objects} - 35 2.366 0.068 2.366 0.068 {built-in method io.open} - 1 1.644 1.644 42.959 42.959 D3plot.py:2565(_read_state_bytebuffer) - 71 0.043 0.001 0.043 0.001 {built-in method nt.stat} - 2 0.002 0.001 0.057 0.028 BinaryBuffer.py:234(load) - 70 0.000 0.000 0.001 0.000 ntpath.py:74(join) - 142 0.000 0.000 0.000 0.000 ntpath.py:121(splitdrive) - 1 0.000 0.000 0.019 0.019 D3plot.py:2738() - 1 0.000 0.000 0.000 0.000 {built-in method nt.listdir} - 36 0.000 0.000 0.000 0.000 {method 'match' of '_sre.SRE_Pattern' objects} - 84 0.000 0.000 0.000 0.000 {built-in method numpy.core.multiarray.frombuffer} - 1 0.000 0.000 42.959 42.959 D3plot.py:1304(_read_states) - ... -``` - -In the table above the largest, first three performance issues are all related -to loading files into memory, accounting for 99.89% of runtime. -The routines reading the data arrays (deserialization) have an almost constant -runtime of a few milliseconds and are independent of the filesize. - -### Efficiency - -Note that writing such efficient and simple code in C or any other language is -much more challenging than in Python, thus surprisingly this implementation can -be expected to outperform most native codes and tools. -Indeed tests show that when reading all results of a d3plot in a postprocessor, -this library is devastatingly fast. -For reading single node-fields this library can be slower though (see -Improvements below). - -### Array-based API - -Building objects is useful (e.g. neighbor search) but requires additional -runtime overhead. -By the principle of "don't pay for what you don't use" it was decided to avoid -object orientation, thus providing a majorly array-based API. -This is perfectly suitable for data analysis as well as machine learning. - -### Improvements - -A speedup 'could' be achieved by using memory-mapping, thus pulling only -fractions of the files into the RAM which hold the required arrays. -Postprocessors sometimes do this when reading certain fields, outperforming -this library in such a case (e.g. node displacements). -Since dyna litters most arrays across the entire file though, this method was -not considered worth the effort and thus this library always reads everything. - -## Binout - -The binout is used to store arbitrary binary data at a much higher frequency -than the d3plot. -As a result the data is dumped in an internal 'state folder'. -Since different results may be dumped at different frequencies some state -folders might contain more information than others. -This inherently prevents efficient memory reading. -The python version used here is slower than the original C-based version but -one therefore gains better portability across operating systems. diff --git a/docs/femzip/FemzipAPI.md b/docs/femzip/FemzipAPI.md deleted file mode 100644 index c96bc44..0000000 --- a/docs/femzip/FemzipAPI.md +++ /dev/null @@ -1,3 +0,0 @@ -# FemzipAPI - -::: lasso.femzip.femzip_api.FemzipAPI diff --git a/docs/femzip/FemzipAPIStatus.md b/docs/femzip/FemzipAPIStatus.md deleted file mode 100644 index e17a919..0000000 --- a/docs/femzip/FemzipAPIStatus.md +++ /dev/null @@ -1,3 +0,0 @@ -# FemzipAPIStatus - -::: lasso.femzip.femzip_api.FemzipAPIStatus diff --git a/docs/femzip/FemzipBufferInfo.md b/docs/femzip/FemzipBufferInfo.md deleted file mode 100644 index aca450a..0000000 --- a/docs/femzip/FemzipBufferInfo.md +++ /dev/null @@ -1,3 +0,0 @@ -# FemzipBufferInfo - -::: lasso.femzip.femzip_api.FemzipBufferInfo diff --git a/docs/femzip/FemzipError.md b/docs/femzip/FemzipError.md deleted file mode 100644 index c463841..0000000 --- a/docs/femzip/FemzipError.md +++ /dev/null @@ -1,3 +0,0 @@ -# FemzipError - -::: lasso.femzip.femzip_api.FemzipError diff --git a/docs/femzip/FemzipFileMetadata.md b/docs/femzip/FemzipFileMetadata.md deleted file mode 100644 index cbf54e2..0000000 --- a/docs/femzip/FemzipFileMetadata.md +++ /dev/null @@ -1,3 +0,0 @@ -# FemzipFileMetadata - -::: lasso.femzip.femzip_api.FemzipFileMetadata diff --git a/docs/femzip/FemzipVariableCategory.md b/docs/femzip/FemzipVariableCategory.md deleted file mode 100644 index d50499c..0000000 --- a/docs/femzip/FemzipVariableCategory.md +++ /dev/null @@ -1,3 +0,0 @@ -# FemzipVariableCategory - -::: lasso.femzip.fz_config.FemzipVariableCategory diff --git a/docs/femzip/VariableInfo.md b/docs/femzip/VariableInfo.md deleted file mode 100644 index f5f5837..0000000 --- a/docs/femzip/VariableInfo.md +++ /dev/null @@ -1,3 +0,0 @@ -# VariableInfo - -::: lasso.femzip.femzip_api.VariableInfo diff --git a/docs/femzip/index.md b/docs/femzip/index.md deleted file mode 100644 index 0288bae..0000000 --- a/docs/femzip/index.md +++ /dev/null @@ -1,103 +0,0 @@ - -# Femzip - -Documentation of the Femzip module. -The D3plot reader uses this module to access femzip file data through the femzip -API. -It also allows to decompress files directly or use some additional utility -functions such as a femzip file check if desired. - -## Example - -``` python ->>> from lasso.femzip import FemzipAPI ->>> from ctypes import * ->>> filepath = "path/to/d3plot.fz" - ->>> # Initialize API ->>> api = FemzipAPI() -``` - -Here we check if we can use the extended FEMZIP-API. -The extended FEMZIP-API allows reading selected arrays, but requires a license -with the feature "FEMUNZIPLIB-DYNA", which can be attained from SIDACT or -femzip distributors. - -``` python ->>> api.has_femunziplib_license() -True -``` - -Check if a file is femzipped: - -``` python ->>> # check if file is femzipped ->>> api.is_sidact_file(filepath) -True -``` - -Check the file and library version. -This is usually not necessary. - -``` python ->>> api.is_femunzip_version_ok(filepath) -True -``` - -It's efficient to get the memory demand for arrays beforehand and -hand this memory info to other functions. -It is often not mandatory though and a mere speedup. - -``` python ->>> # read memory demand info first ->>> buffer_info = api.get_buffer_info(filepath) ->>> # buffer info is a c struct, but we can print it ->>> api.struct_to_dict(buffer_info) -{'n_timesteps': 12, 'timesteps': , 'size_geometry': 537125, 'size_state': 1462902, 'size_displacement': 147716, 'size_activity': 47385, 'size_post': 1266356, 'size_titles': 1448} ->>> for i_timestep in range(buffer_info.n_timesteps): ->>> print(buffer_info.timesteps[i_timestep]) -0.0 -0.9998100399971008 -1.9998900890350342 -2.9999701976776123 -3.9997801780700684 -``` - -Here we read the geometry buffer. -The file is kept open so that we can read states afterwards. - -``` python ->>> mview = api.read_geometry(filepath, buffer_info, close_file=False) -``` - -Femzip can handle only one file per process. -In case of issues close the current file (shown later). -We can check the API status as follows - -``` python ->>> print(api.struct_to_dict(api.get_femzip_status())) -{'is_file_open': 1, 'is_geometry_read': 1, 'is_states_open': 0, 'i_timestep_state': -1, 'i_timestep_activity': -1} -``` - -Get the memory of a single state. -Must start at 0. Femzip does not allow reading arbitrary states inbetween. - -``` python ->>> mview = api.read_single_state(i_timestep=0, buffer_info=buffer_info) -``` - -It is also possible to read the state memory directly into an already -allocated buffer. - -``` python ->>> BufferType = c_float * (buffer_info.size_state) ->>> mview = memoryview(BufferType()) ->>> api.read_single_state(1, buffer_info=buffer_info, state_buffer=mview) -``` - -Let's close the file manually. -This ensures that femzip resets its internal state. - -``` python ->>> api.close_current_file() -``` diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 3625e0e..0000000 --- a/docs/index.md +++ /dev/null @@ -1,20 +0,0 @@ -# Open LASSO Python - -This python library is designed for general purpose usage in the field of -Computer Aided Engineering (CAE). -It's name originates from the original initiator and donator of the project -[Lasso GmbH](https://www.lasso.de/en). -The library is now maintained by an open-source community. - -## Community - -Join our open-source community on: - -[![DISCORD](icon-discord.png)](https://discord.gg/YJNPRjHG) -[Discord](https://discord.gg/YJNPRjHG) - -## Installation - -```console -python -m pip install lasso-python -``` diff --git a/dyna/ArrayType/index.html b/dyna/ArrayType/index.html new file mode 100644 index 0000000..3626c53 --- /dev/null +++ b/dyna/ArrayType/index.html @@ -0,0 +1,2235 @@ + + + + + + + + + + + + + + + + + + ArrayType - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    ArrayType

    + + +
    + + + +
    + + +

    Specifies the names for specific arrays

    +

    Enums from this class shall be used as a preferred practice +instead of the string array names to ensure compatibility.

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    global_timesteps + str +

    array shape: (n_timesteps)

    global_kinetic_energy + str +

    array shape: (n_timesteps)

    global_internal_energy + str +

    array shape: (n_timesteps)

    global_total_energy + str +

    array shape: (n_timesteps)

    global_velocity + str +

    array shape: (n_timesteps)

    node_ids + str +

    array shape: (n_nodes)

    node_coordinates + str +

    array shape: (n_nodes, x_y_z)

    node_displacement + str +

    array shape: (n_states, n_nodes, x_y_z)

    node_velocity + str +

    array shape: (n_states, n_nodes, x_y_z)

    node_acceleration + str +

    array shape: (n_states, n_nodes, x_y_z)

    node_is_alive + str +

    array shape: (n_states, n_nodes)

    node_temperature + str +

    array shape: (n_states, n_nodes) or (n_states, n_nodes, 3)

    node_heat_flux + str +

    array shape: (n_states, n_nodes, 3)

    node_mass_scaling + str +

    array shape: (n_states, n_nodes)

    node_temperature_gradient + str +

    array shape: (n_states, n_nodes)

    node_residual_forces + str +

    array shape: (n_states, n_nodes, fx_fy_fz)

    node_residual_moments + str +

    array shape: (n_states, n_nodes, mx_my_mz)

    element_solid_node_indexes + str +

    array shape: (n_solids, 8)

    element_solid_part_indexes + str +

    array shape: (n_solids)

    element_solid_ids + str +

    array shape: (n_solids)

    element_solid_thermal_data + str +

    array shape: (n_states, n_solids, n_solids_thermal_vars)

    element_solid_stress + str +

    array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz)

    element_solid_effective_plastic_strain + str +

    array shape: (n_states, n_solid_layers, n_solids)

    element_solid_history_variables + str +

    array shape: (n_states, n_solids, n_solid_layers, n_solids_history_vars)

    element_solid_strain + str +

    array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz)

    element_solid_plastic_strain_tensor + str +

    array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz)

    element_solid_thermal_strain_tensor + str +

    array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz)

    element_solid_is_alive + str +

    array shape: (n_states, n_solids)

    element_solid_extra_nodes + str +

    array shape: (n_solids, 2)

    element_solid_node10_extra_node_indexes + str +

    array shape: (n_solids, 2)

    element_solid_node20_element_index + str +

    array shape: (n_node20_solids)

    element_solid_node20_extra_node_indexes + str +

    array shape: (n_node20_solids, 12)

    element_solid_node27_element_index + str +

    array shape: (n_node27_solids)

    element_solid_node27_extra_node_indexes + str +

    array shape: (n_node27_solids, 27)

    element_solid_node21_penta_element_index + str +

    array shape: (n_node21p_solids)

    element_solid_node21_penta_extra_node_indexes + str +

    array shape: (n_node21p_solids, 21)

    element_solid_node15_tetras_element_index + str +

    array shape: (n_node15t_solids)

    element_solid_node15_tetras_extra_node_indexes + str +

    array shape: (n_node15t_solids, 7)

    element_solid_node20_tetras_element_index + str +

    array shape: (n_node20t_solids)

    element_solid_node20_tetras_extra_node_indexes + str +

    array shape: (n_node20t_solids, 20)

    element_solid_node40_pentas_element_index + str +

    array shape: (n_node40h_solids)

    element_solid_node40_pentas_extra_node_indexes + str +

    array shape: (n_node40h_solids, 40)

    element_solid_node64_hexas_element_index + str +

    array shape: (n_node64h_solids)

    element_solid_node64_hexas_extra_node_indexes + str +

    array shape: (n_node64h_solids, 64)

    element_tshell_part_indexes + str +

    array shape: (n_tshells)

    element_tshell_node_indexes + str +

    array shape: (n_tshells, 8)

    element_tshell_ids + str +

    array shape: (n_tshells)

    element_tshell_stress + str +

    array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz)

    element_tshell_effective_plastic_strain + str +

    array shape: (n_states, n_tshells, n_tshells_layers)

    element_tshell_history_variables + str +

    array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz)

    element_tshell_is_alive + str +

    array shape: (n_states, n_tshells)

    element_tshell_strain + str +

    array shape: (n_states, n_tshells, upper_lower, xx_yy_zz_xy_yz_xz)

    element_beam_part_indexes + str +

    array shape: (n_beams)

    element_beam_node_indexes + str +

    array shape: (n_beams, 5)

    element_beam_ids + str +

    array shape: (n_beams)

    element_beam_axial_force + str +

    array shape: (n_states, n_beams)

    element_beam_shear_force + str +

    array shape: (n_states, n_beams, s_t)

    element_beam_bending_moment + str +

    array shape: (n_states, n_beams, s_t)

    element_beam_torsion_moment + str +

    array shape: (n_states, n_beams)

    element_beam_shear_stress + str +

    array shape: (n_states, n_beams, n_beams_layers, rs_rt)

    element_beam_axial_stress + str +

    array shape: (n_states, n_beams, n_beams_layers)

    element_beam_plastic_strain + str +

    array shape: (n_states, n_beams, n_beams_layers)

    element_beam_axial_strain + str +

    array shape: (n_states, n_beams, n_beams_layers)

    element_beam_history_vars + str +

    array shape: (n_states, n_beams, n_beams_layers+3, n_beams_history_vars)

    element_beam_is_alive + str +

    array shape: (n_states, n_beams)

    element_shell_part_indexes + str +

    array shape (n_shells, 4)

    element_shell_node_indexes + str +

    array shape (n_shells)

    element_shell_ids + str +

    array shape (n_shells)

    element_shell_stress + str +

    array shape (n_states, n_shells_non_rigid, n_shell_layers, xx_yy_zz_xy_yz_xz)

    element_shell_effective_plastic_strain + str +

    array shape (n_states, n_shells_non_rigid, n_shell_layers)

    element_shell_history_vars + str +

    array shape (n_states, n_shells_non_rigid, n_shell_layers, n_shell_history_vars)

    element_shell_bending_moment + str +

    array shape (n_states, n_shells_non_rigid, mx_my_mxy)

    element_shell_shear_force + str +

    array shape (n_states, n_shells_non_rigid, qx_qy)

    element_shell_normal_force + str +

    array shape (n_states, n_shells_non_rigid, nx_ny_nxy)

    element_shell_thickness + str +

    array shape (n_states, n_shells_non_rigid)

    element_shell_unknown_variables + str +

    array shape (n_states, n_shells_non_rigid, 2)

    element_shell_internal_energy + str +

    array shape (n_states, n_shells_non_rigid)

    element_shell_strain + str +

    array shape (n_states, n_shells_non_rigid, upper_lower, xx_yy_zz_xy_yz_xz)

    element_shell_is_alive + str +

    array shape (n_states, n_shells_non_rigid)

    element_shell_node8_extra_node_indexes + str +

    array shape (n_shells, 4)

    element_shell_node8_element_index + str +

    array shape: (n_shells)

    element_shell_plastic_strain_tensor + str +

    array shape(n_states, n_shells_non_rigid, n_layers, 6)

    element_shell_thermal_strain_tensor + str +

    array shape(n_states, n_shells_non_rigid, 6)

    part_material_type + str +

    array shape: (n_parts)

    part_ids + str +

    array shape: (n_parts)

    part_ids_unordered + str +

    array shape: (n_parts)

    part_ids_cross_references + str +

    array shape: (n_parts)

    part_titles + str +

    array shape: (n_parts)

    part_titles_ids + str +

    array shape: (n_parts)

    part_internal_energy + str +

    array shape: (n_states, n_parts)

    part_kinetic_energy + str +

    array shape: (n_states, n_parts)

    part_velocity + str +

    array shape: (n_states, n_parts, x_y_z)

    part_mass + str +

    array shape: (n_states, n_parts)

    part_hourglass_energy + str +

    array shape: (n_states, n_parts)

    sph_node_indexes + str +

    array shape: (n_sph_nodes)

    sph_node_material_index + str +

    array shape: (n_sph_nodes)

    sph_is_alive + str +

    array shape: (n_states, n_sph_particles)

    sph_radius + str +

    array shape: (n_states, n_sph_particles)

    sph_pressure + str +

    array shape: (n_states, n_sph_particles)

    sph_stress + str +

    array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz)

    sph_effective_plastic_strain + str +

    array shape: (n_states, n_sph_particles)

    sph_density + str +

    array shape: (n_states, n_sph_particles)

    sph_internal_energy + str +

    array shape: (n_states, n_sph_particles)

    sph_n_neighbors + str +

    array shape: (n_states, n_sph_particles)

    sph_strain + str +

    array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz)

    sph_strainrate + str +

    array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz)

    sph_mass + str +

    array shape: (n_states, n_sph_particles)

    sph_deletion + str +

    array shape: (n_states, n_sph_particles)

    sph_history_vars + str +

    array shape: (n_states, n_sph_particles, n_sph_history_vars)

    airbag_variable_names + str +

    array shape: (n_variables)

    airbag_variable_types + str +

    array shape: (n_variables)

    airbags_first_particle_id + str +

    array shape: (n_airbags)

    airbags_n_particles + str +

    array shape: (n_airbags)

    airbags_ids + str +

    array shape: (n_airbags)

    airbags_n_gas_mixtures + str +

    array shape: (n_airbags)

    airbags_n_chambers + str +

    array shape: (n_airbags)

    airbag_n_active_particles + str +

    array shape: (n_states, n_airbags)

    airbag_bag_volume + str +

    array shape: (n_states, n_airbags)

    airbag_particle_gas_id + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_chamber_id + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_leakage + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_mass + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_radius + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_spin_energy + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_translation_energy + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_nearest_segment_distance + str +

    array shape: (n_states, n_airbag_particles)

    airbag_particle_position + str +

    array shape: (n_states, n_airbag_particles, x_y_z)

    airbag_particle_velocity + str +

    array shape: (n_states, n_airbag_particles, x_y_z)

    rigid_road_node_ids + str +

    array shape: (rigid_road_n_nodes)

    rigid_road_node_coordinates + str +

    array shape: (rigid_road_n_nodes, x_y_z)

    rigid_road_ids + str +

    array shape: (n_roads)

    rigid_road_n_segments + str +

    array shape: (n_roads)

    rigid_road_segment_node_ids + str +

    list!: (n_roads, 4*n_road_segments)

    rigid_road_segment_road_id + str +

    list!: (n_roads, n_road_segments)

    rigid_road_displacement + str +

    array shape: (n_states, n_roads, x_y_z)

    rigid_road_velocity + str +

    array shape: (n_states, n_roads, x_y_z)

    rigid_body_part_indexes + str +

    array shape: (n_rigid_bodies)

    rigid_body_n_nodes + str +

    array shape: (n_rigid_bodies)

    rigid_body_node_indexes_list + str +

    list!: (n_rigid_bodies, n_rigid_body_nodes (differs))

    rigid_body_n_active_nodes + str +

    array shape: (n_rigid_bodies)

    rigid_body_active_node_indexes_list + str +

    list!: (n_rigid_bodies, n_rigid_body_nodes (differs))

    rigid_body_coordinates + str +

    array shape: (n_states, n_rigid_bodies, x_y_z)

    rigid_body_rotation_matrix + str +

    array shape: (n_states, n_rigid_bodies, 9)

    rigid_body_velocity + str +

    array shape: (n_states, n_rigid_bodies, x_y_z)

    rigid_body_rot_velocity + str +

    array shape: (n_states, n_rigid_bodies, x_y_z)

    rigid_body_acceleration + str +

    array shape: (n_states, n_rigid_bodies, x_y_z)

    rigid_body_rot_acceleration + str +

    array shape: (n_states, n_rigid_bodies, x_y_z)

    contact_title_ids + str +

    array shape: (n_contacts)

    contact_titles + str +

    array shape: (n_contacts)

    ale_material_ids + str +

    array shape: (n_ale_material)

    rigid_wall_force + str +

    array shape: (n_states, n_rigid_walls)

    rigid_wall_position + str +

    array shape: (n_states, n_rigid_walls, x_y_z)

    + + + + + +
    + + + + + + + + + +
    + + + +

    +get_state_array_names() + + + staticmethod + + +

    + + +
    + +

    Get the names of all state arrays

    +

    Returns:

    +

    state_array_names: List[str] + list of state array names

    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dyna/Binout/index.html b/dyna/Binout/index.html new file mode 100644 index 0000000..2513788 --- /dev/null +++ b/dyna/Binout/index.html @@ -0,0 +1,1606 @@ + + + + + + + + + + + + + + + + + + Binout - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Binout

    +

    There is a youtube tutorial available for this class:

    +
    + +
    + + + +
    + + + +
    + + +

    This class is meant to read binouts from LS-Dyna

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    Path to the binout to read. May contain * (glob) for selecting multiple +files.

    + required +
    + +

    Attributes:

    + + + + + + + + + + + + + + + +
    NameTypeDescription
    filelist + List[str] +

    List of files which are opened. +lsda: Lsda +The underlying LS-Dyna binout reader instance from code from LSTC. +lsda_root: Symbol +Root lsda symbol which is like a root directory to traverse the +content of the binout file.

    +

    Notes

    +
    This class is only a utility wrapper for Lsda from LSTC.
    +
    + +

    Examples:

    +
    >>> binout = Binout("path/to/binout")
    +
    + + + + + +
    + + + + + + + + + +
    + + + +

    +__init__(filepath) + +

    + + +
    + +

    Constructor for a binout

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to the binout or pattern

    + required +
    +

    Notes

    +
    The class loads the file given in the filepath. By giving a
    +search pattern such as: "binout*", all files with that
    +pattern will be loaded.
    +
    + +

    Examples:

    +
    >>> # reads a single binout
    +>>> binout = Binout("path/to/binout0000")
    +>>> binout.filelist
    +['path/to/binout0000']
    +
    +>>> # reads multiple files
    +>>> binout = Binout("path/to/binout*")
    +>>> binout.filelist
    +['path/to/binout0000','path/to/binout0001']
    +
    + +
    + +
    + +
    + + + +

    +as_df(*args) + +

    + + +
    + +

    read data and convert to pandas dataframe if possible

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    *args +

    internal path in the folder structure of the binout

    + () +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    df + pandas.DataFrame +

    data converted to pandas dataframe

    + +

    Raises:

    + + + + + + + + + + + + + +
    TypeDescription
    + ValueError +

    if the data cannot be converted to a pandas dataframe

    + +

    Examples:

    +
    >>> from lasso.dyna import Binout
    +>>> binout = Binout('path/to/binout')
    +
    +Read a time-dependent array.
    +
    +>>> binout.as_df('glstat', 'eroded_kinetic_energy')
    +time
    +0.00000        0.000000
    +0.19971        0.000000
    +0.39942        0.000000
    +0.59976        0.000000
    +0.79947        0.000000
    +                ...
    +119.19978    105.220786
    +119.39949    105.220786
    +119.59983    105.220786
    +119.79954    105.220786
    +119.99988    105.220786
    +Name: eroded_kinetic_energy, Length: 601, dtype: float64
    +
    +Read a time and id-dependent array.
    +
    +>>> binout.as_df('secforc', 'x_force')
    +                      1             2             3  ...            33            34
    +time                                                 .
    +0.00063    2.168547e-16  2.275245e-15 -3.118639e-14  ... -5.126108e-13  4.592941e-16
    +0.20034    3.514243e-04  3.797908e-04 -1.701294e-03  ...  2.530416e-11  2.755493e-07
    +0.40005    3.052490e-03  3.242951e-02 -2.699926e-02  ...  6.755315e-06 -2.608923e-03
    +0.60039   -1.299816e-02  4.930999e-02 -1.632376e-02  ...  8.941705e-05 -2.203455e-02
    +0.80010    1.178485e-02  4.904512e-02 -9.740204e-03  ...  5.648263e-05 -6.999854e-02
    +...                 ...           ...           ...  ...           ...           ...
    +119.00007  9.737679e-01 -8.833702e+00  1.298964e+01  ... -9.977377e-02  7.883521e+00
    +119.20041  7.421170e-01 -8.849411e+00  1.253505e+01  ... -1.845916e-01  7.791409e+00
    +119.40012  9.946615e-01 -8.541475e+00  1.188757e+01  ... -3.662228e-02  7.675800e+00
    +119.60046  9.677638e-01 -8.566695e+00  1.130774e+01  ...  5.144208e-02  7.273052e+00
    +119.80017  1.035165e+00 -8.040828e+00  1.124044e+01  ... -1.213450e-02  7.188395e+00
    +
    + +
    + +
    + +
    + + + +

    +read(*path) + +

    + + +
    + +

    Read all data from Binout (top to low level)

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    path +

    internal path in the folder structure of the binout

    + () +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    ret + Union[List[str], str, np.ndarray] +

    list of subdata within the folder or data itself (array or string)

    +

    Notes

    +
    This function is used to read any data from the binout. It has been used
    +to make the access to the data more comfortable. The return type depends
    +on the given path:
    +
    + - `binout.read()`: `List[str] names of directories (in binout)
    + - `binout.read(dir)`: `List[str]` names of variables or subdirs
    + - `binout.read(dir1, ..., variable)`: np.array data
    +
    +If you have multiple outputs with different ids (e.g. in nodout for
    +multiple nodes) then don't forget to read the id array for
    +identification or id-labels.
    +
    + +

    Examples:

    +
    >>> from lasso.dyna import Binout
    +>>> binout = Binout("test/binout")
    +>>> # get top dirs
    +>>> binout.read()
    +['swforc']
    +>>> binout.read("swforc")
    +['title', 'failure', 'ids', 'failure_time', ...]
    +>>> binout.read("swforc","shear").shape
    +(321L, 26L)
    +>>> binout.read("swforc","ids").shape
    +(26L,)
    +>>> binout.read("swforc","ids")
    +array([52890, 52891, 52892, ...])
    +>>> # read a string value
    +>>> binout.read("swforc","date")
    +'11/05/2013'
    +
    + +
    + +
    + +
    + + + +

    +save_hdf5(filepath, compression='gzip') + +

    + + +
    + +

    Save a binout as HDF5

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath +

    path where the HDF5 shall be saved

    + required +
    compression +

    compression technique (see h5py docs)

    + 'gzip' +
    + +

    Examples:

    +
    >>> binout = Binout("path/to/binout")
    +>>> binout.save_hdf5("path/to/binout.h5")
    +
    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dyna/D3plot/index.html b/dyna/D3plot/index.html new file mode 100644 index 0000000..e90095a --- /dev/null +++ b/dyna/D3plot/index.html @@ -0,0 +1,2074 @@ + + + + + + + + + + + + + + + + + + D3plot - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    D3plot

    +

    There is a youtube tutorial available for this class:

    +
    + +
    + + + +
    + + + +
    + + +

    Class used to read LS-Dyna d3plots

    + + + + + +
    + + + + + + + +
    + + + +

    +arrays: dict + + + property + writable + + +

    + + +
    + +

    Dictionary holding all d3plot arrays

    +

    Notes

    +
    The corresponding keys of the dictionary can
    +also be found in `lasso.dyna.ArrayTypes`, which
    +helps with IDE integration and code safety.
    +
    + +

    Examples:

    +
    >>> d3plot = D3plot("some/path/to/d3plot")
    +>>> d3plot.arrays.keys()
    +dict_keys(['irbtyp', 'node_coordinates', ...])
    +>>> # The following is good coding practice
    +>>> import lasso.dyna.ArrayTypes.ArrayTypes as atypes
    +>>> d3plot.arrays[atypes.node_displacmeent].shape
    +
    +
    + +
    + +
    + + + +

    +header: D3plotHeader + + + property + + +

    + + +
    + +

    Instance holding all d3plot header information

    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    header + D3plotHeader +

    header of the d3plot

    +

    Notes

    +
    The header contains a lot of information such as number
    +of elements, etc.
    +
    + +

    Examples:

    +
    >>> d3plot = D3plot("some/path/to/d3plot")
    +>>> # number of shells
    +>>> d3plot.header.n_shells
    +85624
    +
    +
    + +
    + +
    + + + +

    +n_timesteps: int + + + property + + +

    + + +
    + +

    Number of timesteps loaded

    +
    + +
    + + + +
    + + + +

    +__init__(filepath=None, use_femzip=None, n_files_to_load_at_once=None, state_array_filter=None, state_filter=None, buffered_reading=False) + +

    + + +
    + +

    Constructor for a D3plot

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to a d3plot file

    + None +
    use_femzip + Union[bool, None] +

    Not used anymore.

    + None +
    n_files_to_load_at_once + Union[int, None] +

    DEPRECATED not used anymore, use buffered_reading

    + None +
    state_array_filter + Union[List[str], None] +

    names of arrays which will be the only ones loaded from state data

    + None +
    state_filter + Union[None, Set[int]] +

    which states to load. Negative indexes count backwards.

    + None +
    buffered_reading + bool +

    whether to pull only a single state into memory during reading

    + False +
    + +

    Examples:

    +
    >>> from lasso.dyna import D3plot, ArrayType
    +>>> # open and read everything
    +>>> d3plot = D3plot("path/to/d3plot")
    +
    +>>> # only read node displacement
    +>>> d3plot = D3plot("path/to/d3plot", state_array_filter=["node_displacement"])
    +>>> # or with nicer syntax
    +>>> d3plot = D3plot("path/to/d3plot", state_array_filter=[ArrayType.node_displacement])
    +
    +>>> # only load first and last state
    +>>> d3plot = D3plot("path/to/d3plot", state_filter={0, -1})
    +
    +>>> # our computer lacks RAM so lets extract a specific array
    +>>> # but only keep one state at a time in memory
    +>>> d3plot = D3plot("path/to/d3plot",
    +>>>                 state_array_filter=[ArrayType.node_displacement],
    +>>>                 buffered_reading=True)
    +
    +

    Notes

    +
    If dyna wrote multiple files for several states,
    +only give the path to the first file.
    +
    + +
    + +
    + +
    + + + +

    +check_array_dims(array_dimensions, dimension_name, dimension_size=-1) + +

    + + +
    + +

    This function checks if multiple arrays share an array dimensions +with the same size.

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    array_dimensions + Dict[str, int] +

    Array name and expected number of dimensions as dict

    + required +
    dimension_name + str +

    Name of the array dimension for error messages

    + required +
    dimension_size + int +

    Optional expected size. If not set then all entries must equal +the first value collected.

    + -1 +
    + +

    Raises:

    + + + + + + + + + + + + + +
    TypeDescription
    + ValueError +

    If dimensions do not match in any kind of way.

    + +
    + +
    + +
    + + + +

    +compare(d3plot2, array_eps=None) + +

    + + +
    + +

    Compare two d3plots and print the info

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    d3plot2 +

    second d3plot

    + required +
    array_eps + Union[float, None] +

    tolerance for arrays

    + None +
    + +

    Returns:

    + + + + + + + + + + + + + + + + + +
    Name TypeDescription
    hdr_differences + dict +

    differences in the header

    array_differences + dict +

    difference between arrays as message

    + +

    Examples:

    +
    Comparison of a femzipped file and an uncompressed file. Femzip
    +is a lossy compression, thus precision is traded for memory.
    +
    +>>> d3plot1 = D3plot("path/to/d3plot")
    +>>> d3plot2 = D3plot("path/to/d3plot.fz")
    +>>> hdr_diff, array_diff = d3plot1.compare(d3plot2)
    +>>> for arraytype, msg in array_diff.items():
    +>>>     print(name, msg)
    +node_coordinates ฮ”max = 0.050048828125
    +node_displacement ฮ”max = 0.050048828125
    +node_velocity ฮ”max = 0.050048828125
    +node_acceleration ฮ”max = 49998984.0
    +element_beam_axial_force ฮ”max = 6.103515625e-05
    +element_shell_stress ฮ”max = 0.0005035400390625
    +element_shell_thickness ฮ”max = 9.999999717180685e-10
    +element_shell_unknown_variables ฮ”max = 0.0005000010132789612
    +element_shell_internal_energy ฮ”max = 188.41957092285156
    +
    + +
    + +
    + +
    + + + +

    +enable_logger(enable) + + + staticmethod + + +

    + + +
    + +

    Enable the logger for this class

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    enable + bool +

    whether to enable logging for this class

    + required +
    + +
    + +
    + +
    + + + +

    +get_part_filter(filter_type, part_ids, for_state_array=True) + +

    + + +
    + +

    Get a part filter for different entities

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filter_type + FilterType +

    the array type to filter for (beam, shell, solid, tshell, node)

    + required +
    part_ids + Iterable[int] +

    part ids to filter out

    + required +
    for_state_array + bool +

    if the filter is meant for a state array. Makes a difference +for shells if rigid bodies are in the model (mattyp == 20)

    + True +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    mask + np.ndarray +

    mask usable on arrays to filter results

    + +

    Examples:

    +
    >>> from lasso.dyna import D3plot, ArrayType, FilterType
    +>>> d3plot = D3plot("path/to/d3plot")
    +>>> part_ids = [13, 14]
    +>>> mask = d3plot.get_part_filter(FilterType.shell)
    +>>> shell_stress = d3plot.arrays[ArrayType.element_shell_stress]
    +>>> shell_stress.shape
    +(34, 7463, 3, 6)
    +>>> # select only parts from part_ids
    +>>> shell_stress_parts = shell_stress[:, mask]
    +
    + +
    + +
    + +
    + + + +

    +plot(i_timestep=0, field=None, is_element_field=True, fringe_limits=None, export_filepath='') + +

    + + +
    + +

    Plot the d3plot geometry

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    i_timestep + int +

    timestep index to plot

    + 0 +
    field + Union[np.ndarray, None] +

    Array containing a field value for every element or node

    + None +
    is_element_field + bool +

    if the specified field is for elements or nodes

    + True +
    fringe_limits + Union[Tuple[float, float], None] +

    limits for the fringe bar. Set by default to min and max.

    + None +
    export_filepath + str +

    filepath to export the html to

    + '' +
    +

    Notes

    +
    Currently only shell elements can be plotted, since for
    +solids the surface needs extraction.
    +
    + +

    Examples:

    +
    Plot deformation of last timestep.
    +
    +>>> d3plot = D3plot("path/to/d3plot")
    +>>> d3plot.plot(-1)
    +>>> # get eff. plastic strain
    +>>> pstrain = d3plot.arrays[ArrayType.element_shell_effective_plastic_strain]
    +>>> pstrain.shape
    +(1, 4696, 3)
    +>>> # mean across all 3 integration points
    +>>> pstrain = pstrain.mean(axis=2)
    +>>> pstrain.shape
    +(1, 4696)
    +>>> # we only have 1 timestep here but let's take last one in general
    +>>> last_timestep = -1
    +>>> d3plot.plot(0, field=pstrain[last_timestep])
    +>>> # we don't like the fringe, let's adjust
    +>>> d3plot.plot(0, field=pstrain[last_timestep], fringe_limits=(0, 0.3))
    +
    + +
    + +
    + +
    + + + +

    +write_d3plot(filepath, block_size_bytes=2048, single_file=True) + +

    + + +
    + +

    Write a d3plot file again

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + Union[str, BinaryIO] +

    filepath of the new d3plot file or an opened file handle

    + required +
    block_size_bytes + int +

    D3plots are originally written in byte-blocks causing zero-padding at the end of +files. This can be controlled by this parameter. Set to 0 for no padding.

    + 2048 +
    single_file + bool +

    whether to write all states into a single file

    + True +
    + +

    Examples:

    +
    Modify an existing d3plot:
    +
    +>>> d3plot = D3plot("path/to/d3plot")
    +>>> hvars = d3plot.array[ArrayType.element_shell_history_vars]
    +>>> hvars.shape
    +(1, 4696, 3, 19)
    +>>> new_history_var = np.random.random((1, 4696, 3, 1))
    +>>> new_hvars = np.concatenate([hvars, new_history_var], axis=3)
    +>>> d3plot.array[ArrayType.element_shell_history_vars] = new_hvars
    +>>> d3plot.write_d3plot("path/to/new/d3plot")
    +
    +Write a new d3plot from scratch:
    +
    +>>> d3plot = D3plot()
    +>>> d3plot.arrays[ArrayType.node_coordinates] = np.array([[0, 0, 0],
    +...                                                       [1, 0, 0],
    +...                                                       [0, 1, 0]])
    +>>> d3plot.arrays[ArrayType.element_shell_node_indexes] = np.array([[0, 2, 1, 1]])
    +>>> d3plot.arrays[ArrayType.element_shell_part_indexes] = np.array([0])
    +>>> d3plot.arrays[ArrayType.node_displacement] = np.array([[[0, 0, 0],
    +...                                                         [1, 0, 0],
    +...                                                         [0, 1, 0]]])
    +>>> d3plot.write_d3plot("yay.d3plot")
    +
    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dyna/D3plotHeader/index.html b/dyna/D3plotHeader/index.html new file mode 100644 index 0000000..133f8e2 --- /dev/null +++ b/dyna/D3plotHeader/index.html @@ -0,0 +1,2115 @@ + + + + + + + + + + + + + + + + + + D3plotHeader - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    D3plotHeader

    + + +
    + + + +
    + + +

    Class for reading only header information of a d3plot

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    filepath + str +

    Filepath of the processed file.

    itype + np.dtype +

    Integer type of d3plot.

    ftype + np.dtype +

    Floating point type of d3plot.

    wordsize + int +

    size of words in bytes (4 = single precision, 8 = double precision).

    raw_header + Dict[str, Any] +

    Raw header data as dict.

    external_numbers_dtype + np.dtype +

    Integer type of user ids.

    n_header_bytes + int +

    Number of bytes of header (at least 256 or more).

    title + str +

    Main title.

    title2 + str +

    Optional, secondary title.

    runtime + int +

    Runtime of the d3plot as timestamp.

    filetype + D3plotFiletype +

    Filetype such as d3plot or d3part.

    source_version + int +

    Source version of LS-Dyna.

    release_version + str +

    Release version of LS-Dyna.

    version + float +

    Version of LS-Dyna.

    extra_long_header + bool +

    If header was longer than default.

    n_dimensions + int +

    Number of dimensions, usually three.

    n_global_vars + int +

    How many global vars for each state.

    n_adapted_element_pairs + int +

    How many adapted element pairs.

    has_node_deletion_data + bool +

    If node deletion data is present.

    has_element_deletion_data + bool +

    If element deletion data is present.

    has_numbering_section + bool +

    If a user numbering section is present.

    has_material_type_section + bool +

    If material type section was written.

    n_numbering_section_words + int +

    Amount of words for numbering section.

    has_invariant_numbering + bool +

    If invariant numbering is used whatever that means.

    quadratic_elems_has_full_connectivity + bool +

    If quadric elements have full connectivity.

    quadratic_elems_has_data_at_integration_points + bool +

    If quadric elements data is at integration points.

    n_post_branches + int +

    Unused and unknown.

    n_types + Tuple[int, ...] +

    Behind geometry these are integers indicating additional data such as +part names.

    n_parts + int +

    Obviously number of parts.

    n_nodes + int +

    Number of nodes.

    has_node_temperatures + bool +

    If node temperature is present.

    has_node_temperature_layers + bool +

    If node temperatures are layered.

    has_node_heat_flux + bool +

    If node heat flux is present.

    has_node_mass_scaling + bool +

    Mass scaling is written.

    has_node_displacement + bool +

    Node displacement is written.

    has_node_velocity + bool +

    Node velocity is written.

    has_node_acceleration + bool +

    Node acceleration is written.

    has_node_temperature_gradient + bool +

    Node temperature gradient is written.

    has_node_residual_forces + bool +

    Node residual forces are written.

    has_node_residual_moments + bool +

    Node residual moments are written.

    has_node_max_contact_penetration_absolute + bool +

    Node contact penetration info exist.

    has_node_max_contact_penetration_relative + bool +

    Node relative contact penetration info was written.

    has_node_contact_energy_density + int +

    Node energy density was written.

    n_shell_tshell_layers + int +

    Number of layers for shells and thick shells.

    n_shell_tshell_history_vars + int +

    Number of history vars for shells and thick shells.

    has_shell_tshell_stress + bool +

    If shells and thick shells have stresses.

    has_shell_tshell_pstrain + bool +

    If shells and thick shells have eff. plastic strain.

    has_element_strain + bool +

    If all elements have strain.

    has_solid_shell_plastic_strain_tensor + bool +

    If solids have plastic strain tensor.

    has_solid_shell_thermal_strain_tensor + bool +

    If solids have thermal strain tensor.

    n_solids + int +

    Number of solids.

    n_solid_vars + int +

    Number of solid variables per element and state.

    n_solid_materials + int +

    Number of solid materials/parts.

    n_solid_history_vars + int +

    Number of solid history variables.

    n_solid_thermal_vars + int +

    Number of solid thermal variables.

    n_solids_20_node_hexas + int +

    Number of 20-node solid hexas.

    n_solids_27_node_hexas + int +

    Number of 27-node solid hexas.

    n_solids_21_node_pentas + int +

    Number of 21-node solid pentas.

    n_solids_15_node_tetras + int +

    Number of 15-node solid tetras.

    n_solids_20_node_tetras + int +

    Number of 20-node solid tetras.

    n_solids_40_node_pentas + int +

    Number of 40-node solid pentas.

    n_solids_64_node_hexas + int +

    Number of 64-node solid hexas.

    has_solid_2_extra_nodes + bool +

    If two extra nodes were written for solids.

    has_solid_stress + bool +

    If solid stress is present.

    has_solid_pstrain + bool +

    If solid eff. plastic strain is present.

    has_quadratic_solids + bool +

    If quadratic solids were used.

    has_cubic_solids + bool +

    If cubic solids were used.

    has_solid_internal_energy_density + bool +

    If solids have internal energy density.

    n_solid_layers + int +

    Number of solid layers.

    n_shells + int +

    Number of shells.

    n_shell_vars + int +

    Number of shell vars per element and state.

    n_shell_materials + int +

    Number of shell materials/parts.

    n_shells_8_nodes + int +

    Number of 8-node shells.

    has_shell_four_inplane_gauss_points + bool +

    If shells have four inplace gaussian integration points.

    has_shell_forces + bool +

    If shell forces are present.

    has_shell_extra_variables + bool +

    If extra shell variables such as forces are present.

    has_shell_internal_energy_density + bool +

    If shell internal energy density is present.

    n_thick_shells + int +

    Number of thick shell elements.

    n_thick_shell_vars + int +

    Number of thick shell element vars.

    n_thick_shell_materials + int +

    Number of thick shell materials/parts.

    has_thick_shell_energy_density + bool +

    If thick shells have energy density.

    thick_shell_energy_density_position + int +

    Nnused.

    n_beams + int +

    Number of beam elements.

    n_beam_vars + int +

    Number of state variables per beam element.

    n_beam_materials + int +

    Number of beam materials.

    n_beam_history_vars + int +

    Number of beam history variables.

    n_airbags + int +

    Number of airbags.

    has_airbag_n_chambers + bool +

    If airbags have number of chambers var.

    has_rigid_road_surface + bool +

    If rigid road surface was written.

    has_rigid_body_data + bool +

    If rigid body section was written.

    has_reduced_rigid_body_data + bool +

    If the reduced set of rigid body data was written.

    n_rigid_wall_vars + int +

    Number of rigid wall vars.

    n_sph_nodes + int +

    Number of sph nodes.

    n_sph_materials + int +

    Number of sph materials.

    n_ale_materials + int +

    Number of ale materials.

    n_ale_fluid_groups + int +

    Number of ale fluid groups.

    has_cfd_data + bool +

    If CFD-Data was written.

    has_multi_solver_data + bool +

    If multi-solver data was written.

    cfd_extra_data + int +

    If cfd data contains extra section.

    legacy_code_type + int +

    Originally a code indicator but unused nowadays.

    unused_numst + int +

    Unused and not explained in docs.

    + + + + + +
    + + + + + + + + + +
    + + + +

    +__init__(filepath=None) + +

    + + +
    + +

    Create a D3plotHeader instance

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + Union[str, BinaryBuffer, None] +

    path to a d3plot file or a buffer holding d3plot memory

    + None +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    header + D3plotHeader +

    d3plot header instance

    + +

    Examples:

    +
    Create an empty header file
    +
    +>>> header = D3plotHeader()
    +
    +Now load only the header of a d3plot.
    +
    +>>> header.load_file("path/to/d3plot")
    +
    +Or we can do the above together.
    +
    +>>> header = D3plotHeader("path/to/d3plot")
    +
    +

    Notes

    +
    This class does not load the entire memory of a d3plot
    +but merely what is required to parse the header information.
    +Thus, it is safe to use on big files.
    +
    + +
    + +
    + +
    + + + +

    +load_file(file) + +

    + + +
    + +

    Load d3plot header from a d3plot file

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    file + Union[str, BinaryBuffer] +

    path to d3plot or BinaryBuffer holding memory of d3plot

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    self + D3plotHeader +

    returning self on success

    +

    Notes

    +
    This routine only loads the minimal amount of data
    +that is neccessary. Thus it is safe to use on huge files.
    +
    + +

    Examples:

    +
    >>> header = D3plotHeader().load_file("path/to/d3plot")
    +>>> header.n_shells
    +19684
    +
    + +
    + +
    + +
    + + + +

    +compare(other) + +

    + + +
    + +

    Compare two headers and get the differences

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    other + D3plotHeader +

    other d3plot header instance

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    differences + Dict[str, Tuple[Any, Any]] +

    The different entries of both headers in a dict

    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dyna/FilterType/index.html b/dyna/FilterType/index.html new file mode 100644 index 0000000..de67c7d --- /dev/null +++ b/dyna/FilterType/index.html @@ -0,0 +1,1153 @@ + + + + + + + + + + + + + + + + + + FilterType - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    FilterType

    + + +
    + + + +
    +

    + Bases: Enum

    + + +

    Used for filtering d3plot arrays

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    BEAM + str +

    Filters for beam elements

    SHELL + str +

    Filters for shell elements

    SOLID + str +

    Filters for solid elements

    TSHELL + str +

    Filters for thick shells elements

    PART + str +

    Filters for parts

    NODE + str +

    Filters for nodes

    + +

    Examples:

    +
    >>> part_ids = [13, 14]
    +>>> d3plot.get_part_filter(FilterType.SHELL, part_ids)
    +
    + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dyna/index.html b/dyna/index.html new file mode 100644 index 0000000..ebe39ef --- /dev/null +++ b/dyna/index.html @@ -0,0 +1,1124 @@ + + + + + + + + + + + + + + + + + + Overview - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    lasso.dyna

    +

    The dyna module contains classes to read, write and display LS-Dyna result +files. +For a detailed list of features, see the following list:

    +
      +
    • D3plot
        +
      • Read & Write
          +
        • Beam, Shell, Solid, TShell Results
        • +
        • Element/Node deletion
        • +
        • Part Metadata
        • +
        • Material Type Data
        • +
        • Rigid Body Data
        • +
        • Rigid Road Data
        • +
        • SPH
        • +
        • Particles
        • +
        +
      • +
      • Plot shell-based parts as 3D HTML
      • +
      +
    • +
    • Binout
        +
      • Read & Write
      • +
      +
    • +
    +
    +

    Note

    +

    The D3plot reader can process almost every structural result or results +connected to it such as airbag results. Multi-Solver data though and +connected results are not supported.

    +
    +

    D3plot Example

    +
    >>> from lasso.dyna import D3plot, ArrayType, FilterType
    +
    +>>> # read a file (zero-copy reading of everything)
    +>>> d3plot = D3plot("path/to/d3plot")
    +
    +>>> # read file 
    +>>> # - buffered (less memory usage)
    +>>> # - only node displacements (safes memory)
    +>>> # - read only first and last state
    +>>> d3plot = D3plot("path/to/d3plot",
    +>>>                 state_array_filter=["node_displacement"],
    +>>>                 buffered_reading=True,
    +>>>                 state_filter={0, -1})
    +
    +>>> # and of course femzipped files
    +>>> d3plot = D3plot("path/to/d3plot.fz")
    +
    +>>> # get arrays (see docs of ArrayType for shape info)
    +>>> disp = d3plot.arrays["node_displacement"]
    +>>> disp.shape
    +(34, 51723, 3)
    +>>> # this is safer and has auto-completion
    +>>> disp = d3plot.arrays[ArrayType.node_displacement]
    +
    +>>> # filter elements for certain parts
    +>>> pstrain = d3plot.arrays[ArrayType.element_shell_effective_plastic_strain]
    +>>> pstrain.shape
    +(34, 56372, 3)
    +>>> mask = d3plot.get_part_filter(FilterType.SHELL, [44, 45])
    +>>> # filter elements with mask
    +>>> pstrain[:, mask].shape
    +(34, 17392, 3)
    +
    +>>> # create a standalone html plot
    +>>> d3plot.plot()
    +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/dyna/performance_info/index.html b/dyna/performance_info/index.html new file mode 100644 index 0000000..f8e23d7 --- /dev/null +++ b/dyna/performance_info/index.html @@ -0,0 +1,1183 @@ + + + + + + + + + + + + + + + + + + Performance Info - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Performance Info

    +

    D3plot

    +

    Benchmark:

    +

    The d3plot reader is blazingly fast by using several memory tricks. +While postprocessors build up an internal datastructure during reading, this +reader avoids this and simply references memory within the files. +In consequence performance benchmarks show that the runtime of the code is +solely dominated by pulling the files into memory.

    +
    2108 function calls (2099 primitive calls) in 43.017 seconds 
    +Ordered by: internal time
    +ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    +    35   38.960    1.113   38.960    1.113 {method 'readinto' of '_io.BufferedReader' objects}
    +    35    2.366    0.068    2.366    0.068 {built-in method io.open}
    +    1     1.644    1.644   42.959   42.959 D3plot.py:2565(_read_state_bytebuffer)
    +    71    0.043    0.001    0.043    0.001 {built-in method nt.stat}
    +    2     0.002    0.001    0.057    0.028 BinaryBuffer.py:234(load)
    +    70    0.000    0.000    0.001    0.000 ntpath.py:74(join)
    +    142   0.000    0.000    0.000    0.000 ntpath.py:121(splitdrive)
    +    1     0.000    0.000    0.019    0.019 D3plot.py:2738(<listcomp>)
    +    1     0.000    0.000    0.000    0.000 {built-in method nt.listdir}
    +    36    0.000    0.000    0.000    0.000 {method 'match' of '_sre.SRE_Pattern' objects}
    +    84    0.000    0.000    0.000    0.000 {built-in method numpy.core.multiarray.frombuffer} 
    +    1     0.000    0.000   42.959   42.959 D3plot.py:1304(_read_states)
    +    ...
    +
    +

    In the table above the largest, first three performance issues are all related +to loading files into memory, accounting for 99.89% of runtime. +The routines reading the data arrays (deserialization) have an almost constant +runtime of a few milliseconds and are independent of the filesize.

    +

    Efficiency

    +

    Note that writing such efficient and simple code in C or any other language is +much more challenging than in Python, thus surprisingly this implementation can +be expected to outperform most native codes and tools. +Indeed tests show that when reading all results of a d3plot in a postprocessor, +this library is devastatingly fast. +For reading single node-fields this library can be slower though (see +Improvements below).

    +

    Array-based API

    +

    Building objects is useful (e.g. neighbor search) but requires additional +runtime overhead. +By the principle of "don't pay for what you don't use" it was decided to avoid +object orientation, thus providing a majorly array-based API. +This is perfectly suitable for data analysis as well as machine learning.

    +

    Improvements

    +

    A speedup 'could' be achieved by using memory-mapping, thus pulling only +fractions of the files into the RAM which hold the required arrays. +Postprocessors sometimes do this when reading certain fields, outperforming +this library in such a case (e.g. node displacements). +Since dyna litters most arrays across the entire file though, this method was +not considered worth the effort and thus this library always reads everything.

    +

    Binout

    +

    The binout is used to store arbitrary binary data at a much higher frequency +than the d3plot. +As a result the data is dumped in an internal 'state folder'. +Since different results may be dumped at different frequencies some state +folders might contain more information than others. +This inherently prevents efficient memory reading. +The python version used here is slower than the original C-based version but +one therefore gains better portability accross operating systems.

    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/FemzipAPI/index.html b/femzip/FemzipAPI/index.html new file mode 100644 index 0000000..15b1be5 --- /dev/null +++ b/femzip/FemzipAPI/index.html @@ -0,0 +1,2646 @@ + + + + + + + + + + + + + + + + + + FemzipAPI - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    FemzipAPI

    + + +
    + + + +
    + + +

    FemzipAPI contains wrapper functions around the femzip library.

    + + + + + +
    + + + + + + + +
    + + + +

    +api: CDLL + + + property + + +

    + + +
    + +

    Returns the loaded, shared object library of the native interface

    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    shared_object_lib + CDLL +

    Loaded shared object library.

    +
    + +
    + + + +
    + + + +

    +close_current_file() + +

    + + +
    + +

    Closes the current file handle(use not recommended)

    +

    Notes

    +
    Closes a currently opened file by the API. There
    +is no arg because femzip can process only one file
    +at a time.
    +This can also be used in case of bugs.
    +
    + +

    Examples:

    +
    >>> api.close_current_file()
    +
    + +
    + +
    + +
    + + + +

    +copy_struct(src, dest) + + + staticmethod + + +

    + + +
    + +

    Copies all fields from src struct to dest

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    src + Structure +

    src struct

    + required +
    src + Structure +

    destination struct

    + required +
    + +

    Examples:

    +
    >>> err1 = FemzipError()
    +>>> err1.ier = -1
    +>>> err1.msg = b"Oops"
    +>>> err2 = FemzipError()
    +>>> api.copy_struct(err1, err2)
    +>>> err2.ier
    +-1
    +>>> err2.msg
    +b'Oops'
    +
    + +
    + +
    + +
    + + + +

    +get_buffer_info(filepath) + +

    + + +
    + +

    Get the dimensions of the buffers for femzip

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to femzip file

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    buffer_info + FemzipBufferInfo +

    c struct with infos about the memory required by femzip

    + +

    Examples:

    +
    >>> # read memory demand info first
    +>>> buffer_info = api.get_buffer_info(filepath)
    +>>> # buffer info is a c struct, but we can print it
    +>>> api.struct_to_dict(buffer_info)
    +{'n_timesteps': 12,
    +'timesteps': <lasso.femzip.femzip_api.LP_c_float object at 0x0000028A8F6B21C0>,
    +'size_geometry': 537125, 'size_state': 1462902, 'size_displacement': 147716,
    +'size_activity': 47385, 'size_post': 1266356, 'size_titles': 1448}
    +>>> for i_timestep in range(buffer_info.n_timesteps):
    +>>>     print(buffer_info.timesteps[i_timestep])
    +0.0
    +0.9998100399971008
    +1.9998900890350342
    +2.9999701976776123
    +3.9997801780700684
    +
    + +
    + +
    + +
    + + + +

    +get_femzip_status() + +

    + + +
    + +

    Check the status of the femzip api

    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    femzip_status + FemzipAPIStatus +

    c struct with info about femzip API

    +

    Notes

    +
    This reports whether a file is currently
    +opened and how far it was processed. This
    +internal state is used to avoid internal
    +conflicts and crashes, thus is useful for
    +debugging.
    +
    + +

    Examples:

    +
    >>> print(api.struct_to_dict(api.get_femzip_status()))
    +{'is_file_open': 0, 'is_geometry_read': 0, 'is_states_open': 0,
    +'i_timestep_state': -1, 'i_timestep_activity': -1}
    +
    + +
    + +
    + +
    + + + +

    +get_file_metadata(filepath) + +

    + + +
    + +

    Get infos about the femzip variables in the file

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to femzip file

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    file_metadata + FemzipFileMetadata +

    c struct with infos about the femzip file

    +

    Notes

    +
    This is for direct interaction with the C-API, thus should
    +not be used by users.
    +
    + +

    Examples:

    +
    >>> file_metadata = api.get_file_metadata("path/to/d3plot.fz")
    +>>> # print general internals
    +>>> api.struct_to_dict(file_metadata)
    +{'version_zip': 605.0, 'activity_flag': 1, 'number_of_variables': 535, ...}
    +
    +>>> # We can iterate the variable names contained in the file
    +>>> print(
    +    [file_metadata.variable_infos[i_var].name.decode("utf8").strip()
    +    for i_var in range(file_metadata.number_of_variables)]
    +)
    +['global', 'Parts: Energies and others', 'coordinates', 'velocities', ...]
    +
    + +
    + +
    + +
    + + + +

    +get_part_titles(filepath, buffer_info=None) + +

    + + +
    + +

    Get the part title section

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to femzip file

    + required +
    buffer_info + Union[None, FemzipBufferInfo] +

    buffer info if previously fetched

    + None +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    mview + memoryview +

    memory of the part title section

    + +
    + +
    + +
    + + + +

    +has_femunziplib_license() + +

    + + +
    + +

    Checks whether the extended libraries are available

    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    has_license + bool +
    + +

    Examples:

    +
    >>> api.has_femunziplib_license()
    +False
    +
    + +
    + +
    + +
    + + + +

    +is_femunzip_version_ok(filepath) + +

    + + +
    + +

    Checks if the femunzip version can be handled

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to the femzpi file

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    version_ok + bool +
    + +

    Examples:

    +
    >>> api.is_femunzip_version_ok("path/to/d3plot.fz")
    +True
    +
    + +
    + +
    + +
    + + + +

    +is_sidact_file(filepath) + +

    + + +
    + +

    Tests if a filepath points at a sidact file

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str + + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    is_sidact_file + bool +
    + +

    Examples:

    +
    >>> api.is_sidact_file("path/to/d3plot.fz")
    +True
    +>>> api.is_sidact_file("path/to/d3plot")
    +False
    +>>> api.is_sidact_file("path/to/non/existing/file")
    +False
    +
    + +
    + +
    + +
    + + + +

    +load_dynamic_library(path) + + + staticmethod + + +

    + + +
    + +

    Load a library and check for correct execution

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    path + str +

    path to the library

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    library + CDLL +

    loaded library

    + +
    + +
    + +
    + + + +

    +read_geometry(filepath, buffer_info=None, close_file=True) + +

    + + +
    + +

    Read the geometry buffer from femzip

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to femzpi file

    + required +
    buffer_info + Union[FemzipBufferInfo, None] +

    struct with info regarding required memory for femzip

    + None +
    close_file + bool +

    it is useful to leave the file open if +states are processed right afterwards

    + True +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    buffer + memoryview +

    memoryview of buffer

    +

    Notes

    +
    If the file isn't closed appropriately bugs and crashes
    +might occur.
    +
    + +

    Examples:

    +
    >>> mview = api.read_geometry(filepath, buffer_info)
    +
    + +
    + +
    + +
    + + + +

    +read_single_state(i_timestep, buffer_info, state_buffer=None) + +

    + + +
    + +

    Read a single state

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    i_timestep + int +

    timestep to be read

    + required +
    buffer_info + FemzipBufferInfo +

    infos about buffer sizes

    + required +
    state_buffer + Union[None, memoryview] +

    buffer in which the states are stored

    + None +
    +

    Notes

    +
    It is unclear to us why the state buffer needs to be given
    +in order to terminate state reading.
    +
    + +

    Examples:

    +
    >>> # get info about required memory
    +>>> buffer_info = api.get_buffer_info(filepath)
    +
    +>>> # first read geometry and leave file open
    +>>> mview_geom = api.read_geometry(filepath, buffer_info, False)
    +
    +>>> # now read a state
    +>>> mview_state = api.read_single_state(0, buffer_info=buffer_info)
    +
    +>>> # close file
    +>>> api.close_current_file()
    +
    + +
    + +
    + +
    + + + +

    +read_state_deletion_info(buffer_info, state_filter=None) + +

    + + +
    + +

    Get information which elements are alive

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    buffer_info + FemzipBufferInfo +

    infos about buffer sizes

    + required +
    state_filter + Union[Set[int], None] +

    usable to read only specific states

    + None +
    +

    Notes

    +
    The `buffer` must have the size of at least
    +`buffer_info.size_activity`.
    +
    + +

    Examples:

    +
    >>> # get info about required memory
    +>>> buffer_info = api.get_buffer_info(filepath)
    +
    +>>> # first read geometry and leave file open!
    +>>> mview_geom = api.read_geometry(filepath, buffer_info, False)
    +
    +>>> # now read deletion info
    +>>> array_deletion = api.read_state_activity(buffer_info)
    +
    +>>> # close file
    +>>> api.close_current_file()
    +
    + +
    + +
    + +
    + + + +

    +read_states(filepath, buffer_info=None, state_filter=None) + +

    + + +
    + +

    Reads all femzip state information

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    filepath + str +

    path to femzip file

    + required +
    buffer_info + Union[FemzipBufferInfo, None] +

    struct with info regarding required memory for femzip

    + None +
    state_filter + Union[Set[int], None] +

    usable to load only specific states

    + None +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    buffer + memoryview +

    buffer containing all state data

    + +

    Examples:

    +
    >>> buffer_info = api.get_buffer_info("path/to/d3plot.fz")
    +>>> array_states = api.read_states("path/to/d3plot.fz", buffer_info)
    +
    + +
    + +
    + +
    + + + +

    +read_variables(file_metadata, n_parts, n_rigid_walls, n_rigid_wall_vars, n_airbag_particles, n_airbags, state_filter=None) + +

    + + +
    + +

    Read specific variables from Femzip

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    file_metadata + FemzipFileMetadata +

    metadata of file including which variables to read

    + required +
    n_parts + int +

    number of parts in the file

    + required +
    n_rigid_walls + int +

    number of rigid walls

    + required +
    n_rigid_wall_vars + int +

    number of rigid wall variables

    + required +
    n_airbag_particles + int +

    number of airbag particles in the file

    + required +
    n_airbags + int + + required +
    state_filter + Union[Set[int], None] +

    used to read specific arrays

    + None +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    arrays + dict +

    dictionary with d3plot arrays

    + +
    + +
    + +
    + + + +

    +struct_to_dict(struct) + + + staticmethod + + +

    + + +
    + +

    Converts a ctypes struct into a dict

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    struct + Structure + + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    fields + Dict[str, Any] +

    struct as dict

    + +

    Examples:

    +
    >>> api.struct_to_dict(api.get_femzip_status())
    +{'is_file_open': 1, 'is_geometry_read': 1, 'is_states_open': 0,
    +'i_timestep_state': -1, 'i_timestep_activity': -1}
    +
    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/FemzipAPIStatus/index.html b/femzip/FemzipAPIStatus/index.html new file mode 100644 index 0000000..620b850 --- /dev/null +++ b/femzip/FemzipAPIStatus/index.html @@ -0,0 +1,1141 @@ + + + + + + + + + + + + + + + + + + FemzipAPIStatus - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    FemzipAPIStatus

    + + +
    + + + +
    +

    + Bases: Structure

    + + +

    This struct summarizes the state of the femzip API library. The library +has a shared, global state which is stored in static variables. The state +of the gloval vars is tracked by this struct.

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    is_file_open + c_int32 +

    Whether a femzip file is opened and being processed.

    is_geometry_read + c_int32 +

    Whether the geometry was already read.

    is_states_open + c_int32 +

    Whether processing of the states was started.

    i_timestep_state + c_int32 +

    Counter of timestep processing.

    i_timestep_activity + c_int32 +

    Counter of activity data for timesteps.

    + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/FemzipBufferInfo/index.html b/femzip/FemzipBufferInfo/index.html new file mode 100644 index 0000000..3249793 --- /dev/null +++ b/femzip/FemzipBufferInfo/index.html @@ -0,0 +1,1161 @@ + + + + + + + + + + + + + + + + + + FemzipBufferInfo - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    FemzipBufferInfo

    + + +
    + + + +
    +

    + Bases: Structure

    + + +

    This struct describes necessary buffer sizes for reading the file

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    n_timesteps + c_uint64 +

    Number of timesteps

    timesteps + POINTER(c_float) +

    Time for each timestep

    size_geometry + c_uint64 +

    Size of the geometry buffer

    size_state + c_uint64 +

    Size of the state buffer

    size_displacement + c_uint64 +

    Size for displacement array

    size_activity + c_uint64 +

    Size for activity array (deletion stuff)

    size_post + c_uint64 +

    Size of the post region of which I currently don't know anymore what it +was.

    size_titles + c_uint64 +

    Size of the titles region behind the geomtry.

    + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/FemzipError/index.html b/femzip/FemzipError/index.html new file mode 100644 index 0000000..5a062fd --- /dev/null +++ b/femzip/FemzipError/index.html @@ -0,0 +1,1118 @@ + + + + + + + + + + + + + + + + + + FemzipError - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    FemzipError

    + + +
    + + + +
    +

    + Bases: Structure

    + + +

    Struct representing femzip errors in c-code

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    ier + c_int32 +

    Error code

    msg + c_char_p +

    Error message

    + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/FemzipFileMetadata/index.html b/femzip/FemzipFileMetadata/index.html new file mode 100644 index 0000000..a04718a --- /dev/null +++ b/femzip/FemzipFileMetadata/index.html @@ -0,0 +1,1286 @@ + + + + + + + + + + + + + + + + + + FemzipFileMetadata - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    FemzipFileMetadata

    + + +
    + + + +
    +

    + Bases: Structure

    + + +

    This struct contains metadata about femzip files.

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    version_zip + c_float +
    activity_flag + c_int32 +
    number_of_variables + c_int32 +
    number_of_nodes + c_int32 +
    number_of_solid_elements + c_int32 +
    number_of_thick_shell_elements + c_int32 +
    number_of_1D_elements + c_int32 +
    number_of_tool_elements + c_int32 +
    number_of_shell_elements + c_int32 +
    number_of_solid_element_neighbors + c_int32 +
    number_of_rbe_element_neighbors + c_int32 +
    number_of_bar_elements + c_int32 +
    number_of_beam_elements + c_int32 +
    number_of_plotel_elements + c_int32 +
    number_of_spring_elements + c_int32 +
    number_of_damper_elements + c_int32 +
    number_of_joint_elements + c_int32 +
    number_of_joint_element_neighbors + c_int32 +
    number_of_bar_element_neighbors + c_int32 +
    number_of_beamcross_elements + c_int32 +
    number_of_spotweld_elements + c_int32 +
    number_of_rbe_elements + c_int32 +
    number_of_hexa20_elements + c_int32 +
    number_of_rigid_shell_elements + c_int32 +
    number_of_timesteps + c_int32 +
    variable_infos + POINTER(VariableInfo) +
    + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/FemzipVariableCategory/index.html b/femzip/FemzipVariableCategory/index.html new file mode 100644 index 0000000..3b64ff4 --- /dev/null +++ b/femzip/FemzipVariableCategory/index.html @@ -0,0 +1,1301 @@ + + + + + + + + + + + + + + + + + + FemzipVariableCategory - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    FemzipVariableCategory

    + + +
    + + + +
    +

    + Bases: enum.Enum

    + + +

    Enum for femzip variable categories

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    GEOMETRY + int +

    -5

    PART + int +

    -2

    GLOBAL + int +

    -1

    NODE + int +

    0

    SOLID + int +

    1

    THICK_SHELL + int +

    2

    BEAM + int +

    3

    TOOLS + int +

    4

    SHELL + int +

    5

    SPH + int +

    6

    FPM + int +

    7

    CFD + int +

    8

    CPM_FLOAT_VAR + int +

    9

    CPM_AIRBAG + int +

    10

    CPM_INT_VAR + int +

    11

    RADIOSS_STATE_DATA + int +

    12

    HEXA20 + int +

    13

    + + + + + +
    + + + + + + + + + +
    + + + +

    +from_int(number) + + + staticmethod + + +

    + + +
    + +

    Deserializes an integer into an enum

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    number + int +

    number to turn into an enum

    + required +
    + +

    Returns:

    + + + + + + + + + + + + + +
    Name TypeDescription
    enum_value + FemzipVariableCategory +
    + +
    + +
    + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/VariableInfo/index.html b/femzip/VariableInfo/index.html new file mode 100644 index 0000000..49235fe --- /dev/null +++ b/femzip/VariableInfo/index.html @@ -0,0 +1,1132 @@ + + + + + + + + + + + + + + + + + + VariableInfo - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    VariableInfo

    + + +
    + + + +
    +

    + Bases: Structure

    + + +

    Struct for details about a single femzip variable

    + +

    Attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    var_index + c_int32 +

    Index of the variable

    name + c_char_p +

    Name from femzip

    var_type + c_int32 +

    Variable type. See FemzipVariableCategory for translation.

    var_size + c_int32 +

    Array size of the field variable.

    + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/femzip/index.html b/femzip/index.html new file mode 100644 index 0000000..1ad9c3a --- /dev/null +++ b/femzip/index.html @@ -0,0 +1,1127 @@ + + + + + + + + + + + + + + + + + + Overview - LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Femzip

    +

    Documentation of the Femzip module. +The D3plot reader uses this module to access femzip file data through the femzip +API. +It also allows to decompress files directly or use some additional utility +functions such as a femzip file check if desired.

    +

    Example

    +
    >>> from lasso.femzip import FemzipAPI
    +>>> from ctypes import *
    +>>> filepath = "path/to/d3plot.fz"
    +
    +>>> # Initialize API
    +>>> api = FemzipAPI()
    +
    +

    Here we check if we can use the extended FEMZIP-API. +The extended FEMZIP-API allows reading selected arrays, but reqires a license +with the feature "FEMUNZIPLIB-DYNA", which can be attained from SIDACT or +femzip distributors.

    +
    >>> api.has_femunziplib_license()
    +True
    +
    +

    Check if a file is femzipped:

    +
    >>> # check if file is femzipped
    +>>> api.is_sidact_file(filepath)
    +True
    +
    +

    Check the file and library version. +This is usually not neccessary.

    +
    >>> api.is_femunzip_version_ok(filepath)
    +True
    +
    +

    It's efficient to get the memory demand for arrays beforehand and +hand this memory info to other functions. +It is often not mandatory though and a mere speedup.

    +
    >>> # read memory demand info first
    +>>> buffer_info = api.get_buffer_info(filepath)
    +>>> # buffer info is a c struct, but we can print it
    +>>> api.struct_to_dict(buffer_info)
    +{'n_timesteps': 12, 'timesteps': <lasso.femzip.femzip_api.LP_c_float object at 0x0000028A8F6B21C0>, 'size_geometry': 537125, 'size_state': 1462902, 'size_displacement': 147716, 'size_activity': 47385, 'size_post': 1266356, 'size_titles': 1448}
    +>>> for i_timestep in range(buffer_info.n_timesteps):
    +>>>     print(buffer_info.timesteps[i_timestep])
    +0.0
    +0.9998100399971008
    +1.9998900890350342
    +2.9999701976776123
    +3.9997801780700684
    +
    +

    Here we read the geometry buffer. +The file is kept open so that we can read states afterwards.

    +
    >>> mview = api.read_geometry(filepath, buffer_info, close_file=False)
    +
    +

    Femzip can handle only one file per process. +In case of issues close the current file (shown later). +We can check the API status as follows

    +
    >>> print(api.struct_to_dict(api.get_femzip_status()))
    +{'is_file_open': 1, 'is_geometry_read': 1, 'is_states_open': 0, 'i_timestep_state': -1, 'i_timestep_activity': -1}
    +
    +

    Get the memory of a single state. +Must start at 0. Femzip does not allow reading arbitrary states inbetween.

    +
    >>> mview = api.read_single_state(i_timestep=0, buffer_info=buffer_info)
    +
    +

    It is also possible to read the state memory directly into an already +allocated buffer.

    +
    >>> BufferType = c_float * (buffer_info.size_state)
    +>>> mview = memoryview(BufferType())
    +>>> api.read_single_state(1, buffer_info=buffer_info, state_buffer=mview)
    +
    +

    Let's close the file manually. +This ensures that femzip resets its internal state.

    +
    >>> api.close_current_file()
    +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/docs/icon-discord.png b/icon-discord.png similarity index 100% rename from docs/icon-discord.png rename to icon-discord.png diff --git a/docs/icon-home.png b/icon-home.png similarity index 100% rename from docs/icon-home.png rename to icon-home.png diff --git a/index.html b/index.html new file mode 100644 index 0000000..6904d81 --- /dev/null +++ b/index.html @@ -0,0 +1,1066 @@ + + + + + + + + + + + + + + + + + + LASSO-Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + + + + +

    Open LASSO Python

    +

    This python library is designed for general purpose usage in the field of +Computer Aided Engineering (CAE). +It's name originates from the original initiator and donator of the project +Lasso GmbH. +The library is now maintained by an open-source community.

    +

    Community

    +

    Join our open-source community on:

    +

    DISCORD +Discord

    +

    Installation

    +
    python -m pip install lasso-python
    +
    + + + + + + +
    +
    + + +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/docs/lasso-logo.png b/lasso-logo.png similarity index 100% rename from docs/lasso-logo.png rename to lasso-logo.png diff --git a/docs/ls-dyna_database_Apr2020.pdf b/ls-dyna_database_Apr2020.pdf similarity index 100% rename from docs/ls-dyna_database_Apr2020.pdf rename to ls-dyna_database_Apr2020.pdf diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 3d030e8..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,68 +0,0 @@ -site_name: LASSO-Python -site_url: https://open-lasso-python.github.io/lasso-python/ -repo_url: https://github.com/open-lasso-python/lasso-python - -theme: - name: material - -nav: - - Home: index.md - - Dyna: - - Overview: dyna/index.md - - D3plot: - - D3plot: dyna/D3plot.md - - ArrayType: dyna/ArrayType.md - - FilterType: dyna/FilterType.md - - D3plotHeader: dyna/D3plotHeader.md - - Binout: dyna/Binout.md - - Performance Info: dyna/performance_info.md - - Femzip: - - Overview: femzip/index.md - - FemzipAPI: femzip/FemzipAPI.md - - FemzipAPIStatus: femzip/FemzipAPIStatus.md - - FemzipBufferInfo: femzip/FemzipBufferInfo.md - - FemzipError: femzip/FemzipError.md - - FemzipFileMetadata: femzip/FemzipFileMetadata.md - - VariableInfo: femzip/VariableInfo.md - - FemzipVariableCategory: femzip/FemzipVariableCategory.md - - Dimensionality Reduction: - - Overview: dimred/index.md - - Command Line Tool: dimred/command_line_interface.md - - Code: - - DimredRun: dimred/DimredRun.md - - SVD: - - Description: dimred/svd.md - - subsampling_methods: dimred/subsampling_methods.md - - pod_functions: dimred/pod_functions.md - - clustering_betas: dimred/clustering_betas.md - - plot_beta_clusters: dimred/plot_beta_clusters.md - - KeywordTypes: dimred/KeywordTypes.md - - Diffcrash: - - Overview: diffcrash/index.md - - Command Line Tool: diffcrash/run.md - - Code: diffcrash/diffcrash_run.md - - Contribution Guide: contributing.md - - Code Coverage Report: coverage.md - - Changelog: changelog.md - -plugins: - - search - - mkdocstrings: - handlers: - python: - options: - docstring_style: numpy - show_source: false - - coverage - -extra_css: - - css/video.css - -markdown_extensions: - - admonition - # Code highlighting - - pymdownx.highlight: - anchor_linenums: true - - pymdownx.inlinehilite - - pymdownx.superfences - - pymdownx.snippets diff --git a/objects.inv b/objects.inv new file mode 100644 index 0000000..fba3826 Binary files /dev/null and b/objects.inv differ diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 54b2e78..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,112 +0,0 @@ -[project] -name = "lasso-python" -description = "An open-source CAE and Machine Learning library." -license-files = ["LICENSE.md"] -readme = "README.rst" -dynamic = ["version"] -authors = [{ name = "open-lasso-python", email = "open.lasso.python@gmail.com" }] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Topic :: Scientific/Engineering", - "Intended Audience :: Science/Research", - "Topic :: Utilities", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", -] - -requires-python = ">=3.11" -dependencies = [ - "h5py==3.*", - "scipy==1.*", - "numpy>2.2", - "plotly==5.*", - "psutil==5.*", - "rich==13.*", - "pandas==2.*", - "scikit_learn==1.*", -] - -[tool.setuptools] -package-dir = {"" = "src"} - -[project.scripts] -diffcrash = "lasso.diffcrash.run:main" -dimred = "lasso.dimred.run:main" - -[dependency-groups] -dev = [ - "pytest==8.*", - "pytest-cov==5.*", - "ruff==0.11.*", - "mkdocs==1.*", - "mkdocs-material==9.*", - "mkdocstrings[python]==0.*", - "mkdocs-coverage==1.*", - "git-changelog==2.*", - "twine==5.*", - "go-task-bin" -] - -[build-system] -requires = ["setuptools>=78", "setuptools-scm>=8"] -build-backend = "setuptools.build_meta" - -[tool.ruff] -required-version = "==0.11.*" -line-length = 100 -indent-width = 4 -preview = true - -# Output serialization format for violations. The default serialization -# format is "full" [env: RUFF_OUTPUT_FORMAT=] [possible values: -# concise, full, json, json-lines, junit, grouped, github, gitlab, -# pylint, rdjson, azure, sarif] -output-format = "grouped" - -[tool.ruff.lint] -isort.lines-after-imports = 2 -select = [ - "C", # Complexity checks (e.g., McCabe complexity, comprehensions) - # "ANN001", "ANN201", "ANN401", # flake8-annotations (required strict type annotations for public functions) - "S", # flake8-bandit (checks basic security issues in code) - # "BLE", # flake8-blind-except (checks the except blocks that do not specify exception) - # "FBT", # flake8-boolean-trap (ensure that boolean args can be used with kw only) - "E", # pycodestyle errors (PEP 8 style guide violations) - "W", # pycodestyle warnings (e.g., extra spaces, indentation issues) - # "DOC", # pydoclint issues (e.g., extra or missing return, yield, warnings) - "A", # flake8-buitins (check variable and function names to not shadow builtins) - "N", # Naming convention checks (e.g., PEP 8 variable and function names) - "F", # Pyflakes errors (e.g., unused imports, undefined variables) - "I", # isort (Ensures imports are sorted properly) - "B", # flake8-bugbear (Detects likely bugs and bad practices) - "TID", # flake8-tidy-imports (Checks for banned or misplaced imports) - "UP", # pyupgrade (Automatically updates old Python syntax) - "YTT", # flake8-2020 (Detects outdated Python 2/3 compatibility issues) - "FLY", # flynt (Converts old-style string formatting to f-strings) - "PIE", # flake8-pie - "NPY201", # numpy2-deprecations - # "PL", # pylint - # "RUF", # Ruff-specific rules (Additional optimizations and best practices) -] - -ignore = [ - "C90", # [mccabe](https://docs.astral.sh/ruff/rules/#mccabe-c90) - "PLR2004", # [magic-value-comparision](https://docs.astral.sh/ruff/rules/magic-value-comparison) - "S311", # [suspicious-non-cryptographic-random-usage](https://docs.astral.sh/ruff/rules/suspicious-non-cryptographic-random-usage/) - "S404", # [suspicious-subprocess-import](https://docs.astral.sh/ruff/rules/suspicious-subprocess-import/) - "S603", # [subprocess-without-shell-equals-true](https://docs.astral.sh/ruff/rules/subprocess-without-shell-equals-true/) - "UP007", # [non-pep604-annotation-union](https://docs.astral.sh/ruff/rules/non-pep604-annotation-union/#non-pep604-annotation-union-up007) -] - -[tool.ruff.lint.per-file-ignores] -# non-lowercase-variable-in-function (N806) -"{femzip_api,femzip_mapper,d3plot,}.py" = ["N806"] -# error-suffix-on-exception-name (N818) -"{femzip_api}.py" = ["N818"] - -[tool.ruff.format] -docstring-code-format = true -skip-magic-trailing-comma = true diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 0000000..c0cc0e9 --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Open LASSO Python This python library is designed for general purpose usage in the field of Computer Aided Engineering (CAE). It's name originates from the original initiator and donator of the project Lasso GmbH . The library is now maintained by an open-source community. Community Join our open-source community on: Discord Installation python -m pip install lasso-python","title":"Home"},{"location":"#open-lasso-python","text":"This python library is designed for general purpose usage in the field of Computer Aided Engineering (CAE). It's name originates from the original initiator and donator of the project Lasso GmbH . The library is now maintained by an open-source community.","title":"Open LASSO Python"},{"location":"#community","text":"Join our open-source community on: Discord","title":"Community"},{"location":"#installation","text":"python -m pip install lasso-python","title":"Installation"},{"location":"changelog/","text":"Unrealeased ( compare ) (2023-04-28) CI add deployment of docs to cd pipeline ( 2a8d0de ) Code Refactoring clean up gitignore ( 35ee429 ) migrate from sphinx to mkdocs ( 9e8d74a ) move project to poetry and address flake8 linting issues ( 5c05102 ) Docs add first contribution guide ( e2d3d4a )","title":"Changelog"},{"location":"changelog/#unrealeased-compare-2023-04-28","text":"","title":"Unrealeased (compare) (2023-04-28)"},{"location":"changelog/#ci","text":"add deployment of docs to cd pipeline ( 2a8d0de )","title":"CI"},{"location":"changelog/#code-refactoring","text":"clean up gitignore ( 35ee429 ) migrate from sphinx to mkdocs ( 9e8d74a ) move project to poetry and address flake8 linting issues ( 5c05102 )","title":"Code Refactoring"},{"location":"changelog/#docs","text":"add first contribution guide ( e2d3d4a )","title":"Docs"},{"location":"contributing/","text":"Open LASSO Python Contribution Guide Roles There are roughly two roles in which you can contribute: Contributors who just want to add changes from time to time Maintainers who oversee the repo, code themselves and review contribution before they can be merged Community The community can be found on discord . Nothing beats a good discussion about existing features, new features or ideas so jump right in. Spirit We are all learners, some in the early stage some in the later. In a code review, we take the patience to imaginarily sit down together and explain other people why something is recommended differently or how things are usually done in software or python. This often seems tedious at first but growing together is important for any kind of project which wants to grow itself. So no fear in case of lack of experience but bring your learning spirit. Samewise to any experienced developer, have patience and explain things. Take the opportunity to sit down together on discord. How to make a Contribution Tl;dr; Fork the open lasso python repository Clone the repo to your filesystem Install task Check out the develop branch Set up the repo for development through task setup Create a new branch from develop with the naming pattern feature/... Make changes, commit and push them Create a Pull Request in your for repo with target on the original repo Add as reviewer open-lasso-python/developers Wait for review patiently but you may nudge us a bit \ud83e\udef6 Perform a Squash Merge and give a reasonable commit message as : where branch_type is one of the categories below. You can fork the repo (1) by clicking on for in the top-right of the original repo. Cloning the repo (2) is traditionally done with git then of course. Task is required (3) since it is used to store complex commands such as testing, linting, build docs, etc. (4) All development activities originate from the develop branch in which all Pull Requests are finally merged again. To create a branch choose a respective naming pattern following the angular scheme: /- . Typical branch types are: feature for new features or if you got no clue what it is bugfix for \ud83d\udc1b-fixes ci for changes on the Continuous Integration pipeline docs for documentation related works refactor if the PR just does cleanup \ud83e\uddf9 and improves the code test for solely test-related work Don't take these too seriously but they ought to provide rough categories. They are also used in the commit message when you squash merge a PR where it is important! Install all dependencies otherwise obviously you can't code (5). After making changes and pushing your branch to your forked repo (7 & 8), open a Pull Request but make the target not develop in your fork but develop in the original repo (7). If not done automatically, add the maintainer group as reviewers (9). Enjoy a healthy code review but be a bit patient with time as people contribute voluntarily and may privately be occupied (10). After approval, perform a Squash Merge (11). A Squash Merge tosses away all the little, dirty commits we all do during development. What stays is the final merge commit message and please pay attention here to format it right. Why is this important? This is needed to automatically generate a reasonable changelog during releases. Thanks for contributing at this point. Go wild and have fun \ud83e\udd73","title":"Contribution Guide"},{"location":"contributing/#open-lasso-python-contribution-guide","text":"","title":"Open LASSO Python Contribution Guide"},{"location":"contributing/#roles","text":"There are roughly two roles in which you can contribute: Contributors who just want to add changes from time to time Maintainers who oversee the repo, code themselves and review contribution before they can be merged","title":"Roles"},{"location":"contributing/#community","text":"The community can be found on discord . Nothing beats a good discussion about existing features, new features or ideas so jump right in.","title":"Community"},{"location":"contributing/#spirit","text":"We are all learners, some in the early stage some in the later. In a code review, we take the patience to imaginarily sit down together and explain other people why something is recommended differently or how things are usually done in software or python. This often seems tedious at first but growing together is important for any kind of project which wants to grow itself. So no fear in case of lack of experience but bring your learning spirit. Samewise to any experienced developer, have patience and explain things. Take the opportunity to sit down together on discord.","title":"Spirit"},{"location":"contributing/#how-to-make-a-contribution","text":"Tl;dr; Fork the open lasso python repository Clone the repo to your filesystem Install task Check out the develop branch Set up the repo for development through task setup Create a new branch from develop with the naming pattern feature/... Make changes, commit and push them Create a Pull Request in your for repo with target on the original repo Add as reviewer open-lasso-python/developers Wait for review patiently but you may nudge us a bit \ud83e\udef6 Perform a Squash Merge and give a reasonable commit message as : where branch_type is one of the categories below. You can fork the repo (1) by clicking on for in the top-right of the original repo. Cloning the repo (2) is traditionally done with git then of course. Task is required (3) since it is used to store complex commands such as testing, linting, build docs, etc. (4) All development activities originate from the develop branch in which all Pull Requests are finally merged again. To create a branch choose a respective naming pattern following the angular scheme: /- . Typical branch types are: feature for new features or if you got no clue what it is bugfix for \ud83d\udc1b-fixes ci for changes on the Continuous Integration pipeline docs for documentation related works refactor if the PR just does cleanup \ud83e\uddf9 and improves the code test for solely test-related work Don't take these too seriously but they ought to provide rough categories. They are also used in the commit message when you squash merge a PR where it is important! Install all dependencies otherwise obviously you can't code (5). After making changes and pushing your branch to your forked repo (7 & 8), open a Pull Request but make the target not develop in your fork but develop in the original repo (7). If not done automatically, add the maintainer group as reviewers (9). Enjoy a healthy code review but be a bit patient with time as people contribute voluntarily and may privately be occupied (10). After approval, perform a Squash Merge (11). A Squash Merge tosses away all the little, dirty commits we all do during development. What stays is the final merge commit message and please pay attention here to format it right. Why is this important? This is needed to automatically generate a reasonable changelog during releases. Thanks for contributing at this point. Go wild and have fun \ud83e\udd73","title":"How to make a Contribution"},{"location":"diffcrash/diffcrash/","text":"lasso.diffcrash This is the diffcrash module, which consists of a command line utility as well as a class for writing scripts. Diffcrash is a software from Sidact which is designed for robustness analysis of simulation runs. It can be used as a set of independent executables or as a postprocessor plugin. Diffcrash itself must be licensed. Please therefore contact Sidact directly. This module makes running a Diffcrash analysis much easier. Command Line Utility Code","title":"Overview"},{"location":"diffcrash/diffcrash/#lassodiffcrash","text":"This is the diffcrash module, which consists of a command line utility as well as a class for writing scripts. Diffcrash is a software from Sidact which is designed for robustness analysis of simulation runs. It can be used as a set of independent executables or as a postprocessor plugin. Diffcrash itself must be licensed. Please therefore contact Sidact directly. This module makes running a Diffcrash analysis much easier. Command Line Utility Code","title":"lasso.diffcrash"},{"location":"diffcrash/diffcrash_run/","text":"DiffcrashRun This class can be used in order to automate diffcrash runs in a hopefully comfortable manner. Class for handling the settings of a diffcrash run __init__ ( project_dir , crash_code , reference_run , simulation_runs , exclude_runs , diffcrash_home = '' , use_id_mapping = False , config_file = None , parameter_file = None , n_processes = 1 , logfile_dir = None ) Object handling a diffcrash run Parameters: Name Type Description Default project_dir str directory to put all buffer files etc., in required crash_code str crash code to use. required reference_run str filepath to the reference run required simulation_runs typing . Sequence [ str ] patterns used to search for simulation runs required diffcrash_home str home directory of diffcrash installation. Uses environment variable DIFFCRASHHOME if not set. '' use_id_mapping bool whether to use id mapping instead of nearest neighbor mapping False config_file str filepath to a config file None parameter_file str filepath to the parameter file None n_processes int number of processes to spawn for worker pool 1 logfile_dir str directory to put logfiles in None check_if_logfiles_show_success ( pattern ) Check if a logfiles with given pattern show success Parameters: Name Type Description Default pattern str file pattern used to search for logfiles required Returns: Name Type Description messages List [ str ] list with messages of failed log checks clear_project_dir () Clears the entire project dir create_project_dirs () Creates all project relevant directores Notes Created dirs: - logfile_dir - project_dir is_logfile_successful ( logfile ) Checks if a logfile indicates a success Parameters: Name Type Description Default logfile str filepath to the logfile required Returns: Name Type Description success bool read_config_file ( config_file ) Read a diffcrash config file Parameters: Name Type Description Default config_file str path to the config file required Notes From the official diffcrash docs ... seriously. run_eigen ( pool ) Run diffcrash eigen Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required run_export ( pool ) Run diffcrash export Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required run_import ( pool ) Run diffcrash import of runs Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required run_math ( pool ) Run diffcrash math Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required run_matrix ( pool ) Run diffcrash matrix Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required run_merge ( pool ) Run diffcrash merge Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required run_setup ( pool ) Run diffcrash setup Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"Code"},{"location":"diffcrash/diffcrash_run/#diffcrashrun","text":"This class can be used in order to automate diffcrash runs in a hopefully comfortable manner. Class for handling the settings of a diffcrash run","title":"DiffcrashRun"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.__init__","text":"Object handling a diffcrash run Parameters: Name Type Description Default project_dir str directory to put all buffer files etc., in required crash_code str crash code to use. required reference_run str filepath to the reference run required simulation_runs typing . Sequence [ str ] patterns used to search for simulation runs required diffcrash_home str home directory of diffcrash installation. Uses environment variable DIFFCRASHHOME if not set. '' use_id_mapping bool whether to use id mapping instead of nearest neighbor mapping False config_file str filepath to a config file None parameter_file str filepath to the parameter file None n_processes int number of processes to spawn for worker pool 1 logfile_dir str directory to put logfiles in None","title":"__init__()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.check_if_logfiles_show_success","text":"Check if a logfiles with given pattern show success Parameters: Name Type Description Default pattern str file pattern used to search for logfiles required Returns: Name Type Description messages List [ str ] list with messages of failed log checks","title":"check_if_logfiles_show_success()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.clear_project_dir","text":"Clears the entire project dir","title":"clear_project_dir()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.create_project_dirs","text":"Creates all project relevant directores","title":"create_project_dirs()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.create_project_dirs--notes","text":"Created dirs: - logfile_dir - project_dir","title":"Notes"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.is_logfile_successful","text":"Checks if a logfile indicates a success Parameters: Name Type Description Default logfile str filepath to the logfile required Returns: Name Type Description success bool","title":"is_logfile_successful()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.read_config_file","text":"Read a diffcrash config file Parameters: Name Type Description Default config_file str path to the config file required","title":"read_config_file()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.read_config_file--notes","text":"From the official diffcrash docs ... seriously.","title":"Notes"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.run_eigen","text":"Run diffcrash eigen Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"run_eigen()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.run_export","text":"Run diffcrash export Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"run_export()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.run_import","text":"Run diffcrash import of runs Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"run_import()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.run_math","text":"Run diffcrash math Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"run_math()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.run_matrix","text":"Run diffcrash matrix Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"run_matrix()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.run_merge","text":"Run diffcrash merge Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"run_merge()"},{"location":"diffcrash/diffcrash_run/#lasso.diffcrash.diffcrash_run.DiffcrashRun.run_setup","text":"Run diffcrash setup Parameters: Name Type Description Default pool futures . ThreadPoolExecutor multiprocessing pool required","title":"run_setup()"},{"location":"diffcrash/run/","text":"Command Line Tool What is Diffcrash? Diffcrash is a software from Sidact which is designed for robustness analysis of simulation runs. It can be used as a set of independent executables or as a postprocessor plugin. Diffcrash itself must be licensed. Please therefore contact Sidact directly. This commmand line utility makes running a Diffcrash analysis much easier. How to use the utility? You can get the run info by performing: $ python -m lasso.diffcrash.run --help ==== D I F F C R A S H ==== an open lasso utility script usage: run.py [-h] --reference-run REFERENCE_RUN [--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]] --crash-code CRASH_CODE [--start-stage [START_STAGE]] [--end-stage [END_STAGE]] [--diffcrash-home [DIFFCRASH_HOME]] [--use-id-mapping [USE_ID_MAPPING]] [--project-dir [PROJECT_DIR]] [--config-file [CONFIG_FILE]] [--parameter-file [PARAMETER_FILE]] [--n-processes [N_PROCESSES]] [simulation_runs [simulation_runs ...]] Python utility script for Diffcrash. positional arguments: simulation_runs Simulation runs or patterns used to search for simulation runs. optional arguments: -h, --help show this help message and exit --reference-run REFERENCE_RUN filepath of the reference run. --exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]] Runs to exclude from the analysis. --crash-code CRASH_CODE Which crash code is used ('dyna', 'pam' or 'radioss'). --start-stage [START_STAGE] At which specific stage to start the analysis (SETUP, IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE). --end-stage [END_STAGE] At which specific stage to stop the analysis (SETUP, IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE). --diffcrash-home [DIFFCRASH_HOME] Home directory where Diffcrash is installed. Uses environment variable 'DIFFCRASHHOME' if unspecified. --use-id-mapping [USE_ID_MAPPING] Whether to use id-based mapping (default is nearest neighbour). --project-dir [PROJECT_DIR] Project dir to use for femzip. --config-file [CONFIG_FILE] Path to the config file. --parameter-file [PARAMETER_FILE] Path to the parameter file. --n-processes [N_PROCESSES] Number of processes to use (default: max-1). It is important to specify a --reference-run for the analysis. If the reference run is contained within the rest of the simulation_runs , it is automatically removed from that list. simulation_runs can be either tagged individually or by using placeholders for entire directories (e.g. '*.fz') and subdirectories (e.g. '/**/*.fz'). Warning Every run clears the project directory entirely! Example $ python -m lasso.diffcrash.run \\ $ --reference-run ./runs/run_1.fz \\ $ --crash-code dyna \\ $ --project-dir diffcrash_project \\ $ ./runs/*.fz ==== D I F F C R A S H ==== an open lasso utility script [/] diffcrash-home : /sw/Linux/diffcrash/V6.1.24 [/] project-dir : test-example-project [/] crash-code : dyna [/] reference-run : bus/run_1.fz [/] use-id-mapping : False [/] # simul.-files : 37 [/] # excluded files: 0 [/] config-file : None [!] Config file missing. Consider specifying the path with the option '--config-file'. [/] parameter-file : None [!] Parameter file missing. Consider specifying the path with the option '--parameter-file'. [/] n-processes : 4 ---- Running Routines ---- [\u2714] Running Setup ... done in 3.88s [\u2714] Running Imports ... done in 58.20s [\u2714] Running Math ... done in 56.22s [\u2714] Running Export ... done in 2.22s [\u2714] Running Matrix ... done in 9.78s [\u2714] Running Eigen ... done in 0.46s [\u2714] Running Merge ... done in 23.29s","title":"Command Line Tool"},{"location":"diffcrash/run/#command-line-tool","text":"","title":"Command Line Tool"},{"location":"diffcrash/run/#what-is-diffcrash","text":"Diffcrash is a software from Sidact which is designed for robustness analysis of simulation runs. It can be used as a set of independent executables or as a postprocessor plugin. Diffcrash itself must be licensed. Please therefore contact Sidact directly. This commmand line utility makes running a Diffcrash analysis much easier.","title":"What is Diffcrash?"},{"location":"diffcrash/run/#how-to-use-the-utility","text":"You can get the run info by performing: $ python -m lasso.diffcrash.run --help ==== D I F F C R A S H ==== an open lasso utility script usage: run.py [-h] --reference-run REFERENCE_RUN [--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]] --crash-code CRASH_CODE [--start-stage [START_STAGE]] [--end-stage [END_STAGE]] [--diffcrash-home [DIFFCRASH_HOME]] [--use-id-mapping [USE_ID_MAPPING]] [--project-dir [PROJECT_DIR]] [--config-file [CONFIG_FILE]] [--parameter-file [PARAMETER_FILE]] [--n-processes [N_PROCESSES]] [simulation_runs [simulation_runs ...]] Python utility script for Diffcrash. positional arguments: simulation_runs Simulation runs or patterns used to search for simulation runs. optional arguments: -h, --help show this help message and exit --reference-run REFERENCE_RUN filepath of the reference run. --exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]] Runs to exclude from the analysis. --crash-code CRASH_CODE Which crash code is used ('dyna', 'pam' or 'radioss'). --start-stage [START_STAGE] At which specific stage to start the analysis (SETUP, IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE). --end-stage [END_STAGE] At which specific stage to stop the analysis (SETUP, IMPORT, MATH, EXPORT, MATRIX, EIGEN, MERGE). --diffcrash-home [DIFFCRASH_HOME] Home directory where Diffcrash is installed. Uses environment variable 'DIFFCRASHHOME' if unspecified. --use-id-mapping [USE_ID_MAPPING] Whether to use id-based mapping (default is nearest neighbour). --project-dir [PROJECT_DIR] Project dir to use for femzip. --config-file [CONFIG_FILE] Path to the config file. --parameter-file [PARAMETER_FILE] Path to the parameter file. --n-processes [N_PROCESSES] Number of processes to use (default: max-1). It is important to specify a --reference-run for the analysis. If the reference run is contained within the rest of the simulation_runs , it is automatically removed from that list. simulation_runs can be either tagged individually or by using placeholders for entire directories (e.g. '*.fz') and subdirectories (e.g. '/**/*.fz'). Warning Every run clears the project directory entirely!","title":"How to use the utility?"},{"location":"diffcrash/run/#example","text":"$ python -m lasso.diffcrash.run \\ $ --reference-run ./runs/run_1.fz \\ $ --crash-code dyna \\ $ --project-dir diffcrash_project \\ $ ./runs/*.fz ==== D I F F C R A S H ==== an open lasso utility script [/] diffcrash-home : /sw/Linux/diffcrash/V6.1.24 [/] project-dir : test-example-project [/] crash-code : dyna [/] reference-run : bus/run_1.fz [/] use-id-mapping : False [/] # simul.-files : 37 [/] # excluded files: 0 [/] config-file : None [!] Config file missing. Consider specifying the path with the option '--config-file'. [/] parameter-file : None [!] Parameter file missing. Consider specifying the path with the option '--parameter-file'. [/] n-processes : 4 ---- Running Routines ---- [\u2714] Running Setup ... done in 3.88s [\u2714] Running Imports ... done in 58.20s [\u2714] Running Math ... done in 56.22s [\u2714] Running Export ... done in 2.22s [\u2714] Running Matrix ... done in 9.78s [\u2714] Running Eigen ... done in 0.46s [\u2714] Running Merge ... done in 23.29s","title":"Example"},{"location":"dimred/","text":"lasso.dimred The dimred module consists of a command line utility as well as several classes to reduce the dimensionality of D3plots and visualize the results.","title":"Overview"},{"location":"dimred/#lassodimred","text":"The dimred module consists of a command line utility as well as several classes to reduce the dimensionality of D3plots and visualize the results.","title":"lasso.dimred"},{"location":"dimred/DimredRun/","text":"DimredRun This class can be used in order to comfortably represent multiple D3plot samples in a 3D graph through dimensionality reduction. In the 3D graph every simulation is a data point and the closeness of the data points represents the similarity of the result field. It offers functions to: Subsample simulations to reduce the computational effort and account for different meshing. Reduce order which is the black magic reducing complex field results to a few numbers which can then be plotted in 3D. Clustering with sklearn to group simulations semi-automatically (mostly just a visual feature). Output 3D similarity plot as a webpage For ease of use, check out the Tool section, which explains the command line tool for this dimensionality reduction feature. Class to control and run the dimensionality reduction process __init__ ( simulation_runs , start_stage , end_stage , project_dir , html_name = '3d-beta-plot' , html_set_timestamp = False , reference_run = None , console = None , img_path = None , exclude_runs = None , logfile_filepath = None , n_processes = 1 , part_id_filter = None , timestep =- 1 , show_output = True , cluster_args = None , outlier_args = None ) Class handling a dimensionality reduction Parameters: Name Type Description Default simulation_runs Sequence [ str ] simulation runs to analyze required start_stage str where to start required end_stage str where to stop required project_dir Union [None, str ] required project directory for creation of buffer files. Allows restart in between. required html_name str Name of the output .html file '3d-beta-plot' html_set_timestamp bool If true, the output .html will include a timestamp (hh_mm_ss) at the end of the filename False reference_run str filepath to the reference run. If not set, first entry in simulation_runs will be used as reference run. None console Union [ Console , None] Console for information printing and logging. Rich offers pretty text printing, syntax highlighting etc. None img_path Union [None, str ] optional image directory to show images in visualization. None exclude_runs Union [None, Sequence [ str ]] optional list of runs to exclude from processing None logfile_filepath Union [ str , None] path of the log file (always appends) None n_processes int number of processes to use during execution 1 part_id_filter Union [None, Sequence [ int ]] which part ids to process None timestep int specifies timestep to analyze in clustering and show in output visualization -1 show_output bool Set to false not to show the output html in the browser True cluster_args Union [None, Sequence [ str ]] Arguments for cluster algorithm None outlier_args Union [None, Sequence [ str ]] Arguments for outlier detection algorithm None Notes Using a project directory allows to restart stages of the entire process. process_reference_run () Process the reference run subsample_to_reference_run () Subsamples all runs dimension_reduction_svd () Calculate V_ROB and Betas clustering_results () clustering results visualize_results () creates an output .html file","title":"DimredRun"},{"location":"dimred/DimredRun/#dimredrun","text":"This class can be used in order to comfortably represent multiple D3plot samples in a 3D graph through dimensionality reduction. In the 3D graph every simulation is a data point and the closeness of the data points represents the similarity of the result field. It offers functions to: Subsample simulations to reduce the computational effort and account for different meshing. Reduce order which is the black magic reducing complex field results to a few numbers which can then be plotted in 3D. Clustering with sklearn to group simulations semi-automatically (mostly just a visual feature). Output 3D similarity plot as a webpage For ease of use, check out the Tool section, which explains the command line tool for this dimensionality reduction feature. Class to control and run the dimensionality reduction process","title":"DimredRun"},{"location":"dimred/DimredRun/#lasso.dimred.dimred_run.DimredRun.__init__","text":"Class handling a dimensionality reduction Parameters: Name Type Description Default simulation_runs Sequence [ str ] simulation runs to analyze required start_stage str where to start required end_stage str where to stop required project_dir Union [None, str ] required project directory for creation of buffer files. Allows restart in between. required html_name str Name of the output .html file '3d-beta-plot' html_set_timestamp bool If true, the output .html will include a timestamp (hh_mm_ss) at the end of the filename False reference_run str filepath to the reference run. If not set, first entry in simulation_runs will be used as reference run. None console Union [ Console , None] Console for information printing and logging. Rich offers pretty text printing, syntax highlighting etc. None img_path Union [None, str ] optional image directory to show images in visualization. None exclude_runs Union [None, Sequence [ str ]] optional list of runs to exclude from processing None logfile_filepath Union [ str , None] path of the log file (always appends) None n_processes int number of processes to use during execution 1 part_id_filter Union [None, Sequence [ int ]] which part ids to process None timestep int specifies timestep to analyze in clustering and show in output visualization -1 show_output bool Set to false not to show the output html in the browser True cluster_args Union [None, Sequence [ str ]] Arguments for cluster algorithm None outlier_args Union [None, Sequence [ str ]] Arguments for outlier detection algorithm None","title":"__init__()"},{"location":"dimred/DimredRun/#lasso.dimred.dimred_run.DimredRun.__init__--notes","text":"Using a project directory allows to restart stages of the entire process.","title":"Notes"},{"location":"dimred/DimredRun/#lasso.dimred.dimred_run.DimredRun.process_reference_run","text":"Process the reference run","title":"process_reference_run()"},{"location":"dimred/DimredRun/#lasso.dimred.dimred_run.DimredRun.subsample_to_reference_run","text":"Subsamples all runs","title":"subsample_to_reference_run()"},{"location":"dimred/DimredRun/#lasso.dimred.dimred_run.DimredRun.dimension_reduction_svd","text":"Calculate V_ROB and Betas","title":"dimension_reduction_svd()"},{"location":"dimred/DimredRun/#lasso.dimred.dimred_run.DimredRun.clustering_results","text":"clustering results","title":"clustering_results()"},{"location":"dimred/DimredRun/#lasso.dimred.dimred_run.DimredRun.visualize_results","text":"creates an output .html file","title":"visualize_results()"},{"location":"dimred/KeywordTypes/","text":"Keyword Types Keywords for using the clustering_betas {.interpreted-text role=\"doc\"} functions. ClusterType Specifies names of specific clustering algorithms Attributes: Name Type Description OPTICS str OPTICS DBSCAN str DBSCAN KMeans str KMeans SpectralClustering str SpectralClustering get_cluster_type_name () staticmethod Get the name of the clustering algorithms DetectorType Specifies names of different outlier detector algorythms Attributes: Name Type Description IsolationForest str IsolationForest OneClassSVM str OneClassSVM LocalOutlierFactor str LocalOutlierFactor get_detector_type_name () staticmethod Get the name of the detector algorithms","title":"KeywordTypes"},{"location":"dimred/KeywordTypes/#keyword-types","text":"Keywords for using the clustering_betas {.interpreted-text role=\"doc\"} functions.","title":"Keyword Types"},{"location":"dimred/KeywordTypes/#lasso.dimred.svd.keyword_types.ClusterType","text":"Specifies names of specific clustering algorithms Attributes: Name Type Description OPTICS str OPTICS DBSCAN str DBSCAN KMeans str KMeans SpectralClustering str SpectralClustering","title":"ClusterType"},{"location":"dimred/KeywordTypes/#lasso.dimred.svd.keyword_types.ClusterType.get_cluster_type_name","text":"Get the name of the clustering algorithms","title":"get_cluster_type_name()"},{"location":"dimred/KeywordTypes/#lasso.dimred.svd.keyword_types.DetectorType","text":"Specifies names of different outlier detector algorythms Attributes: Name Type Description IsolationForest str IsolationForest OneClassSVM str OneClassSVM LocalOutlierFactor str LocalOutlierFactor","title":"DetectorType"},{"location":"dimred/KeywordTypes/#lasso.dimred.svd.keyword_types.DetectorType.get_detector_type_name","text":"Get the name of the detector algorithms","title":"get_detector_type_name()"},{"location":"dimred/clustering_betas/","text":"Clustering Betas Methods that apply different clustering and outlier detection algorithms. Offers additional functions to convert console command arguments into variables to use in the function. Warning This function is optimized to be used by the console commandline tool group_betas ( beta_index , betas , scale_betas = False , cluster = None , detector = None , cluster_params = None , detector_params = None ) Base function to to group betas into groups, detect outliers. Provides that all different clustering and outlier detection algorythms are implemented in an easy to access environment. To select different clustering and outlier detection algoyrthms, please use appropriate KeywordTypes. A description of each function can be accessed with document_algorythm(keyword) A list of all functions can be accessed with list_detectors_and_clusters() Parameters: Name Type Description Default beta_index Array containing the file names specific to the betas with the same index in the beta array required betas Numpy array containing the betas. Betas are expected to be of shape (samples, timestep, 3) The three entries per beta can either be dimesnions (x,y,z) or any three betas/eigenvalues required cluster String specifying which clustering algorythm shall be applied. Use ClusterTypefor easier access None detector String specifying which outlier detection algorythm shall be applied. Use DetectorType for easier access None cluster_params Dictionary containing parameters for the clustering algorythms. See the sklearn documentation for the function to learn more. None detector_params Dictionary containing parameters for the outlier detection algorythms. See the sklearn documentation for the function to learn more None Returns: Name Type Description beta_clusters list List containing Numpy Arrays of betas in one cluster. If a detector was selected, or the clustering algorythm has its own outlier detection, the first entry in the list will be oultier betas id_clusters list List containing lists of beta ids. Each id corresponds to the beta in the same place in the beta_clusters list err_msg str Error message if wrong keywords for detector or cluster algorithms were used Notes document_algorithm: Prints docstring of each function into console list_detectors_and_clusters: Prints out all detection and clustering algorythms into console Sklearn Userguide chapter 2.3 Clustering: https://scikit-learn.org/stable/modules/clustering.html Detailed overview of different clustering algorythms Sklearn Examples outlier detection: https://scikit-learn.org/stable/auto_examples/plot_anomaly_comparison.html Example of different used outlier detection algorythms create_cluster_arg_dict ( args ) Determines which cluster to use and creates a python dictionary to use as cluster_params Parameters: Name Type Description Default args Sequence [ str ] List of strings containing parameters and arguments required Returns: Name Type Description cluster_type str determines which cluster algorithm to use cluster_arg_dict dict dictionary containing arguments and values for specific cluster_type err_msg str message containing error, mostly unrecognised keywords create_detector_arg_dict ( args ) Determines which detector to use and creates a python dictionary to use as detector_params Parameters: Name Type Description Default args Sequence [ str ] List of strings containing parameters and arguments required Returns: Name Type Description detector_type str determines which cluster algorithm to use detector_arg_dict dict dictionary containing arguments and values for specific cluster_type err_mgs str message containing error, mostly unrecognised keywords","title":"clustering_betas"},{"location":"dimred/clustering_betas/#clustering-betas","text":"Methods that apply different clustering and outlier detection algorithms. Offers additional functions to convert console command arguments into variables to use in the function. Warning This function is optimized to be used by the console commandline tool","title":"Clustering Betas"},{"location":"dimred/clustering_betas/#lasso.dimred.svd.clustering_betas.group_betas","text":"Base function to to group betas into groups, detect outliers. Provides that all different clustering and outlier detection algorythms are implemented in an easy to access environment. To select different clustering and outlier detection algoyrthms, please use appropriate KeywordTypes. A description of each function can be accessed with document_algorythm(keyword) A list of all functions can be accessed with list_detectors_and_clusters() Parameters: Name Type Description Default beta_index Array containing the file names specific to the betas with the same index in the beta array required betas Numpy array containing the betas. Betas are expected to be of shape (samples, timestep, 3) The three entries per beta can either be dimesnions (x,y,z) or any three betas/eigenvalues required cluster String specifying which clustering algorythm shall be applied. Use ClusterTypefor easier access None detector String specifying which outlier detection algorythm shall be applied. Use DetectorType for easier access None cluster_params Dictionary containing parameters for the clustering algorythms. See the sklearn documentation for the function to learn more. None detector_params Dictionary containing parameters for the outlier detection algorythms. See the sklearn documentation for the function to learn more None Returns: Name Type Description beta_clusters list List containing Numpy Arrays of betas in one cluster. If a detector was selected, or the clustering algorythm has its own outlier detection, the first entry in the list will be oultier betas id_clusters list List containing lists of beta ids. Each id corresponds to the beta in the same place in the beta_clusters list err_msg str Error message if wrong keywords for detector or cluster algorithms were used","title":"group_betas()"},{"location":"dimred/clustering_betas/#lasso.dimred.svd.clustering_betas.group_betas--notes","text":"document_algorithm: Prints docstring of each function into console list_detectors_and_clusters: Prints out all detection and clustering algorythms into console Sklearn Userguide chapter 2.3 Clustering: https://scikit-learn.org/stable/modules/clustering.html Detailed overview of different clustering algorythms Sklearn Examples outlier detection: https://scikit-learn.org/stable/auto_examples/plot_anomaly_comparison.html Example of different used outlier detection algorythms","title":"Notes"},{"location":"dimred/clustering_betas/#lasso.dimred.svd.clustering_betas.create_cluster_arg_dict","text":"Determines which cluster to use and creates a python dictionary to use as cluster_params Parameters: Name Type Description Default args Sequence [ str ] List of strings containing parameters and arguments required Returns: Name Type Description cluster_type str determines which cluster algorithm to use cluster_arg_dict dict dictionary containing arguments and values for specific cluster_type err_msg str message containing error, mostly unrecognised keywords","title":"create_cluster_arg_dict()"},{"location":"dimred/clustering_betas/#lasso.dimred.svd.clustering_betas.create_detector_arg_dict","text":"Determines which detector to use and creates a python dictionary to use as detector_params Parameters: Name Type Description Default args Sequence [ str ] List of strings containing parameters and arguments required Returns: Name Type Description detector_type str determines which cluster algorithm to use detector_arg_dict dict dictionary containing arguments and values for specific cluster_type err_mgs str message containing error, mostly unrecognised keywords","title":"create_detector_arg_dict()"},{"location":"dimred/command_line_interface/","text":"Command-Line Tool What does this command-line tool do? This command-line tool creates compact overviews over tens, hundreds or even thousands of simulation runs. This is done by performing an unsupervised learning method on the displacement field of the simulations. The result is a report in the form of a 3D plot. Every point in the plot is a simulation result. If two points are very close their simulation results are also expected to be very similar. One can confirm by using images from every simulation (there is an option to specify the path to a folder with those images). Example Visualization Report This is a plot for dimensionality reduction of a rail getting crushed. This plot has many detail levels. Check out the following facts: There are two groups. The small group stands for samples buckling bottom . The big group represents buckling in the top area. There are two outliers Sample 143 is folding in the top and bottom. Sample 99 is folding in the middle. Similarity Axis The similarity axis X describes buckling top or bottom The similarity axis Y describes how much a sample gets compressed The samples are basically in a plane. The out of plane axis represents buckling not strictly top but also slightly in the lower end (zoom in). .navClosed { background-color: white; transition: 0.5s; display: flex; flex-direction: row; align-content: center; width: 100%; margin-bottom: 100px; } #plotDiv { width: 70%; } .imgDiv { width: 50%; display: flex; justify-content: center; align-items: center; } img.hoverIMG { /* height: 550px; */ } path = \"https://www.lasso.de/fileadmin/ressources/ml-embedding-images/\" imgType = \"png\" const plotDiv = document.getElementById(\"plotDiv\") function initDocument(){ /* const userWidth = plotDiv.offsetWidth / 2 const userHeight = \"550px\" plotDiv.style = `width: ${Math.floor( userWidth * 0.65) - 10}px; height: ${userHeight-30}px; z-index: 10;` plotDiv.style = `width: ${Math.floor( userWidth * 0.25) - 10}px; height: ${userHeight-30}px; z-index: 1;` */ } function resizeContents(){ /* let userWidth = plotDiv.offsetWidth / 2 const userHeight = \"550px\" plotDiv.style = `width: ${Math.floor( userWidth * 0.65) - 10}px; height: ${userHeight-30}px; z-index: 10;` plotDiv.style = `width: ${Math.floor( userWidth * 0.25) - 10}px; height: ${userHeight-30}px: z-index: 1;` Plotly.Plots.resize(plotDiv) */ } initDocument() const runIDs = [['1000', '100', '101', '102', '103', '104', '105', '106', '107', '108', '109', '10', '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '11', '120', '121', '122', '123', '124', '125', '126', '127', '128', '129', '12', '130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '13', '140', '141', '142', '143', '144', '145', '146', '147', '148', '149', '14', '150', '151', '152', '153', '154', '155', '156', '157', '158', '159', '15', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169', '16', '170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '17', '180', '181', '182', '183', '184', '185', '186', '187', '188', '189', '18', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '19', '200', '201', '202', '203', '204', '205', '206', '207', '208', '209', '20', '210', '211', '212', '213', '214', '215', '216', '217', '218', '219', '21', '220', '221', '222', '223', '224', '225', '226', '227', '228', '229', '22', '230', '231', '232', '233', '234', '235', '236', '237', '238', '239', '23', '240', '241', '242', '243', '244', '245', '246', '247', '248', '249', '24', '250', '251', '252', '253', '254', '255', '256', '257', '258', '259', '25', '260', '261', '262', '263', '264', '265', '266', '267', '268', '269', '26', '270', '271', '272', '273', '274', '275', '276', '277', '278', '279', '27', '280', '281', '282', '283', '284', '285', '286', '287', '288', '289', '28', '290', '291', '292', '293', '294', '295', '296', '297', '298', '299', '29', '2', '300', '301', '302', '303', '304', '305', '306', '307', '308', '309', '30', '310', '311', '312', '313', '314', '315', '316', '317', '318', '319', '31', '320', '321', '322', '323', '324', '325', '326', '327', '328', '329', '32', '330', '331', '332', '333', '334', '335', '336', '337', '338', '339', '33', '340', '341', '342', '343', '344', '345', '346', '347', '348', '349', '34', '350', '351', '352', '353', '354', '355', '356', '357', '358', '359', '35', '360', '361', '362', '363', '364', '365', '366', '367', '368', '369', '36', '370', '371', '372', '373', '374', '375', '376', '377', '378', '379', '37', '380', '381', '382', '383', '384', '385', '386', '387', '388', '389', '38', '390', '391', '392', '393', '394', '395', '396', '397', '398', '399', '39', '3', '400', '401', '402', '403', '404', '405', '406', '407', '408', '409', '40', '410', '411', '412', '413', '414', '415', '416', '417', '418', '419', '41', '420', '421', '422', '423', '424', '425', '426', '427', '428', '429', '42', '430', '431', '432', '433', '434', '435', '436', '437', '438', '439', '43', '440', '441', '442', '443', '444', '445', '446', '447', '448', '449', '44', '450', '451', '452', '453', '454', '455', '456', '457', '458', '459', '45', '460', '461', '462', '463', '464', '465', '466', '467', '468', '469', '46', '470', '471', '472', '473', '474', '475', '476', '477', '478', '479', '47', '480', '481', '482', '483', '484', '485', '486', '487', '488', '489', '48', '490', '491', '492', '493', '494', '495', '496', '497', '498', '499', '49', '4', '500', '501', '502', '503', '504', '505', '506', '507', '508', '509', '50', '510', '511', '512', '513', '514', '515', '516', '517', '518', '519', '51', '520', '521', '522', '523', '524', '525', '526', '527', '528', '529', '52', '530', '531', '532', '533', '534', '535', '536', '537', '538', '539', '53', '540', '541', '542', '543', '544', '545', '546', '547', '548', '549', '54', '550', '551', '552', '553', '554', '555', '556', '557', '558', '559', '55', '560', '561', '562', '563', '564', '565', '566', '567', '568', '569', '56', '570', '571', '572', '573', '574', '575', '576', '577', '578', '579', '57', '580', '581', '582', '583', '584', '585', '586', '587', '588', '589', '58', '590', '591', '592', '593', '594', '595', '596', '597', '598', '599', '59', '5', '600', '601', '602', '603', '604', '605', '606', '607', '608', '609', '60', '610', '611', '612', '613', '614', '615', '616', '617', '618', '619', '61', '620', '621', '622', '623', '624', '625', '626', '627', '628', '629', '62', '630', '631', '632', '633', '634', '635', '636', '637', '638', '639', '63', '640', '641', '642', '643', '644', '645', '646', '647', '648', '649', '64', '650', '651', '652', '653', '654', '655', '656', '657', '658', '659', '65', '660', '661', '662', '663', '664', '665', '666', '667', '668', '669', '66', '670', '671', '672', '673', '674', '675', '676', '677', '678', '679', '67', '680', '681', '682', '683', '684', '685', '686', '687', '688', '689', '68', '690', '691', '692', '693', '694', '695', '696', '697', '698', '699', '69', '6', '700', '701', '702', '703', '704', '705', '706', '707', '708', '709', '70', '710', '711', '712', '713', '714', '715', '716', '717', '718', '719', '71', '720', '721', '722', '723', '724', '725', '726', '727', '728', '729', '72', '730', '731', '732', '733', '734', '735', '736', '737', '738', '739', '73', '740', '741', '742', '743', '744', '745', '746', '747', '748', '749', '74', '750', '751', '752', '753', '754', '755', '756', '757', '758', '759', '75', '760', '761', '762', '763', '764', '765', '766', '767', '768', '769', '76', '770', '771', '772', '773', '774', '775', '776', '777', '778', '779', '77', '780', '781', '782', '783', '784', '785', '786', '787', '788', '789', '78', '790', '791', '792', '793', '794', '795', '796', '797', '798', '799', '79', '7', '800', '801', '802', '803', '804', '805', '806', '807', '808', '809', '80', '810', '811', '812', '813', '814', '815', '816', '817', '818', '819', '81', '820', '821', '822', '823', '824', '825', '826', '827', '828', '829', '82', '830', '831', '832', '833', '834', '835', '836', '837', '838', '839', '83', '840', '841', '842', '843', '844', '845', '846', '847', '848', '849', '84', '850', '851', '852', '853', '854', '855', '856', '857', '858', '859', '85', '860', '861', '862', '863', '864', '865', '866', '867', '868', '869', '86', '870', '871', '872', '873', '874', '875', '876', '877', '878', '879', '87', '880', '881', '882', '883', '884', '885', '886', '887', '888', '889', '88', '890', '891', '892', '893', '894', '895', '896', '897', '898', '899', '89', '8', '900', '901', '902', '903', '904', '905', '906', '907', '908', '909', '90', '910', '911', '912', '913', '914', '915', '916', '917', '918', '919', '91', '920', '921', '922', '923', '924', '925', '926', '927', '928', '929', '92', '930', '931', '932', '933', '934', '935', '936', '937', '938', '939', '93', '940', '941', '942', '943', '944', '945', '946', '947', '948', '949', '94', '950', '951', '952', '953', '954', '955', '956', '957', '958', '959', '95', '960', '961', '962', '963', '964', '965', '966', '967', '968', '969', '96', '970', '971', '972', '973', '974', '975', '976', '977', '978', '979', '97', '980', '981', '982', '983', '984', '985', '986', '987', '988', '989', '98', '990', '991', '992', '993', '994', '995', '996', '997', '998', '999', '99', '9']] trace0 = { type: 'scatter3d', name: 'cluster 0', mode: 'markers', marker: { color: '#17becf', colorscale: 'Jet', size: 5.5, line: { width: 0.5, color: 'rgb(220, 220, 220)', }, }, hoverinfo: 'text', text: ['sample1000.fz', 'sample100.fz', 'sample101.fz', 'sample102.fz', 'sample103.fz', 'sample104.fz', 'sample105.fz', 'sample106.fz', 'sample107.fz', 'sample108.fz', 'sample109.fz', 'sample10.fz', 'sample110.fz', 'sample111.fz', 'sample112.fz', 'sample113.fz', 'sample114.fz', 'sample115.fz', 'sample116.fz', 'sample117.fz', 'sample118.fz', 'sample119.fz', 'sample11.fz', 'sample120.fz', 'sample121.fz', 'sample122.fz', 'sample123.fz', 'sample124.fz', 'sample125.fz', 'sample126.fz', 'sample127.fz', 'sample128.fz', 'sample129.fz', 'sample12.fz', 'sample130.fz', 'sample131.fz', 'sample132.fz', 'sample133.fz', 'sample134.fz', 'sample135.fz', 'sample136.fz', 'sample137.fz', 'sample138.fz', 'sample139.fz', 'sample13.fz', 'sample140.fz', 'sample141.fz', 'sample142.fz', 'sample143.fz', 'sample144.fz', 'sample145.fz', 'sample146.fz', 'sample147.fz', 'sample148.fz', 'sample149.fz', 'sample14.fz', 'sample150.fz', 'sample151.fz', 'sample152.fz', 'sample153.fz', 'sample154.fz', 'sample155.fz', 'sample156.fz', 'sample157.fz', 'sample158.fz', 'sample159.fz', 'sample15.fz', 'sample160.fz', 'sample161.fz', 'sample162.fz', 'sample163.fz', 'sample164.fz', 'sample165.fz', 'sample166.fz', 'sample167.fz', 'sample168.fz', 'sample169.fz', 'sample16.fz', 'sample170.fz', 'sample171.fz', 'sample172.fz', 'sample173.fz', 'sample174.fz', 'sample175.fz', 'sample176.fz', 'sample177.fz', 'sample178.fz', 'sample179.fz', 'sample17.fz', 'sample180.fz', 'sample181.fz', 'sample182.fz', 'sample183.fz', 'sample184.fz', 'sample185.fz', 'sample186.fz', 'sample187.fz', 'sample188.fz', 'sample189.fz', 'sample18.fz', 'sample190.fz', 'sample191.fz', 'sample192.fz', 'sample193.fz', 'sample194.fz', 'sample195.fz', 'sample196.fz', 'sample197.fz', 'sample198.fz', 'sample199.fz', 'sample19.fz', 'sample200.fz', 'sample201.fz', 'sample202.fz', 'sample203.fz', 'sample204.fz', 'sample205.fz', 'sample206.fz', 'sample207.fz', 'sample208.fz', 'sample209.fz', 'sample20.fz', 'sample210.fz', 'sample211.fz', 'sample212.fz', 'sample213.fz', 'sample214.fz', 'sample215.fz', 'sample216.fz', 'sample217.fz', 'sample218.fz', 'sample219.fz', 'sample21.fz', 'sample220.fz', 'sample221.fz', 'sample222.fz', 'sample223.fz', 'sample224.fz', 'sample225.fz', 'sample226.fz', 'sample227.fz', 'sample228.fz', 'sample229.fz', 'sample22.fz', 'sample230.fz', 'sample231.fz', 'sample232.fz', 'sample233.fz', 'sample234.fz', 'sample235.fz', 'sample236.fz', 'sample237.fz', 'sample238.fz', 'sample239.fz', 'sample23.fz', 'sample240.fz', 'sample241.fz', 'sample242.fz', 'sample243.fz', 'sample244.fz', 'sample245.fz', 'sample246.fz', 'sample247.fz', 'sample248.fz', 'sample249.fz', 'sample24.fz', 'sample250.fz', 'sample251.fz', 'sample252.fz', 'sample253.fz', 'sample254.fz', 'sample255.fz', 'sample256.fz', 'sample257.fz', 'sample258.fz', 'sample259.fz', 'sample25.fz', 'sample260.fz', 'sample261.fz', 'sample262.fz', 'sample263.fz', 'sample264.fz', 'sample265.fz', 'sample266.fz', 'sample267.fz', 'sample268.fz', 'sample269.fz', 'sample26.fz', 'sample270.fz', 'sample271.fz', 'sample272.fz', 'sample273.fz', 'sample274.fz', 'sample275.fz', 'sample276.fz', 'sample277.fz', 'sample278.fz', 'sample279.fz', 'sample27.fz', 'sample280.fz', 'sample281.fz', 'sample282.fz', 'sample283.fz', 'sample284.fz', 'sample285.fz', 'sample286.fz', 'sample287.fz', 'sample288.fz', 'sample289.fz', 'sample28.fz', 'sample290.fz', 'sample291.fz', 'sample292.fz', 'sample293.fz', 'sample294.fz', 'sample295.fz', 'sample296.fz', 'sample297.fz', 'sample298.fz', 'sample299.fz', 'sample29.fz', 'sample2.fz', 'sample300.fz', 'sample301.fz', 'sample302.fz', 'sample303.fz', 'sample304.fz', 'sample305.fz', 'sample306.fz', 'sample307.fz', 'sample308.fz', 'sample309.fz', 'sample30.fz', 'sample310.fz', 'sample311.fz', 'sample312.fz', 'sample313.fz', 'sample314.fz', 'sample315.fz', 'sample316.fz', 'sample317.fz', 'sample318.fz', 'sample319.fz', 'sample31.fz', 'sample320.fz', 'sample321.fz', 'sample322.fz', 'sample323.fz', 'sample324.fz', 'sample325.fz', 'sample326.fz', 'sample327.fz', 'sample328.fz', 'sample329.fz', 'sample32.fz', 'sample330.fz', 'sample331.fz', 'sample332.fz', 'sample333.fz', 'sample334.fz', 'sample335.fz', 'sample336.fz', 'sample337.fz', 'sample338.fz', 'sample339.fz', 'sample33.fz', 'sample340.fz', 'sample341.fz', 'sample342.fz', 'sample343.fz', 'sample344.fz', 'sample345.fz', 'sample346.fz', 'sample347.fz', 'sample348.fz', 'sample349.fz', 'sample34.fz', 'sample350.fz', 'sample351.fz', 'sample352.fz', 'sample353.fz', 'sample354.fz', 'sample355.fz', 'sample356.fz', 'sample357.fz', 'sample358.fz', 'sample359.fz', 'sample35.fz', 'sample360.fz', 'sample361.fz', 'sample362.fz', 'sample363.fz', 'sample364.fz', 'sample365.fz', 'sample366.fz', 'sample367.fz', 'sample368.fz', 'sample369.fz', 'sample36.fz', 'sample370.fz', 'sample371.fz', 'sample372.fz', 'sample373.fz', 'sample374.fz', 'sample375.fz', 'sample376.fz', 'sample377.fz', 'sample378.fz', 'sample379.fz', 'sample37.fz', 'sample380.fz', 'sample381.fz', 'sample382.fz', 'sample383.fz', 'sample384.fz', 'sample385.fz', 'sample386.fz', 'sample387.fz', 'sample388.fz', 'sample389.fz', 'sample38.fz', 'sample390.fz', 'sample391.fz', 'sample392.fz', 'sample393.fz', 'sample394.fz', 'sample395.fz', 'sample396.fz', 'sample397.fz', 'sample398.fz', 'sample399.fz', 'sample39.fz', 'sample3.fz', 'sample400.fz', 'sample401.fz', 'sample402.fz', 'sample403.fz', 'sample404.fz', 'sample405.fz', 'sample406.fz', 'sample407.fz', 'sample408.fz', 'sample409.fz', 'sample40.fz', 'sample410.fz', 'sample411.fz', 'sample412.fz', 'sample413.fz', 'sample414.fz', 'sample415.fz', 'sample416.fz', 'sample417.fz', 'sample418.fz', 'sample419.fz', 'sample41.fz', 'sample420.fz', 'sample421.fz', 'sample422.fz', 'sample423.fz', 'sample424.fz', 'sample425.fz', 'sample426.fz', 'sample427.fz', 'sample428.fz', 'sample429.fz', 'sample42.fz', 'sample430.fz', 'sample431.fz', 'sample432.fz', 'sample433.fz', 'sample434.fz', 'sample435.fz', 'sample436.fz', 'sample437.fz', 'sample438.fz', 'sample439.fz', 'sample43.fz', 'sample440.fz', 'sample441.fz', 'sample442.fz', 'sample443.fz', 'sample444.fz', 'sample445.fz', 'sample446.fz', 'sample447.fz', 'sample448.fz', 'sample449.fz', 'sample44.fz', 'sample450.fz', 'sample451.fz', 'sample452.fz', 'sample453.fz', 'sample454.fz', 'sample455.fz', 'sample456.fz', 'sample457.fz', 'sample458.fz', 'sample459.fz', 'sample45.fz', 'sample460.fz', 'sample461.fz', 'sample462.fz', 'sample463.fz', 'sample464.fz', 'sample465.fz', 'sample466.fz', 'sample467.fz', 'sample468.fz', 'sample469.fz', 'sample46.fz', 'sample470.fz', 'sample471.fz', 'sample472.fz', 'sample473.fz', 'sample474.fz', 'sample475.fz', 'sample476.fz', 'sample477.fz', 'sample478.fz', 'sample479.fz', 'sample47.fz', 'sample480.fz', 'sample481.fz', 'sample482.fz', 'sample483.fz', 'sample484.fz', 'sample485.fz', 'sample486.fz', 'sample487.fz', 'sample488.fz', 'sample489.fz', 'sample48.fz', 'sample490.fz', 'sample491.fz', 'sample492.fz', 'sample493.fz', 'sample494.fz', 'sample495.fz', 'sample496.fz', 'sample497.fz', 'sample498.fz', 'sample499.fz', 'sample49.fz', 'sample4.fz', 'sample500.fz', 'sample501.fz', 'sample502.fz', 'sample503.fz', 'sample504.fz', 'sample505.fz', 'sample506.fz', 'sample507.fz', 'sample508.fz', 'sample509.fz', 'sample50.fz', 'sample510.fz', 'sample511.fz', 'sample512.fz', 'sample513.fz', 'sample514.fz', 'sample515.fz', 'sample516.fz', 'sample517.fz', 'sample518.fz', 'sample519.fz', 'sample51.fz', 'sample520.fz', 'sample521.fz', 'sample522.fz', 'sample523.fz', 'sample524.fz', 'sample525.fz', 'sample526.fz', 'sample527.fz', 'sample528.fz', 'sample529.fz', 'sample52.fz', 'sample530.fz', 'sample531.fz', 'sample532.fz', 'sample533.fz', 'sample534.fz', 'sample535.fz', 'sample536.fz', 'sample537.fz', 'sample538.fz', 'sample539.fz', 'sample53.fz', 'sample540.fz', 'sample541.fz', 'sample542.fz', 'sample543.fz', 'sample544.fz', 'sample545.fz', 'sample546.fz', 'sample547.fz', 'sample548.fz', 'sample549.fz', 'sample54.fz', 'sample550.fz', 'sample551.fz', 'sample552.fz', 'sample553.fz', 'sample554.fz', 'sample555.fz', 'sample556.fz', 'sample557.fz', 'sample558.fz', 'sample559.fz', 'sample55.fz', 'sample560.fz', 'sample561.fz', 'sample562.fz', 'sample563.fz', 'sample564.fz', 'sample565.fz', 'sample566.fz', 'sample567.fz', 'sample568.fz', 'sample569.fz', 'sample56.fz', 'sample570.fz', 'sample571.fz', 'sample572.fz', 'sample573.fz', 'sample574.fz', 'sample575.fz', 'sample576.fz', 'sample577.fz', 'sample578.fz', 'sample579.fz', 'sample57.fz', 'sample580.fz', 'sample581.fz', 'sample582.fz', 'sample583.fz', 'sample584.fz', 'sample585.fz', 'sample586.fz', 'sample587.fz', 'sample588.fz', 'sample589.fz', 'sample58.fz', 'sample590.fz', 'sample591.fz', 'sample592.fz', 'sample593.fz', 'sample594.fz', 'sample595.fz', 'sample596.fz', 'sample597.fz', 'sample598.fz', 'sample599.fz', 'sample59.fz', 'sample5.fz', 'sample600.fz', 'sample601.fz', 'sample602.fz', 'sample603.fz', 'sample604.fz', 'sample605.fz', 'sample606.fz', 'sample607.fz', 'sample608.fz', 'sample609.fz', 'sample60.fz', 'sample610.fz', 'sample611.fz', 'sample612.fz', 'sample613.fz', 'sample614.fz', 'sample615.fz', 'sample616.fz', 'sample617.fz', 'sample618.fz', 'sample619.fz', 'sample61.fz', 'sample620.fz', 'sample621.fz', 'sample622.fz', 'sample623.fz', 'sample624.fz', 'sample625.fz', 'sample626.fz', 'sample627.fz', 'sample628.fz', 'sample629.fz', 'sample62.fz', 'sample630.fz', 'sample631.fz', 'sample632.fz', 'sample633.fz', 'sample634.fz', 'sample635.fz', 'sample636.fz', 'sample637.fz', 'sample638.fz', 'sample639.fz', 'sample63.fz', 'sample640.fz', 'sample641.fz', 'sample642.fz', 'sample643.fz', 'sample644.fz', 'sample645.fz', 'sample646.fz', 'sample647.fz', 'sample648.fz', 'sample649.fz', 'sample64.fz', 'sample650.fz', 'sample651.fz', 'sample652.fz', 'sample653.fz', 'sample654.fz', 'sample655.fz', 'sample656.fz', 'sample657.fz', 'sample658.fz', 'sample659.fz', 'sample65.fz', 'sample660.fz', 'sample661.fz', 'sample662.fz', 'sample663.fz', 'sample664.fz', 'sample665.fz', 'sample666.fz', 'sample667.fz', 'sample668.fz', 'sample669.fz', 'sample66.fz', 'sample670.fz', 'sample671.fz', 'sample672.fz', 'sample673.fz', 'sample674.fz', 'sample675.fz', 'sample676.fz', 'sample677.fz', 'sample678.fz', 'sample679.fz', 'sample67.fz', 'sample680.fz', 'sample681.fz', 'sample682.fz', 'sample683.fz', 'sample684.fz', 'sample685.fz', 'sample686.fz', 'sample687.fz', 'sample688.fz', 'sample689.fz', 'sample68.fz', 'sample690.fz', 'sample691.fz', 'sample692.fz', 'sample693.fz', 'sample694.fz', 'sample695.fz', 'sample696.fz', 'sample697.fz', 'sample698.fz', 'sample699.fz', 'sample69.fz', 'sample6.fz', 'sample700.fz', 'sample701.fz', 'sample702.fz', 'sample703.fz', 'sample704.fz', 'sample705.fz', 'sample706.fz', 'sample707.fz', 'sample708.fz', 'sample709.fz', 'sample70.fz', 'sample710.fz', 'sample711.fz', 'sample712.fz', 'sample713.fz', 'sample714.fz', 'sample715.fz', 'sample716.fz', 'sample717.fz', 'sample718.fz', 'sample719.fz', 'sample71.fz', 'sample720.fz', 'sample721.fz', 'sample722.fz', 'sample723.fz', 'sample724.fz', 'sample725.fz', 'sample726.fz', 'sample727.fz', 'sample728.fz', 'sample729.fz', 'sample72.fz', 'sample730.fz', 'sample731.fz', 'sample732.fz', 'sample733.fz', 'sample734.fz', 'sample735.fz', 'sample736.fz', 'sample737.fz', 'sample738.fz', 'sample739.fz', 'sample73.fz', 'sample740.fz', 'sample741.fz', 'sample742.fz', 'sample743.fz', 'sample744.fz', 'sample745.fz', 'sample746.fz', 'sample747.fz', 'sample748.fz', 'sample749.fz', 'sample74.fz', 'sample750.fz', 'sample751.fz', 'sample752.fz', 'sample753.fz', 'sample754.fz', 'sample755.fz', 'sample756.fz', 'sample757.fz', 'sample758.fz', 'sample759.fz', 'sample75.fz', 'sample760.fz', 'sample761.fz', 'sample762.fz', 'sample763.fz', 'sample764.fz', 'sample765.fz', 'sample766.fz', 'sample767.fz', 'sample768.fz', 'sample769.fz', 'sample76.fz', 'sample770.fz', 'sample771.fz', 'sample772.fz', 'sample773.fz', 'sample774.fz', 'sample775.fz', 'sample776.fz', 'sample777.fz', 'sample778.fz', 'sample779.fz', 'sample77.fz', 'sample780.fz', 'sample781.fz', 'sample782.fz', 'sample783.fz', 'sample784.fz', 'sample785.fz', 'sample786.fz', 'sample787.fz', 'sample788.fz', 'sample789.fz', 'sample78.fz', 'sample790.fz', 'sample791.fz', 'sample792.fz', 'sample793.fz', 'sample794.fz', 'sample795.fz', 'sample796.fz', 'sample797.fz', 'sample798.fz', 'sample799.fz', 'sample79.fz', 'sample7.fz', 'sample800.fz', 'sample801.fz', 'sample802.fz', 'sample803.fz', 'sample804.fz', 'sample805.fz', 'sample806.fz', 'sample807.fz', 'sample808.fz', 'sample809.fz', 'sample80.fz', 'sample810.fz', 'sample811.fz', 'sample812.fz', 'sample813.fz', 'sample814.fz', 'sample815.fz', 'sample816.fz', 'sample817.fz', 'sample818.fz', 'sample819.fz', 'sample81.fz', 'sample820.fz', 'sample821.fz', 'sample822.fz', 'sample823.fz', 'sample824.fz', 'sample825.fz', 'sample826.fz', 'sample827.fz', 'sample828.fz', 'sample829.fz', 'sample82.fz', 'sample830.fz', 'sample831.fz', 'sample832.fz', 'sample833.fz', 'sample834.fz', 'sample835.fz', 'sample836.fz', 'sample837.fz', 'sample838.fz', 'sample839.fz', 'sample83.fz', 'sample840.fz', 'sample841.fz', 'sample842.fz', 'sample843.fz', 'sample844.fz', 'sample845.fz', 'sample846.fz', 'sample847.fz', 'sample848.fz', 'sample849.fz', 'sample84.fz', 'sample850.fz', 'sample851.fz', 'sample852.fz', 'sample853.fz', 'sample854.fz', 'sample855.fz', 'sample856.fz', 'sample857.fz', 'sample858.fz', 'sample859.fz', 'sample85.fz', 'sample860.fz', 'sample861.fz', 'sample862.fz', 'sample863.fz', 'sample864.fz', 'sample865.fz', 'sample866.fz', 'sample867.fz', 'sample868.fz', 'sample869.fz', 'sample86.fz', 'sample870.fz', 'sample871.fz', 'sample872.fz', 'sample873.fz', 'sample874.fz', 'sample875.fz', 'sample876.fz', 'sample877.fz', 'sample878.fz', 'sample879.fz', 'sample87.fz', 'sample880.fz', 'sample881.fz', 'sample882.fz', 'sample883.fz', 'sample884.fz', 'sample885.fz', 'sample886.fz', 'sample887.fz', 'sample888.fz', 'sample889.fz', 'sample88.fz', 'sample890.fz', 'sample891.fz', 'sample892.fz', 'sample893.fz', 'sample894.fz', 'sample895.fz', 'sample896.fz', 'sample897.fz', 'sample898.fz', 'sample899.fz', 'sample89.fz', 'sample8.fz', 'sample900.fz', 'sample901.fz', 'sample902.fz', 'sample903.fz', 'sample904.fz', 'sample905.fz', 'sample906.fz', 'sample907.fz', 'sample908.fz', 'sample909.fz', 'sample90.fz', 'sample910.fz', 'sample911.fz', 'sample912.fz', 'sample913.fz', 'sample914.fz', 'sample915.fz', 'sample916.fz', 'sample917.fz', 'sample918.fz', 'sample919.fz', 'sample91.fz', 'sample920.fz', 'sample921.fz', 'sample922.fz', 'sample923.fz', 'sample924.fz', 'sample925.fz', 'sample926.fz', 'sample927.fz', 'sample928.fz', 'sample929.fz', 'sample92.fz', 'sample930.fz', 'sample931.fz', 'sample932.fz', 'sample933.fz', 'sample934.fz', 'sample935.fz', 'sample936.fz', 'sample937.fz', 'sample938.fz', 'sample939.fz', 'sample93.fz', 'sample940.fz', 'sample941.fz', 'sample942.fz', 'sample943.fz', 'sample944.fz', 'sample945.fz', 'sample946.fz', 'sample947.fz', 'sample948.fz', 'sample949.fz', 'sample94.fz', 'sample950.fz', 'sample951.fz', 'sample952.fz', 'sample953.fz', 'sample954.fz', 'sample955.fz', 'sample956.fz', 'sample957.fz', 'sample958.fz', 'sample959.fz', 'sample95.fz', 'sample960.fz', 'sample961.fz', 'sample962.fz', 'sample963.fz', 'sample964.fz', 'sample965.fz', 'sample966.fz', 'sample967.fz', 'sample968.fz', 'sample969.fz', 'sample96.fz', 'sample970.fz', 'sample971.fz', 'sample972.fz', 'sample973.fz', 'sample974.fz', 'sample975.fz', 'sample976.fz', 'sample977.fz', 'sample978.fz', 'sample979.fz', 'sample97.fz', 'sample980.fz', 'sample981.fz', 'sample982.fz', 'sample983.fz', 'sample984.fz', 'sample985.fz', 'sample986.fz', 'sample987.fz', 'sample988.fz', 'sample989.fz', 'sample98.fz', 'sample990.fz', 'sample991.fz', 'sample992.fz', 'sample993.fz', 'sample994.fz', 'sample995.fz', 'sample996.fz', 'sample997.fz', 'sample998.fz', 'sample999.fz', 'sample99.fz', 'sample9.fz'], x: [-11256.96233, -11094.03624, -10902.04215, -11436.37481, -11019.87183, -11231.66053, -11760.61067, -11092.52577, -11131.071, -11548.26191, -11336.21688, -11455.75609, -10993.08369, -11136.41398, -11120.80834, -11651.53912, -11505.2641, -11065.8395, -11252.14566, -11195.11805, -11208.15313, -11549.57451, -11183.98095, -11447.70649, -11396.97983, -11502.58576, -10777.88722, -11423.25097, -11073.8111, -11456.03308, -11320.22604, -11425.54582, -11350.70933, -10788.95191, -11129.26559, -11181.99726, -11171.78797, -10772.77859, -11091.40557, -11394.45965, -11142.08877, -11441.01806, -11234.84514, -11118.47273, -11126.91252, -11281.18949, -10993.39975, -11630.44451, -9900.72104, -11284.144, -11061.57236, -10979.38964, -10684.53575, -10960.18346, -11532.50397, -11125.14717, -10874.73972, -11149.48666, -11065.69476, -11274.58272, -11274.41671, -11082.19982, -11054.47888, -11114.99657, -11075.82221, -11276.3578, -11346.96683, -11227.64289, -11654.14694, -11388.16222, -11080.8325, -11128.88419, -11102.48858, -11161.00593, -11518.78527, -11447.59472, -11133.85206, -11381.75273, -10691.4447, -11751.14894, -11206.3286, -10927.02232, -10845.04258, -11237.24169, -11205.43232, -11292.96904, -11236.82919, -11245.54199, -11312.32245, -10841.64566, -11323.12356, -11246.35481, -11380.73518, -10787.74169, -11472.93048, -10862.81544, -11224.19337, -11335.76741, -10484.38462, -11516.12077, -11226.80014, -11124.18626, -11326.77288, -10986.88914, -11042.40996, -11123.01309, -11281.48448, -11426.29622, -11070.21382, -11229.42368, -11163.45976, -10456.68088, -11655.98311, -11058.31051, -11308.25223, -11291.07347, -11268.18831, -10915.18277, -11246.86948, -11064.33274, -10976.09436, -11292.63847, -11684.84921, -11149.8996, -11294.48825, -10982.68729, -11285.61227, -11334.69051, -11637.66826, -11270.49267, -11466.13415, -10949.61751, -10868.89276, -11124.02779, -11196.4448, -11605.4022, -11411.61559, -10744.57014, -10795.65693, -10988.46574, -10896.45065, -11349.53617, -10786.10239, -11292.55959, -10636.35457, -11014.2577, -10816.76134, -11034.07461, -11178.77966, -10930.55234, -11062.85637, -11054.38449, -11186.95147, -10931.95086, -11141.25022, -11310.27932, -11174.04752, -11519.95808, -11381.85428, -11110.51477, -11156.70384, -11245.63191, -11757.59679, -11483.84539, -11242.42345, -10896.09764, -11234.9697, -11243.43571, -11141.38614, -11650.75536, -11402.32793, -11429.11218, -11262.21914, -11313.61181, -11381.01765, -10980.03587, -11345.92993, -11435.20596, -11236.69778, -11414.61509, -11117.15719, -11086.92201, -11379.07405, -11532.08433, -11147.47155, -10667.453, -11230.08582, -10965.92649, -10690.40374, -10894.85443, -10975.38093, -10749.73772, -10815.96917, -11933.1066, -10863.27839, -11371.60443, -11261.22035, -11063.84828, -11329.28673, -11305.13313, -11483.45098, -11117.51345, -10790.16307, -11193.93848, -11236.14529, -11431.48312, -11671.56613, -11529.39385, -11283.15423, -11214.04729, -11265.39857, -11386.03617, -11199.24016, -11505.23701, -11023.44056, -11463.49613, -10765.73007, -10948.90321, -11148.85889, -11365.50131, -10953.79819, -10683.98632, -11605.41569, -11459.14841, -11162.40558, -11322.51903, -11464.27747, -10586.24646, -10925.69819, -11154.8472, -11256.93064, -10953.75448, -11235.77015, -11216.82907, -11514.78609, -11517.76638, -10928.82262, -11141.53015, -10995.9099, -11323.61608, -11037.91564, -11084.73288, -11321.46855, -11771.20695, -11371.75265, -11286.33452, -11129.64322, -10872.7149, -11498.32555, -11290.87829, -11180.06809, -11157.5687, -11170.13108, -11090.5745, -11324.01601, -11282.84133, -11169.87716, -10909.67952, -11186.75993, -11244.17953, -10812.93055, -11454.8638, -11036.78045, -11502.26905, -11797.65986, -11222.39181, -11277.81272, -11290.12704, -11339.11654, -11169.41585, -11455.37055, -11327.98307, -11347.18811, -11159.1177, -10695.9952, -11114.85418, -10910.91282, -11118.37197, -11165.12932, -11510.63288, -11090.08322, -11192.05018, -11253.81224, -10511.76821, -10941.47571, -11058.71122, -11077.22459, -10992.12215, -11545.44468, -10573.43756, -11362.66217, -11140.7985, -11420.64321, -11047.5157, -11256.40043, -11409.16798, -11112.73456, -11457.01419, -11465.39639, -11661.86924, -11341.19761, -11449.88077, -11250.53478, -11054.32832, -10731.50058, -11396.51385, -11366.96709, -11250.52672, -10776.64383, -11310.4483, -11264.66259, -11226.61233, -11286.2832, -11011.44824, -11405.58242, -11449.41987, -11460.64351, -10963.33019, -10847.24179, -11025.73236, -11658.31607, -11381.31247, -11544.15863, -11280.46348, -11172.60028, -10761.3249, -11189.77113, -11530.88619, -10930.62938, -11380.68245, -11297.7815, -11214.79194, -11543.85416, -11488.50668, -11050.03141, -10994.08104, -11142.55168, -10930.41378, -11079.58244, -11266.66898, -11329.53202, -10940.25989, -11051.09074, -11364.12973, -11242.13025, -10892.33505, -11121.05398, -10723.18104, -11245.2756, -11294.02274, -11157.74906, -11146.58037, -11348.23758, -11250.17566, -10712.40405, -11539.89347, -10981.14194, -11322.1018, -10594.7068, -11128.2829, -11050.30144, -11088.83537, -11100.23956, -11527.05957, -11241.6355, -11344.37971, -11255.47212, -11557.817, -11322.07052, -11678.09779, -11185.82967, -11069.60977, -11525.00196, -11401.62154, -11306.72281, -11326.07816, -11285.8332, -11273.64876, -11596.98228, -11427.97948, -11389.22739, -10945.7321, -11131.80848, -10619.05583, -11229.41936, -11230.51778, -11421.20661, -11557.11252, -11354.90649, -10720.56255, -10978.75765, -11224.49927, -11281.94107, -11169.57155, -10941.52222, -11427.99721, -11180.54305, -11183.67326, -11397.31763, -11204.00427, -10856.69992, -11309.33997, -11577.94802, -11499.86514, -11061.43634, -11262.41874, -11285.32524, -11516.10453, -11258.74027, -11588.22291, -11352.09742, -11093.69552, -10773.76139, -10913.50391, -11192.59612, -11341.87615, -10976.13102, -11097.33159, -11501.49728, -11108.80333, -11627.88279, -11343.71017, -11144.03624, -11292.45247, -11063.79428, -11025.42258, -11226.55222, -11142.79145, -11204.91721, -11387.53331, -11171.36818, -10886.24546, -11183.19487, -11341.78485, -11168.30428, -11553.35204, -11421.05897, -11348.59935, -11096.7331, -11317.53098, -11124.82028, -11350.77028, -11147.3848, -11168.5268, -11287.05793, -11113.76792, -11011.88561, -11501.9533, -10918.88324, -11179.09856, -11565.02159, -11623.48339, -10827.27969, -11292.70532, -11217.16582, -11065.16755, -11512.80601, -11235.3568, -10719.70508, -11120.14483, -11000.69341, -11452.29563, -11029.337, -11136.05977, -10940.06827, -11111.12388, -11045.39217, -11410.65124, -11402.44477, -11249.812, -11204.42445, -10756.89483, -11528.60151, -10654.72788, -11435.66056, -10928.529, -11335.33187, -11136.20591, -11294.71117, -11272.37435, -11475.94979, -11187.57268, -11512.48858, -10978.00742, -10839.39929, -11537.95491, -11554.65644, -11144.4288, -11391.79983, -10909.73879, -11316.16287, -11417.37279, -11189.99216, -11322.5736, -10837.69036, -11151.40274, -11317.17681, -11386.98945, -11012.90326, -11359.22588, -11354.06612, -11005.49551, -11225.97435, -10799.62311, -10709.47319, -11008.84778, -11296.58831, -11406.75499, -11488.47055, -11399.88899, -11241.6759, -11063.55736, -11475.7266, -11059.5596, -11347.36667, -11181.19921, -11314.1653, -10675.06675, -10941.19602, -11467.30203, -11009.33704, -11551.70543, -11149.91219, -11257.04471, -11326.88882, -10777.8076, -11263.14878, -11275.43042, -10989.56538, -11194.50595, -11482.4118, -11067.03574, -10834.67579, -11451.02989, -11489.10708, -11423.77577, -11739.30036, -10673.01099, -11392.30913, -11445.84317, -10888.5959, -11354.55952, -10740.41537, -11175.69614, -11197.90189, -11251.70136, -11211.49565, -11446.09337, -10901.03013, -11401.53942, -11438.83053, -11049.39181, -11112.07987, -11213.87099, -11422.30018, -11515.68849, -11181.46217, -11469.36031, -11563.56289, -11085.58805, -11507.5738, -11252.64155, -11217.54101, -11468.90146, -11614.26376, -11406.32286, -11549.02462, -10989.83521, -11346.45835, -11140.05586, -11473.9575, -11523.91488, -11418.39354, -11332.90828, -10835.86901, -11256.2741, -11366.15232, -11246.82105, -11204.31352, -11137.25477, -11438.31373, -11709.30875, -11211.48375, -11286.68847, -11257.96113, -11432.10484, -10879.41694, -11926.24231, -11196.20712, -11637.15727, -11572.81423, -10758.6365, -11281.52877, -10942.45815, -11292.4212, -11570.99461, -11073.39243, -11452.54057, -11125.83305, -11193.21702, -11314.23787, -11120.89717, -10951.49571, -11117.21234, -11098.88795, -11184.64699, -11426.6784, -11057.4922, -11095.21652, -11223.70846, -11183.82331, -11213.39824, -11528.58551, -10940.49355, -10887.49531, -11095.06825, -11324.62879, -11344.0357, -11185.6962, -11209.86608, -11354.14111, -11068.30947, -11208.44604, -11264.83519, -11209.0228, -11427.64944, -11131.54865, -11046.41646, -10935.53389, -11251.20265, -11578.96075, -11298.79929, -11186.20213, -10942.84876, -11244.67171, -11180.666, -11613.87724, -11170.22059, -11238.8205, -11335.87947, -11007.30681, -11033.20998, -11252.95505, -11376.42802, -11031.95118, -10522.67925, -11278.00497, -11195.7, -11259.30169, -11144.62176, -11116.8643, -11219.22154, -11173.97887, -11218.07984, -11723.08271, -10451.28147, -10935.13299, -11363.13111, -11040.43664, -11048.54545, -10850.42564, -11077.78654, -11310.85006, -11193.00108, -11043.26781, -10970.39351, -11275.80459, -11616.64726, -11577.97283, -11193.44119, -11202.71108, -11318.25841, -10919.61163, -10957.74171, -11580.60485, -11065.42971, -11026.71164, -10921.3886, -11620.8788, -11141.82536, -11191.16426, -11105.77909, -11181.46307, -11123.34764, -11111.08118, -11382.45855, -11303.4037, -11427.37951, -11056.19693, -11308.61975, -10966.54545, -11605.65944, -10611.8787, -11225.56293, -11048.08468, -11326.49185, -10871.94279, -11373.79368, -11031.27739, -11337.24881, -11675.78883, -10823.92276, -11567.87269, -11283.94035, -11435.32925, -10711.5674, -10891.3176, -11088.50012, -11637.2076, -10525.70837, -11016.75814, -11506.4226, -11169.35697, -11098.56791, -11019.16155, -11076.5732, -11095.89178, -11001.65793, -10512.03894, -10662.48414, -10934.99974, -11411.80531, -11599.8609, -10902.89305, -11493.33196, -11376.02629, -10870.6665, -11125.07454, -11101.53981, -11451.4269, -10850.7647, -11426.73633, -11423.52049, -10828.36235, -11245.13106, -11022.23101, -11274.681, -11216.97107, -11231.96943, -11489.39949, -11418.98248, -10836.78213, -11213.13009, -11394.41991, -11004.42118, -11099.75339, -11479.50377, -10903.962, -10952.68534, -11121.21942, -11486.66309, -11595.65766, -11353.10309, -11391.50478, -11075.94643, -11299.10631, -10648.75073, -11253.69107, -11270.78862, -11210.6259, -11163.33819, -10976.28837, -11196.27771, -11044.42749, -11479.81099, -11481.82777, -11274.62572, -11499.03388, -11162.2192, -11484.29603, -10566.59829, -11266.37927, -11355.46137, -10978.38457, -11169.10653, -11177.83757, -10997.44413, -11014.52851, -11019.47654, -10922.01387, -11174.88678, -11090.48717, -10827.44974, -11376.11562, -11246.04729, -11219.93222, -11111.79989, -11253.98131, -11366.27094, -11055.90446, -11268.98915, -11048.81704, -10824.09433, -10949.8444, -10725.27495, -11348.83595, -11583.22393, -11275.519, -11400.58258, -11017.55562, -11412.94504, -11417.44773, -11242.91152, -11351.08458, -11266.5463, -11250.10376, -11279.86653, -11399.69756, -11140.53754, -11474.08538, -11601.45419, -11268.03553, -11181.32147, -11288.35867, -11287.05496, -11357.47481, -11855.87435, -11120.27896, -10753.44219, -10879.80933, -10776.02748, -10833.73997, -10973.29422, -11065.26525, -11721.93989, -11221.59706, -11199.88626, -10890.68249, -11035.81283, -11357.38225, -10931.77981, -10976.55493, -11315.83502, -11256.93045, -11439.43424, -10697.28811, -10926.78414, -11162.85777, -11499.48887, -11542.44745, -11472.18471, -11180.56114, -11147.08417, -11214.35552, -11413.78854, -10979.72668, -11121.30388, -11056.67533, -11243.04795, -11338.77956, -11473.93952, -11065.20182, -11625.26975, -11441.71767, -11385.67446, -11371.51799, -11388.42831, -11463.87334, -11214.02897, -11190.59753, -11147.52548, -10948.09697, -10877.26395, -11077.68584, -11049.51872, -11113.29898, -11220.76872, -10951.72657, -11184.6737, -11157.06759, -11105.09615, -11160.70475, -10716.04621, -10672.63097, -11211.21769, -11398.10157, -11153.63296, -11137.90929, -11069.82517, -11177.97351, -11545.77001, -11015.47414, -11355.70058, -11085.41794, -11156.24884, -11221.63048, -11180.16209, -11066.55856, -11047.52069, -11347.91197, -11139.23434, -11110.77304, -11021.08651, -11030.92761, -11201.99842, -11500.67763, -11242.68757, -10991.56815, -10860.58152, -11289.6365, -11423.63717, -11549.91634, -11291.71902, -11160.02246, -11345.57282, -11515.97963, -11081.39977, -11436.48541, -11122.91387, -11334.54608, -11108.96397, -11557.60475, -11030.14404, -10978.71337, -11126.61502, -11642.80148, -11692.55072, -11242.89316, -10934.2699, -11160.62477, -11526.78586, -11369.28184, -11654.34649, -11118.37123, -11434.8557, -11079.41221, -11153.55223, -11273.31328, -11466.29224, -10905.59744, -11635.17802, -10921.00739, -11544.96914, -11367.19476, -11161.66884, -11275.95825, -11028.78967, -10996.91283, -11564.99435, -11035.56593, -11391.78401, -11583.17363, -10938.87333, -11399.30369, -11314.94737, -10704.69483, -11162.8958, -11129.69312, -11647.01959, -11221.97299, -11106.64833, -11555.56199, -11277.92434, -11499.28179, -11165.61804, -11016.74119, -11546.58907, -11290.41176, -11764.07684, -11240.65533, -10992.22194, -11056.99564, -11324.765, -11096.10901, -11352.1917, -11400.16986, -11333.28166, -11413.2578, -11327.03124, -11049.68448, -11111.44706, -11313.72277, -11029.92495, -11675.32877, -11140.86061, -11096.40707, -11311.25778, -11400.0631, -11325.00202, -11123.61647, -11155.0563, -10780.39959, -11172.08161, -11354.42928, -11113.00582, -11219.74384, -10931.34617, -11184.40559, -10813.66236, -11019.31601, -11433.98555, -11258.04373, -11362.31445, -11396.91032, -11326.98761, -10915.893, -11175.35791, -11227.95869, -11588.85104], y: [-3684.19364, -3249.27131, -3753.10328, -3630.32732, -3614.47383, -3506.0874, -3750.31843, -3750.9428, -3717.70263, -3695.07468, -3695.34247, -3828.78146, -3774.00198, -3771.94283, -3763.01493, -3700.71525, -3124.86759, -3567.32882, -3718.34534, -3793.11128, -3766.91107, -3818.35643, -3448.72299, -3476.48838, -3755.36422, -3834.05114, -2978.53098, -3681.51211, -3828.07557, -3048.15877, -3305.62158, -3189.96954, -3808.03957, -3700.13251, -3636.91204, -3816.6785, -3619.60114, -3754.51627, -2384.2597, -3809.70299, -3736.75634, -3711.30798, -3746.68491, -3603.67254, -3726.06286, -3796.21596, -3661.34024, -3527.49033, -2271.31927, -3690.44321, -3105.35913, -3768.07782, -3656.28875, -3278.82994, -3062.89882, -3743.54511, -3756.89956, -3694.38842, -3186.51234, -3428.34418, -3803.02034, -3695.29925, -3724.59164, -3790.71512, -3618.20366, -3455.93927, -3744.96359, -3667.44181, -3663.49246, -3779.33732, -3797.51162, -3470.90168, -3814.74683, -3572.26569, -3778.05494, -3620.84407, -3610.67272, -3739.01285, -2994.37402, -3759.83572, -3731.28189, -3761.73791, -3751.27117, -3744.0195, -3702.86038, -3094.29627, -3595.58377, -3746.6422, -3734.59018, -3610.61242, -3684.27248, -3732.32371, -3493.60136, -3086.67012, -3743.46195, -3717.11448, -3682.60896, -3601.61415, -3723.55821, -3818.52053, -3405.56483, -2925.63275, -3615.83516, -3603.60841, -3737.88801, -3677.52904, -3681.85924, -3788.41795, -3771.3733, -3811.87032, -3724.03083, -2144.36045, -3820.02892, -3732.27132, -3746.08495, -3630.98635, -3757.02185, -3684.48495, -3687.04067, -3801.97672, -3666.45818, -3832.94443, -3088.70403, -3614.31017, -3002.53136, -3701.70713, -3788.69382, -2506.19208, -3670.48475, -3875.65426, -3663.12878, -3745.81798, -2836.95219, -3732.0608, -3315.06336, -3652.95699, -3843.52083, -3531.40107, -3462.18678, -3252.58363, -3211.95244, -3840.25151, -3756.1783, -3810.16874, -3748.8152, -3714.31612, -3758.85638, -3792.31855, -3687.10097, -3768.5072, -3035.59811, -3546.18182, -3584.01952, -3683.76454, -3745.68133, -3831.429, -3686.18028, -3698.21667, -3677.85031, -3728.96736, -3706.22134, -3661.2254, -3632.04477, -3841.9685, -3714.45405, -3830.99692, -3650.995, -3703.11878, -3684.86534, -3778.88039, -3684.81544, -3690.82504, -3778.7899, -3762.46189, -3767.94427, -2321.96456, -3750.49282, -3838.04559, -2999.92655, -3654.76261, -3700.5139, -3752.95391, -3661.91644, -3550.16368, -3611.63622, -3384.40413, -3670.78141, -3693.51163, -3597.5658, -3754.73865, -3802.4924, -3556.82234, -3671.54153, -2755.18156, -3719.33181, -3695.0559, -3813.73918, -3472.5881, -3608.80667, -3810.91965, -3761.69309, -3638.43497, -3606.63498, -3596.62366, -2421.77419, -3702.11765, -3641.01759, -3836.65264, -3399.22484, -3746.59225, -3646.70614, -3048.41108, -3693.91371, -3783.42627, -3280.94816, -3791.80208, -3465.77989, -3562.32675, -3866.33714, -3784.79473, -2934.28688, -3739.70537, -3768.34475, -3646.19401, -3676.494, -3720.97912, -3646.74686, -3739.96273, -3746.11442, -3097.31884, -2985.89909, -3439.95587, -3855.49667, -3722.54029, -3629.21735, -3697.06916, -3008.40464, -3735.28804, -3646.34305, -3655.37672, -3787.30453, -3719.98786, -3518.52227, -3807.75028, -2516.74432, -3820.36904, -3729.28482, -3662.29833, -3047.39662, -3876.17488, -3270.59708, -3837.05614, -3818.72759, -3561.60204, -3748.4589, -3768.86023, -3728.94444, -3647.39577, -3861.43844, -3844.99966, -2951.2181, -3022.96999, -3722.50326, -3801.3152, -3727.00871, -3692.65987, -3741.77893, -3730.73219, -3124.91675, -3769.55225, -3840.81969, -3681.8697, -3792.04001, -3182.64324, -2939.11006, -3668.21169, -3589.27014, -2906.33099, -3829.54879, -3445.62597, -3645.502, -2385.70488, -3758.36986, -3663.95405, -3678.97693, -3685.21121, -3777.03363, -3784.89507, -3623.34751, -3706.12266, -3627.01218, -3667.60976, -3826.37953, -3370.63079, -3589.80099, -3735.71945, -3771.8682, -3774.37173, -3634.77249, -3758.31657, -3749.19452, -3677.10876, -3728.00797, -3640.81915, -3540.42697, -3448.41964, -3834.09391, -3060.61518, -3664.05201, -3607.97007, -3731.07445, -3849.79478, -3720.57118, -3712.86539, -3626.03427, -3545.90379, -3690.5754, -3736.97991, -3814.60032, -3569.60372, -3624.79801, -3772.34552, -3635.78398, -3680.50224, -3830.94804, -3100.75711, -3811.75416, -3375.10322, -3713.8034, -3716.8557, -3773.27612, -3616.26228, -3792.95069, -3699.82837, -3712.30187, -3652.21381, -3772.67545, -3730.69638, -3180.42377, -3731.01891, -3656.6345, -3589.26981, -3365.31141, -3793.89053, -3751.78377, -3641.23323, -3788.9752, -3699.48946, -3805.97252, -3740.13525, -3702.08267, -3833.97412, -3851.91576, -3810.69839, -3575.04551, -3727.35857, -3618.14368, -3068.29181, -3738.58683, -3636.64207, -3758.93976, -3747.60747, -3760.65562, -3778.13719, -3586.31253, -2451.91593, -3561.00577, -3808.76838, -3737.5205, -3756.55458, -3641.16626, -3805.07342, -2603.7415, -3765.78742, -3058.95611, -3590.34963, -3784.02812, -3558.72062, -3815.67732, -3254.78223, -3738.33967, -3864.2556, -3543.46179, -2230.7855, -3852.31022, -3866.42289, -3747.04305, -3672.36318, -2456.71654, -3651.08841, -3752.13968, -3790.68112, -3594.93591, -3706.80109, -3773.60002, -3713.8101, -3541.95586, -3039.10001, -3823.56485, -3124.7327, -3550.66299, -3816.25967, -3648.95876, -3617.89864, -3793.55808, -3746.43267, -3246.7001, -3750.93485, -3605.98687, -3798.11518, -3764.30629, -3689.96865, -3651.81241, -3789.93434, -3680.11952, -3631.73796, -3049.02159, -3134.42512, -3775.8162, -3203.23315, -3796.8538, -3779.589, -3782.75374, -3724.50571, -3563.46808, -3637.00358, -3692.27775, -3729.2818, -3689.84155, -3702.09245, -3806.13394, -3679.25979, -3690.54166, -3664.87832, -3752.4629, -3795.74541, -3748.25849, -2537.72991, -3675.45843, -3796.06806, -3738.4687, -3107.18421, -3819.84251, -3714.74346, -3487.90148, -3712.01879, -3628.57614, -3791.91459, -3714.56627, -3580.27292, -3538.66975, -3792.73551, -3728.28489, -3707.0282, -3436.19852, -3720.6223, -3743.04572, -3836.27582, -3767.0517, -3825.06849, -3670.45342, -3539.26504, -3799.64424, -3698.97314, -3016.48193, -3839.43272, -3767.63494, -3760.58403, -3693.9771, -3046.08004, -3600.78317, -3691.8332, -3735.41008, -3716.44943, -3779.90282, -3821.00874, -2928.53893, -2976.82808, -3042.6176, -3679.95702, -3452.38314, -3591.20734, -3746.68898, -3782.15224, -3812.40865, -3796.24652, -3785.09092, -3534.26138, -3503.61877, -3632.79455, -3763.03128, -3809.5197, -3694.79436, -3780.89297, -3642.48611, -3372.40021, -3429.33269, -3716.40079, -3751.8315, -3539.63712, -3749.67603, -3794.16053, -3610.02948, -3755.63508, -3703.41989, -3689.67236, -3752.6661, -3767.03998, -3043.287, -3624.66481, -3610.07369, -3782.02223, -3626.72357, -3725.94641, -3776.50098, -3474.55435, -3742.4211, -3681.67545, -3720.16821, -3613.04986, -3839.1831, -3697.38625, -3814.3375, -3695.0159, -3824.87765, -3723.34781, -3684.94642, -2924.80843, -3763.83308, -3693.12041, -2509.57984, -3492.61306, -3649.21371, -3742.21158, -3644.20248, -3819.91741, -3662.69108, -3750.49913, -3858.4361, -3691.8581, -3781.75408, -3693.00597, -3713.18659, -3824.80944, -3755.85518, -3796.98957, -3870.47388, -3689.70208, -3726.06712, -3622.42098, -3733.58348, -3706.85861, -3582.32873, -3583.41458, -3023.00286, -3799.54444, -3784.0841, -3086.96482, -3525.05239, -3758.63749, -3757.20877, -3769.96655, -3587.65799, -3710.64271, -3795.93988, -3787.26911, -3626.43889, -3773.86239, -3763.10088, -3598.29114, -3600.67081, -3692.98724, -3735.5217, -3791.28459, -3670.58247, -3793.36135, -3023.89684, -3743.03684, -3643.47904, -3466.47515, -3858.39498, -3556.8464, -3586.41354, -3788.88676, -3792.32873, -2533.23455, -3667.97283, -3759.94699, -3725.1857, -3744.37737, -3682.24543, -3324.12201, -3611.44915, -3714.20088, -3457.36307, -3681.33092, -3587.69317, -3763.74816, -3726.16056, -3733.95498, -3677.81342, -3762.74215, -3709.65468, -3717.86058, -3703.89212, -3788.72939, -3675.4938, -3841.18228, -2989.61025, -3744.36187, -3338.45402, -3707.46525, -3810.88806, -3228.89033, -3373.44763, -3787.19708, -3699.99926, -3799.01817, -3524.2589, -3698.76756, -3558.96075, -3820.36177, -3628.36393, -3642.95347, -3716.3603, -3743.71293, -3788.69089, -3655.74606, -2952.91832, -3508.48018, -3734.42648, -3630.46892, -3606.84338, -3163.06632, -3836.02757, -3597.00506, -3782.66199, -3707.15014, -3659.63277, -3436.428, -3793.62848, -3412.9194, -3753.70438, -3748.77721, -3822.50315, -3508.8951, -3543.93698, -3629.25291, -3744.2409, -3744.91141, -3658.53727, -3721.74127, -3779.08528, -3613.44248, -3794.50416, -3654.85376, -3064.30356, -3605.45484, -3713.60453, -3797.49436, -3782.16413, -3321.70562, -3750.09386, -3702.10567, -3602.32273, -3744.42528, -2473.26392, -3639.8739, -3747.167, -3672.3282, -3142.02038, -3714.17811, -3098.50429, -3799.69306, -3644.6091, -3782.55214, -3816.63082, -3585.67472, -3724.50602, -3761.56991, -3805.50119, -3687.83118, -2380.4542, -3748.39799, -3776.38072, -3736.01833, -3195.18826, -3788.16154, -3768.63966, -3627.25571, -3360.42616, -3726.93113, -3750.09462, -2976.88528, -3745.8041, -3591.74552, -3702.53114, -3636.89125, -3218.12218, -3766.32646, -3428.05943, -3859.70358, -3662.80266, -3773.58317, -3114.49402, -3781.39915, -3524.67674, -3463.39198, -3686.19455, -3731.72875, -3687.27563, -3668.68481, -3829.58159, -3435.44991, -3564.68479, -3641.95408, -3745.00201, -3844.04753, -3613.10676, -3700.20504, -3718.19042, -3235.80525, -3757.23134, -3738.83852, -3627.89744, -3850.9568, -3643.50405, -3772.85114, -3342.30838, -3531.35247, -3699.54223, -3749.80603, -3812.50747, -3808.66178, -3784.74166, -3661.56164, -3843.40074, -3762.3781, -3140.24823, -3468.81027, -3616.21711, -3619.90003, -3685.28216, -3504.23474, -3790.43408, -3439.58872, -3786.39241, -3157.19275, -3568.60717, -3745.15671, -3811.39152, -3748.6503, -3619.53742, -3717.3562, -3039.23656, -3782.32698, -3635.93734, -3768.60485, -3727.18281, -3786.73152, -3867.5829, -3857.08243, -3698.60087, -3739.767, -3056.00323, -3727.22845, -3733.17164, -3613.41784, -3683.41836, -3780.37915, -3579.20409, -3697.43723, -3106.00343, -3807.82346, -3838.32842, -3746.65142, -3655.79896, -3735.75995, -3597.49107, -3620.39102, -3754.14229, -3801.67301, -3744.41482, -3546.43896, -3808.127, -3660.34285, -3747.2622, -3778.76239, -3570.19543, -3570.10171, -3771.04531, -3494.92752, -3641.17771, -3538.24783, -3741.42397, -3792.52551, -3736.12958, -3722.09165, -3762.96742, -3683.32587, -3734.67907, -3848.9109, -3687.33859, -3795.69491, -3689.25859, -3472.81119, -3788.18533, -3615.97611, -3620.36661, -3658.44051, -3773.41762, -3664.66817, -3655.25603, -3839.99886, -3819.17824, -3743.97513, -3500.12974, -3494.17433, -2925.67711, -3783.92679, -3757.61891, -3727.65154, -3744.36385, -3728.38429, -3658.7074, -3831.16402, -2912.00617, -3738.12658, -3383.17161, -2494.60527, -3644.1252, -3556.93231, -3258.0832, -3744.81694, -3792.84885, -3659.0729, -3738.19135, -3004.96653, -3396.13362, -3570.90098, -3751.77234, -3731.3911, -3668.34474, -3702.49426, -3758.33443, -3068.39812, -3701.0839, -3730.95097, -3739.35626, -3680.68047, -3659.58277, -3780.39831, -3077.25392, -3759.93744, -3011.48175, -3688.13133, -3441.75015, -3656.6468, -2486.2664, -3594.55945, -3684.29692, -3717.19662, -3681.85662, -3824.31421, -3831.41093, -3375.82299, -3528.65362, -3557.67853, -3699.82633, -3343.74841, -3703.21527, -2974.90397, -3316.73086, -3681.92108, -3223.38454, -3593.97978, -3841.63211, -3660.29956, -3273.57201, -3073.3335, -3776.53585, -3749.53302, -3796.35954, -3731.22055, -3666.87548, -3808.6893, -3080.46301, -3473.75911, -3857.9605, -3163.58289, -3759.98552, -3595.15811, -3786.40283, -3709.04342, -3790.95296, -2974.56026, -3784.34657, -3255.206, -3674.80704, -3844.1303, -3708.49228, -3484.773, -3807.36265, -3799.86324, -3717.54841, -3631.02227, -3728.32687, -3803.46942, -3613.1419, -3656.93942, -3799.88019, -3711.09648, -3808.84055, -3778.90559, -3826.86358, -3732.61477, -3675.86393, -3708.97352, -3728.52026, -3002.67237, -3571.77285, -3814.93193, -3785.17352, -3857.7999, -3727.14057, -3030.18949, -3835.59851, -3799.13918, -3443.87701, -2885.96333, -3608.22989, -3713.59758, -3703.5394, -3744.21774, -3466.08183, -3782.98432, -3051.66411, -3774.51124, -3641.32358, -3630.30746, -3625.16964, -3789.22005, -3699.54566, -3630.96287, -3717.60093, -3724.95823, -3669.09102, -3793.49797, -3730.84114, -3726.24787, -3717.14313, -3088.73411, -3692.20057, -3082.84474, -3480.44477, -3664.81931, -3800.67345, -3820.89927, -3519.84783, -3639.51818, -3556.0118, -3780.32931, -3761.14948, -3688.49057, -3722.04237, -3623.56063, -3823.31684, -3748.41497, -3538.67868, -3739.25111, -3546.76213, -3607.68259, -3336.61354, -3638.44114, -3778.83276, -3658.18199, -3768.31493, -3458.6938, -3682.46874, -2970.26081, -2392.1093, -3734.92382, -3659.23431, -3684.68498, -3788.8627, -3793.93355, -3576.3403, -3744.48267, -3464.31165, -3749.58042, -3372.27746, -3766.07171, -3764.63362, -3727.29883, -3610.03386, -3736.18673, -3688.92529, -2753.51174, -3638.80875], z: [-1627.47432, -1836.99289, -1555.98552, -1674.49278, -1667.88065, -1742.6826, -1548.46262, -1558.51975, -1590.96359, -1603.09519, -1599.09518, -1490.08769, -1551.75062, -1539.60974, -1534.89916, -1569.06914, -1833.38995, -1684.35565, -1591.40647, -1523.73423, -1546.10459, -1511.41899, -1763.91353, -1773.41044, -1569.96891, -1504.88428, -1881.56361, -1620.68805, -1527.31073, -1807.71175, -1801.23666, -1834.68805, -1534.04838, -1610.17131, -1652.0186, -1537.91931, -1618.04053, -1592.08075, -794.78971, -1530.48456, -1574.7638, -1565.20558, -1592.01579, -1658.7459, -1591.93683, -1539.8502, -1630.69842, -1745.14595, -1004.68363, -1623.20053, -1880.19779, -1581.98472, -1630.46421, -1845.70854, -1779.22073, -1584.12774, -1593.2219, -1629.14392, -1816.57845, -1784.09011, -1538.04712, -1618.064, -1595.13372, -1571.61263, -1662.60411, -1732.32524, -1582.63225, -1645.97181, -1565.82508, -1535.2466, -1539.0997, -1758.91213, -1542.09392, -1704.30407, -1545.79279, -1680.42238, -1665.75381, -1564.07022, -1890.11962, -1535.20151, -1574.0218, -1597.77889, -1573.18064, -1565.08122, -1598.30227, -1851.12328, -1682.60414, -1555.20207, -1581.41115, -1665.12537, -1640.32749, -1604.97672, -1761.84116, -1867.87387, -1560.81146, -1600.05972, -1621.27103, -1686.08655, -1584.69706, -1512.9227, -1797.93734, -1829.18999, -1612.0362, -1665.05916, -1587.26892, -1638.68305, -1607.90099, -1521.10387, -1525.18956, -1537.92512, -1579.13877, -611.28058, -1507.01516, -1549.83419, -1575.62048, -1578.71572, -1511.21202, -1582.30913, -1619.9537, -1537.91691, -1628.41259, -1488.61827, -1785.41778, -1624.40493, -1834.87744, -1618.96925, -1541.2026, -840.40416, -1580.92595, -1490.87367, -1646.28157, -1564.40861, -1797.72508, -1570.04285, -1810.96403, -1584.45225, -1486.53951, -1688.16336, -1772.7521, -1798.81115, -1825.03963, -1501.32802, -1561.02871, -1530.0059, -1574.3524, -1617.36931, -1570.8129, -1526.03726, -1619.38116, -1523.94051, -1860.96615, -1718.01023, -1671.84698, -1634.04614, -1569.86098, -1485.49338, -1621.35656, -1635.10236, -1590.23676, -1606.20562, -1595.66265, -1654.48095, -1606.27393, -1489.32185, -1584.8739, -1507.74979, -1594.87441, -1569.22076, -1601.9896, -1520.70034, -1552.11436, -1633.82362, -1543.75268, -1544.25006, -1581.03635, -724.85772, -1586.4404, -1492.03058, -1835.44484, -1588.13742, -1598.75726, -1563.38743, -1652.2212, -1707.65113, -1666.38616, -1789.9896, -1632.07456, -1617.3775, -1679.12958, -1548.82084, -1536.03921, -1711.07916, -1631.34638, -1076.80481, -1611.05397, -1582.80614, -1516.22817, -1743.1803, -1643.28551, -1534.23547, -1565.00284, -1663.96362, -1682.62371, -1660.8135, -823.13738, -1614.15209, -1601.89672, -1501.72441, -1793.51547, -1550.35597, -1635.84831, -1822.58731, -1597.59322, -1567.29355, -1808.84944, -1544.47116, -1757.24342, -1724.303, -1486.49193, -1533.22708, -1842.77516, -1591.15145, -1527.77145, -1612.07282, -1652.32434, -1590.26544, -1588.34985, -1578.23053, -1575.26146, -1850.73796, -1820.81416, -1778.47742, -1514.23669, -1586.06632, -1597.32385, -1615.97178, -1851.66271, -1581.49704, -1654.3685, -1630.57225, -1544.04139, -1546.54191, -1711.88171, -1510.09868, -894.60616, -1519.40221, -1600.35451, -1629.64587, -1812.08193, -1482.56845, -1816.39751, -1487.22167, -1520.09731, -1674.53252, -1562.24085, -1564.05709, -1610.99771, -1674.17446, -1490.04689, -1494.13455, -1863.96641, -1815.92659, -1591.39382, -1509.01399, -1582.38095, -1535.56307, -1566.07824, -1586.28693, -1845.31787, -1584.52143, -1504.68414, -1621.20429, -1572.56609, -1839.49268, -1873.00151, -1658.05409, -1696.48022, -1791.82072, -1511.29796, -1777.67272, -1587.93376, -809.06656, -1566.16201, -1657.39319, -1623.12404, -1615.88311, -1564.50842, -1547.72853, -1676.30986, -1616.06722, -1621.18598, -1650.4348, -1489.06465, -1793.0907, -1664.21861, -1589.70301, -1548.32233, -1536.91886, -1672.30044, -1554.85206, -1567.75435, -1594.41146, -1578.24147, -1639.87186, -1693.41536, -1758.58761, -1516.00263, -1840.58024, -1657.65196, -1646.00222, -1519.59924, -1505.9347, -1584.94621, -1605.54961, -1603.4395, -1705.80126, -1581.09174, -1571.31269, -1539.0175, -1665.58151, -1606.44055, -1548.76577, -1659.05555, -1615.14502, -1526.77163, -1877.76875, -1517.92329, -1792.50388, -1639.49025, -1608.1388, -1573.16349, -1647.2889, -1539.19401, -1573.27062, -1612.23336, -1670.64323, -1520.91388, -1589.31978, -1852.16305, -1610.50249, -1626.09527, -1673.63556, -1821.55677, -1525.4755, -1571.80534, -1682.43008, -1523.81803, -1612.6523, -1519.10236, -1565.9001, -1610.23435, -1515.63294, -1494.66707, -1521.73373, -1694.86432, -1528.40909, -1675.54353, -1830.37617, -1585.51706, -1679.2051, -1551.3299, -1579.87052, -1579.74842, -1528.40107, -1655.03852, -862.92538, -1691.0601, -1519.27735, -1577.47119, -1539.37339, -1605.93172, -1557.60453, -941.8031, -1499.15063, -1836.6699, -1671.04787, -1554.21428, -1614.89647, -1511.32395, -1844.96112, -1572.7198, -1507.46621, -1694.57501, -668.12659, -1492.76055, -1483.35501, -1568.09576, -1602.00488, -853.66934, -1652.88283, -1573.06181, -1542.1354, -1600.96259, -1623.5882, -1573.70192, -1588.65233, -1717.86939, -1837.56971, -1501.63991, -1842.73493, -1684.52597, -1509.35438, -1620.56997, -1583.07868, -1539.86933, -1596.41033, -1816.71922, -1555.47485, -1680.79144, -1532.24646, -1495.07823, -1604.96711, -1654.84148, -1537.86828, -1636.55815, -1616.90115, -1838.65444, -1853.29716, -1553.3276, -1835.50777, -1520.67287, -1573.76455, -1550.97344, -1615.70177, -1673.39099, -1665.37783, -1594.27998, -1608.21394, -1633.49644, -1605.18279, -1514.98654, -1611.04977, -1624.27547, -1652.77985, -1574.23091, -1541.51826, -1577.82481, -872.63512, -1625.3585, -1549.07882, -1583.94931, -1845.7434, -1519.96525, -1579.84488, -1737.83677, -1600.01159, -1662.82459, -1532.94365, -1583.82911, -1679.07437, -1705.80639, -1528.06348, -1618.2868, -1583.31879, -1790.94373, -1629.89558, -1569.97529, -1518.24736, -1567.02463, -1525.72615, -1620.19548, -1726.07465, -1550.84114, -1607.54933, -1877.81018, -1536.17688, -1576.07659, -1556.4236, -1618.78694, -1846.55609, -1634.39182, -1620.74244, -1562.13148, -1625.18955, -1539.40341, -1536.90705, -1796.24466, -1846.98434, -1825.82612, -1637.84451, -1786.86656, -1640.99126, -1585.37284, -1543.24162, -1537.58373, -1510.51852, -1519.53166, -1714.20639, -1740.97554, -1656.99925, -1580.01524, -1519.72061, -1609.54908, -1547.22079, -1648.51634, -1812.3565, -1754.82791, -1594.06886, -1586.02242, -1725.47607, -1580.03638, -1542.8611, -1654.96116, -1598.26721, -1605.65241, -1617.73023, -1593.00367, -1539.88427, -1815.0083, -1639.0839, -1628.10843, -1558.63219, -1571.25093, -1607.60349, -1530.64396, -1774.54097, -1575.27903, -1581.0529, -1610.07901, -1632.68266, -1506.82556, -1576.1131, -1534.1928, -1621.78916, -1517.07447, -1605.28925, -1630.12254, -1734.74917, -1576.83254, -1618.99955, -911.8594, -1744.39658, -1678.95567, -1584.32078, -1654.1464, -1505.75332, -1648.53572, -1621.73245, -1500.03771, -1575.53695, -1543.64084, -1612.9748, -1618.05498, -1504.37844, -1557.12032, -1536.64836, -1477.25785, -1585.47289, -1618.09894, -1629.1892, -1587.01634, -1616.51134, -1653.6662, -1658.12594, -1818.34959, -1531.70086, -1539.46204, -1819.82247, -1717.3648, -1570.16514, -1529.01593, -1514.95787, -1660.16537, -1603.681, -1533.36097, -1546.30137, -1656.03155, -1561.12241, -1568.5364, -1688.62239, -1694.82331, -1603.44707, -1577.86445, -1557.91763, -1636.23043, -1525.82939, -1804.28687, -1590.33302, -1651.34514, -1763.36297, -1503.71614, -1700.58166, -1678.65467, -1540.36903, -1541.27763, -893.3337, -1597.11133, -1530.57883, -1587.24682, -1551.42038, -1557.09278, -1821.60109, -1626.492, -1614.49475, -1778.02164, -1555.75598, -1632.38117, -1551.51292, -1596.84514, -1579.87266, -1573.88966, -1565.00734, -1613.07212, -1604.09183, -1620.27783, -1533.59268, -1576.03113, -1510.02659, -1850.84319, -1599.76604, -1817.75761, -1621.14207, -1523.53921, -1721.27898, -1776.77938, -1537.95105, -1613.76191, -1532.48622, -1733.20085, -1564.12969, -1706.00953, -1513.3643, -1669.03995, -1646.86261, -1604.11507, -1556.12531, -1519.79407, -1635.07201, -1853.53224, -1723.07474, -1583.7363, -1641.95173, -1663.56208, -1856.02121, -1499.95275, -1631.87606, -1528.26763, -1596.6974, -1631.06283, -1778.68323, -1568.64849, -1792.07404, -1594.26542, -1564.9493, -1534.3621, -1728.80859, -1732.41568, -1657.78121, -1562.83079, -1600.92268, -1647.93724, -1576.44233, -1559.67291, -1644.9845, -1519.63307, -1643.27478, -1857.38469, -1644.98213, -1605.64199, -1532.47564, -1549.0722, -1824.33494, -1572.01674, -1588.46521, -1638.99217, -1572.17806, -854.82928, -1609.65523, -1570.17272, -1618.37274, -1844.5853, -1592.65925, -1856.89467, -1532.37183, -1585.90354, -1573.40895, -1536.59563, -1666.32376, -1558.69759, -1516.72244, -1519.18122, -1618.62377, -805.10001, -1599.79748, -1509.55277, -1599.59065, -1836.43252, -1520.95349, -1546.84314, -1653.45571, -1815.54338, -1564.23951, -1541.17622, -1825.02394, -1598.27763, -1672.35245, -1628.11804, -1629.09174, -1850.76811, -1544.08699, -1790.40281, -1509.71787, -1585.81504, -1542.43854, -1838.51217, -1558.7221, -1730.42102, -1772.57315, -1607.7336, -1626.59307, -1631.52457, -1591.17527, -1521.82709, -1764.26317, -1689.0979, -1648.24864, -1530.69435, -1513.9113, -1673.3079, -1646.98956, -1602.79202, -1700.20017, -1554.70716, -1612.25108, -1672.89594, -1484.8498, -1651.78365, -1569.24465, -1825.91271, -1725.77809, -1634.34953, -1565.29965, -1502.50917, -1533.68227, -1529.47574, -1642.60238, -1508.3897, -1561.36122, -1841.83483, -1768.74337, -1677.13701, -1667.23123, -1597.16366, -1732.95724, -1545.04269, -1761.31209, -1524.93338, -1729.75085, -1713.43906, -1554.47295, -1517.49553, -1565.58306, -1638.77619, -1626.41021, -1877.57016, -1545.65723, -1653.00811, -1529.70822, -1578.67723, -1528.04726, -1493.33741, -1518.66465, -1609.55723, -1605.8835, -1818.95434, -1582.52446, -1598.67142, -1645.90077, -1610.27141, -1507.94904, -1717.52206, -1615.14629, -1826.03349, -1546.15107, -1516.3739, -1576.35142, -1650.46019, -1584.73738, -1678.05716, -1655.97051, -1574.80231, -1539.58053, -1563.87246, -1697.99717, -1522.79635, -1636.27343, -1563.99869, -1571.019, -1703.26619, -1666.12816, -1563.58134, -1745.51169, -1656.43745, -1683.06796, -1595.54389, -1544.35973, -1568.87098, -1582.92962, -1552.79556, -1639.24227, -1589.14979, -1492.37669, -1623.78323, -1546.31085, -1610.3688, -1763.61012, -1544.40068, -1660.25099, -1667.53018, -1618.21574, -1545.55171, -1626.29077, -1661.11402, -1491.01595, -1511.02548, -1597.03607, -1720.90369, -1744.63172, -1881.25676, -1539.63761, -1584.58647, -1594.06911, -1580.1284, -1611.02013, -1554.29279, -1487.56509, -1790.17701, -1586.51349, -1818.56341, -868.56619, -1651.27951, -1711.6132, -1832.28135, -1533.84278, -1542.51916, -1646.3636, -1533.87769, -1854.74958, -1804.42303, -1684.31625, -1560.96806, -1572.42498, -1618.20682, -1623.0288, -1547.79327, -1860.42191, -1607.69376, -1583.09655, -1573.51042, -1622.41911, -1503.26025, -1533.13256, -1804.0569, -1554.66405, -1800.65139, -1618.20571, -1789.3049, -1643.53466, -898.46168, -1660.61477, -1576.02073, -1618.44144, -1615.65672, -1519.64008, -1522.28767, -1813.83032, -1737.54664, -1692.9416, -1617.83743, -1823.27591, -1597.86463, -1827.03248, -1817.70474, -1620.58361, -1847.09492, -1703.9398, -1502.83717, -1652.25931, -1833.48683, -1854.13973, -1547.00511, -1594.42343, -1521.93707, -1604.4268, -1632.91598, -1528.01252, -1840.51288, -1781.47127, -1505.38653, -1844.95366, -1549.17153, -1680.0805, -1524.99905, -1597.61222, -1554.73373, -1773.56776, -1513.09455, -1812.59559, -1669.5962, -1497.37093, -1563.36462, -1771.10349, -1510.93094, -1519.4981, -1605.00271, -1669.38559, -1620.21686, -1513.06339, -1685.18259, -1632.6536, -1532.24981, -1557.20948, -1521.72588, -1523.18124, -1507.6357, -1580.94117, -1571.88128, -1591.21092, -1589.87408, -1842.01622, -1686.59634, -1524.84439, -1524.81883, -1515.35309, -1596.61346, -1829.07341, -1521.92122, -1525.27212, -1781.62422, -1818.16381, -1553.53886, -1612.6163, -1613.95146, -1583.50875, -1760.97243, -1507.84077, -1824.07903, -1545.18034, -1599.22498, -1675.21656, -1660.14388, -1532.95684, -1611.82927, -1612.29466, -1610.62986, -1606.23592, -1624.83321, -1524.52863, -1569.86447, -1610.92391, -1521.97667, -1819.29482, -1601.60454, -1820.85377, -1768.67773, -1636.77506, -1533.61593, -1530.95154, -1738.84415, -1627.31103, -1685.51007, -1521.13315, -1533.09162, -1603.65552, -1606.28173, -1663.68521, -1507.92187, -1510.64463, -1737.43404, -1566.36498, -1680.54174, -1639.57087, -1820.78295, -1602.46143, -1546.7185, -1648.946, -1542.36938, -1784.14415, -1610.21847, -1844.0876, -781.56228, -1625.82415, -1582.82979, -1609.6247, -1535.26915, -1544.74938, -1708.34728, -1542.18444, -1757.66117, -1544.34491, -1808.20153, -1552.65673, -1497.01902, -1581.24905, -1586.56829, -1594.57584, -1629.18614, -1569.73538, -1603.22399], }, layout = { paper_bgcolor: 'rgba(0,0,0,0)', plot_bgcolor: 'rgba(0,0,0,0)', scene: { yaxis: { title: 'sx' }, xaxis: { title: 'sy' }, zaxis: { title: 'sz' }, }, margin: { t: 30, l: 0, r: 0, b: 0, }, } config = { showLink: false, modeBarButtonsToRemove: ['sendDataToCloud'], responsive: true, } Plotly.plot(plotDiv, [trace0, ], layout, config) plotDiv.on('plotly_hover', data =>{ const runID = runIDs[data.points[0].curveNumber][data.points[0].pointNumber] document.getElementById(\"hoverIMG\").src = path+`/${runID}.`+imgType }) window.onresize = () => { resizeContents() } Quick Start You can call the command-line tool as follows: $ python -m lasso.dimred.run --help usage: run.py [-h] --reference-run REFERENCE_RUN [--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]] [--start-stage [START_STAGE]] [--end-stage [END_STAGE]] --project-dir PROJECT_DIR [--embedding-images EMBEDDING_IMAGES] [--logfile-filepath [LOGFILE_FILEPATH]] [--n-processes [N_PROCESSES]] [--part-ids [PART_IDS [PART_IDS ...]]] [--timestep TIMESTEP] [--cluster-args [CLUSTER_ARGS [CLUSTER_ARGS ...]]] [--outlier-args [OUTLIER_ARGS [OUTLIER_ARGS ...]]] [simulation_runs [simulation_runs ...]] Python utility script for dimensionality reduction. positional arguments: simulation_runs Simulation runs or patterns used to search for simulation runs. optional arguments: -h, --help show this help message and exit --reference-run REFERENCE_RUN Set the reference run instead of using the first entry in simulation runs. --exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]] Runs to exclude from the analysis. --start-stage [START_STAGE] At which specific stage to start the analysis (REFERENCE_RUN, IMPORT_RUNS, REDUCTION, CLUSTERING, EXPORT_PLOT). --end-stage [END_STAGE] At which specific stage to stop the analysis (REFERENCE_RUN, IMPORT_RUNS, REDUCTION, CLUSTERING, EXPORT_PLOT). --project-dir PROJECT_DIR Project dir for temporary files. Must be specified to allow restart at specific steps --embedding-images EMBEDDING_IMAGES Path to folder containing images of runs. Sample names must be numbers --logfile-filepath [LOGFILE_FILEPATH] Path for the logfile. A file will be created automatically if a project dir is specified. --n-processes [N_PROCESSES] Number of processes to use (default: n_cpu-1). --part-ids [PART_IDS [PART_IDS ...]] Part ids to process. By default all are taken. --timestep TIMESTEP Sets timestep to analyse. Uses last timestep if not set. --cluster-args [CLUSTER_ARGS [CLUSTER_ARGS ...]] Arguments for clustering algorithms. If not set, clustering will be skipped. --outlier-args [OUTLIER_ARGS [OUTLIER_ARGS ...]] Arguments for outlier detection befor clustering. Following arguments are required for the analysis: simulation-runs --project-dir] simulation-runs can be either tagged individually or by using placeholders for entire directories (e.g. '*.fz') and subdirectories (e.g. './**/*.fz'). Warning Every run clears respective steps of the generated .hdf5 file of previous runs, as well as the logfile. Tutorial In this tutorial, we will introduce the application of the command-line utility and explain some of the arguments. Make sure to have some similar D3plots (20 should already be fine). At first we will only apply the required arguments: $ python -m lasso/dimred/run \\ $ user/tutorial/plots/plot*.fz \\ $ --project-dir user/tutorial/projectfolder The first required argument is the filepath to the folder containing the simulation runs. In our case, all plots are contained in the same folder. If each plot is saved in its own folder, the command would look like this: $ python -m lasso/dimred/run \\ $ user/tutorial/plots*/plot.fz \\ $ --project-dir user/tutorial/projectfolder The --project-dir argument specifies the folder where the project data is saved. This will be a project_buffer.hdf5 file, a logfile , and the 3d_beta_plot[hh:mm:ss].html output. Note that for each run, corresponding entries in the project_buffer.hdf5 and the logfile will be overwritten. How to access the results in the project_buffer.hdf5 file will be discussed later. Your output should look similar to this: ==== OPEN - LASSO ==== \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513 \u2503 n-processes \u2503 5 \u2503 \u2502 reference-run \u2502 user/tuorial/plots/plot0.fz \u2502 \u2502 project-dir \u2502 user/tutorial/projectfolder \u2502 \u2502 # simul.-files \u2502 35 \u2502 \u2502 # excluded files \u2502 0 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 ---- Running Routines ---- [14:25:56] Reference Subsample ... [14:26:04] Loadtime Reference subample: 8.020 [14:26:04] Total time for Reference subample: 8.080 [14:26:04] Reference subsample completed [14:26:04] Subsampling Subsampling plots ... \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 35 of 35; [14:29:03] Average Time per Subsampling Process: 24.76 [14:29:03] Average Loadtime per sample: 24.55 [14:29:03] Subsampling completed [14:29:03] Dimension Reduction ... [14:29:04] Dimension Reduction completed [14:29:04] No arguments provided for clustering, clustering aborted [14:29:04] Creating .html viz [14:29:05] Finished creating viz The output provides information about the different stages of the dimred tool, as well as some additional information. This allows you to keep track of the tools progress. The following 5 stages are run through: REFERENCE_RUN: The reference run is subsampled and saved. The reference run is either the first entry of the simulation runs, or can be manually set with --reference-run IMPORT_RUNS: The provided simulation runs are loaded, and subsampled using the reference run. This process applies a nearest neighbor algorithm to match nodes between different meshes to compensate for different meshing. REDUCTION: The dimensionality reduction is performed. CLUSTERING: If clustering and outlier arguments are provided, the results will be further categorized. EXPORT_PLOT: The results are exported and saved as .html file. Note Your computer may slow down while using the tool. If you want to use other programs while waiting on the tool to finish, reduce the amount of cores with --n-processes Start and End stage Next, we will take a look at the --start-stage and --end-stage arguments. These allow to restart and end the command-line utility at certain points in the process. This is usefull if you don't want to repeat certain stages to save time, or want to end the process prematurly, e.g. don't want to generate the .html output. To set the desired start and end stage, use the the following keywords: REFERENCE_RUN IMPORT_RUNS REDUCTION CLUSTERING EXPORT_PLOT Example: $ python -m lasso/dimred/run \\ $ user/tutorial/plots \\ $ --project-dir user/tutorial/projectfolder \\ $ --start-stage REDUCTION \\ $ --end-stage CLUSTERING ==== OPEN - LASSO ==== \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513 \u2503 n-processes \u2503 5 \u2503 \u2502 reference-run \u2502 user/tutorial/plots/plot0.fz \u2502 \u2502 project-dir \u2502 user/tutorial/projectfolder \u2502 \u2502 # simul.-files \u2502 35 \u2502 \u2502 # excluded files \u2502 0 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 ---- Running Routines ---- [14:45:28] Skipped import stage [14:45:28] Dimension Reduction ... [14:45:29] Dimension Reduction completed [14:45:29] No arguments provided for clustering, clustering aborted This process is much quicker, as the samples have already been loaded and subsampled. Note that this only works, if the stages before the selected start stage (here: REFERENCE_RUN and IMPORT_RUNS have already been processed before. Clustering and outlier detection The dimred tool has an integrated functionality to cluster your results and detect outliers. Following cluster algorithms from the scikit sklearn library have been implemented: kmeans SpectralClustering DBScan Optics Additionally, you have access to the following outlier detection algorithms from the same library: IsolationForest LocalOutlierFactor OneClassSVM These classes have additional optional arguments, specified in their respective documentation. Here is an example on how to find two clusters with kmeans and detect oultiers with LocalOutlierFactor: $ python -m lasso/dimred/run \\ $ user/tutorial/plots \\ $ --project-dir user/tutorial/projectfolder \\ $ --reference-run user/tuorial/referenceplot \\ $ --start-stage REDUCTION \\ $ --cluster-arg kmeans n_clusters int 2 \\ $ --outlier-args LocalOutlierFactor !!! note> The argument n_clusters is followed by its type and then its value! The type of a keyword can be referenced by the appropriate sklearn documentation. Some types are not supported, make sure that they are either float , int or str . We skip the import stage again and add the --cluster-args and --outlier-args arguments, followed by the desired algorithm and optional additional arguments and their values. Accessing the results All results, as well as the subsamples and reference subsample are saved in the project_buffer.hdf5 file. You can access these in your own python scripts: import numpy as np import h5py h5py_path = \"user/tutorial/project_buffer.hdf5\" h5file = h5py . File ( h5py_path ) # access the reference subsamples: ref_sample = h5file [ \"subsample\" ][:] # create a numpy array containing displacement of all subsamples # this returns an array of shape (samples, timesteps, nodes, dims) np . stack ( h5file [ \"subsampled_runs\" ][ entry ][:] for entry in h5file [ \"subsampled_runs\" ] . keys ()]) # create a numpy array containg the right reduced order basis for projection: v_rob = h5file [ \"v_rob\" ][:] # the subsampled runs are projected into the right reduced order basis and called betas: betas = np . stack ([ h5file [ \"betas\" ][ entry ][:] for entry in h5file [ \"betas\" ] . keys ()]) These betas are used for the visulatization and if specified, clustering or outlier detection. In the visulatization, only the first 3 coefficients (betas) and only the last timestamp are accounted for. If you have provided clustering and outlier detection arguments, you can also access the different clusters: cluster_index = np . stack ([ h5file [ \"betas\" ][ entry ] . attrs [ \"cluster\" ] for entry in h5file [ \"betas\" ] . keys () ]) beta_clusters = [] for cluster in range ( h5file [ \"betas\" ] . attrs [ \"nr_clusters\" ]): beta_clusters . append ( betas [ np . where ( cluster_index == cluster )[ 0 ]]) The beta_clusters list contains lists of betas for each cluster. If outlier arguments have been provided, the first list contains all detected outliers. FAQ How to specify a path to the displayed images? In the final HTML there is a menu on the left side. In it you can specify a path to the image folder, as well as the file-ending. Be aware: The names of the images must be a number starting at 0 .","title":"Command Line Tool"},{"location":"dimred/command_line_interface/#command-line-tool","text":"","title":"Command-Line Tool"},{"location":"dimred/command_line_interface/#what-does-this-command-line-tool-do","text":"This command-line tool creates compact overviews over tens, hundreds or even thousands of simulation runs. This is done by performing an unsupervised learning method on the displacement field of the simulations. The result is a report in the form of a 3D plot. Every point in the plot is a simulation result. If two points are very close their simulation results are also expected to be very similar. One can confirm by using images from every simulation (there is an option to specify the path to a folder with those images).","title":"What does this command-line tool do?"},{"location":"dimred/command_line_interface/#example-visualization-report","text":"This is a plot for dimensionality reduction of a rail getting crushed. This plot has many detail levels. Check out the following facts: There are two groups. The small group stands for samples buckling bottom . The big group represents buckling in the top area. There are two outliers Sample 143 is folding in the top and bottom. Sample 99 is folding in the middle. Similarity Axis The similarity axis X describes buckling top or bottom The similarity axis Y describes how much a sample gets compressed The samples are basically in a plane. The out of plane axis represents buckling not strictly top but also slightly in the lower end (zoom in). .navClosed { background-color: white; transition: 0.5s; display: flex; flex-direction: row; align-content: center; width: 100%; margin-bottom: 100px; } #plotDiv { width: 70%; } .imgDiv { width: 50%; display: flex; justify-content: center; align-items: center; } img.hoverIMG { /* height: 550px; */ } path = \"https://www.lasso.de/fileadmin/ressources/ml-embedding-images/\" imgType = \"png\" const plotDiv = document.getElementById(\"plotDiv\") function initDocument(){ /* const userWidth = plotDiv.offsetWidth / 2 const userHeight = \"550px\" plotDiv.style = `width: ${Math.floor( userWidth * 0.65) - 10}px; height: ${userHeight-30}px; z-index: 10;` plotDiv.style = `width: ${Math.floor( userWidth * 0.25) - 10}px; height: ${userHeight-30}px; z-index: 1;` */ } function resizeContents(){ /* let userWidth = plotDiv.offsetWidth / 2 const userHeight = \"550px\" plotDiv.style = `width: ${Math.floor( userWidth * 0.65) - 10}px; height: ${userHeight-30}px; z-index: 10;` plotDiv.style = `width: ${Math.floor( userWidth * 0.25) - 10}px; height: ${userHeight-30}px: z-index: 1;` Plotly.Plots.resize(plotDiv) */ } initDocument() const runIDs = [['1000', '100', '101', '102', '103', '104', '105', '106', '107', '108', '109', '10', '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '11', '120', '121', '122', '123', '124', '125', '126', '127', '128', '129', '12', '130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '13', '140', '141', '142', '143', '144', '145', '146', '147', '148', '149', '14', '150', '151', '152', '153', '154', '155', '156', '157', '158', '159', '15', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169', '16', '170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '17', '180', '181', '182', '183', '184', '185', '186', '187', '188', '189', '18', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '19', '200', '201', '202', '203', '204', '205', '206', '207', '208', '209', '20', '210', '211', '212', '213', '214', '215', '216', '217', '218', '219', '21', '220', '221', '222', '223', '224', '225', '226', '227', '228', '229', '22', '230', '231', '232', '233', '234', '235', '236', '237', '238', '239', '23', '240', '241', '242', '243', '244', '245', '246', '247', '248', '249', '24', '250', '251', '252', '253', '254', '255', '256', '257', '258', '259', '25', '260', '261', '262', '263', '264', '265', '266', '267', '268', '269', '26', '270', '271', '272', '273', '274', '275', '276', '277', '278', '279', '27', '280', '281', '282', '283', '284', '285', '286', '287', '288', '289', '28', '290', '291', '292', '293', '294', '295', '296', '297', '298', '299', '29', '2', '300', '301', '302', '303', '304', '305', '306', '307', '308', '309', '30', '310', '311', '312', '313', '314', '315', '316', '317', '318', '319', '31', '320', '321', '322', '323', '324', '325', '326', '327', '328', '329', '32', '330', '331', '332', '333', '334', '335', '336', '337', '338', '339', '33', '340', '341', '342', '343', '344', '345', '346', '347', '348', '349', '34', '350', '351', '352', '353', '354', '355', '356', '357', '358', '359', '35', '360', '361', '362', '363', '364', '365', '366', '367', '368', '369', '36', '370', '371', '372', '373', '374', '375', '376', '377', '378', '379', '37', '380', '381', '382', '383', '384', '385', '386', '387', '388', '389', '38', '390', '391', '392', '393', '394', '395', '396', '397', '398', '399', '39', '3', '400', '401', '402', '403', '404', '405', '406', '407', '408', '409', '40', '410', '411', '412', '413', '414', '415', '416', '417', '418', '419', '41', '420', '421', '422', '423', '424', '425', '426', '427', '428', '429', '42', '430', '431', '432', '433', '434', '435', '436', '437', '438', '439', '43', '440', '441', '442', '443', '444', '445', '446', '447', '448', '449', '44', '450', '451', '452', '453', '454', '455', '456', '457', '458', '459', '45', '460', '461', '462', '463', '464', '465', '466', '467', '468', '469', '46', '470', '471', '472', '473', '474', '475', '476', '477', '478', '479', '47', '480', '481', '482', '483', '484', '485', '486', '487', '488', '489', '48', '490', '491', '492', '493', '494', '495', '496', '497', '498', '499', '49', '4', '500', '501', '502', '503', '504', '505', '506', '507', '508', '509', '50', '510', '511', '512', '513', '514', '515', '516', '517', '518', '519', '51', '520', '521', '522', '523', '524', '525', '526', '527', '528', '529', '52', '530', '531', '532', '533', '534', '535', '536', '537', '538', '539', '53', '540', '541', '542', '543', '544', '545', '546', '547', '548', '549', '54', '550', '551', '552', '553', '554', '555', '556', '557', '558', '559', '55', '560', '561', '562', '563', '564', '565', '566', '567', '568', '569', '56', '570', '571', '572', '573', '574', '575', '576', '577', '578', '579', '57', '580', '581', '582', '583', '584', '585', '586', '587', '588', '589', '58', '590', '591', '592', '593', '594', '595', '596', '597', '598', '599', '59', '5', '600', '601', '602', '603', '604', '605', '606', '607', '608', '609', '60', '610', '611', '612', '613', '614', '615', '616', '617', '618', '619', '61', '620', '621', '622', '623', '624', '625', '626', '627', '628', '629', '62', '630', '631', '632', '633', '634', '635', '636', '637', '638', '639', '63', '640', '641', '642', '643', '644', '645', '646', '647', '648', '649', '64', '650', '651', '652', '653', '654', '655', '656', '657', '658', '659', '65', '660', '661', '662', '663', '664', '665', '666', '667', '668', '669', '66', '670', '671', '672', '673', '674', '675', '676', '677', '678', '679', '67', '680', '681', '682', '683', '684', '685', '686', '687', '688', '689', '68', '690', '691', '692', '693', '694', '695', '696', '697', '698', '699', '69', '6', '700', '701', '702', '703', '704', '705', '706', '707', '708', '709', '70', '710', '711', '712', '713', '714', '715', '716', '717', '718', '719', '71', '720', '721', '722', '723', '724', '725', '726', '727', '728', '729', '72', '730', '731', '732', '733', '734', '735', '736', '737', '738', '739', '73', '740', '741', '742', '743', '744', '745', '746', '747', '748', '749', '74', '750', '751', '752', '753', '754', '755', '756', '757', '758', '759', '75', '760', '761', '762', '763', '764', '765', '766', '767', '768', '769', '76', '770', '771', '772', '773', '774', '775', '776', '777', '778', '779', '77', '780', '781', '782', '783', '784', '785', '786', '787', '788', '789', '78', '790', '791', '792', '793', '794', '795', '796', '797', '798', '799', '79', '7', '800', '801', '802', '803', '804', '805', '806', '807', '808', '809', '80', '810', '811', '812', '813', '814', '815', '816', '817', '818', '819', '81', '820', '821', '822', '823', '824', '825', '826', '827', '828', '829', '82', '830', '831', '832', '833', '834', '835', '836', '837', '838', '839', '83', '840', '841', '842', '843', '844', '845', '846', '847', '848', '849', '84', '850', '851', '852', '853', '854', '855', '856', '857', '858', '859', '85', '860', '861', '862', '863', '864', '865', '866', '867', '868', '869', '86', '870', '871', '872', '873', '874', '875', '876', '877', '878', '879', '87', '880', '881', '882', '883', '884', '885', '886', '887', '888', '889', '88', '890', '891', '892', '893', '894', '895', '896', '897', '898', '899', '89', '8', '900', '901', '902', '903', '904', '905', '906', '907', '908', '909', '90', '910', '911', '912', '913', '914', '915', '916', '917', '918', '919', '91', '920', '921', '922', '923', '924', '925', '926', '927', '928', '929', '92', '930', '931', '932', '933', '934', '935', '936', '937', '938', '939', '93', '940', '941', '942', '943', '944', '945', '946', '947', '948', '949', '94', '950', '951', '952', '953', '954', '955', '956', '957', '958', '959', '95', '960', '961', '962', '963', '964', '965', '966', '967', '968', '969', '96', '970', '971', '972', '973', '974', '975', '976', '977', '978', '979', '97', '980', '981', '982', '983', '984', '985', '986', '987', '988', '989', '98', '990', '991', '992', '993', '994', '995', '996', '997', '998', '999', '99', '9']] trace0 = { type: 'scatter3d', name: 'cluster 0', mode: 'markers', marker: { color: '#17becf', colorscale: 'Jet', size: 5.5, line: { width: 0.5, color: 'rgb(220, 220, 220)', }, }, hoverinfo: 'text', text: ['sample1000.fz', 'sample100.fz', 'sample101.fz', 'sample102.fz', 'sample103.fz', 'sample104.fz', 'sample105.fz', 'sample106.fz', 'sample107.fz', 'sample108.fz', 'sample109.fz', 'sample10.fz', 'sample110.fz', 'sample111.fz', 'sample112.fz', 'sample113.fz', 'sample114.fz', 'sample115.fz', 'sample116.fz', 'sample117.fz', 'sample118.fz', 'sample119.fz', 'sample11.fz', 'sample120.fz', 'sample121.fz', 'sample122.fz', 'sample123.fz', 'sample124.fz', 'sample125.fz', 'sample126.fz', 'sample127.fz', 'sample128.fz', 'sample129.fz', 'sample12.fz', 'sample130.fz', 'sample131.fz', 'sample132.fz', 'sample133.fz', 'sample134.fz', 'sample135.fz', 'sample136.fz', 'sample137.fz', 'sample138.fz', 'sample139.fz', 'sample13.fz', 'sample140.fz', 'sample141.fz', 'sample142.fz', 'sample143.fz', 'sample144.fz', 'sample145.fz', 'sample146.fz', 'sample147.fz', 'sample148.fz', 'sample149.fz', 'sample14.fz', 'sample150.fz', 'sample151.fz', 'sample152.fz', 'sample153.fz', 'sample154.fz', 'sample155.fz', 'sample156.fz', 'sample157.fz', 'sample158.fz', 'sample159.fz', 'sample15.fz', 'sample160.fz', 'sample161.fz', 'sample162.fz', 'sample163.fz', 'sample164.fz', 'sample165.fz', 'sample166.fz', 'sample167.fz', 'sample168.fz', 'sample169.fz', 'sample16.fz', 'sample170.fz', 'sample171.fz', 'sample172.fz', 'sample173.fz', 'sample174.fz', 'sample175.fz', 'sample176.fz', 'sample177.fz', 'sample178.fz', 'sample179.fz', 'sample17.fz', 'sample180.fz', 'sample181.fz', 'sample182.fz', 'sample183.fz', 'sample184.fz', 'sample185.fz', 'sample186.fz', 'sample187.fz', 'sample188.fz', 'sample189.fz', 'sample18.fz', 'sample190.fz', 'sample191.fz', 'sample192.fz', 'sample193.fz', 'sample194.fz', 'sample195.fz', 'sample196.fz', 'sample197.fz', 'sample198.fz', 'sample199.fz', 'sample19.fz', 'sample200.fz', 'sample201.fz', 'sample202.fz', 'sample203.fz', 'sample204.fz', 'sample205.fz', 'sample206.fz', 'sample207.fz', 'sample208.fz', 'sample209.fz', 'sample20.fz', 'sample210.fz', 'sample211.fz', 'sample212.fz', 'sample213.fz', 'sample214.fz', 'sample215.fz', 'sample216.fz', 'sample217.fz', 'sample218.fz', 'sample219.fz', 'sample21.fz', 'sample220.fz', 'sample221.fz', 'sample222.fz', 'sample223.fz', 'sample224.fz', 'sample225.fz', 'sample226.fz', 'sample227.fz', 'sample228.fz', 'sample229.fz', 'sample22.fz', 'sample230.fz', 'sample231.fz', 'sample232.fz', 'sample233.fz', 'sample234.fz', 'sample235.fz', 'sample236.fz', 'sample237.fz', 'sample238.fz', 'sample239.fz', 'sample23.fz', 'sample240.fz', 'sample241.fz', 'sample242.fz', 'sample243.fz', 'sample244.fz', 'sample245.fz', 'sample246.fz', 'sample247.fz', 'sample248.fz', 'sample249.fz', 'sample24.fz', 'sample250.fz', 'sample251.fz', 'sample252.fz', 'sample253.fz', 'sample254.fz', 'sample255.fz', 'sample256.fz', 'sample257.fz', 'sample258.fz', 'sample259.fz', 'sample25.fz', 'sample260.fz', 'sample261.fz', 'sample262.fz', 'sample263.fz', 'sample264.fz', 'sample265.fz', 'sample266.fz', 'sample267.fz', 'sample268.fz', 'sample269.fz', 'sample26.fz', 'sample270.fz', 'sample271.fz', 'sample272.fz', 'sample273.fz', 'sample274.fz', 'sample275.fz', 'sample276.fz', 'sample277.fz', 'sample278.fz', 'sample279.fz', 'sample27.fz', 'sample280.fz', 'sample281.fz', 'sample282.fz', 'sample283.fz', 'sample284.fz', 'sample285.fz', 'sample286.fz', 'sample287.fz', 'sample288.fz', 'sample289.fz', 'sample28.fz', 'sample290.fz', 'sample291.fz', 'sample292.fz', 'sample293.fz', 'sample294.fz', 'sample295.fz', 'sample296.fz', 'sample297.fz', 'sample298.fz', 'sample299.fz', 'sample29.fz', 'sample2.fz', 'sample300.fz', 'sample301.fz', 'sample302.fz', 'sample303.fz', 'sample304.fz', 'sample305.fz', 'sample306.fz', 'sample307.fz', 'sample308.fz', 'sample309.fz', 'sample30.fz', 'sample310.fz', 'sample311.fz', 'sample312.fz', 'sample313.fz', 'sample314.fz', 'sample315.fz', 'sample316.fz', 'sample317.fz', 'sample318.fz', 'sample319.fz', 'sample31.fz', 'sample320.fz', 'sample321.fz', 'sample322.fz', 'sample323.fz', 'sample324.fz', 'sample325.fz', 'sample326.fz', 'sample327.fz', 'sample328.fz', 'sample329.fz', 'sample32.fz', 'sample330.fz', 'sample331.fz', 'sample332.fz', 'sample333.fz', 'sample334.fz', 'sample335.fz', 'sample336.fz', 'sample337.fz', 'sample338.fz', 'sample339.fz', 'sample33.fz', 'sample340.fz', 'sample341.fz', 'sample342.fz', 'sample343.fz', 'sample344.fz', 'sample345.fz', 'sample346.fz', 'sample347.fz', 'sample348.fz', 'sample349.fz', 'sample34.fz', 'sample350.fz', 'sample351.fz', 'sample352.fz', 'sample353.fz', 'sample354.fz', 'sample355.fz', 'sample356.fz', 'sample357.fz', 'sample358.fz', 'sample359.fz', 'sample35.fz', 'sample360.fz', 'sample361.fz', 'sample362.fz', 'sample363.fz', 'sample364.fz', 'sample365.fz', 'sample366.fz', 'sample367.fz', 'sample368.fz', 'sample369.fz', 'sample36.fz', 'sample370.fz', 'sample371.fz', 'sample372.fz', 'sample373.fz', 'sample374.fz', 'sample375.fz', 'sample376.fz', 'sample377.fz', 'sample378.fz', 'sample379.fz', 'sample37.fz', 'sample380.fz', 'sample381.fz', 'sample382.fz', 'sample383.fz', 'sample384.fz', 'sample385.fz', 'sample386.fz', 'sample387.fz', 'sample388.fz', 'sample389.fz', 'sample38.fz', 'sample390.fz', 'sample391.fz', 'sample392.fz', 'sample393.fz', 'sample394.fz', 'sample395.fz', 'sample396.fz', 'sample397.fz', 'sample398.fz', 'sample399.fz', 'sample39.fz', 'sample3.fz', 'sample400.fz', 'sample401.fz', 'sample402.fz', 'sample403.fz', 'sample404.fz', 'sample405.fz', 'sample406.fz', 'sample407.fz', 'sample408.fz', 'sample409.fz', 'sample40.fz', 'sample410.fz', 'sample411.fz', 'sample412.fz', 'sample413.fz', 'sample414.fz', 'sample415.fz', 'sample416.fz', 'sample417.fz', 'sample418.fz', 'sample419.fz', 'sample41.fz', 'sample420.fz', 'sample421.fz', 'sample422.fz', 'sample423.fz', 'sample424.fz', 'sample425.fz', 'sample426.fz', 'sample427.fz', 'sample428.fz', 'sample429.fz', 'sample42.fz', 'sample430.fz', 'sample431.fz', 'sample432.fz', 'sample433.fz', 'sample434.fz', 'sample435.fz', 'sample436.fz', 'sample437.fz', 'sample438.fz', 'sample439.fz', 'sample43.fz', 'sample440.fz', 'sample441.fz', 'sample442.fz', 'sample443.fz', 'sample444.fz', 'sample445.fz', 'sample446.fz', 'sample447.fz', 'sample448.fz', 'sample449.fz', 'sample44.fz', 'sample450.fz', 'sample451.fz', 'sample452.fz', 'sample453.fz', 'sample454.fz', 'sample455.fz', 'sample456.fz', 'sample457.fz', 'sample458.fz', 'sample459.fz', 'sample45.fz', 'sample460.fz', 'sample461.fz', 'sample462.fz', 'sample463.fz', 'sample464.fz', 'sample465.fz', 'sample466.fz', 'sample467.fz', 'sample468.fz', 'sample469.fz', 'sample46.fz', 'sample470.fz', 'sample471.fz', 'sample472.fz', 'sample473.fz', 'sample474.fz', 'sample475.fz', 'sample476.fz', 'sample477.fz', 'sample478.fz', 'sample479.fz', 'sample47.fz', 'sample480.fz', 'sample481.fz', 'sample482.fz', 'sample483.fz', 'sample484.fz', 'sample485.fz', 'sample486.fz', 'sample487.fz', 'sample488.fz', 'sample489.fz', 'sample48.fz', 'sample490.fz', 'sample491.fz', 'sample492.fz', 'sample493.fz', 'sample494.fz', 'sample495.fz', 'sample496.fz', 'sample497.fz', 'sample498.fz', 'sample499.fz', 'sample49.fz', 'sample4.fz', 'sample500.fz', 'sample501.fz', 'sample502.fz', 'sample503.fz', 'sample504.fz', 'sample505.fz', 'sample506.fz', 'sample507.fz', 'sample508.fz', 'sample509.fz', 'sample50.fz', 'sample510.fz', 'sample511.fz', 'sample512.fz', 'sample513.fz', 'sample514.fz', 'sample515.fz', 'sample516.fz', 'sample517.fz', 'sample518.fz', 'sample519.fz', 'sample51.fz', 'sample520.fz', 'sample521.fz', 'sample522.fz', 'sample523.fz', 'sample524.fz', 'sample525.fz', 'sample526.fz', 'sample527.fz', 'sample528.fz', 'sample529.fz', 'sample52.fz', 'sample530.fz', 'sample531.fz', 'sample532.fz', 'sample533.fz', 'sample534.fz', 'sample535.fz', 'sample536.fz', 'sample537.fz', 'sample538.fz', 'sample539.fz', 'sample53.fz', 'sample540.fz', 'sample541.fz', 'sample542.fz', 'sample543.fz', 'sample544.fz', 'sample545.fz', 'sample546.fz', 'sample547.fz', 'sample548.fz', 'sample549.fz', 'sample54.fz', 'sample550.fz', 'sample551.fz', 'sample552.fz', 'sample553.fz', 'sample554.fz', 'sample555.fz', 'sample556.fz', 'sample557.fz', 'sample558.fz', 'sample559.fz', 'sample55.fz', 'sample560.fz', 'sample561.fz', 'sample562.fz', 'sample563.fz', 'sample564.fz', 'sample565.fz', 'sample566.fz', 'sample567.fz', 'sample568.fz', 'sample569.fz', 'sample56.fz', 'sample570.fz', 'sample571.fz', 'sample572.fz', 'sample573.fz', 'sample574.fz', 'sample575.fz', 'sample576.fz', 'sample577.fz', 'sample578.fz', 'sample579.fz', 'sample57.fz', 'sample580.fz', 'sample581.fz', 'sample582.fz', 'sample583.fz', 'sample584.fz', 'sample585.fz', 'sample586.fz', 'sample587.fz', 'sample588.fz', 'sample589.fz', 'sample58.fz', 'sample590.fz', 'sample591.fz', 'sample592.fz', 'sample593.fz', 'sample594.fz', 'sample595.fz', 'sample596.fz', 'sample597.fz', 'sample598.fz', 'sample599.fz', 'sample59.fz', 'sample5.fz', 'sample600.fz', 'sample601.fz', 'sample602.fz', 'sample603.fz', 'sample604.fz', 'sample605.fz', 'sample606.fz', 'sample607.fz', 'sample608.fz', 'sample609.fz', 'sample60.fz', 'sample610.fz', 'sample611.fz', 'sample612.fz', 'sample613.fz', 'sample614.fz', 'sample615.fz', 'sample616.fz', 'sample617.fz', 'sample618.fz', 'sample619.fz', 'sample61.fz', 'sample620.fz', 'sample621.fz', 'sample622.fz', 'sample623.fz', 'sample624.fz', 'sample625.fz', 'sample626.fz', 'sample627.fz', 'sample628.fz', 'sample629.fz', 'sample62.fz', 'sample630.fz', 'sample631.fz', 'sample632.fz', 'sample633.fz', 'sample634.fz', 'sample635.fz', 'sample636.fz', 'sample637.fz', 'sample638.fz', 'sample639.fz', 'sample63.fz', 'sample640.fz', 'sample641.fz', 'sample642.fz', 'sample643.fz', 'sample644.fz', 'sample645.fz', 'sample646.fz', 'sample647.fz', 'sample648.fz', 'sample649.fz', 'sample64.fz', 'sample650.fz', 'sample651.fz', 'sample652.fz', 'sample653.fz', 'sample654.fz', 'sample655.fz', 'sample656.fz', 'sample657.fz', 'sample658.fz', 'sample659.fz', 'sample65.fz', 'sample660.fz', 'sample661.fz', 'sample662.fz', 'sample663.fz', 'sample664.fz', 'sample665.fz', 'sample666.fz', 'sample667.fz', 'sample668.fz', 'sample669.fz', 'sample66.fz', 'sample670.fz', 'sample671.fz', 'sample672.fz', 'sample673.fz', 'sample674.fz', 'sample675.fz', 'sample676.fz', 'sample677.fz', 'sample678.fz', 'sample679.fz', 'sample67.fz', 'sample680.fz', 'sample681.fz', 'sample682.fz', 'sample683.fz', 'sample684.fz', 'sample685.fz', 'sample686.fz', 'sample687.fz', 'sample688.fz', 'sample689.fz', 'sample68.fz', 'sample690.fz', 'sample691.fz', 'sample692.fz', 'sample693.fz', 'sample694.fz', 'sample695.fz', 'sample696.fz', 'sample697.fz', 'sample698.fz', 'sample699.fz', 'sample69.fz', 'sample6.fz', 'sample700.fz', 'sample701.fz', 'sample702.fz', 'sample703.fz', 'sample704.fz', 'sample705.fz', 'sample706.fz', 'sample707.fz', 'sample708.fz', 'sample709.fz', 'sample70.fz', 'sample710.fz', 'sample711.fz', 'sample712.fz', 'sample713.fz', 'sample714.fz', 'sample715.fz', 'sample716.fz', 'sample717.fz', 'sample718.fz', 'sample719.fz', 'sample71.fz', 'sample720.fz', 'sample721.fz', 'sample722.fz', 'sample723.fz', 'sample724.fz', 'sample725.fz', 'sample726.fz', 'sample727.fz', 'sample728.fz', 'sample729.fz', 'sample72.fz', 'sample730.fz', 'sample731.fz', 'sample732.fz', 'sample733.fz', 'sample734.fz', 'sample735.fz', 'sample736.fz', 'sample737.fz', 'sample738.fz', 'sample739.fz', 'sample73.fz', 'sample740.fz', 'sample741.fz', 'sample742.fz', 'sample743.fz', 'sample744.fz', 'sample745.fz', 'sample746.fz', 'sample747.fz', 'sample748.fz', 'sample749.fz', 'sample74.fz', 'sample750.fz', 'sample751.fz', 'sample752.fz', 'sample753.fz', 'sample754.fz', 'sample755.fz', 'sample756.fz', 'sample757.fz', 'sample758.fz', 'sample759.fz', 'sample75.fz', 'sample760.fz', 'sample761.fz', 'sample762.fz', 'sample763.fz', 'sample764.fz', 'sample765.fz', 'sample766.fz', 'sample767.fz', 'sample768.fz', 'sample769.fz', 'sample76.fz', 'sample770.fz', 'sample771.fz', 'sample772.fz', 'sample773.fz', 'sample774.fz', 'sample775.fz', 'sample776.fz', 'sample777.fz', 'sample778.fz', 'sample779.fz', 'sample77.fz', 'sample780.fz', 'sample781.fz', 'sample782.fz', 'sample783.fz', 'sample784.fz', 'sample785.fz', 'sample786.fz', 'sample787.fz', 'sample788.fz', 'sample789.fz', 'sample78.fz', 'sample790.fz', 'sample791.fz', 'sample792.fz', 'sample793.fz', 'sample794.fz', 'sample795.fz', 'sample796.fz', 'sample797.fz', 'sample798.fz', 'sample799.fz', 'sample79.fz', 'sample7.fz', 'sample800.fz', 'sample801.fz', 'sample802.fz', 'sample803.fz', 'sample804.fz', 'sample805.fz', 'sample806.fz', 'sample807.fz', 'sample808.fz', 'sample809.fz', 'sample80.fz', 'sample810.fz', 'sample811.fz', 'sample812.fz', 'sample813.fz', 'sample814.fz', 'sample815.fz', 'sample816.fz', 'sample817.fz', 'sample818.fz', 'sample819.fz', 'sample81.fz', 'sample820.fz', 'sample821.fz', 'sample822.fz', 'sample823.fz', 'sample824.fz', 'sample825.fz', 'sample826.fz', 'sample827.fz', 'sample828.fz', 'sample829.fz', 'sample82.fz', 'sample830.fz', 'sample831.fz', 'sample832.fz', 'sample833.fz', 'sample834.fz', 'sample835.fz', 'sample836.fz', 'sample837.fz', 'sample838.fz', 'sample839.fz', 'sample83.fz', 'sample840.fz', 'sample841.fz', 'sample842.fz', 'sample843.fz', 'sample844.fz', 'sample845.fz', 'sample846.fz', 'sample847.fz', 'sample848.fz', 'sample849.fz', 'sample84.fz', 'sample850.fz', 'sample851.fz', 'sample852.fz', 'sample853.fz', 'sample854.fz', 'sample855.fz', 'sample856.fz', 'sample857.fz', 'sample858.fz', 'sample859.fz', 'sample85.fz', 'sample860.fz', 'sample861.fz', 'sample862.fz', 'sample863.fz', 'sample864.fz', 'sample865.fz', 'sample866.fz', 'sample867.fz', 'sample868.fz', 'sample869.fz', 'sample86.fz', 'sample870.fz', 'sample871.fz', 'sample872.fz', 'sample873.fz', 'sample874.fz', 'sample875.fz', 'sample876.fz', 'sample877.fz', 'sample878.fz', 'sample879.fz', 'sample87.fz', 'sample880.fz', 'sample881.fz', 'sample882.fz', 'sample883.fz', 'sample884.fz', 'sample885.fz', 'sample886.fz', 'sample887.fz', 'sample888.fz', 'sample889.fz', 'sample88.fz', 'sample890.fz', 'sample891.fz', 'sample892.fz', 'sample893.fz', 'sample894.fz', 'sample895.fz', 'sample896.fz', 'sample897.fz', 'sample898.fz', 'sample899.fz', 'sample89.fz', 'sample8.fz', 'sample900.fz', 'sample901.fz', 'sample902.fz', 'sample903.fz', 'sample904.fz', 'sample905.fz', 'sample906.fz', 'sample907.fz', 'sample908.fz', 'sample909.fz', 'sample90.fz', 'sample910.fz', 'sample911.fz', 'sample912.fz', 'sample913.fz', 'sample914.fz', 'sample915.fz', 'sample916.fz', 'sample917.fz', 'sample918.fz', 'sample919.fz', 'sample91.fz', 'sample920.fz', 'sample921.fz', 'sample922.fz', 'sample923.fz', 'sample924.fz', 'sample925.fz', 'sample926.fz', 'sample927.fz', 'sample928.fz', 'sample929.fz', 'sample92.fz', 'sample930.fz', 'sample931.fz', 'sample932.fz', 'sample933.fz', 'sample934.fz', 'sample935.fz', 'sample936.fz', 'sample937.fz', 'sample938.fz', 'sample939.fz', 'sample93.fz', 'sample940.fz', 'sample941.fz', 'sample942.fz', 'sample943.fz', 'sample944.fz', 'sample945.fz', 'sample946.fz', 'sample947.fz', 'sample948.fz', 'sample949.fz', 'sample94.fz', 'sample950.fz', 'sample951.fz', 'sample952.fz', 'sample953.fz', 'sample954.fz', 'sample955.fz', 'sample956.fz', 'sample957.fz', 'sample958.fz', 'sample959.fz', 'sample95.fz', 'sample960.fz', 'sample961.fz', 'sample962.fz', 'sample963.fz', 'sample964.fz', 'sample965.fz', 'sample966.fz', 'sample967.fz', 'sample968.fz', 'sample969.fz', 'sample96.fz', 'sample970.fz', 'sample971.fz', 'sample972.fz', 'sample973.fz', 'sample974.fz', 'sample975.fz', 'sample976.fz', 'sample977.fz', 'sample978.fz', 'sample979.fz', 'sample97.fz', 'sample980.fz', 'sample981.fz', 'sample982.fz', 'sample983.fz', 'sample984.fz', 'sample985.fz', 'sample986.fz', 'sample987.fz', 'sample988.fz', 'sample989.fz', 'sample98.fz', 'sample990.fz', 'sample991.fz', 'sample992.fz', 'sample993.fz', 'sample994.fz', 'sample995.fz', 'sample996.fz', 'sample997.fz', 'sample998.fz', 'sample999.fz', 'sample99.fz', 'sample9.fz'], x: [-11256.96233, -11094.03624, -10902.04215, -11436.37481, -11019.87183, -11231.66053, -11760.61067, -11092.52577, -11131.071, -11548.26191, -11336.21688, -11455.75609, -10993.08369, -11136.41398, -11120.80834, -11651.53912, -11505.2641, -11065.8395, -11252.14566, -11195.11805, -11208.15313, -11549.57451, -11183.98095, -11447.70649, -11396.97983, -11502.58576, -10777.88722, -11423.25097, -11073.8111, -11456.03308, -11320.22604, -11425.54582, -11350.70933, -10788.95191, -11129.26559, -11181.99726, -11171.78797, -10772.77859, -11091.40557, -11394.45965, -11142.08877, -11441.01806, -11234.84514, -11118.47273, -11126.91252, -11281.18949, -10993.39975, -11630.44451, -9900.72104, -11284.144, -11061.57236, -10979.38964, -10684.53575, -10960.18346, -11532.50397, -11125.14717, -10874.73972, -11149.48666, -11065.69476, -11274.58272, -11274.41671, -11082.19982, -11054.47888, -11114.99657, -11075.82221, -11276.3578, -11346.96683, -11227.64289, -11654.14694, -11388.16222, -11080.8325, -11128.88419, -11102.48858, -11161.00593, -11518.78527, -11447.59472, -11133.85206, -11381.75273, -10691.4447, -11751.14894, -11206.3286, -10927.02232, -10845.04258, -11237.24169, -11205.43232, -11292.96904, -11236.82919, -11245.54199, -11312.32245, -10841.64566, -11323.12356, -11246.35481, -11380.73518, -10787.74169, -11472.93048, -10862.81544, -11224.19337, -11335.76741, -10484.38462, -11516.12077, -11226.80014, -11124.18626, -11326.77288, -10986.88914, -11042.40996, -11123.01309, -11281.48448, -11426.29622, -11070.21382, -11229.42368, -11163.45976, -10456.68088, -11655.98311, -11058.31051, -11308.25223, -11291.07347, -11268.18831, -10915.18277, -11246.86948, -11064.33274, -10976.09436, -11292.63847, -11684.84921, -11149.8996, -11294.48825, -10982.68729, -11285.61227, -11334.69051, -11637.66826, -11270.49267, -11466.13415, -10949.61751, -10868.89276, -11124.02779, -11196.4448, -11605.4022, -11411.61559, -10744.57014, -10795.65693, -10988.46574, -10896.45065, -11349.53617, -10786.10239, -11292.55959, -10636.35457, -11014.2577, -10816.76134, -11034.07461, -11178.77966, -10930.55234, -11062.85637, -11054.38449, -11186.95147, -10931.95086, -11141.25022, -11310.27932, -11174.04752, -11519.95808, -11381.85428, -11110.51477, -11156.70384, -11245.63191, -11757.59679, -11483.84539, -11242.42345, -10896.09764, -11234.9697, -11243.43571, -11141.38614, -11650.75536, -11402.32793, -11429.11218, -11262.21914, -11313.61181, -11381.01765, -10980.03587, -11345.92993, -11435.20596, -11236.69778, -11414.61509, -11117.15719, -11086.92201, -11379.07405, -11532.08433, -11147.47155, -10667.453, -11230.08582, -10965.92649, -10690.40374, -10894.85443, -10975.38093, -10749.73772, -10815.96917, -11933.1066, -10863.27839, -11371.60443, -11261.22035, -11063.84828, -11329.28673, -11305.13313, -11483.45098, -11117.51345, -10790.16307, -11193.93848, -11236.14529, -11431.48312, -11671.56613, -11529.39385, -11283.15423, -11214.04729, -11265.39857, -11386.03617, -11199.24016, -11505.23701, -11023.44056, -11463.49613, -10765.73007, -10948.90321, -11148.85889, -11365.50131, -10953.79819, -10683.98632, -11605.41569, -11459.14841, -11162.40558, -11322.51903, -11464.27747, -10586.24646, -10925.69819, -11154.8472, -11256.93064, -10953.75448, -11235.77015, -11216.82907, -11514.78609, -11517.76638, -10928.82262, -11141.53015, -10995.9099, -11323.61608, -11037.91564, -11084.73288, -11321.46855, -11771.20695, -11371.75265, -11286.33452, -11129.64322, -10872.7149, -11498.32555, -11290.87829, -11180.06809, -11157.5687, -11170.13108, -11090.5745, -11324.01601, -11282.84133, -11169.87716, -10909.67952, -11186.75993, -11244.17953, -10812.93055, -11454.8638, -11036.78045, -11502.26905, -11797.65986, -11222.39181, -11277.81272, -11290.12704, -11339.11654, -11169.41585, -11455.37055, -11327.98307, -11347.18811, -11159.1177, -10695.9952, -11114.85418, -10910.91282, -11118.37197, -11165.12932, -11510.63288, -11090.08322, -11192.05018, -11253.81224, -10511.76821, -10941.47571, -11058.71122, -11077.22459, -10992.12215, -11545.44468, -10573.43756, -11362.66217, -11140.7985, -11420.64321, -11047.5157, -11256.40043, -11409.16798, -11112.73456, -11457.01419, -11465.39639, -11661.86924, -11341.19761, -11449.88077, -11250.53478, -11054.32832, -10731.50058, -11396.51385, -11366.96709, -11250.52672, -10776.64383, -11310.4483, -11264.66259, -11226.61233, -11286.2832, -11011.44824, -11405.58242, -11449.41987, -11460.64351, -10963.33019, -10847.24179, -11025.73236, -11658.31607, -11381.31247, -11544.15863, -11280.46348, -11172.60028, -10761.3249, -11189.77113, -11530.88619, -10930.62938, -11380.68245, -11297.7815, -11214.79194, -11543.85416, -11488.50668, -11050.03141, -10994.08104, -11142.55168, -10930.41378, -11079.58244, -11266.66898, -11329.53202, -10940.25989, -11051.09074, -11364.12973, -11242.13025, -10892.33505, -11121.05398, -10723.18104, -11245.2756, -11294.02274, -11157.74906, -11146.58037, -11348.23758, -11250.17566, -10712.40405, -11539.89347, -10981.14194, -11322.1018, -10594.7068, -11128.2829, -11050.30144, -11088.83537, -11100.23956, -11527.05957, -11241.6355, -11344.37971, -11255.47212, -11557.817, -11322.07052, -11678.09779, -11185.82967, -11069.60977, -11525.00196, -11401.62154, -11306.72281, -11326.07816, -11285.8332, -11273.64876, -11596.98228, -11427.97948, -11389.22739, -10945.7321, -11131.80848, -10619.05583, -11229.41936, -11230.51778, -11421.20661, -11557.11252, -11354.90649, -10720.56255, -10978.75765, -11224.49927, -11281.94107, -11169.57155, -10941.52222, -11427.99721, -11180.54305, -11183.67326, -11397.31763, -11204.00427, -10856.69992, -11309.33997, -11577.94802, -11499.86514, -11061.43634, -11262.41874, -11285.32524, -11516.10453, -11258.74027, -11588.22291, -11352.09742, -11093.69552, -10773.76139, -10913.50391, -11192.59612, -11341.87615, -10976.13102, -11097.33159, -11501.49728, -11108.80333, -11627.88279, -11343.71017, -11144.03624, -11292.45247, -11063.79428, -11025.42258, -11226.55222, -11142.79145, -11204.91721, -11387.53331, -11171.36818, -10886.24546, -11183.19487, -11341.78485, -11168.30428, -11553.35204, -11421.05897, -11348.59935, -11096.7331, -11317.53098, -11124.82028, -11350.77028, -11147.3848, -11168.5268, -11287.05793, -11113.76792, -11011.88561, -11501.9533, -10918.88324, -11179.09856, -11565.02159, -11623.48339, -10827.27969, -11292.70532, -11217.16582, -11065.16755, -11512.80601, -11235.3568, -10719.70508, -11120.14483, -11000.69341, -11452.29563, -11029.337, -11136.05977, -10940.06827, -11111.12388, -11045.39217, -11410.65124, -11402.44477, -11249.812, -11204.42445, -10756.89483, -11528.60151, -10654.72788, -11435.66056, -10928.529, -11335.33187, -11136.20591, -11294.71117, -11272.37435, -11475.94979, -11187.57268, -11512.48858, -10978.00742, -10839.39929, -11537.95491, -11554.65644, -11144.4288, -11391.79983, -10909.73879, -11316.16287, -11417.37279, -11189.99216, -11322.5736, -10837.69036, -11151.40274, -11317.17681, -11386.98945, -11012.90326, -11359.22588, -11354.06612, -11005.49551, -11225.97435, -10799.62311, -10709.47319, -11008.84778, -11296.58831, -11406.75499, -11488.47055, -11399.88899, -11241.6759, -11063.55736, -11475.7266, -11059.5596, -11347.36667, -11181.19921, -11314.1653, -10675.06675, -10941.19602, -11467.30203, -11009.33704, -11551.70543, -11149.91219, -11257.04471, -11326.88882, -10777.8076, -11263.14878, -11275.43042, -10989.56538, -11194.50595, -11482.4118, -11067.03574, -10834.67579, -11451.02989, -11489.10708, -11423.77577, -11739.30036, -10673.01099, -11392.30913, -11445.84317, -10888.5959, -11354.55952, -10740.41537, -11175.69614, -11197.90189, -11251.70136, -11211.49565, -11446.09337, -10901.03013, -11401.53942, -11438.83053, -11049.39181, -11112.07987, -11213.87099, -11422.30018, -11515.68849, -11181.46217, -11469.36031, -11563.56289, -11085.58805, -11507.5738, -11252.64155, -11217.54101, -11468.90146, -11614.26376, -11406.32286, -11549.02462, -10989.83521, -11346.45835, -11140.05586, -11473.9575, -11523.91488, -11418.39354, -11332.90828, -10835.86901, -11256.2741, -11366.15232, -11246.82105, -11204.31352, -11137.25477, -11438.31373, -11709.30875, -11211.48375, -11286.68847, -11257.96113, -11432.10484, -10879.41694, -11926.24231, -11196.20712, -11637.15727, -11572.81423, -10758.6365, -11281.52877, -10942.45815, -11292.4212, -11570.99461, -11073.39243, -11452.54057, -11125.83305, -11193.21702, -11314.23787, -11120.89717, -10951.49571, -11117.21234, -11098.88795, -11184.64699, -11426.6784, -11057.4922, -11095.21652, -11223.70846, -11183.82331, -11213.39824, -11528.58551, -10940.49355, -10887.49531, -11095.06825, -11324.62879, -11344.0357, -11185.6962, -11209.86608, -11354.14111, -11068.30947, -11208.44604, -11264.83519, -11209.0228, -11427.64944, -11131.54865, -11046.41646, -10935.53389, -11251.20265, -11578.96075, -11298.79929, -11186.20213, -10942.84876, -11244.67171, -11180.666, -11613.87724, -11170.22059, -11238.8205, -11335.87947, -11007.30681, -11033.20998, -11252.95505, -11376.42802, -11031.95118, -10522.67925, -11278.00497, -11195.7, -11259.30169, -11144.62176, -11116.8643, -11219.22154, -11173.97887, -11218.07984, -11723.08271, -10451.28147, -10935.13299, -11363.13111, -11040.43664, -11048.54545, -10850.42564, -11077.78654, -11310.85006, -11193.00108, -11043.26781, -10970.39351, -11275.80459, -11616.64726, -11577.97283, -11193.44119, -11202.71108, -11318.25841, -10919.61163, -10957.74171, -11580.60485, -11065.42971, -11026.71164, -10921.3886, -11620.8788, -11141.82536, -11191.16426, -11105.77909, -11181.46307, -11123.34764, -11111.08118, -11382.45855, -11303.4037, -11427.37951, -11056.19693, -11308.61975, -10966.54545, -11605.65944, -10611.8787, -11225.56293, -11048.08468, -11326.49185, -10871.94279, -11373.79368, -11031.27739, -11337.24881, -11675.78883, -10823.92276, -11567.87269, -11283.94035, -11435.32925, -10711.5674, -10891.3176, -11088.50012, -11637.2076, -10525.70837, -11016.75814, -11506.4226, -11169.35697, -11098.56791, -11019.16155, -11076.5732, -11095.89178, -11001.65793, -10512.03894, -10662.48414, -10934.99974, -11411.80531, -11599.8609, -10902.89305, -11493.33196, -11376.02629, -10870.6665, -11125.07454, -11101.53981, -11451.4269, -10850.7647, -11426.73633, -11423.52049, -10828.36235, -11245.13106, -11022.23101, -11274.681, -11216.97107, -11231.96943, -11489.39949, -11418.98248, -10836.78213, -11213.13009, -11394.41991, -11004.42118, -11099.75339, -11479.50377, -10903.962, -10952.68534, -11121.21942, -11486.66309, -11595.65766, -11353.10309, -11391.50478, -11075.94643, -11299.10631, -10648.75073, -11253.69107, -11270.78862, -11210.6259, -11163.33819, -10976.28837, -11196.27771, -11044.42749, -11479.81099, -11481.82777, -11274.62572, -11499.03388, -11162.2192, -11484.29603, -10566.59829, -11266.37927, -11355.46137, -10978.38457, -11169.10653, -11177.83757, -10997.44413, -11014.52851, -11019.47654, -10922.01387, -11174.88678, -11090.48717, -10827.44974, -11376.11562, -11246.04729, -11219.93222, -11111.79989, -11253.98131, -11366.27094, -11055.90446, -11268.98915, -11048.81704, -10824.09433, -10949.8444, -10725.27495, -11348.83595, -11583.22393, -11275.519, -11400.58258, -11017.55562, -11412.94504, -11417.44773, -11242.91152, -11351.08458, -11266.5463, -11250.10376, -11279.86653, -11399.69756, -11140.53754, -11474.08538, -11601.45419, -11268.03553, -11181.32147, -11288.35867, -11287.05496, -11357.47481, -11855.87435, -11120.27896, -10753.44219, -10879.80933, -10776.02748, -10833.73997, -10973.29422, -11065.26525, -11721.93989, -11221.59706, -11199.88626, -10890.68249, -11035.81283, -11357.38225, -10931.77981, -10976.55493, -11315.83502, -11256.93045, -11439.43424, -10697.28811, -10926.78414, -11162.85777, -11499.48887, -11542.44745, -11472.18471, -11180.56114, -11147.08417, -11214.35552, -11413.78854, -10979.72668, -11121.30388, -11056.67533, -11243.04795, -11338.77956, -11473.93952, -11065.20182, -11625.26975, -11441.71767, -11385.67446, -11371.51799, -11388.42831, -11463.87334, -11214.02897, -11190.59753, -11147.52548, -10948.09697, -10877.26395, -11077.68584, -11049.51872, -11113.29898, -11220.76872, -10951.72657, -11184.6737, -11157.06759, -11105.09615, -11160.70475, -10716.04621, -10672.63097, -11211.21769, -11398.10157, -11153.63296, -11137.90929, -11069.82517, -11177.97351, -11545.77001, -11015.47414, -11355.70058, -11085.41794, -11156.24884, -11221.63048, -11180.16209, -11066.55856, -11047.52069, -11347.91197, -11139.23434, -11110.77304, -11021.08651, -11030.92761, -11201.99842, -11500.67763, -11242.68757, -10991.56815, -10860.58152, -11289.6365, -11423.63717, -11549.91634, -11291.71902, -11160.02246, -11345.57282, -11515.97963, -11081.39977, -11436.48541, -11122.91387, -11334.54608, -11108.96397, -11557.60475, -11030.14404, -10978.71337, -11126.61502, -11642.80148, -11692.55072, -11242.89316, -10934.2699, -11160.62477, -11526.78586, -11369.28184, -11654.34649, -11118.37123, -11434.8557, -11079.41221, -11153.55223, -11273.31328, -11466.29224, -10905.59744, -11635.17802, -10921.00739, -11544.96914, -11367.19476, -11161.66884, -11275.95825, -11028.78967, -10996.91283, -11564.99435, -11035.56593, -11391.78401, -11583.17363, -10938.87333, -11399.30369, -11314.94737, -10704.69483, -11162.8958, -11129.69312, -11647.01959, -11221.97299, -11106.64833, -11555.56199, -11277.92434, -11499.28179, -11165.61804, -11016.74119, -11546.58907, -11290.41176, -11764.07684, -11240.65533, -10992.22194, -11056.99564, -11324.765, -11096.10901, -11352.1917, -11400.16986, -11333.28166, -11413.2578, -11327.03124, -11049.68448, -11111.44706, -11313.72277, -11029.92495, -11675.32877, -11140.86061, -11096.40707, -11311.25778, -11400.0631, -11325.00202, -11123.61647, -11155.0563, -10780.39959, -11172.08161, -11354.42928, -11113.00582, -11219.74384, -10931.34617, -11184.40559, -10813.66236, -11019.31601, -11433.98555, -11258.04373, -11362.31445, -11396.91032, -11326.98761, -10915.893, -11175.35791, -11227.95869, -11588.85104], y: [-3684.19364, -3249.27131, -3753.10328, -3630.32732, -3614.47383, -3506.0874, -3750.31843, -3750.9428, -3717.70263, -3695.07468, -3695.34247, -3828.78146, -3774.00198, -3771.94283, -3763.01493, -3700.71525, -3124.86759, -3567.32882, -3718.34534, -3793.11128, -3766.91107, -3818.35643, -3448.72299, -3476.48838, -3755.36422, -3834.05114, -2978.53098, -3681.51211, -3828.07557, -3048.15877, -3305.62158, -3189.96954, -3808.03957, -3700.13251, -3636.91204, -3816.6785, -3619.60114, -3754.51627, -2384.2597, -3809.70299, -3736.75634, -3711.30798, -3746.68491, -3603.67254, -3726.06286, -3796.21596, -3661.34024, -3527.49033, -2271.31927, -3690.44321, -3105.35913, -3768.07782, -3656.28875, -3278.82994, -3062.89882, -3743.54511, -3756.89956, -3694.38842, -3186.51234, -3428.34418, -3803.02034, -3695.29925, -3724.59164, -3790.71512, -3618.20366, -3455.93927, -3744.96359, -3667.44181, -3663.49246, -3779.33732, -3797.51162, -3470.90168, -3814.74683, -3572.26569, -3778.05494, -3620.84407, -3610.67272, -3739.01285, -2994.37402, -3759.83572, -3731.28189, -3761.73791, -3751.27117, -3744.0195, -3702.86038, -3094.29627, -3595.58377, -3746.6422, -3734.59018, -3610.61242, -3684.27248, -3732.32371, -3493.60136, -3086.67012, -3743.46195, -3717.11448, -3682.60896, -3601.61415, -3723.55821, -3818.52053, -3405.56483, -2925.63275, -3615.83516, -3603.60841, -3737.88801, -3677.52904, -3681.85924, -3788.41795, -3771.3733, -3811.87032, -3724.03083, -2144.36045, -3820.02892, -3732.27132, -3746.08495, -3630.98635, -3757.02185, -3684.48495, -3687.04067, -3801.97672, -3666.45818, -3832.94443, -3088.70403, -3614.31017, -3002.53136, -3701.70713, -3788.69382, -2506.19208, -3670.48475, -3875.65426, -3663.12878, -3745.81798, -2836.95219, -3732.0608, -3315.06336, -3652.95699, -3843.52083, -3531.40107, -3462.18678, -3252.58363, -3211.95244, -3840.25151, -3756.1783, -3810.16874, -3748.8152, -3714.31612, -3758.85638, -3792.31855, -3687.10097, -3768.5072, -3035.59811, -3546.18182, -3584.01952, -3683.76454, -3745.68133, -3831.429, -3686.18028, -3698.21667, -3677.85031, -3728.96736, -3706.22134, -3661.2254, -3632.04477, -3841.9685, -3714.45405, -3830.99692, -3650.995, -3703.11878, -3684.86534, -3778.88039, -3684.81544, -3690.82504, -3778.7899, -3762.46189, -3767.94427, -2321.96456, -3750.49282, -3838.04559, -2999.92655, -3654.76261, -3700.5139, -3752.95391, -3661.91644, -3550.16368, -3611.63622, -3384.40413, -3670.78141, -3693.51163, -3597.5658, -3754.73865, -3802.4924, -3556.82234, -3671.54153, -2755.18156, -3719.33181, -3695.0559, -3813.73918, -3472.5881, -3608.80667, -3810.91965, -3761.69309, -3638.43497, -3606.63498, -3596.62366, -2421.77419, -3702.11765, -3641.01759, -3836.65264, -3399.22484, -3746.59225, -3646.70614, -3048.41108, -3693.91371, -3783.42627, -3280.94816, -3791.80208, -3465.77989, -3562.32675, -3866.33714, -3784.79473, -2934.28688, -3739.70537, -3768.34475, -3646.19401, -3676.494, -3720.97912, -3646.74686, -3739.96273, -3746.11442, -3097.31884, -2985.89909, -3439.95587, -3855.49667, -3722.54029, -3629.21735, -3697.06916, -3008.40464, -3735.28804, -3646.34305, -3655.37672, -3787.30453, -3719.98786, -3518.52227, -3807.75028, -2516.74432, -3820.36904, -3729.28482, -3662.29833, -3047.39662, -3876.17488, -3270.59708, -3837.05614, -3818.72759, -3561.60204, -3748.4589, -3768.86023, -3728.94444, -3647.39577, -3861.43844, -3844.99966, -2951.2181, -3022.96999, -3722.50326, -3801.3152, -3727.00871, -3692.65987, -3741.77893, -3730.73219, -3124.91675, -3769.55225, -3840.81969, -3681.8697, -3792.04001, -3182.64324, -2939.11006, -3668.21169, -3589.27014, -2906.33099, -3829.54879, -3445.62597, -3645.502, -2385.70488, -3758.36986, -3663.95405, -3678.97693, -3685.21121, -3777.03363, -3784.89507, -3623.34751, -3706.12266, -3627.01218, -3667.60976, -3826.37953, -3370.63079, -3589.80099, -3735.71945, -3771.8682, -3774.37173, -3634.77249, -3758.31657, -3749.19452, -3677.10876, -3728.00797, -3640.81915, -3540.42697, -3448.41964, -3834.09391, -3060.61518, -3664.05201, -3607.97007, -3731.07445, -3849.79478, -3720.57118, -3712.86539, -3626.03427, -3545.90379, -3690.5754, -3736.97991, -3814.60032, -3569.60372, -3624.79801, -3772.34552, -3635.78398, -3680.50224, -3830.94804, -3100.75711, -3811.75416, -3375.10322, -3713.8034, -3716.8557, -3773.27612, -3616.26228, -3792.95069, -3699.82837, -3712.30187, -3652.21381, -3772.67545, -3730.69638, -3180.42377, -3731.01891, -3656.6345, -3589.26981, -3365.31141, -3793.89053, -3751.78377, -3641.23323, -3788.9752, -3699.48946, -3805.97252, -3740.13525, -3702.08267, -3833.97412, -3851.91576, -3810.69839, -3575.04551, -3727.35857, -3618.14368, -3068.29181, -3738.58683, -3636.64207, -3758.93976, -3747.60747, -3760.65562, -3778.13719, -3586.31253, -2451.91593, -3561.00577, -3808.76838, -3737.5205, -3756.55458, -3641.16626, -3805.07342, -2603.7415, -3765.78742, -3058.95611, -3590.34963, -3784.02812, -3558.72062, -3815.67732, -3254.78223, -3738.33967, -3864.2556, -3543.46179, -2230.7855, -3852.31022, -3866.42289, -3747.04305, -3672.36318, -2456.71654, -3651.08841, -3752.13968, -3790.68112, -3594.93591, -3706.80109, -3773.60002, -3713.8101, -3541.95586, -3039.10001, -3823.56485, -3124.7327, -3550.66299, -3816.25967, -3648.95876, -3617.89864, -3793.55808, -3746.43267, -3246.7001, -3750.93485, -3605.98687, -3798.11518, -3764.30629, -3689.96865, -3651.81241, -3789.93434, -3680.11952, -3631.73796, -3049.02159, -3134.42512, -3775.8162, -3203.23315, -3796.8538, -3779.589, -3782.75374, -3724.50571, -3563.46808, -3637.00358, -3692.27775, -3729.2818, -3689.84155, -3702.09245, -3806.13394, -3679.25979, -3690.54166, -3664.87832, -3752.4629, -3795.74541, -3748.25849, -2537.72991, -3675.45843, -3796.06806, -3738.4687, -3107.18421, -3819.84251, -3714.74346, -3487.90148, -3712.01879, -3628.57614, -3791.91459, -3714.56627, -3580.27292, -3538.66975, -3792.73551, -3728.28489, -3707.0282, -3436.19852, -3720.6223, -3743.04572, -3836.27582, -3767.0517, -3825.06849, -3670.45342, -3539.26504, -3799.64424, -3698.97314, -3016.48193, -3839.43272, -3767.63494, -3760.58403, -3693.9771, -3046.08004, -3600.78317, -3691.8332, -3735.41008, -3716.44943, -3779.90282, -3821.00874, -2928.53893, -2976.82808, -3042.6176, -3679.95702, -3452.38314, -3591.20734, -3746.68898, -3782.15224, -3812.40865, -3796.24652, -3785.09092, -3534.26138, -3503.61877, -3632.79455, -3763.03128, -3809.5197, -3694.79436, -3780.89297, -3642.48611, -3372.40021, -3429.33269, -3716.40079, -3751.8315, -3539.63712, -3749.67603, -3794.16053, -3610.02948, -3755.63508, -3703.41989, -3689.67236, -3752.6661, -3767.03998, -3043.287, -3624.66481, -3610.07369, -3782.02223, -3626.72357, -3725.94641, -3776.50098, -3474.55435, -3742.4211, -3681.67545, -3720.16821, -3613.04986, -3839.1831, -3697.38625, -3814.3375, -3695.0159, -3824.87765, -3723.34781, -3684.94642, -2924.80843, -3763.83308, -3693.12041, -2509.57984, -3492.61306, -3649.21371, -3742.21158, -3644.20248, -3819.91741, -3662.69108, -3750.49913, -3858.4361, -3691.8581, -3781.75408, -3693.00597, -3713.18659, -3824.80944, -3755.85518, -3796.98957, -3870.47388, -3689.70208, -3726.06712, -3622.42098, -3733.58348, -3706.85861, -3582.32873, -3583.41458, -3023.00286, -3799.54444, -3784.0841, -3086.96482, -3525.05239, -3758.63749, -3757.20877, -3769.96655, -3587.65799, -3710.64271, -3795.93988, -3787.26911, -3626.43889, -3773.86239, -3763.10088, -3598.29114, -3600.67081, -3692.98724, -3735.5217, -3791.28459, -3670.58247, -3793.36135, -3023.89684, -3743.03684, -3643.47904, -3466.47515, -3858.39498, -3556.8464, -3586.41354, -3788.88676, -3792.32873, -2533.23455, -3667.97283, -3759.94699, -3725.1857, -3744.37737, -3682.24543, -3324.12201, -3611.44915, -3714.20088, -3457.36307, -3681.33092, -3587.69317, -3763.74816, -3726.16056, -3733.95498, -3677.81342, -3762.74215, -3709.65468, -3717.86058, -3703.89212, -3788.72939, -3675.4938, -3841.18228, -2989.61025, -3744.36187, -3338.45402, -3707.46525, -3810.88806, -3228.89033, -3373.44763, -3787.19708, -3699.99926, -3799.01817, -3524.2589, -3698.76756, -3558.96075, -3820.36177, -3628.36393, -3642.95347, -3716.3603, -3743.71293, -3788.69089, -3655.74606, -2952.91832, -3508.48018, -3734.42648, -3630.46892, -3606.84338, -3163.06632, -3836.02757, -3597.00506, -3782.66199, -3707.15014, -3659.63277, -3436.428, -3793.62848, -3412.9194, -3753.70438, -3748.77721, -3822.50315, -3508.8951, -3543.93698, -3629.25291, -3744.2409, -3744.91141, -3658.53727, -3721.74127, -3779.08528, -3613.44248, -3794.50416, -3654.85376, -3064.30356, -3605.45484, -3713.60453, -3797.49436, -3782.16413, -3321.70562, -3750.09386, -3702.10567, -3602.32273, -3744.42528, -2473.26392, -3639.8739, -3747.167, -3672.3282, -3142.02038, -3714.17811, -3098.50429, -3799.69306, -3644.6091, -3782.55214, -3816.63082, -3585.67472, -3724.50602, -3761.56991, -3805.50119, -3687.83118, -2380.4542, -3748.39799, -3776.38072, -3736.01833, -3195.18826, -3788.16154, -3768.63966, -3627.25571, -3360.42616, -3726.93113, -3750.09462, -2976.88528, -3745.8041, -3591.74552, -3702.53114, -3636.89125, -3218.12218, -3766.32646, -3428.05943, -3859.70358, -3662.80266, -3773.58317, -3114.49402, -3781.39915, -3524.67674, -3463.39198, -3686.19455, -3731.72875, -3687.27563, -3668.68481, -3829.58159, -3435.44991, -3564.68479, -3641.95408, -3745.00201, -3844.04753, -3613.10676, -3700.20504, -3718.19042, -3235.80525, -3757.23134, -3738.83852, -3627.89744, -3850.9568, -3643.50405, -3772.85114, -3342.30838, -3531.35247, -3699.54223, -3749.80603, -3812.50747, -3808.66178, -3784.74166, -3661.56164, -3843.40074, -3762.3781, -3140.24823, -3468.81027, -3616.21711, -3619.90003, -3685.28216, -3504.23474, -3790.43408, -3439.58872, -3786.39241, -3157.19275, -3568.60717, -3745.15671, -3811.39152, -3748.6503, -3619.53742, -3717.3562, -3039.23656, -3782.32698, -3635.93734, -3768.60485, -3727.18281, -3786.73152, -3867.5829, -3857.08243, -3698.60087, -3739.767, -3056.00323, -3727.22845, -3733.17164, -3613.41784, -3683.41836, -3780.37915, -3579.20409, -3697.43723, -3106.00343, -3807.82346, -3838.32842, -3746.65142, -3655.79896, -3735.75995, -3597.49107, -3620.39102, -3754.14229, -3801.67301, -3744.41482, -3546.43896, -3808.127, -3660.34285, -3747.2622, -3778.76239, -3570.19543, -3570.10171, -3771.04531, -3494.92752, -3641.17771, -3538.24783, -3741.42397, -3792.52551, -3736.12958, -3722.09165, -3762.96742, -3683.32587, -3734.67907, -3848.9109, -3687.33859, -3795.69491, -3689.25859, -3472.81119, -3788.18533, -3615.97611, -3620.36661, -3658.44051, -3773.41762, -3664.66817, -3655.25603, -3839.99886, -3819.17824, -3743.97513, -3500.12974, -3494.17433, -2925.67711, -3783.92679, -3757.61891, -3727.65154, -3744.36385, -3728.38429, -3658.7074, -3831.16402, -2912.00617, -3738.12658, -3383.17161, -2494.60527, -3644.1252, -3556.93231, -3258.0832, -3744.81694, -3792.84885, -3659.0729, -3738.19135, -3004.96653, -3396.13362, -3570.90098, -3751.77234, -3731.3911, -3668.34474, -3702.49426, -3758.33443, -3068.39812, -3701.0839, -3730.95097, -3739.35626, -3680.68047, -3659.58277, -3780.39831, -3077.25392, -3759.93744, -3011.48175, -3688.13133, -3441.75015, -3656.6468, -2486.2664, -3594.55945, -3684.29692, -3717.19662, -3681.85662, -3824.31421, -3831.41093, -3375.82299, -3528.65362, -3557.67853, -3699.82633, -3343.74841, -3703.21527, -2974.90397, -3316.73086, -3681.92108, -3223.38454, -3593.97978, -3841.63211, -3660.29956, -3273.57201, -3073.3335, -3776.53585, -3749.53302, -3796.35954, -3731.22055, -3666.87548, -3808.6893, -3080.46301, -3473.75911, -3857.9605, -3163.58289, -3759.98552, -3595.15811, -3786.40283, -3709.04342, -3790.95296, -2974.56026, -3784.34657, -3255.206, -3674.80704, -3844.1303, -3708.49228, -3484.773, -3807.36265, -3799.86324, -3717.54841, -3631.02227, -3728.32687, -3803.46942, -3613.1419, -3656.93942, -3799.88019, -3711.09648, -3808.84055, -3778.90559, -3826.86358, -3732.61477, -3675.86393, -3708.97352, -3728.52026, -3002.67237, -3571.77285, -3814.93193, -3785.17352, -3857.7999, -3727.14057, -3030.18949, -3835.59851, -3799.13918, -3443.87701, -2885.96333, -3608.22989, -3713.59758, -3703.5394, -3744.21774, -3466.08183, -3782.98432, -3051.66411, -3774.51124, -3641.32358, -3630.30746, -3625.16964, -3789.22005, -3699.54566, -3630.96287, -3717.60093, -3724.95823, -3669.09102, -3793.49797, -3730.84114, -3726.24787, -3717.14313, -3088.73411, -3692.20057, -3082.84474, -3480.44477, -3664.81931, -3800.67345, -3820.89927, -3519.84783, -3639.51818, -3556.0118, -3780.32931, -3761.14948, -3688.49057, -3722.04237, -3623.56063, -3823.31684, -3748.41497, -3538.67868, -3739.25111, -3546.76213, -3607.68259, -3336.61354, -3638.44114, -3778.83276, -3658.18199, -3768.31493, -3458.6938, -3682.46874, -2970.26081, -2392.1093, -3734.92382, -3659.23431, -3684.68498, -3788.8627, -3793.93355, -3576.3403, -3744.48267, -3464.31165, -3749.58042, -3372.27746, -3766.07171, -3764.63362, -3727.29883, -3610.03386, -3736.18673, -3688.92529, -2753.51174, -3638.80875], z: [-1627.47432, -1836.99289, -1555.98552, -1674.49278, -1667.88065, -1742.6826, -1548.46262, -1558.51975, -1590.96359, -1603.09519, -1599.09518, -1490.08769, -1551.75062, -1539.60974, -1534.89916, -1569.06914, -1833.38995, -1684.35565, -1591.40647, -1523.73423, -1546.10459, -1511.41899, -1763.91353, -1773.41044, -1569.96891, -1504.88428, -1881.56361, -1620.68805, -1527.31073, -1807.71175, -1801.23666, -1834.68805, -1534.04838, -1610.17131, -1652.0186, -1537.91931, -1618.04053, -1592.08075, -794.78971, -1530.48456, -1574.7638, -1565.20558, -1592.01579, -1658.7459, -1591.93683, -1539.8502, -1630.69842, -1745.14595, -1004.68363, -1623.20053, -1880.19779, -1581.98472, -1630.46421, -1845.70854, -1779.22073, -1584.12774, -1593.2219, -1629.14392, -1816.57845, -1784.09011, -1538.04712, -1618.064, -1595.13372, -1571.61263, -1662.60411, -1732.32524, -1582.63225, -1645.97181, -1565.82508, -1535.2466, -1539.0997, -1758.91213, -1542.09392, -1704.30407, -1545.79279, -1680.42238, -1665.75381, -1564.07022, -1890.11962, -1535.20151, -1574.0218, -1597.77889, -1573.18064, -1565.08122, -1598.30227, -1851.12328, -1682.60414, -1555.20207, -1581.41115, -1665.12537, -1640.32749, -1604.97672, -1761.84116, -1867.87387, -1560.81146, -1600.05972, -1621.27103, -1686.08655, -1584.69706, -1512.9227, -1797.93734, -1829.18999, -1612.0362, -1665.05916, -1587.26892, -1638.68305, -1607.90099, -1521.10387, -1525.18956, -1537.92512, -1579.13877, -611.28058, -1507.01516, -1549.83419, -1575.62048, -1578.71572, -1511.21202, -1582.30913, -1619.9537, -1537.91691, -1628.41259, -1488.61827, -1785.41778, -1624.40493, -1834.87744, -1618.96925, -1541.2026, -840.40416, -1580.92595, -1490.87367, -1646.28157, -1564.40861, -1797.72508, -1570.04285, -1810.96403, -1584.45225, -1486.53951, -1688.16336, -1772.7521, -1798.81115, -1825.03963, -1501.32802, -1561.02871, -1530.0059, -1574.3524, -1617.36931, -1570.8129, -1526.03726, -1619.38116, -1523.94051, -1860.96615, -1718.01023, -1671.84698, -1634.04614, -1569.86098, -1485.49338, -1621.35656, -1635.10236, -1590.23676, -1606.20562, -1595.66265, -1654.48095, -1606.27393, -1489.32185, -1584.8739, -1507.74979, -1594.87441, -1569.22076, -1601.9896, -1520.70034, -1552.11436, -1633.82362, -1543.75268, -1544.25006, -1581.03635, -724.85772, -1586.4404, -1492.03058, -1835.44484, -1588.13742, -1598.75726, -1563.38743, -1652.2212, -1707.65113, -1666.38616, -1789.9896, -1632.07456, -1617.3775, -1679.12958, -1548.82084, -1536.03921, -1711.07916, -1631.34638, -1076.80481, -1611.05397, -1582.80614, -1516.22817, -1743.1803, -1643.28551, -1534.23547, -1565.00284, -1663.96362, -1682.62371, -1660.8135, -823.13738, -1614.15209, -1601.89672, -1501.72441, -1793.51547, -1550.35597, -1635.84831, -1822.58731, -1597.59322, -1567.29355, -1808.84944, -1544.47116, -1757.24342, -1724.303, -1486.49193, -1533.22708, -1842.77516, -1591.15145, -1527.77145, -1612.07282, -1652.32434, -1590.26544, -1588.34985, -1578.23053, -1575.26146, -1850.73796, -1820.81416, -1778.47742, -1514.23669, -1586.06632, -1597.32385, -1615.97178, -1851.66271, -1581.49704, -1654.3685, -1630.57225, -1544.04139, -1546.54191, -1711.88171, -1510.09868, -894.60616, -1519.40221, -1600.35451, -1629.64587, -1812.08193, -1482.56845, -1816.39751, -1487.22167, -1520.09731, -1674.53252, -1562.24085, -1564.05709, -1610.99771, -1674.17446, -1490.04689, -1494.13455, -1863.96641, -1815.92659, -1591.39382, -1509.01399, -1582.38095, -1535.56307, -1566.07824, -1586.28693, -1845.31787, -1584.52143, -1504.68414, -1621.20429, -1572.56609, -1839.49268, -1873.00151, -1658.05409, -1696.48022, -1791.82072, -1511.29796, -1777.67272, -1587.93376, -809.06656, -1566.16201, -1657.39319, -1623.12404, -1615.88311, -1564.50842, -1547.72853, -1676.30986, -1616.06722, -1621.18598, -1650.4348, -1489.06465, -1793.0907, -1664.21861, -1589.70301, -1548.32233, -1536.91886, -1672.30044, -1554.85206, -1567.75435, -1594.41146, -1578.24147, -1639.87186, -1693.41536, -1758.58761, -1516.00263, -1840.58024, -1657.65196, -1646.00222, -1519.59924, -1505.9347, -1584.94621, -1605.54961, -1603.4395, -1705.80126, -1581.09174, -1571.31269, -1539.0175, -1665.58151, -1606.44055, -1548.76577, -1659.05555, -1615.14502, -1526.77163, -1877.76875, -1517.92329, -1792.50388, -1639.49025, -1608.1388, -1573.16349, -1647.2889, -1539.19401, -1573.27062, -1612.23336, -1670.64323, -1520.91388, -1589.31978, -1852.16305, -1610.50249, -1626.09527, -1673.63556, -1821.55677, -1525.4755, -1571.80534, -1682.43008, -1523.81803, -1612.6523, -1519.10236, -1565.9001, -1610.23435, -1515.63294, -1494.66707, -1521.73373, -1694.86432, -1528.40909, -1675.54353, -1830.37617, -1585.51706, -1679.2051, -1551.3299, -1579.87052, -1579.74842, -1528.40107, -1655.03852, -862.92538, -1691.0601, -1519.27735, -1577.47119, -1539.37339, -1605.93172, -1557.60453, -941.8031, -1499.15063, -1836.6699, -1671.04787, -1554.21428, -1614.89647, -1511.32395, -1844.96112, -1572.7198, -1507.46621, -1694.57501, -668.12659, -1492.76055, -1483.35501, -1568.09576, -1602.00488, -853.66934, -1652.88283, -1573.06181, -1542.1354, -1600.96259, -1623.5882, -1573.70192, -1588.65233, -1717.86939, -1837.56971, -1501.63991, -1842.73493, -1684.52597, -1509.35438, -1620.56997, -1583.07868, -1539.86933, -1596.41033, -1816.71922, -1555.47485, -1680.79144, -1532.24646, -1495.07823, -1604.96711, -1654.84148, -1537.86828, -1636.55815, -1616.90115, -1838.65444, -1853.29716, -1553.3276, -1835.50777, -1520.67287, -1573.76455, -1550.97344, -1615.70177, -1673.39099, -1665.37783, -1594.27998, -1608.21394, -1633.49644, -1605.18279, -1514.98654, -1611.04977, -1624.27547, -1652.77985, -1574.23091, -1541.51826, -1577.82481, -872.63512, -1625.3585, -1549.07882, -1583.94931, -1845.7434, -1519.96525, -1579.84488, -1737.83677, -1600.01159, -1662.82459, -1532.94365, -1583.82911, -1679.07437, -1705.80639, -1528.06348, -1618.2868, -1583.31879, -1790.94373, -1629.89558, -1569.97529, -1518.24736, -1567.02463, -1525.72615, -1620.19548, -1726.07465, -1550.84114, -1607.54933, -1877.81018, -1536.17688, -1576.07659, -1556.4236, -1618.78694, -1846.55609, -1634.39182, -1620.74244, -1562.13148, -1625.18955, -1539.40341, -1536.90705, -1796.24466, -1846.98434, -1825.82612, -1637.84451, -1786.86656, -1640.99126, -1585.37284, -1543.24162, -1537.58373, -1510.51852, -1519.53166, -1714.20639, -1740.97554, -1656.99925, -1580.01524, -1519.72061, -1609.54908, -1547.22079, -1648.51634, -1812.3565, -1754.82791, -1594.06886, -1586.02242, -1725.47607, -1580.03638, -1542.8611, -1654.96116, -1598.26721, -1605.65241, -1617.73023, -1593.00367, -1539.88427, -1815.0083, -1639.0839, -1628.10843, -1558.63219, -1571.25093, -1607.60349, -1530.64396, -1774.54097, -1575.27903, -1581.0529, -1610.07901, -1632.68266, -1506.82556, -1576.1131, -1534.1928, -1621.78916, -1517.07447, -1605.28925, -1630.12254, -1734.74917, -1576.83254, -1618.99955, -911.8594, -1744.39658, -1678.95567, -1584.32078, -1654.1464, -1505.75332, -1648.53572, -1621.73245, -1500.03771, -1575.53695, -1543.64084, -1612.9748, -1618.05498, -1504.37844, -1557.12032, -1536.64836, -1477.25785, -1585.47289, -1618.09894, -1629.1892, -1587.01634, -1616.51134, -1653.6662, -1658.12594, -1818.34959, -1531.70086, -1539.46204, -1819.82247, -1717.3648, -1570.16514, -1529.01593, -1514.95787, -1660.16537, -1603.681, -1533.36097, -1546.30137, -1656.03155, -1561.12241, -1568.5364, -1688.62239, -1694.82331, -1603.44707, -1577.86445, -1557.91763, -1636.23043, -1525.82939, -1804.28687, -1590.33302, -1651.34514, -1763.36297, -1503.71614, -1700.58166, -1678.65467, -1540.36903, -1541.27763, -893.3337, -1597.11133, -1530.57883, -1587.24682, -1551.42038, -1557.09278, -1821.60109, -1626.492, -1614.49475, -1778.02164, -1555.75598, -1632.38117, -1551.51292, -1596.84514, -1579.87266, -1573.88966, -1565.00734, -1613.07212, -1604.09183, -1620.27783, -1533.59268, -1576.03113, -1510.02659, -1850.84319, -1599.76604, -1817.75761, -1621.14207, -1523.53921, -1721.27898, -1776.77938, -1537.95105, -1613.76191, -1532.48622, -1733.20085, -1564.12969, -1706.00953, -1513.3643, -1669.03995, -1646.86261, -1604.11507, -1556.12531, -1519.79407, -1635.07201, -1853.53224, -1723.07474, -1583.7363, -1641.95173, -1663.56208, -1856.02121, -1499.95275, -1631.87606, -1528.26763, -1596.6974, -1631.06283, -1778.68323, -1568.64849, -1792.07404, -1594.26542, -1564.9493, -1534.3621, -1728.80859, -1732.41568, -1657.78121, -1562.83079, -1600.92268, -1647.93724, -1576.44233, -1559.67291, -1644.9845, -1519.63307, -1643.27478, -1857.38469, -1644.98213, -1605.64199, -1532.47564, -1549.0722, -1824.33494, -1572.01674, -1588.46521, -1638.99217, -1572.17806, -854.82928, -1609.65523, -1570.17272, -1618.37274, -1844.5853, -1592.65925, -1856.89467, -1532.37183, -1585.90354, -1573.40895, -1536.59563, -1666.32376, -1558.69759, -1516.72244, -1519.18122, -1618.62377, -805.10001, -1599.79748, -1509.55277, -1599.59065, -1836.43252, -1520.95349, -1546.84314, -1653.45571, -1815.54338, -1564.23951, -1541.17622, -1825.02394, -1598.27763, -1672.35245, -1628.11804, -1629.09174, -1850.76811, -1544.08699, -1790.40281, -1509.71787, -1585.81504, -1542.43854, -1838.51217, -1558.7221, -1730.42102, -1772.57315, -1607.7336, -1626.59307, -1631.52457, -1591.17527, -1521.82709, -1764.26317, -1689.0979, -1648.24864, -1530.69435, -1513.9113, -1673.3079, -1646.98956, -1602.79202, -1700.20017, -1554.70716, -1612.25108, -1672.89594, -1484.8498, -1651.78365, -1569.24465, -1825.91271, -1725.77809, -1634.34953, -1565.29965, -1502.50917, -1533.68227, -1529.47574, -1642.60238, -1508.3897, -1561.36122, -1841.83483, -1768.74337, -1677.13701, -1667.23123, -1597.16366, -1732.95724, -1545.04269, -1761.31209, -1524.93338, -1729.75085, -1713.43906, -1554.47295, -1517.49553, -1565.58306, -1638.77619, -1626.41021, -1877.57016, -1545.65723, -1653.00811, -1529.70822, -1578.67723, -1528.04726, -1493.33741, -1518.66465, -1609.55723, -1605.8835, -1818.95434, -1582.52446, -1598.67142, -1645.90077, -1610.27141, -1507.94904, -1717.52206, -1615.14629, -1826.03349, -1546.15107, -1516.3739, -1576.35142, -1650.46019, -1584.73738, -1678.05716, -1655.97051, -1574.80231, -1539.58053, -1563.87246, -1697.99717, -1522.79635, -1636.27343, -1563.99869, -1571.019, -1703.26619, -1666.12816, -1563.58134, -1745.51169, -1656.43745, -1683.06796, -1595.54389, -1544.35973, -1568.87098, -1582.92962, -1552.79556, -1639.24227, -1589.14979, -1492.37669, -1623.78323, -1546.31085, -1610.3688, -1763.61012, -1544.40068, -1660.25099, -1667.53018, -1618.21574, -1545.55171, -1626.29077, -1661.11402, -1491.01595, -1511.02548, -1597.03607, -1720.90369, -1744.63172, -1881.25676, -1539.63761, -1584.58647, -1594.06911, -1580.1284, -1611.02013, -1554.29279, -1487.56509, -1790.17701, -1586.51349, -1818.56341, -868.56619, -1651.27951, -1711.6132, -1832.28135, -1533.84278, -1542.51916, -1646.3636, -1533.87769, -1854.74958, -1804.42303, -1684.31625, -1560.96806, -1572.42498, -1618.20682, -1623.0288, -1547.79327, -1860.42191, -1607.69376, -1583.09655, -1573.51042, -1622.41911, -1503.26025, -1533.13256, -1804.0569, -1554.66405, -1800.65139, -1618.20571, -1789.3049, -1643.53466, -898.46168, -1660.61477, -1576.02073, -1618.44144, -1615.65672, -1519.64008, -1522.28767, -1813.83032, -1737.54664, -1692.9416, -1617.83743, -1823.27591, -1597.86463, -1827.03248, -1817.70474, -1620.58361, -1847.09492, -1703.9398, -1502.83717, -1652.25931, -1833.48683, -1854.13973, -1547.00511, -1594.42343, -1521.93707, -1604.4268, -1632.91598, -1528.01252, -1840.51288, -1781.47127, -1505.38653, -1844.95366, -1549.17153, -1680.0805, -1524.99905, -1597.61222, -1554.73373, -1773.56776, -1513.09455, -1812.59559, -1669.5962, -1497.37093, -1563.36462, -1771.10349, -1510.93094, -1519.4981, -1605.00271, -1669.38559, -1620.21686, -1513.06339, -1685.18259, -1632.6536, -1532.24981, -1557.20948, -1521.72588, -1523.18124, -1507.6357, -1580.94117, -1571.88128, -1591.21092, -1589.87408, -1842.01622, -1686.59634, -1524.84439, -1524.81883, -1515.35309, -1596.61346, -1829.07341, -1521.92122, -1525.27212, -1781.62422, -1818.16381, -1553.53886, -1612.6163, -1613.95146, -1583.50875, -1760.97243, -1507.84077, -1824.07903, -1545.18034, -1599.22498, -1675.21656, -1660.14388, -1532.95684, -1611.82927, -1612.29466, -1610.62986, -1606.23592, -1624.83321, -1524.52863, -1569.86447, -1610.92391, -1521.97667, -1819.29482, -1601.60454, -1820.85377, -1768.67773, -1636.77506, -1533.61593, -1530.95154, -1738.84415, -1627.31103, -1685.51007, -1521.13315, -1533.09162, -1603.65552, -1606.28173, -1663.68521, -1507.92187, -1510.64463, -1737.43404, -1566.36498, -1680.54174, -1639.57087, -1820.78295, -1602.46143, -1546.7185, -1648.946, -1542.36938, -1784.14415, -1610.21847, -1844.0876, -781.56228, -1625.82415, -1582.82979, -1609.6247, -1535.26915, -1544.74938, -1708.34728, -1542.18444, -1757.66117, -1544.34491, -1808.20153, -1552.65673, -1497.01902, -1581.24905, -1586.56829, -1594.57584, -1629.18614, -1569.73538, -1603.22399], }, layout = { paper_bgcolor: 'rgba(0,0,0,0)', plot_bgcolor: 'rgba(0,0,0,0)', scene: { yaxis: { title: 'sx' }, xaxis: { title: 'sy' }, zaxis: { title: 'sz' }, }, margin: { t: 30, l: 0, r: 0, b: 0, }, } config = { showLink: false, modeBarButtonsToRemove: ['sendDataToCloud'], responsive: true, } Plotly.plot(plotDiv, [trace0, ], layout, config) plotDiv.on('plotly_hover', data =>{ const runID = runIDs[data.points[0].curveNumber][data.points[0].pointNumber] document.getElementById(\"hoverIMG\").src = path+`/${runID}.`+imgType }) window.onresize = () => { resizeContents() }","title":"Example Visualization Report"},{"location":"dimred/command_line_interface/#quick-start","text":"You can call the command-line tool as follows: $ python -m lasso.dimred.run --help usage: run.py [-h] --reference-run REFERENCE_RUN [--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]] [--start-stage [START_STAGE]] [--end-stage [END_STAGE]] --project-dir PROJECT_DIR [--embedding-images EMBEDDING_IMAGES] [--logfile-filepath [LOGFILE_FILEPATH]] [--n-processes [N_PROCESSES]] [--part-ids [PART_IDS [PART_IDS ...]]] [--timestep TIMESTEP] [--cluster-args [CLUSTER_ARGS [CLUSTER_ARGS ...]]] [--outlier-args [OUTLIER_ARGS [OUTLIER_ARGS ...]]] [simulation_runs [simulation_runs ...]] Python utility script for dimensionality reduction. positional arguments: simulation_runs Simulation runs or patterns used to search for simulation runs. optional arguments: -h, --help show this help message and exit --reference-run REFERENCE_RUN Set the reference run instead of using the first entry in simulation runs. --exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]] Runs to exclude from the analysis. --start-stage [START_STAGE] At which specific stage to start the analysis (REFERENCE_RUN, IMPORT_RUNS, REDUCTION, CLUSTERING, EXPORT_PLOT). --end-stage [END_STAGE] At which specific stage to stop the analysis (REFERENCE_RUN, IMPORT_RUNS, REDUCTION, CLUSTERING, EXPORT_PLOT). --project-dir PROJECT_DIR Project dir for temporary files. Must be specified to allow restart at specific steps --embedding-images EMBEDDING_IMAGES Path to folder containing images of runs. Sample names must be numbers --logfile-filepath [LOGFILE_FILEPATH] Path for the logfile. A file will be created automatically if a project dir is specified. --n-processes [N_PROCESSES] Number of processes to use (default: n_cpu-1). --part-ids [PART_IDS [PART_IDS ...]] Part ids to process. By default all are taken. --timestep TIMESTEP Sets timestep to analyse. Uses last timestep if not set. --cluster-args [CLUSTER_ARGS [CLUSTER_ARGS ...]] Arguments for clustering algorithms. If not set, clustering will be skipped. --outlier-args [OUTLIER_ARGS [OUTLIER_ARGS ...]] Arguments for outlier detection befor clustering. Following arguments are required for the analysis: simulation-runs --project-dir] simulation-runs can be either tagged individually or by using placeholders for entire directories (e.g. '*.fz') and subdirectories (e.g. './**/*.fz'). Warning Every run clears respective steps of the generated .hdf5 file of previous runs, as well as the logfile.","title":"Quick Start"},{"location":"dimred/command_line_interface/#tutorial","text":"In this tutorial, we will introduce the application of the command-line utility and explain some of the arguments. Make sure to have some similar D3plots (20 should already be fine). At first we will only apply the required arguments: $ python -m lasso/dimred/run \\ $ user/tutorial/plots/plot*.fz \\ $ --project-dir user/tutorial/projectfolder The first required argument is the filepath to the folder containing the simulation runs. In our case, all plots are contained in the same folder. If each plot is saved in its own folder, the command would look like this: $ python -m lasso/dimred/run \\ $ user/tutorial/plots*/plot.fz \\ $ --project-dir user/tutorial/projectfolder The --project-dir argument specifies the folder where the project data is saved. This will be a project_buffer.hdf5 file, a logfile , and the 3d_beta_plot[hh:mm:ss].html output. Note that for each run, corresponding entries in the project_buffer.hdf5 and the logfile will be overwritten. How to access the results in the project_buffer.hdf5 file will be discussed later. Your output should look similar to this: ==== OPEN - LASSO ==== \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513 \u2503 n-processes \u2503 5 \u2503 \u2502 reference-run \u2502 user/tuorial/plots/plot0.fz \u2502 \u2502 project-dir \u2502 user/tutorial/projectfolder \u2502 \u2502 # simul.-files \u2502 35 \u2502 \u2502 # excluded files \u2502 0 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 ---- Running Routines ---- [14:25:56] Reference Subsample ... [14:26:04] Loadtime Reference subample: 8.020 [14:26:04] Total time for Reference subample: 8.080 [14:26:04] Reference subsample completed [14:26:04] Subsampling Subsampling plots ... \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 35 of 35; [14:29:03] Average Time per Subsampling Process: 24.76 [14:29:03] Average Loadtime per sample: 24.55 [14:29:03] Subsampling completed [14:29:03] Dimension Reduction ... [14:29:04] Dimension Reduction completed [14:29:04] No arguments provided for clustering, clustering aborted [14:29:04] Creating .html viz [14:29:05] Finished creating viz The output provides information about the different stages of the dimred tool, as well as some additional information. This allows you to keep track of the tools progress. The following 5 stages are run through: REFERENCE_RUN: The reference run is subsampled and saved. The reference run is either the first entry of the simulation runs, or can be manually set with --reference-run IMPORT_RUNS: The provided simulation runs are loaded, and subsampled using the reference run. This process applies a nearest neighbor algorithm to match nodes between different meshes to compensate for different meshing. REDUCTION: The dimensionality reduction is performed. CLUSTERING: If clustering and outlier arguments are provided, the results will be further categorized. EXPORT_PLOT: The results are exported and saved as .html file. Note Your computer may slow down while using the tool. If you want to use other programs while waiting on the tool to finish, reduce the amount of cores with --n-processes","title":"Tutorial"},{"location":"dimred/command_line_interface/#start-and-end-stage","text":"Next, we will take a look at the --start-stage and --end-stage arguments. These allow to restart and end the command-line utility at certain points in the process. This is usefull if you don't want to repeat certain stages to save time, or want to end the process prematurly, e.g. don't want to generate the .html output. To set the desired start and end stage, use the the following keywords: REFERENCE_RUN IMPORT_RUNS REDUCTION CLUSTERING EXPORT_PLOT Example: $ python -m lasso/dimred/run \\ $ user/tutorial/plots \\ $ --project-dir user/tutorial/projectfolder \\ $ --start-stage REDUCTION \\ $ --end-stage CLUSTERING ==== OPEN - LASSO ==== \u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513 \u2503 n-processes \u2503 5 \u2503 \u2502 reference-run \u2502 user/tutorial/plots/plot0.fz \u2502 \u2502 project-dir \u2502 user/tutorial/projectfolder \u2502 \u2502 # simul.-files \u2502 35 \u2502 \u2502 # excluded files \u2502 0 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 ---- Running Routines ---- [14:45:28] Skipped import stage [14:45:28] Dimension Reduction ... [14:45:29] Dimension Reduction completed [14:45:29] No arguments provided for clustering, clustering aborted This process is much quicker, as the samples have already been loaded and subsampled. Note that this only works, if the stages before the selected start stage (here: REFERENCE_RUN and IMPORT_RUNS have already been processed before.","title":"Start and End stage"},{"location":"dimred/command_line_interface/#clustering-and-outlier-detection","text":"The dimred tool has an integrated functionality to cluster your results and detect outliers. Following cluster algorithms from the scikit sklearn library have been implemented: kmeans SpectralClustering DBScan Optics Additionally, you have access to the following outlier detection algorithms from the same library: IsolationForest LocalOutlierFactor OneClassSVM These classes have additional optional arguments, specified in their respective documentation. Here is an example on how to find two clusters with kmeans and detect oultiers with LocalOutlierFactor: $ python -m lasso/dimred/run \\ $ user/tutorial/plots \\ $ --project-dir user/tutorial/projectfolder \\ $ --reference-run user/tuorial/referenceplot \\ $ --start-stage REDUCTION \\ $ --cluster-arg kmeans n_clusters int 2 \\ $ --outlier-args LocalOutlierFactor !!! note> The argument n_clusters is followed by its type and then its value! The type of a keyword can be referenced by the appropriate sklearn documentation. Some types are not supported, make sure that they are either float , int or str . We skip the import stage again and add the --cluster-args and --outlier-args arguments, followed by the desired algorithm and optional additional arguments and their values.","title":"Clustering and outlier detection"},{"location":"dimred/command_line_interface/#accessing-the-results","text":"All results, as well as the subsamples and reference subsample are saved in the project_buffer.hdf5 file. You can access these in your own python scripts: import numpy as np import h5py h5py_path = \"user/tutorial/project_buffer.hdf5\" h5file = h5py . File ( h5py_path ) # access the reference subsamples: ref_sample = h5file [ \"subsample\" ][:] # create a numpy array containing displacement of all subsamples # this returns an array of shape (samples, timesteps, nodes, dims) np . stack ( h5file [ \"subsampled_runs\" ][ entry ][:] for entry in h5file [ \"subsampled_runs\" ] . keys ()]) # create a numpy array containg the right reduced order basis for projection: v_rob = h5file [ \"v_rob\" ][:] # the subsampled runs are projected into the right reduced order basis and called betas: betas = np . stack ([ h5file [ \"betas\" ][ entry ][:] for entry in h5file [ \"betas\" ] . keys ()]) These betas are used for the visulatization and if specified, clustering or outlier detection. In the visulatization, only the first 3 coefficients (betas) and only the last timestamp are accounted for. If you have provided clustering and outlier detection arguments, you can also access the different clusters: cluster_index = np . stack ([ h5file [ \"betas\" ][ entry ] . attrs [ \"cluster\" ] for entry in h5file [ \"betas\" ] . keys () ]) beta_clusters = [] for cluster in range ( h5file [ \"betas\" ] . attrs [ \"nr_clusters\" ]): beta_clusters . append ( betas [ np . where ( cluster_index == cluster )[ 0 ]]) The beta_clusters list contains lists of betas for each cluster. If outlier arguments have been provided, the first list contains all detected outliers.","title":"Accessing the results"},{"location":"dimred/command_line_interface/#faq","text":"","title":"FAQ"},{"location":"dimred/command_line_interface/#how-to-specify-a-path-to-the-displayed-images","text":"In the final HTML there is a menu on the left side. In it you can specify a path to the image folder, as well as the file-ending. Be aware: The names of the images must be a number starting at 0 .","title":"How to specify a path to the displayed images?"},{"location":"dimred/plot_beta_clusters/","text":"Plot beta clusters Functions converting input list of clusters and corresponding ids into a .html page visualizing the results as a 3D Plot plot_clusters_js ( beta_cluster , id_cluster , save_path , img_path = None , mark_outliers = False , mark_timestamp = True , filename = '3d_beta_plot' , write = True , show_res = True ) Creates a .html visualization of input data Parameters: Name Type Description Default beta_cluster Sequence Numpy array containing beta clusters required id_cluster Union [ np . ndarray , Sequence ] Numpy array or sequence containing the ids samples in clusters. Must be of same structure as beta_clusters required save_path str Where to save the .html visualization required img_path Union [None, str ] Path to images of samples None mark_outliers bool Set to True if first entry in beta_cluster are outliers False mark_timestamp bool Set to True if name of visualization shall contain time of creation. If set to False, visualization will override previous file True filename str Name of .hmtl file '3d_beta_plot' write bool Set to False to not write .html file and return as string instead True show_res bool Set to False to not open resulting page in webbrowser True Returns: Name Type Description html_str_formatted str If write=False returns .hmtl file as string, else None","title":"plot_beta_clusters"},{"location":"dimred/plot_beta_clusters/#plot-beta-clusters","text":"Functions converting input list of clusters and corresponding ids into a .html page visualizing the results as a 3D Plot","title":"Plot beta clusters"},{"location":"dimred/plot_beta_clusters/#lasso.dimred.svd.plot_beta_clusters.plot_clusters_js","text":"Creates a .html visualization of input data Parameters: Name Type Description Default beta_cluster Sequence Numpy array containing beta clusters required id_cluster Union [ np . ndarray , Sequence ] Numpy array or sequence containing the ids samples in clusters. Must be of same structure as beta_clusters required save_path str Where to save the .html visualization required img_path Union [None, str ] Path to images of samples None mark_outliers bool Set to True if first entry in beta_cluster are outliers False mark_timestamp bool Set to True if name of visualization shall contain time of creation. If set to False, visualization will override previous file True filename str Name of .hmtl file '3d_beta_plot' write bool Set to False to not write .html file and return as string instead True show_res bool Set to False to not open resulting page in webbrowser True Returns: Name Type Description html_str_formatted str If write=False returns .hmtl file as string, else None","title":"plot_clusters_js()"},{"location":"dimred/pod_functions/","text":"POD Functions These functions are used for the proper orthogonal decomposition of samples calculate_v_and_betas ( stacked_sub_displ , progress_bar = None , task_id = None ) Calculates the right reduced order Basis V and up to 10 eigenvalues of the subsamples Parameters: Name Type Description Default stacked_sub_displ np . ndarray np.ndarray containing all subsampled displacements shape must be (samples, timesteps, nodes, dims) required Returns: Name Type Description v_big np . ndarray Reduced order basis to transform betas bag into subsamples betas np . ndarray Projected simulation runs err_msg str Error message if not enough samples where provided svd_step_and_dim ( s_mat , k = 10 ) Performs a svds operation on the two dimensional s_mat Parameters: Name Type Description Default s_mat np . ndarray 2D array on which the svds operation shall be performed required k The size of the POD 10 Returns: Name Type Description v ndarray Array containing the right reduced order basis","title":"pod_functions"},{"location":"dimred/pod_functions/#pod-functions","text":"These functions are used for the proper orthogonal decomposition of samples","title":"POD Functions"},{"location":"dimred/pod_functions/#lasso.dimred.svd.pod_functions.calculate_v_and_betas","text":"Calculates the right reduced order Basis V and up to 10 eigenvalues of the subsamples Parameters: Name Type Description Default stacked_sub_displ np . ndarray np.ndarray containing all subsampled displacements shape must be (samples, timesteps, nodes, dims) required Returns: Name Type Description v_big np . ndarray Reduced order basis to transform betas bag into subsamples betas np . ndarray Projected simulation runs err_msg str Error message if not enough samples where provided","title":"calculate_v_and_betas()"},{"location":"dimred/pod_functions/#lasso.dimred.svd.pod_functions.svd_step_and_dim","text":"Performs a svds operation on the two dimensional s_mat Parameters: Name Type Description Default s_mat np . ndarray 2D array on which the svds operation shall be performed required k The size of the POD 10 Returns: Name Type Description v ndarray Array containing the right reduced order basis","title":"svd_step_and_dim()"},{"location":"dimred/subsampling_methods/","text":"Subsampling Methods Methods used to perform subsampling of simulation runs. create_reference_subsample ( load_path , parts , nr_samples = 2000 ) Loads the D3plot at load_path, extracts the node coordinates of part 13, returns a random subsample of these nodes Parameters: Name Type Description Default load_path str Filepath of the D3plot required parts Sequence [ int ] List of parts to be extracted required nr_samples How many nodes are subsampled 2000 Returns: Name Type Description reference_sample np . array Numpy array containing the reference sample t_total float Total time required for subsampling t_load float Time required to load plot err_msg str If an error occurs, a string containing the error is returned instead remap_random_subsample ( load_path , parts , reference_subsample ) Remaps the specified sample onto a new mesh provided by reference subsampl, using knn matching Parameters: Name Type Description Default load_path str Filepath of the desired D3plot required parts list Which parts shall be extracted from the D3plot required reference_subsample np . ndarray Numpy array containing the reference nodes required Returns: Name Type Description subsampled_displacement np . ndarray Subsampled displacement of provided sample t_total float Total time required to perform subsampling t_load float Time required to load D3plot err_msg str If an error occured, a string is returned instead containing the error","title":"subsampling_methods"},{"location":"dimred/subsampling_methods/#subsampling-methods","text":"Methods used to perform subsampling of simulation runs.","title":"Subsampling Methods"},{"location":"dimred/subsampling_methods/#lasso.dimred.svd.subsampling_methods.create_reference_subsample","text":"Loads the D3plot at load_path, extracts the node coordinates of part 13, returns a random subsample of these nodes Parameters: Name Type Description Default load_path str Filepath of the D3plot required parts Sequence [ int ] List of parts to be extracted required nr_samples How many nodes are subsampled 2000 Returns: Name Type Description reference_sample np . array Numpy array containing the reference sample t_total float Total time required for subsampling t_load float Time required to load plot err_msg str If an error occurs, a string containing the error is returned instead","title":"create_reference_subsample()"},{"location":"dimred/subsampling_methods/#lasso.dimred.svd.subsampling_methods.remap_random_subsample","text":"Remaps the specified sample onto a new mesh provided by reference subsampl, using knn matching Parameters: Name Type Description Default load_path str Filepath of the desired D3plot required parts list Which parts shall be extracted from the D3plot required reference_subsample np . ndarray Numpy array containing the reference nodes required Returns: Name Type Description subsampled_displacement np . ndarray Subsampled displacement of provided sample t_total float Total time required to perform subsampling t_load float Time required to load D3plot err_msg str If an error occured, a string is returned instead containing the error","title":"remap_random_subsample()"},{"location":"dimred/svd/","text":"Module lasso.dimred.svd Module containing the methods and functions used by DimredRun subsampling_methods pod_functions clustering_betas plot_beta_clusters KeywordTypes","title":"Description"},{"location":"dimred/svd/#module-lassodimredsvd","text":"Module containing the methods and functions used by DimredRun subsampling_methods pod_functions clustering_betas plot_beta_clusters KeywordTypes","title":"Module lasso.dimred.svd"},{"location":"dyna/","text":"lasso.dyna The dyna module contains classes to read, write and display LS-Dyna result files. For a detailed list of features, see the following list: D3plot Read & Write Beam, Shell, Solid, TShell Results Element/Node deletion Part Metadata Material Type Data Rigid Body Data Rigid Road Data SPH Particles Plot shell-based parts as 3D HTML Binout Read & Write Note The D3plot reader can process almost every structural result or results connected to it such as airbag results. Multi-Solver data though and connected results are not supported. D3plot Example >>> from lasso.dyna import D3plot , ArrayType , FilterType >>> # read a file (zero-copy reading of everything) >>> d3plot = D3plot ( \"path/to/d3plot\" ) >>> # read file >>> # - buffered (less memory usage) >>> # - only node displacements (safes memory) >>> # - read only first and last state >>> d3plot = D3plot ( \"path/to/d3plot\" , >>> state_array_filter = [ \"node_displacement\" ], >>> buffered_reading = True , >>> state_filter = { 0 , - 1 }) >>> # and of course femzipped files >>> d3plot = D3plot ( \"path/to/d3plot.fz\" ) >>> # get arrays (see docs of ArrayType for shape info) >>> disp = d3plot . arrays [ \"node_displacement\" ] >>> disp . shape ( 34 , 51723 , 3 ) >>> # this is safer and has auto-completion >>> disp = d3plot . arrays [ ArrayType . node_displacement ] >>> # filter elements for certain parts >>> pstrain = d3plot . arrays [ ArrayType . element_shell_effective_plastic_strain ] >>> pstrain . shape ( 34 , 56372 , 3 ) >>> mask = d3plot . get_part_filter ( FilterType . SHELL , [ 44 , 45 ]) >>> # filter elements with mask >>> pstrain [:, mask ] . shape ( 34 , 17392 , 3 ) >>> # create a standalone html plot >>> d3plot . plot ()","title":"Overview"},{"location":"dyna/#lassodyna","text":"The dyna module contains classes to read, write and display LS-Dyna result files. For a detailed list of features, see the following list: D3plot Read & Write Beam, Shell, Solid, TShell Results Element/Node deletion Part Metadata Material Type Data Rigid Body Data Rigid Road Data SPH Particles Plot shell-based parts as 3D HTML Binout Read & Write Note The D3plot reader can process almost every structural result or results connected to it such as airbag results. Multi-Solver data though and connected results are not supported.","title":"lasso.dyna"},{"location":"dyna/#d3plot-example","text":">>> from lasso.dyna import D3plot , ArrayType , FilterType >>> # read a file (zero-copy reading of everything) >>> d3plot = D3plot ( \"path/to/d3plot\" ) >>> # read file >>> # - buffered (less memory usage) >>> # - only node displacements (safes memory) >>> # - read only first and last state >>> d3plot = D3plot ( \"path/to/d3plot\" , >>> state_array_filter = [ \"node_displacement\" ], >>> buffered_reading = True , >>> state_filter = { 0 , - 1 }) >>> # and of course femzipped files >>> d3plot = D3plot ( \"path/to/d3plot.fz\" ) >>> # get arrays (see docs of ArrayType for shape info) >>> disp = d3plot . arrays [ \"node_displacement\" ] >>> disp . shape ( 34 , 51723 , 3 ) >>> # this is safer and has auto-completion >>> disp = d3plot . arrays [ ArrayType . node_displacement ] >>> # filter elements for certain parts >>> pstrain = d3plot . arrays [ ArrayType . element_shell_effective_plastic_strain ] >>> pstrain . shape ( 34 , 56372 , 3 ) >>> mask = d3plot . get_part_filter ( FilterType . SHELL , [ 44 , 45 ]) >>> # filter elements with mask >>> pstrain [:, mask ] . shape ( 34 , 17392 , 3 ) >>> # create a standalone html plot >>> d3plot . plot ()","title":"D3plot Example"},{"location":"dyna/ArrayType/","text":"ArrayType Specifies the names for specific arrays Enums from this class shall be used as a preferred practice instead of the string array names to ensure compatibility. Attributes: Name Type Description global_timesteps str array shape: (n_timesteps) global_kinetic_energy str array shape: (n_timesteps) global_internal_energy str array shape: (n_timesteps) global_total_energy str array shape: (n_timesteps) global_velocity str array shape: (n_timesteps) node_ids str array shape: (n_nodes) node_coordinates str array shape: (n_nodes, x_y_z) node_displacement str array shape: (n_states, n_nodes, x_y_z) node_velocity str array shape: (n_states, n_nodes, x_y_z) node_acceleration str array shape: (n_states, n_nodes, x_y_z) node_is_alive str array shape: (n_states, n_nodes) node_temperature str array shape: (n_states, n_nodes) or (n_states, n_nodes, 3) node_heat_flux str array shape: (n_states, n_nodes, 3) node_mass_scaling str array shape: (n_states, n_nodes) node_temperature_gradient str array shape: (n_states, n_nodes) node_residual_forces str array shape: (n_states, n_nodes, fx_fy_fz) node_residual_moments str array shape: (n_states, n_nodes, mx_my_mz) element_solid_node_indexes str array shape: (n_solids, 8) element_solid_part_indexes str array shape: (n_solids) element_solid_ids str array shape: (n_solids) element_solid_thermal_data str array shape: (n_states, n_solids, n_solids_thermal_vars) element_solid_stress str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_effective_plastic_strain str array shape: (n_states, n_solid_layers, n_solids) element_solid_history_variables str array shape: (n_states, n_solids, n_solid_layers, n_solids_history_vars) element_solid_strain str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_plastic_strain_tensor str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_thermal_strain_tensor str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_is_alive str array shape: (n_states, n_solids) element_solid_extra_nodes str array shape: (n_solids, 2) element_solid_node10_extra_node_indexes str array shape: (n_solids, 2) element_solid_node20_element_index str array shape: (n_node20_solids) element_solid_node20_extra_node_indexes str array shape: (n_node20_solids, 12) element_solid_node27_element_index str array shape: (n_node27_solids) element_solid_node27_extra_node_indexes str array shape: (n_node27_solids, 27) element_solid_node21_penta_element_index str array shape: (n_node21p_solids) element_solid_node21_penta_extra_node_indexes str array shape: (n_node21p_solids, 21) element_solid_node15_tetras_element_index str array shape: (n_node15t_solids) element_solid_node15_tetras_extra_node_indexes str array shape: (n_node15t_solids, 7) element_solid_node20_tetras_element_index str array shape: (n_node20t_solids) element_solid_node20_tetras_extra_node_indexes str array shape: (n_node20t_solids, 20) element_solid_node40_pentas_element_index str array shape: (n_node40h_solids) element_solid_node40_pentas_extra_node_indexes str array shape: (n_node40h_solids, 40) element_solid_node64_hexas_element_index str array shape: (n_node64h_solids) element_solid_node64_hexas_extra_node_indexes str array shape: (n_node64h_solids, 64) element_tshell_part_indexes str array shape: (n_tshells) element_tshell_node_indexes str array shape: (n_tshells, 8) element_tshell_ids str array shape: (n_tshells) element_tshell_stress str array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) element_tshell_effective_plastic_strain str array shape: (n_states, n_tshells, n_tshells_layers) element_tshell_history_variables str array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) element_tshell_is_alive str array shape: (n_states, n_tshells) element_tshell_strain str array shape: (n_states, n_tshells, upper_lower, xx_yy_zz_xy_yz_xz) element_beam_part_indexes str array shape: (n_beams) element_beam_node_indexes str array shape: (n_beams, 5) element_beam_ids str array shape: (n_beams) element_beam_axial_force str array shape: (n_states, n_beams) element_beam_shear_force str array shape: (n_states, n_beams, s_t) element_beam_bending_moment str array shape: (n_states, n_beams, s_t) element_beam_torsion_moment str array shape: (n_states, n_beams) element_beam_shear_stress str array shape: (n_states, n_beams, n_beams_layers, rs_rt) element_beam_axial_stress str array shape: (n_states, n_beams, n_beams_layers) element_beam_plastic_strain str array shape: (n_states, n_beams, n_beams_layers) element_beam_axial_strain str array shape: (n_states, n_beams, n_beams_layers) element_beam_history_vars str array shape: (n_states, n_beams, n_beams_layers+3, n_beams_history_vars) element_beam_is_alive str array shape: (n_states, n_beams) element_shell_part_indexes str array shape (n_shells, 4) element_shell_node_indexes str array shape (n_shells) element_shell_ids str array shape (n_shells) element_shell_stress str array shape (n_states, n_shells_non_rigid, n_shell_layers, xx_yy_zz_xy_yz_xz) element_shell_effective_plastic_strain str array shape (n_states, n_shells_non_rigid, n_shell_layers) element_shell_history_vars str array shape (n_states, n_shells_non_rigid, n_shell_layers, n_shell_history_vars) element_shell_bending_moment str array shape (n_states, n_shells_non_rigid, mx_my_mxy) element_shell_shear_force str array shape (n_states, n_shells_non_rigid, qx_qy) element_shell_normal_force str array shape (n_states, n_shells_non_rigid, nx_ny_nxy) element_shell_thickness str array shape (n_states, n_shells_non_rigid) element_shell_unknown_variables str array shape (n_states, n_shells_non_rigid, 2) element_shell_internal_energy str array shape (n_states, n_shells_non_rigid) element_shell_strain str array shape (n_states, n_shells_non_rigid, upper_lower, xx_yy_zz_xy_yz_xz) element_shell_is_alive str array shape (n_states, n_shells_non_rigid) element_shell_node8_extra_node_indexes str array shape (n_shells, 4) element_shell_node8_element_index str array shape: (n_shells) element_shell_plastic_strain_tensor str array shape(n_states, n_shells_non_rigid, n_layers, 6) element_shell_thermal_strain_tensor str array shape(n_states, n_shells_non_rigid, 6) part_material_type str array shape: (n_parts) part_ids str array shape: (n_parts) part_ids_unordered str array shape: (n_parts) part_ids_cross_references str array shape: (n_parts) part_titles str array shape: (n_parts) part_titles_ids str array shape: (n_parts) part_internal_energy str array shape: (n_states, n_parts) part_kinetic_energy str array shape: (n_states, n_parts) part_velocity str array shape: (n_states, n_parts, x_y_z) part_mass str array shape: (n_states, n_parts) part_hourglass_energy str array shape: (n_states, n_parts) sph_node_indexes str array shape: (n_sph_nodes) sph_node_material_index str array shape: (n_sph_nodes) sph_is_alive str array shape: (n_states, n_sph_particles) sph_radius str array shape: (n_states, n_sph_particles) sph_pressure str array shape: (n_states, n_sph_particles) sph_stress str array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) sph_effective_plastic_strain str array shape: (n_states, n_sph_particles) sph_density str array shape: (n_states, n_sph_particles) sph_internal_energy str array shape: (n_states, n_sph_particles) sph_n_neighbors str array shape: (n_states, n_sph_particles) sph_strain str array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) sph_strainrate str array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) sph_mass str array shape: (n_states, n_sph_particles) sph_deletion str array shape: (n_states, n_sph_particles) sph_history_vars str array shape: (n_states, n_sph_particles, n_sph_history_vars) airbag_variable_names str array shape: (n_variables) airbag_variable_types str array shape: (n_variables) airbags_first_particle_id str array shape: (n_airbags) airbags_n_particles str array shape: (n_airbags) airbags_ids str array shape: (n_airbags) airbags_n_gas_mixtures str array shape: (n_airbags) airbags_n_chambers str array shape: (n_airbags) airbag_n_active_particles str array shape: (n_states, n_airbags) airbag_bag_volume str array shape: (n_states, n_airbags) airbag_particle_gas_id str array shape: (n_states, n_airbag_particles) airbag_particle_chamber_id str array shape: (n_states, n_airbag_particles) airbag_particle_leakage str array shape: (n_states, n_airbag_particles) airbag_particle_mass str array shape: (n_states, n_airbag_particles) airbag_particle_radius str array shape: (n_states, n_airbag_particles) airbag_particle_spin_energy str array shape: (n_states, n_airbag_particles) airbag_particle_translation_energy str array shape: (n_states, n_airbag_particles) airbag_particle_nearest_segment_distance str array shape: (n_states, n_airbag_particles) airbag_particle_position str array shape: (n_states, n_airbag_particles, x_y_z) airbag_particle_velocity str array shape: (n_states, n_airbag_particles, x_y_z) rigid_road_node_ids str array shape: (rigid_road_n_nodes) rigid_road_node_coordinates str array shape: (rigid_road_n_nodes, x_y_z) rigid_road_ids str array shape: (n_roads) rigid_road_n_segments str array shape: (n_roads) rigid_road_segment_node_ids str list!: (n_roads, 4*n_road_segments) rigid_road_segment_road_id str list!: (n_roads, n_road_segments) rigid_road_displacement str array shape: (n_states, n_roads, x_y_z) rigid_road_velocity str array shape: (n_states, n_roads, x_y_z) rigid_body_part_indexes str array shape: (n_rigid_bodies) rigid_body_n_nodes str array shape: (n_rigid_bodies) rigid_body_node_indexes_list str list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) rigid_body_n_active_nodes str array shape: (n_rigid_bodies) rigid_body_active_node_indexes_list str list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) rigid_body_coordinates str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_rotation_matrix str array shape: (n_states, n_rigid_bodies, 9) rigid_body_velocity str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_rot_velocity str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_acceleration str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_rot_acceleration str array shape: (n_states, n_rigid_bodies, x_y_z) contact_title_ids str array shape: (n_contacts) contact_titles str array shape: (n_contacts) ale_material_ids str array shape: (n_ale_material) rigid_wall_force str array shape: (n_states, n_rigid_walls) rigid_wall_position str array shape: (n_states, n_rigid_walls, x_y_z) get_state_array_names () staticmethod Get the names of all state arrays Returns: state_array_names: List[str] list of state array names","title":"ArrayType"},{"location":"dyna/ArrayType/#arraytype","text":"Specifies the names for specific arrays Enums from this class shall be used as a preferred practice instead of the string array names to ensure compatibility. Attributes: Name Type Description global_timesteps str array shape: (n_timesteps) global_kinetic_energy str array shape: (n_timesteps) global_internal_energy str array shape: (n_timesteps) global_total_energy str array shape: (n_timesteps) global_velocity str array shape: (n_timesteps) node_ids str array shape: (n_nodes) node_coordinates str array shape: (n_nodes, x_y_z) node_displacement str array shape: (n_states, n_nodes, x_y_z) node_velocity str array shape: (n_states, n_nodes, x_y_z) node_acceleration str array shape: (n_states, n_nodes, x_y_z) node_is_alive str array shape: (n_states, n_nodes) node_temperature str array shape: (n_states, n_nodes) or (n_states, n_nodes, 3) node_heat_flux str array shape: (n_states, n_nodes, 3) node_mass_scaling str array shape: (n_states, n_nodes) node_temperature_gradient str array shape: (n_states, n_nodes) node_residual_forces str array shape: (n_states, n_nodes, fx_fy_fz) node_residual_moments str array shape: (n_states, n_nodes, mx_my_mz) element_solid_node_indexes str array shape: (n_solids, 8) element_solid_part_indexes str array shape: (n_solids) element_solid_ids str array shape: (n_solids) element_solid_thermal_data str array shape: (n_states, n_solids, n_solids_thermal_vars) element_solid_stress str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_effective_plastic_strain str array shape: (n_states, n_solid_layers, n_solids) element_solid_history_variables str array shape: (n_states, n_solids, n_solid_layers, n_solids_history_vars) element_solid_strain str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_plastic_strain_tensor str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_thermal_strain_tensor str array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) element_solid_is_alive str array shape: (n_states, n_solids) element_solid_extra_nodes str array shape: (n_solids, 2) element_solid_node10_extra_node_indexes str array shape: (n_solids, 2) element_solid_node20_element_index str array shape: (n_node20_solids) element_solid_node20_extra_node_indexes str array shape: (n_node20_solids, 12) element_solid_node27_element_index str array shape: (n_node27_solids) element_solid_node27_extra_node_indexes str array shape: (n_node27_solids, 27) element_solid_node21_penta_element_index str array shape: (n_node21p_solids) element_solid_node21_penta_extra_node_indexes str array shape: (n_node21p_solids, 21) element_solid_node15_tetras_element_index str array shape: (n_node15t_solids) element_solid_node15_tetras_extra_node_indexes str array shape: (n_node15t_solids, 7) element_solid_node20_tetras_element_index str array shape: (n_node20t_solids) element_solid_node20_tetras_extra_node_indexes str array shape: (n_node20t_solids, 20) element_solid_node40_pentas_element_index str array shape: (n_node40h_solids) element_solid_node40_pentas_extra_node_indexes str array shape: (n_node40h_solids, 40) element_solid_node64_hexas_element_index str array shape: (n_node64h_solids) element_solid_node64_hexas_extra_node_indexes str array shape: (n_node64h_solids, 64) element_tshell_part_indexes str array shape: (n_tshells) element_tshell_node_indexes str array shape: (n_tshells, 8) element_tshell_ids str array shape: (n_tshells) element_tshell_stress str array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) element_tshell_effective_plastic_strain str array shape: (n_states, n_tshells, n_tshells_layers) element_tshell_history_variables str array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) element_tshell_is_alive str array shape: (n_states, n_tshells) element_tshell_strain str array shape: (n_states, n_tshells, upper_lower, xx_yy_zz_xy_yz_xz) element_beam_part_indexes str array shape: (n_beams) element_beam_node_indexes str array shape: (n_beams, 5) element_beam_ids str array shape: (n_beams) element_beam_axial_force str array shape: (n_states, n_beams) element_beam_shear_force str array shape: (n_states, n_beams, s_t) element_beam_bending_moment str array shape: (n_states, n_beams, s_t) element_beam_torsion_moment str array shape: (n_states, n_beams) element_beam_shear_stress str array shape: (n_states, n_beams, n_beams_layers, rs_rt) element_beam_axial_stress str array shape: (n_states, n_beams, n_beams_layers) element_beam_plastic_strain str array shape: (n_states, n_beams, n_beams_layers) element_beam_axial_strain str array shape: (n_states, n_beams, n_beams_layers) element_beam_history_vars str array shape: (n_states, n_beams, n_beams_layers+3, n_beams_history_vars) element_beam_is_alive str array shape: (n_states, n_beams) element_shell_part_indexes str array shape (n_shells, 4) element_shell_node_indexes str array shape (n_shells) element_shell_ids str array shape (n_shells) element_shell_stress str array shape (n_states, n_shells_non_rigid, n_shell_layers, xx_yy_zz_xy_yz_xz) element_shell_effective_plastic_strain str array shape (n_states, n_shells_non_rigid, n_shell_layers) element_shell_history_vars str array shape (n_states, n_shells_non_rigid, n_shell_layers, n_shell_history_vars) element_shell_bending_moment str array shape (n_states, n_shells_non_rigid, mx_my_mxy) element_shell_shear_force str array shape (n_states, n_shells_non_rigid, qx_qy) element_shell_normal_force str array shape (n_states, n_shells_non_rigid, nx_ny_nxy) element_shell_thickness str array shape (n_states, n_shells_non_rigid) element_shell_unknown_variables str array shape (n_states, n_shells_non_rigid, 2) element_shell_internal_energy str array shape (n_states, n_shells_non_rigid) element_shell_strain str array shape (n_states, n_shells_non_rigid, upper_lower, xx_yy_zz_xy_yz_xz) element_shell_is_alive str array shape (n_states, n_shells_non_rigid) element_shell_node8_extra_node_indexes str array shape (n_shells, 4) element_shell_node8_element_index str array shape: (n_shells) element_shell_plastic_strain_tensor str array shape(n_states, n_shells_non_rigid, n_layers, 6) element_shell_thermal_strain_tensor str array shape(n_states, n_shells_non_rigid, 6) part_material_type str array shape: (n_parts) part_ids str array shape: (n_parts) part_ids_unordered str array shape: (n_parts) part_ids_cross_references str array shape: (n_parts) part_titles str array shape: (n_parts) part_titles_ids str array shape: (n_parts) part_internal_energy str array shape: (n_states, n_parts) part_kinetic_energy str array shape: (n_states, n_parts) part_velocity str array shape: (n_states, n_parts, x_y_z) part_mass str array shape: (n_states, n_parts) part_hourglass_energy str array shape: (n_states, n_parts) sph_node_indexes str array shape: (n_sph_nodes) sph_node_material_index str array shape: (n_sph_nodes) sph_is_alive str array shape: (n_states, n_sph_particles) sph_radius str array shape: (n_states, n_sph_particles) sph_pressure str array shape: (n_states, n_sph_particles) sph_stress str array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) sph_effective_plastic_strain str array shape: (n_states, n_sph_particles) sph_density str array shape: (n_states, n_sph_particles) sph_internal_energy str array shape: (n_states, n_sph_particles) sph_n_neighbors str array shape: (n_states, n_sph_particles) sph_strain str array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) sph_strainrate str array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) sph_mass str array shape: (n_states, n_sph_particles) sph_deletion str array shape: (n_states, n_sph_particles) sph_history_vars str array shape: (n_states, n_sph_particles, n_sph_history_vars) airbag_variable_names str array shape: (n_variables) airbag_variable_types str array shape: (n_variables) airbags_first_particle_id str array shape: (n_airbags) airbags_n_particles str array shape: (n_airbags) airbags_ids str array shape: (n_airbags) airbags_n_gas_mixtures str array shape: (n_airbags) airbags_n_chambers str array shape: (n_airbags) airbag_n_active_particles str array shape: (n_states, n_airbags) airbag_bag_volume str array shape: (n_states, n_airbags) airbag_particle_gas_id str array shape: (n_states, n_airbag_particles) airbag_particle_chamber_id str array shape: (n_states, n_airbag_particles) airbag_particle_leakage str array shape: (n_states, n_airbag_particles) airbag_particle_mass str array shape: (n_states, n_airbag_particles) airbag_particle_radius str array shape: (n_states, n_airbag_particles) airbag_particle_spin_energy str array shape: (n_states, n_airbag_particles) airbag_particle_translation_energy str array shape: (n_states, n_airbag_particles) airbag_particle_nearest_segment_distance str array shape: (n_states, n_airbag_particles) airbag_particle_position str array shape: (n_states, n_airbag_particles, x_y_z) airbag_particle_velocity str array shape: (n_states, n_airbag_particles, x_y_z) rigid_road_node_ids str array shape: (rigid_road_n_nodes) rigid_road_node_coordinates str array shape: (rigid_road_n_nodes, x_y_z) rigid_road_ids str array shape: (n_roads) rigid_road_n_segments str array shape: (n_roads) rigid_road_segment_node_ids str list!: (n_roads, 4*n_road_segments) rigid_road_segment_road_id str list!: (n_roads, n_road_segments) rigid_road_displacement str array shape: (n_states, n_roads, x_y_z) rigid_road_velocity str array shape: (n_states, n_roads, x_y_z) rigid_body_part_indexes str array shape: (n_rigid_bodies) rigid_body_n_nodes str array shape: (n_rigid_bodies) rigid_body_node_indexes_list str list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) rigid_body_n_active_nodes str array shape: (n_rigid_bodies) rigid_body_active_node_indexes_list str list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) rigid_body_coordinates str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_rotation_matrix str array shape: (n_states, n_rigid_bodies, 9) rigid_body_velocity str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_rot_velocity str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_acceleration str array shape: (n_states, n_rigid_bodies, x_y_z) rigid_body_rot_acceleration str array shape: (n_states, n_rigid_bodies, x_y_z) contact_title_ids str array shape: (n_contacts) contact_titles str array shape: (n_contacts) ale_material_ids str array shape: (n_ale_material) rigid_wall_force str array shape: (n_states, n_rigid_walls) rigid_wall_position str array shape: (n_states, n_rigid_walls, x_y_z)","title":"ArrayType"},{"location":"dyna/ArrayType/#lasso.dyna.array_type.ArrayType.get_state_array_names","text":"Get the names of all state arrays","title":"get_state_array_names()"},{"location":"dyna/ArrayType/#lasso.dyna.array_type.ArrayType.get_state_array_names--returns","text":"state_array_names: List[str] list of state array names","title":"Returns:"},{"location":"dyna/Binout/","text":"Binout There is a youtube tutorial available for this class: This class is meant to read binouts from LS-Dyna Parameters: Name Type Description Default filepath str Path to the binout to read. May contain * (glob) for selecting multiple files. required Attributes: Name Type Description filelist List [ str ] List of files which are opened. lsda: Lsda The underlying LS-Dyna binout reader instance from code from LSTC. lsda_root: Symbol Root lsda symbol which is like a root directory to traverse the content of the binout file. Notes This class is only a utility wrapper for Lsda from LSTC. Examples: >>> binout = Binout(\"path/to/binout\") __init__ ( filepath ) Constructor for a binout Parameters: Name Type Description Default filepath str path to the binout or pattern required Notes The class loads the file given in the filepath. By giving a search pattern such as: \"binout*\", all files with that pattern will be loaded. Examples: >>> # reads a single binout >>> binout = Binout(\"path/to/binout0000\") >>> binout.filelist ['path/to/binout0000'] >>> # reads multiple files >>> binout = Binout(\"path/to/binout*\") >>> binout.filelist ['path/to/binout0000','path/to/binout0001'] as_df ( * args ) read data and convert to pandas dataframe if possible Parameters: Name Type Description Default *args internal path in the folder structure of the binout () Returns: Name Type Description df pandas . DataFrame data converted to pandas dataframe Raises: Type Description ValueError if the data cannot be converted to a pandas dataframe Examples: >>> from lasso.dyna import Binout >>> binout = Binout('path/to/binout') Read a time-dependent array. >>> binout.as_df('glstat', 'eroded_kinetic_energy') time 0.00000 0.000000 0.19971 0.000000 0.39942 0.000000 0.59976 0.000000 0.79947 0.000000 ... 119.19978 105.220786 119.39949 105.220786 119.59983 105.220786 119.79954 105.220786 119.99988 105.220786 Name: eroded_kinetic_energy, Length: 601, dtype: float64 Read a time and id-dependent array. >>> binout.as_df('secforc', 'x_force') 1 2 3 ... 33 34 time . 0.00063 2.168547e-16 2.275245e-15 -3.118639e-14 ... -5.126108e-13 4.592941e-16 0.20034 3.514243e-04 3.797908e-04 -1.701294e-03 ... 2.530416e-11 2.755493e-07 0.40005 3.052490e-03 3.242951e-02 -2.699926e-02 ... 6.755315e-06 -2.608923e-03 0.60039 -1.299816e-02 4.930999e-02 -1.632376e-02 ... 8.941705e-05 -2.203455e-02 0.80010 1.178485e-02 4.904512e-02 -9.740204e-03 ... 5.648263e-05 -6.999854e-02 ... ... ... ... ... ... ... 119.00007 9.737679e-01 -8.833702e+00 1.298964e+01 ... -9.977377e-02 7.883521e+00 119.20041 7.421170e-01 -8.849411e+00 1.253505e+01 ... -1.845916e-01 7.791409e+00 119.40012 9.946615e-01 -8.541475e+00 1.188757e+01 ... -3.662228e-02 7.675800e+00 119.60046 9.677638e-01 -8.566695e+00 1.130774e+01 ... 5.144208e-02 7.273052e+00 119.80017 1.035165e+00 -8.040828e+00 1.124044e+01 ... -1.213450e-02 7.188395e+00 read ( * path ) Read all data from Binout (top to low level) Parameters: Name Type Description Default path internal path in the folder structure of the binout () Returns: Name Type Description ret Union [ List [ str ], str , np . ndarray ] list of subdata within the folder or data itself (array or string) Notes This function is used to read any data from the binout. It has been used to make the access to the data more comfortable. The return type depends on the given path: - `binout.read()`: `List[str] names of directories (in binout) - `binout.read(dir)`: `List[str]` names of variables or subdirs - `binout.read(dir1, ..., variable)`: np.array data If you have multiple outputs with different ids (e.g. in nodout for multiple nodes) then don't forget to read the id array for identification or id-labels. Examples: >>> from lasso.dyna import Binout >>> binout = Binout(\"test/binout\") >>> # get top dirs >>> binout.read() ['swforc'] >>> binout.read(\"swforc\") ['title', 'failure', 'ids', 'failure_time', ...] >>> binout.read(\"swforc\",\"shear\").shape (321L, 26L) >>> binout.read(\"swforc\",\"ids\").shape (26L,) >>> binout.read(\"swforc\",\"ids\") array([52890, 52891, 52892, ...]) >>> # read a string value >>> binout.read(\"swforc\",\"date\") '11/05/2013' save_hdf5 ( filepath , compression = 'gzip' ) Save a binout as HDF5 Parameters: Name Type Description Default filepath path where the HDF5 shall be saved required compression compression technique (see h5py docs) 'gzip' Examples: >>> binout = Binout(\"path/to/binout\") >>> binout.save_hdf5(\"path/to/binout.h5\")","title":"Binout"},{"location":"dyna/Binout/#binout","text":"There is a youtube tutorial available for this class: This class is meant to read binouts from LS-Dyna Parameters: Name Type Description Default filepath str Path to the binout to read. May contain * (glob) for selecting multiple files. required Attributes: Name Type Description filelist List [ str ] List of files which are opened. lsda: Lsda The underlying LS-Dyna binout reader instance from code from LSTC. lsda_root: Symbol Root lsda symbol which is like a root directory to traverse the content of the binout file.","title":"Binout"},{"location":"dyna/Binout/#lasso.dyna.binout.Binout--notes","text":"This class is only a utility wrapper for Lsda from LSTC. Examples: >>> binout = Binout(\"path/to/binout\")","title":"Notes"},{"location":"dyna/Binout/#lasso.dyna.binout.Binout.__init__","text":"Constructor for a binout Parameters: Name Type Description Default filepath str path to the binout or pattern required","title":"__init__()"},{"location":"dyna/Binout/#lasso.dyna.binout.Binout.__init__--notes","text":"The class loads the file given in the filepath. By giving a search pattern such as: \"binout*\", all files with that pattern will be loaded. Examples: >>> # reads a single binout >>> binout = Binout(\"path/to/binout0000\") >>> binout.filelist ['path/to/binout0000'] >>> # reads multiple files >>> binout = Binout(\"path/to/binout*\") >>> binout.filelist ['path/to/binout0000','path/to/binout0001']","title":"Notes"},{"location":"dyna/Binout/#lasso.dyna.binout.Binout.as_df","text":"read data and convert to pandas dataframe if possible Parameters: Name Type Description Default *args internal path in the folder structure of the binout () Returns: Name Type Description df pandas . DataFrame data converted to pandas dataframe Raises: Type Description ValueError if the data cannot be converted to a pandas dataframe Examples: >>> from lasso.dyna import Binout >>> binout = Binout('path/to/binout') Read a time-dependent array. >>> binout.as_df('glstat', 'eroded_kinetic_energy') time 0.00000 0.000000 0.19971 0.000000 0.39942 0.000000 0.59976 0.000000 0.79947 0.000000 ... 119.19978 105.220786 119.39949 105.220786 119.59983 105.220786 119.79954 105.220786 119.99988 105.220786 Name: eroded_kinetic_energy, Length: 601, dtype: float64 Read a time and id-dependent array. >>> binout.as_df('secforc', 'x_force') 1 2 3 ... 33 34 time . 0.00063 2.168547e-16 2.275245e-15 -3.118639e-14 ... -5.126108e-13 4.592941e-16 0.20034 3.514243e-04 3.797908e-04 -1.701294e-03 ... 2.530416e-11 2.755493e-07 0.40005 3.052490e-03 3.242951e-02 -2.699926e-02 ... 6.755315e-06 -2.608923e-03 0.60039 -1.299816e-02 4.930999e-02 -1.632376e-02 ... 8.941705e-05 -2.203455e-02 0.80010 1.178485e-02 4.904512e-02 -9.740204e-03 ... 5.648263e-05 -6.999854e-02 ... ... ... ... ... ... ... 119.00007 9.737679e-01 -8.833702e+00 1.298964e+01 ... -9.977377e-02 7.883521e+00 119.20041 7.421170e-01 -8.849411e+00 1.253505e+01 ... -1.845916e-01 7.791409e+00 119.40012 9.946615e-01 -8.541475e+00 1.188757e+01 ... -3.662228e-02 7.675800e+00 119.60046 9.677638e-01 -8.566695e+00 1.130774e+01 ... 5.144208e-02 7.273052e+00 119.80017 1.035165e+00 -8.040828e+00 1.124044e+01 ... -1.213450e-02 7.188395e+00","title":"as_df()"},{"location":"dyna/Binout/#lasso.dyna.binout.Binout.read","text":"Read all data from Binout (top to low level) Parameters: Name Type Description Default path internal path in the folder structure of the binout () Returns: Name Type Description ret Union [ List [ str ], str , np . ndarray ] list of subdata within the folder or data itself (array or string)","title":"read()"},{"location":"dyna/Binout/#lasso.dyna.binout.Binout.read--notes","text":"This function is used to read any data from the binout. It has been used to make the access to the data more comfortable. The return type depends on the given path: - `binout.read()`: `List[str] names of directories (in binout) - `binout.read(dir)`: `List[str]` names of variables or subdirs - `binout.read(dir1, ..., variable)`: np.array data If you have multiple outputs with different ids (e.g. in nodout for multiple nodes) then don't forget to read the id array for identification or id-labels. Examples: >>> from lasso.dyna import Binout >>> binout = Binout(\"test/binout\") >>> # get top dirs >>> binout.read() ['swforc'] >>> binout.read(\"swforc\") ['title', 'failure', 'ids', 'failure_time', ...] >>> binout.read(\"swforc\",\"shear\").shape (321L, 26L) >>> binout.read(\"swforc\",\"ids\").shape (26L,) >>> binout.read(\"swforc\",\"ids\") array([52890, 52891, 52892, ...]) >>> # read a string value >>> binout.read(\"swforc\",\"date\") '11/05/2013'","title":"Notes"},{"location":"dyna/Binout/#lasso.dyna.binout.Binout.save_hdf5","text":"Save a binout as HDF5 Parameters: Name Type Description Default filepath path where the HDF5 shall be saved required compression compression technique (see h5py docs) 'gzip' Examples: >>> binout = Binout(\"path/to/binout\") >>> binout.save_hdf5(\"path/to/binout.h5\")","title":"save_hdf5()"},{"location":"dyna/D3plot/","text":"D3plot There is a youtube tutorial available for this class: Class used to read LS-Dyna d3plots arrays : dict property writable Dictionary holding all d3plot arrays Notes The corresponding keys of the dictionary can also be found in `lasso.dyna.ArrayTypes`, which helps with IDE integration and code safety. Examples: >>> d3plot = D3plot(\"some/path/to/d3plot\") >>> d3plot.arrays.keys() dict_keys(['irbtyp', 'node_coordinates', ...]) >>> # The following is good coding practice >>> import lasso.dyna.ArrayTypes.ArrayTypes as atypes >>> d3plot.arrays[atypes.node_displacmeent].shape header : D3plotHeader property Instance holding all d3plot header information Returns: Name Type Description header D3plotHeader header of the d3plot Notes The header contains a lot of information such as number of elements, etc. Examples: >>> d3plot = D3plot(\"some/path/to/d3plot\") >>> # number of shells >>> d3plot.header.n_shells 85624 n_timesteps : int property Number of timesteps loaded __init__ ( filepath = None , use_femzip = None , n_files_to_load_at_once = None , state_array_filter = None , state_filter = None , buffered_reading = False ) Constructor for a D3plot Parameters: Name Type Description Default filepath str path to a d3plot file None use_femzip Union [ bool , None] Not used anymore. None n_files_to_load_at_once Union [ int , None] DEPRECATED not used anymore, use buffered_reading None state_array_filter Union [ List [ str ], None] names of arrays which will be the only ones loaded from state data None state_filter Union [None, Set [ int ]] which states to load. Negative indexes count backwards. None buffered_reading bool whether to pull only a single state into memory during reading False Examples: >>> from lasso.dyna import D3plot, ArrayType >>> # open and read everything >>> d3plot = D3plot(\"path/to/d3plot\") >>> # only read node displacement >>> d3plot = D3plot(\"path/to/d3plot\", state_array_filter=[\"node_displacement\"]) >>> # or with nicer syntax >>> d3plot = D3plot(\"path/to/d3plot\", state_array_filter=[ArrayType.node_displacement]) >>> # only load first and last state >>> d3plot = D3plot(\"path/to/d3plot\", state_filter={0, -1}) >>> # our computer lacks RAM so lets extract a specific array >>> # but only keep one state at a time in memory >>> d3plot = D3plot(\"path/to/d3plot\", >>> state_array_filter=[ArrayType.node_displacement], >>> buffered_reading=True) Notes If dyna wrote multiple files for several states, only give the path to the first file. check_array_dims ( array_dimensions , dimension_name , dimension_size =- 1 ) This function checks if multiple arrays share an array dimensions with the same size. Parameters: Name Type Description Default array_dimensions Dict [ str , int ] Array name and expected number of dimensions as dict required dimension_name str Name of the array dimension for error messages required dimension_size int Optional expected size. If not set then all entries must equal the first value collected. -1 Raises: Type Description ValueError If dimensions do not match in any kind of way. compare ( d3plot2 , array_eps = None ) Compare two d3plots and print the info Parameters: Name Type Description Default d3plot2 second d3plot required array_eps Union [ float , None] tolerance for arrays None Returns: Name Type Description hdr_differences dict differences in the header array_differences dict difference between arrays as message Examples: Comparison of a femzipped file and an uncompressed file. Femzip is a lossy compression, thus precision is traded for memory. >>> d3plot1 = D3plot(\"path/to/d3plot\") >>> d3plot2 = D3plot(\"path/to/d3plot.fz\") >>> hdr_diff, array_diff = d3plot1.compare(d3plot2) >>> for arraytype, msg in array_diff.items(): >>> print(name, msg) node_coordinates \u0394max = 0.050048828125 node_displacement \u0394max = 0.050048828125 node_velocity \u0394max = 0.050048828125 node_acceleration \u0394max = 49998984.0 element_beam_axial_force \u0394max = 6.103515625e-05 element_shell_stress \u0394max = 0.0005035400390625 element_shell_thickness \u0394max = 9.999999717180685e-10 element_shell_unknown_variables \u0394max = 0.0005000010132789612 element_shell_internal_energy \u0394max = 188.41957092285156 enable_logger ( enable ) staticmethod Enable the logger for this class Parameters: Name Type Description Default enable bool whether to enable logging for this class required get_part_filter ( filter_type , part_ids , for_state_array = True ) Get a part filter for different entities Parameters: Name Type Description Default filter_type FilterType the array type to filter for (beam, shell, solid, tshell, node) required part_ids Iterable [ int ] part ids to filter out required for_state_array bool if the filter is meant for a state array. Makes a difference for shells if rigid bodies are in the model (mattyp == 20) True Returns: Name Type Description mask np . ndarray mask usable on arrays to filter results Examples: >>> from lasso.dyna import D3plot, ArrayType, FilterType >>> d3plot = D3plot(\"path/to/d3plot\") >>> part_ids = [13, 14] >>> mask = d3plot.get_part_filter(FilterType.shell) >>> shell_stress = d3plot.arrays[ArrayType.element_shell_stress] >>> shell_stress.shape (34, 7463, 3, 6) >>> # select only parts from part_ids >>> shell_stress_parts = shell_stress[:, mask] plot ( i_timestep = 0 , field = None , is_element_field = True , fringe_limits = None , export_filepath = '' ) Plot the d3plot geometry Parameters: Name Type Description Default i_timestep int timestep index to plot 0 field Union [ np . ndarray , None] Array containing a field value for every element or node None is_element_field bool if the specified field is for elements or nodes True fringe_limits Union [ Tuple [ float , float ], None] limits for the fringe bar. Set by default to min and max. None export_filepath str filepath to export the html to '' Notes Currently only shell elements can be plotted, since for solids the surface needs extraction. Examples: Plot deformation of last timestep. >>> d3plot = D3plot(\"path/to/d3plot\") >>> d3plot.plot(-1) >>> # get eff. plastic strain >>> pstrain = d3plot.arrays[ArrayType.element_shell_effective_plastic_strain] >>> pstrain.shape (1, 4696, 3) >>> # mean across all 3 integration points >>> pstrain = pstrain.mean(axis=2) >>> pstrain.shape (1, 4696) >>> # we only have 1 timestep here but let's take last one in general >>> last_timestep = -1 >>> d3plot.plot(0, field=pstrain[last_timestep]) >>> # we don't like the fringe, let's adjust >>> d3plot.plot(0, field=pstrain[last_timestep], fringe_limits=(0, 0.3)) write_d3plot ( filepath , block_size_bytes = 2048 , single_file = True ) Write a d3plot file again Parameters: Name Type Description Default filepath Union [ str , BinaryIO ] filepath of the new d3plot file or an opened file handle required block_size_bytes int D3plots are originally written in byte-blocks causing zero-padding at the end of files. This can be controlled by this parameter. Set to 0 for no padding. 2048 single_file bool whether to write all states into a single file True Examples: Modify an existing d3plot: >>> d3plot = D3plot(\"path/to/d3plot\") >>> hvars = d3plot.array[ArrayType.element_shell_history_vars] >>> hvars.shape (1, 4696, 3, 19) >>> new_history_var = np.random.random((1, 4696, 3, 1)) >>> new_hvars = np.concatenate([hvars, new_history_var], axis=3) >>> d3plot.array[ArrayType.element_shell_history_vars] = new_hvars >>> d3plot.write_d3plot(\"path/to/new/d3plot\") Write a new d3plot from scratch: >>> d3plot = D3plot() >>> d3plot.arrays[ArrayType.node_coordinates] = np.array([[0, 0, 0], ... [1, 0, 0], ... [0, 1, 0]]) >>> d3plot.arrays[ArrayType.element_shell_node_indexes] = np.array([[0, 2, 1, 1]]) >>> d3plot.arrays[ArrayType.element_shell_part_indexes] = np.array([0]) >>> d3plot.arrays[ArrayType.node_displacement] = np.array([[[0, 0, 0], ... [1, 0, 0], ... [0, 1, 0]]]) >>> d3plot.write_d3plot(\"yay.d3plot\")","title":"D3plot"},{"location":"dyna/D3plot/#d3plot","text":"There is a youtube tutorial available for this class: Class used to read LS-Dyna d3plots","title":"D3plot"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.arrays","text":"Dictionary holding all d3plot arrays","title":"arrays"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.arrays--notes","text":"The corresponding keys of the dictionary can also be found in `lasso.dyna.ArrayTypes`, which helps with IDE integration and code safety. Examples: >>> d3plot = D3plot(\"some/path/to/d3plot\") >>> d3plot.arrays.keys() dict_keys(['irbtyp', 'node_coordinates', ...]) >>> # The following is good coding practice >>> import lasso.dyna.ArrayTypes.ArrayTypes as atypes >>> d3plot.arrays[atypes.node_displacmeent].shape","title":"Notes"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.header","text":"Instance holding all d3plot header information Returns: Name Type Description header D3plotHeader header of the d3plot","title":"header"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.header--notes","text":"The header contains a lot of information such as number of elements, etc. Examples: >>> d3plot = D3plot(\"some/path/to/d3plot\") >>> # number of shells >>> d3plot.header.n_shells 85624","title":"Notes"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.n_timesteps","text":"Number of timesteps loaded","title":"n_timesteps"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.__init__","text":"Constructor for a D3plot Parameters: Name Type Description Default filepath str path to a d3plot file None use_femzip Union [ bool , None] Not used anymore. None n_files_to_load_at_once Union [ int , None] DEPRECATED not used anymore, use buffered_reading None state_array_filter Union [ List [ str ], None] names of arrays which will be the only ones loaded from state data None state_filter Union [None, Set [ int ]] which states to load. Negative indexes count backwards. None buffered_reading bool whether to pull only a single state into memory during reading False Examples: >>> from lasso.dyna import D3plot, ArrayType >>> # open and read everything >>> d3plot = D3plot(\"path/to/d3plot\") >>> # only read node displacement >>> d3plot = D3plot(\"path/to/d3plot\", state_array_filter=[\"node_displacement\"]) >>> # or with nicer syntax >>> d3plot = D3plot(\"path/to/d3plot\", state_array_filter=[ArrayType.node_displacement]) >>> # only load first and last state >>> d3plot = D3plot(\"path/to/d3plot\", state_filter={0, -1}) >>> # our computer lacks RAM so lets extract a specific array >>> # but only keep one state at a time in memory >>> d3plot = D3plot(\"path/to/d3plot\", >>> state_array_filter=[ArrayType.node_displacement], >>> buffered_reading=True)","title":"__init__()"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.__init__--notes","text":"If dyna wrote multiple files for several states, only give the path to the first file.","title":"Notes"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.check_array_dims","text":"This function checks if multiple arrays share an array dimensions with the same size. Parameters: Name Type Description Default array_dimensions Dict [ str , int ] Array name and expected number of dimensions as dict required dimension_name str Name of the array dimension for error messages required dimension_size int Optional expected size. If not set then all entries must equal the first value collected. -1 Raises: Type Description ValueError If dimensions do not match in any kind of way.","title":"check_array_dims()"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.compare","text":"Compare two d3plots and print the info Parameters: Name Type Description Default d3plot2 second d3plot required array_eps Union [ float , None] tolerance for arrays None Returns: Name Type Description hdr_differences dict differences in the header array_differences dict difference between arrays as message Examples: Comparison of a femzipped file and an uncompressed file. Femzip is a lossy compression, thus precision is traded for memory. >>> d3plot1 = D3plot(\"path/to/d3plot\") >>> d3plot2 = D3plot(\"path/to/d3plot.fz\") >>> hdr_diff, array_diff = d3plot1.compare(d3plot2) >>> for arraytype, msg in array_diff.items(): >>> print(name, msg) node_coordinates \u0394max = 0.050048828125 node_displacement \u0394max = 0.050048828125 node_velocity \u0394max = 0.050048828125 node_acceleration \u0394max = 49998984.0 element_beam_axial_force \u0394max = 6.103515625e-05 element_shell_stress \u0394max = 0.0005035400390625 element_shell_thickness \u0394max = 9.999999717180685e-10 element_shell_unknown_variables \u0394max = 0.0005000010132789612 element_shell_internal_energy \u0394max = 188.41957092285156","title":"compare()"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.enable_logger","text":"Enable the logger for this class Parameters: Name Type Description Default enable bool whether to enable logging for this class required","title":"enable_logger()"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.get_part_filter","text":"Get a part filter for different entities Parameters: Name Type Description Default filter_type FilterType the array type to filter for (beam, shell, solid, tshell, node) required part_ids Iterable [ int ] part ids to filter out required for_state_array bool if the filter is meant for a state array. Makes a difference for shells if rigid bodies are in the model (mattyp == 20) True Returns: Name Type Description mask np . ndarray mask usable on arrays to filter results Examples: >>> from lasso.dyna import D3plot, ArrayType, FilterType >>> d3plot = D3plot(\"path/to/d3plot\") >>> part_ids = [13, 14] >>> mask = d3plot.get_part_filter(FilterType.shell) >>> shell_stress = d3plot.arrays[ArrayType.element_shell_stress] >>> shell_stress.shape (34, 7463, 3, 6) >>> # select only parts from part_ids >>> shell_stress_parts = shell_stress[:, mask]","title":"get_part_filter()"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.plot","text":"Plot the d3plot geometry Parameters: Name Type Description Default i_timestep int timestep index to plot 0 field Union [ np . ndarray , None] Array containing a field value for every element or node None is_element_field bool if the specified field is for elements or nodes True fringe_limits Union [ Tuple [ float , float ], None] limits for the fringe bar. Set by default to min and max. None export_filepath str filepath to export the html to ''","title":"plot()"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.plot--notes","text":"Currently only shell elements can be plotted, since for solids the surface needs extraction. Examples: Plot deformation of last timestep. >>> d3plot = D3plot(\"path/to/d3plot\") >>> d3plot.plot(-1) >>> # get eff. plastic strain >>> pstrain = d3plot.arrays[ArrayType.element_shell_effective_plastic_strain] >>> pstrain.shape (1, 4696, 3) >>> # mean across all 3 integration points >>> pstrain = pstrain.mean(axis=2) >>> pstrain.shape (1, 4696) >>> # we only have 1 timestep here but let's take last one in general >>> last_timestep = -1 >>> d3plot.plot(0, field=pstrain[last_timestep]) >>> # we don't like the fringe, let's adjust >>> d3plot.plot(0, field=pstrain[last_timestep], fringe_limits=(0, 0.3))","title":"Notes"},{"location":"dyna/D3plot/#lasso.dyna.d3plot.D3plot.write_d3plot","text":"Write a d3plot file again Parameters: Name Type Description Default filepath Union [ str , BinaryIO ] filepath of the new d3plot file or an opened file handle required block_size_bytes int D3plots are originally written in byte-blocks causing zero-padding at the end of files. This can be controlled by this parameter. Set to 0 for no padding. 2048 single_file bool whether to write all states into a single file True Examples: Modify an existing d3plot: >>> d3plot = D3plot(\"path/to/d3plot\") >>> hvars = d3plot.array[ArrayType.element_shell_history_vars] >>> hvars.shape (1, 4696, 3, 19) >>> new_history_var = np.random.random((1, 4696, 3, 1)) >>> new_hvars = np.concatenate([hvars, new_history_var], axis=3) >>> d3plot.array[ArrayType.element_shell_history_vars] = new_hvars >>> d3plot.write_d3plot(\"path/to/new/d3plot\") Write a new d3plot from scratch: >>> d3plot = D3plot() >>> d3plot.arrays[ArrayType.node_coordinates] = np.array([[0, 0, 0], ... [1, 0, 0], ... [0, 1, 0]]) >>> d3plot.arrays[ArrayType.element_shell_node_indexes] = np.array([[0, 2, 1, 1]]) >>> d3plot.arrays[ArrayType.element_shell_part_indexes] = np.array([0]) >>> d3plot.arrays[ArrayType.node_displacement] = np.array([[[0, 0, 0], ... [1, 0, 0], ... [0, 1, 0]]]) >>> d3plot.write_d3plot(\"yay.d3plot\")","title":"write_d3plot()"},{"location":"dyna/D3plotHeader/","text":"D3plotHeader Class for reading only header information of a d3plot Attributes: Name Type Description filepath str Filepath of the processed file. itype np . dtype Integer type of d3plot. ftype np . dtype Floating point type of d3plot. wordsize int size of words in bytes (4 = single precision, 8 = double precision). raw_header Dict [ str , Any ] Raw header data as dict. external_numbers_dtype np . dtype Integer type of user ids. n_header_bytes int Number of bytes of header (at least 256 or more). title str Main title. title2 str Optional, secondary title. runtime int Runtime of the d3plot as timestamp. filetype D3plotFiletype Filetype such as d3plot or d3part. source_version int Source version of LS-Dyna. release_version str Release version of LS-Dyna. version float Version of LS-Dyna. extra_long_header bool If header was longer than default. n_dimensions int Number of dimensions, usually three. n_global_vars int How many global vars for each state. n_adapted_element_pairs int How many adapted element pairs. has_node_deletion_data bool If node deletion data is present. has_element_deletion_data bool If element deletion data is present. has_numbering_section bool If a user numbering section is present. has_material_type_section bool If material type section was written. n_numbering_section_words int Amount of words for numbering section. has_invariant_numbering bool If invariant numbering is used whatever that means. quadratic_elems_has_full_connectivity bool If quadric elements have full connectivity. quadratic_elems_has_data_at_integration_points bool If quadric elements data is at integration points. n_post_branches int Unused and unknown. n_types Tuple [ int , ...] Behind geometry these are integers indicating additional data such as part names. n_parts int Obviously number of parts. n_nodes int Number of nodes. has_node_temperatures bool If node temperature is present. has_node_temperature_layers bool If node temperatures are layered. has_node_heat_flux bool If node heat flux is present. has_node_mass_scaling bool Mass scaling is written. has_node_displacement bool Node displacement is written. has_node_velocity bool Node velocity is written. has_node_acceleration bool Node acceleration is written. has_node_temperature_gradient bool Node temperature gradient is written. has_node_residual_forces bool Node residual forces are written. has_node_residual_moments bool Node residual moments are written. has_node_max_contact_penetration_absolute bool Node contact penetration info exist. has_node_max_contact_penetration_relative bool Node relative contact penetration info was written. has_node_contact_energy_density int Node energy density was written. n_shell_tshell_layers int Number of layers for shells and thick shells. n_shell_tshell_history_vars int Number of history vars for shells and thick shells. has_shell_tshell_stress bool If shells and thick shells have stresses. has_shell_tshell_pstrain bool If shells and thick shells have eff. plastic strain. has_element_strain bool If all elements have strain. has_solid_shell_plastic_strain_tensor bool If solids have plastic strain tensor. has_solid_shell_thermal_strain_tensor bool If solids have thermal strain tensor. n_solids int Number of solids. n_solid_vars int Number of solid variables per element and state. n_solid_materials int Number of solid materials/parts. n_solid_history_vars int Number of solid history variables. n_solid_thermal_vars int Number of solid thermal variables. n_solids_20_node_hexas int Number of 20-node solid hexas. n_solids_27_node_hexas int Number of 27-node solid hexas. n_solids_21_node_pentas int Number of 21-node solid pentas. n_solids_15_node_tetras int Number of 15-node solid tetras. n_solids_20_node_tetras int Number of 20-node solid tetras. n_solids_40_node_pentas int Number of 40-node solid pentas. n_solids_64_node_hexas int Number of 64-node solid hexas. has_solid_2_extra_nodes bool If two extra nodes were written for solids. has_solid_stress bool If solid stress is present. has_solid_pstrain bool If solid eff. plastic strain is present. has_quadratic_solids bool If quadratic solids were used. has_cubic_solids bool If cubic solids were used. has_solid_internal_energy_density bool If solids have internal energy density. n_solid_layers int Number of solid layers. n_shells int Number of shells. n_shell_vars int Number of shell vars per element and state. n_shell_materials int Number of shell materials/parts. n_shells_8_nodes int Number of 8-node shells. has_shell_four_inplane_gauss_points bool If shells have four inplace gaussian integration points. has_shell_forces bool If shell forces are present. has_shell_extra_variables bool If extra shell variables such as forces are present. has_shell_internal_energy_density bool If shell internal energy density is present. n_thick_shells int Number of thick shell elements. n_thick_shell_vars int Number of thick shell element vars. n_thick_shell_materials int Number of thick shell materials/parts. has_thick_shell_energy_density bool If thick shells have energy density. thick_shell_energy_density_position int Nnused. n_beams int Number of beam elements. n_beam_vars int Number of state variables per beam element. n_beam_materials int Number of beam materials. n_beam_history_vars int Number of beam history variables. n_airbags int Number of airbags. has_airbag_n_chambers bool If airbags have number of chambers var. has_rigid_road_surface bool If rigid road surface was written. has_rigid_body_data bool If rigid body section was written. has_reduced_rigid_body_data bool If the reduced set of rigid body data was written. n_rigid_wall_vars int Number of rigid wall vars. n_sph_nodes int Number of sph nodes. n_sph_materials int Number of sph materials. n_ale_materials int Number of ale materials. n_ale_fluid_groups int Number of ale fluid groups. has_cfd_data bool If CFD-Data was written. has_multi_solver_data bool If multi-solver data was written. cfd_extra_data int If cfd data contains extra section. legacy_code_type int Originally a code indicator but unused nowadays. unused_numst int Unused and not explained in docs. __init__ ( filepath = None ) Create a D3plotHeader instance Parameters: Name Type Description Default filepath Union [ str , BinaryBuffer , None] path to a d3plot file or a buffer holding d3plot memory None Returns: Name Type Description header D3plotHeader d3plot header instance Examples: Create an empty header file >>> header = D3plotHeader() Now load only the header of a d3plot. >>> header.load_file(\"path/to/d3plot\") Or we can do the above together. >>> header = D3plotHeader(\"path/to/d3plot\") Notes This class does not load the entire memory of a d3plot but merely what is required to parse the header information. Thus, it is safe to use on big files. load_file ( file ) Load d3plot header from a d3plot file Parameters: Name Type Description Default file Union [ str , BinaryBuffer ] path to d3plot or BinaryBuffer holding memory of d3plot required Returns: Name Type Description self D3plotHeader returning self on success Notes This routine only loads the minimal amount of data that is neccessary. Thus it is safe to use on huge files. Examples: >>> header = D3plotHeader().load_file(\"path/to/d3plot\") >>> header.n_shells 19684 compare ( other ) Compare two headers and get the differences Parameters: Name Type Description Default other D3plotHeader other d3plot header instance required Returns: Name Type Description differences Dict [ str , Tuple [ Any , Any ]] The different entries of both headers in a dict","title":"D3plotHeader"},{"location":"dyna/D3plotHeader/#d3plotheader","text":"Class for reading only header information of a d3plot Attributes: Name Type Description filepath str Filepath of the processed file. itype np . dtype Integer type of d3plot. ftype np . dtype Floating point type of d3plot. wordsize int size of words in bytes (4 = single precision, 8 = double precision). raw_header Dict [ str , Any ] Raw header data as dict. external_numbers_dtype np . dtype Integer type of user ids. n_header_bytes int Number of bytes of header (at least 256 or more). title str Main title. title2 str Optional, secondary title. runtime int Runtime of the d3plot as timestamp. filetype D3plotFiletype Filetype such as d3plot or d3part. source_version int Source version of LS-Dyna. release_version str Release version of LS-Dyna. version float Version of LS-Dyna. extra_long_header bool If header was longer than default. n_dimensions int Number of dimensions, usually three. n_global_vars int How many global vars for each state. n_adapted_element_pairs int How many adapted element pairs. has_node_deletion_data bool If node deletion data is present. has_element_deletion_data bool If element deletion data is present. has_numbering_section bool If a user numbering section is present. has_material_type_section bool If material type section was written. n_numbering_section_words int Amount of words for numbering section. has_invariant_numbering bool If invariant numbering is used whatever that means. quadratic_elems_has_full_connectivity bool If quadric elements have full connectivity. quadratic_elems_has_data_at_integration_points bool If quadric elements data is at integration points. n_post_branches int Unused and unknown. n_types Tuple [ int , ...] Behind geometry these are integers indicating additional data such as part names. n_parts int Obviously number of parts. n_nodes int Number of nodes. has_node_temperatures bool If node temperature is present. has_node_temperature_layers bool If node temperatures are layered. has_node_heat_flux bool If node heat flux is present. has_node_mass_scaling bool Mass scaling is written. has_node_displacement bool Node displacement is written. has_node_velocity bool Node velocity is written. has_node_acceleration bool Node acceleration is written. has_node_temperature_gradient bool Node temperature gradient is written. has_node_residual_forces bool Node residual forces are written. has_node_residual_moments bool Node residual moments are written. has_node_max_contact_penetration_absolute bool Node contact penetration info exist. has_node_max_contact_penetration_relative bool Node relative contact penetration info was written. has_node_contact_energy_density int Node energy density was written. n_shell_tshell_layers int Number of layers for shells and thick shells. n_shell_tshell_history_vars int Number of history vars for shells and thick shells. has_shell_tshell_stress bool If shells and thick shells have stresses. has_shell_tshell_pstrain bool If shells and thick shells have eff. plastic strain. has_element_strain bool If all elements have strain. has_solid_shell_plastic_strain_tensor bool If solids have plastic strain tensor. has_solid_shell_thermal_strain_tensor bool If solids have thermal strain tensor. n_solids int Number of solids. n_solid_vars int Number of solid variables per element and state. n_solid_materials int Number of solid materials/parts. n_solid_history_vars int Number of solid history variables. n_solid_thermal_vars int Number of solid thermal variables. n_solids_20_node_hexas int Number of 20-node solid hexas. n_solids_27_node_hexas int Number of 27-node solid hexas. n_solids_21_node_pentas int Number of 21-node solid pentas. n_solids_15_node_tetras int Number of 15-node solid tetras. n_solids_20_node_tetras int Number of 20-node solid tetras. n_solids_40_node_pentas int Number of 40-node solid pentas. n_solids_64_node_hexas int Number of 64-node solid hexas. has_solid_2_extra_nodes bool If two extra nodes were written for solids. has_solid_stress bool If solid stress is present. has_solid_pstrain bool If solid eff. plastic strain is present. has_quadratic_solids bool If quadratic solids were used. has_cubic_solids bool If cubic solids were used. has_solid_internal_energy_density bool If solids have internal energy density. n_solid_layers int Number of solid layers. n_shells int Number of shells. n_shell_vars int Number of shell vars per element and state. n_shell_materials int Number of shell materials/parts. n_shells_8_nodes int Number of 8-node shells. has_shell_four_inplane_gauss_points bool If shells have four inplace gaussian integration points. has_shell_forces bool If shell forces are present. has_shell_extra_variables bool If extra shell variables such as forces are present. has_shell_internal_energy_density bool If shell internal energy density is present. n_thick_shells int Number of thick shell elements. n_thick_shell_vars int Number of thick shell element vars. n_thick_shell_materials int Number of thick shell materials/parts. has_thick_shell_energy_density bool If thick shells have energy density. thick_shell_energy_density_position int Nnused. n_beams int Number of beam elements. n_beam_vars int Number of state variables per beam element. n_beam_materials int Number of beam materials. n_beam_history_vars int Number of beam history variables. n_airbags int Number of airbags. has_airbag_n_chambers bool If airbags have number of chambers var. has_rigid_road_surface bool If rigid road surface was written. has_rigid_body_data bool If rigid body section was written. has_reduced_rigid_body_data bool If the reduced set of rigid body data was written. n_rigid_wall_vars int Number of rigid wall vars. n_sph_nodes int Number of sph nodes. n_sph_materials int Number of sph materials. n_ale_materials int Number of ale materials. n_ale_fluid_groups int Number of ale fluid groups. has_cfd_data bool If CFD-Data was written. has_multi_solver_data bool If multi-solver data was written. cfd_extra_data int If cfd data contains extra section. legacy_code_type int Originally a code indicator but unused nowadays. unused_numst int Unused and not explained in docs.","title":"D3plotHeader"},{"location":"dyna/D3plotHeader/#lasso.dyna.d3plot_header.D3plotHeader.__init__","text":"Create a D3plotHeader instance Parameters: Name Type Description Default filepath Union [ str , BinaryBuffer , None] path to a d3plot file or a buffer holding d3plot memory None Returns: Name Type Description header D3plotHeader d3plot header instance Examples: Create an empty header file >>> header = D3plotHeader() Now load only the header of a d3plot. >>> header.load_file(\"path/to/d3plot\") Or we can do the above together. >>> header = D3plotHeader(\"path/to/d3plot\")","title":"__init__()"},{"location":"dyna/D3plotHeader/#lasso.dyna.d3plot_header.D3plotHeader.__init__--notes","text":"This class does not load the entire memory of a d3plot but merely what is required to parse the header information. Thus, it is safe to use on big files.","title":"Notes"},{"location":"dyna/D3plotHeader/#lasso.dyna.d3plot_header.D3plotHeader.load_file","text":"Load d3plot header from a d3plot file Parameters: Name Type Description Default file Union [ str , BinaryBuffer ] path to d3plot or BinaryBuffer holding memory of d3plot required Returns: Name Type Description self D3plotHeader returning self on success","title":"load_file()"},{"location":"dyna/D3plotHeader/#lasso.dyna.d3plot_header.D3plotHeader.load_file--notes","text":"This routine only loads the minimal amount of data that is neccessary. Thus it is safe to use on huge files. Examples: >>> header = D3plotHeader().load_file(\"path/to/d3plot\") >>> header.n_shells 19684","title":"Notes"},{"location":"dyna/D3plotHeader/#lasso.dyna.d3plot_header.D3plotHeader.compare","text":"Compare two headers and get the differences Parameters: Name Type Description Default other D3plotHeader other d3plot header instance required Returns: Name Type Description differences Dict [ str , Tuple [ Any , Any ]] The different entries of both headers in a dict","title":"compare()"},{"location":"dyna/FilterType/","text":"FilterType Bases: Enum Used for filtering d3plot arrays Attributes: Name Type Description BEAM str Filters for beam elements SHELL str Filters for shell elements SOLID str Filters for solid elements TSHELL str Filters for thick shells elements PART str Filters for parts NODE str Filters for nodes Examples: >>> part_ids = [13, 14] >>> d3plot.get_part_filter(FilterType.SHELL, part_ids)","title":"FilterType"},{"location":"dyna/FilterType/#filtertype","text":"Bases: Enum Used for filtering d3plot arrays Attributes: Name Type Description BEAM str Filters for beam elements SHELL str Filters for shell elements SOLID str Filters for solid elements TSHELL str Filters for thick shells elements PART str Filters for parts NODE str Filters for nodes Examples: >>> part_ids = [13, 14] >>> d3plot.get_part_filter(FilterType.SHELL, part_ids)","title":"FilterType"},{"location":"dyna/performance_info/","text":"Performance Info D3plot Benchmark: The d3plot reader is blazingly fast by using several memory tricks. While postprocessors build up an internal datastructure during reading, this reader avoids this and simply references memory within the files. In consequence performance benchmarks show that the runtime of the code is solely dominated by pulling the files into memory. 2108 function calls (2099 primitive calls) in 43.017 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 35 38.960 1.113 38.960 1.113 {method 'readinto' of '_io.BufferedReader' objects} 35 2.366 0.068 2.366 0.068 {built-in method io.open} 1 1.644 1.644 42.959 42.959 D3plot.py:2565(_read_state_bytebuffer) 71 0.043 0.001 0.043 0.001 {built-in method nt.stat} 2 0.002 0.001 0.057 0.028 BinaryBuffer.py:234(load) 70 0.000 0.000 0.001 0.000 ntpath.py:74(join) 142 0.000 0.000 0.000 0.000 ntpath.py:121(splitdrive) 1 0.000 0.000 0.019 0.019 D3plot.py:2738() 1 0.000 0.000 0.000 0.000 {built-in method nt.listdir} 36 0.000 0.000 0.000 0.000 {method 'match' of '_sre.SRE_Pattern' objects} 84 0.000 0.000 0.000 0.000 {built-in method numpy.core.multiarray.frombuffer} 1 0.000 0.000 42.959 42.959 D3plot.py:1304(_read_states) ... In the table above the largest, first three performance issues are all related to loading files into memory, accounting for 99.89% of runtime. The routines reading the data arrays (deserialization) have an almost constant runtime of a few milliseconds and are independent of the filesize. Efficiency Note that writing such efficient and simple code in C or any other language is much more challenging than in Python, thus surprisingly this implementation can be expected to outperform most native codes and tools. Indeed tests show that when reading all results of a d3plot in a postprocessor, this library is devastatingly fast. For reading single node-fields this library can be slower though (see Improvements below). Array-based API Building objects is useful (e.g. neighbor search) but requires additional runtime overhead. By the principle of \"don't pay for what you don't use\" it was decided to avoid object orientation, thus providing a majorly array-based API. This is perfectly suitable for data analysis as well as machine learning. Improvements A speedup 'could' be achieved by using memory-mapping, thus pulling only fractions of the files into the RAM which hold the required arrays. Postprocessors sometimes do this when reading certain fields, outperforming this library in such a case (e.g. node displacements). Since dyna litters most arrays across the entire file though, this method was not considered worth the effort and thus this library always reads everything. Binout The binout is used to store arbitrary binary data at a much higher frequency than the d3plot. As a result the data is dumped in an internal 'state folder'. Since different results may be dumped at different frequencies some state folders might contain more information than others. This inherently prevents efficient memory reading. The python version used here is slower than the original C-based version but one therefore gains better portability accross operating systems.","title":"Performance Info"},{"location":"dyna/performance_info/#performance-info","text":"","title":"Performance Info"},{"location":"dyna/performance_info/#d3plot","text":"Benchmark: The d3plot reader is blazingly fast by using several memory tricks. While postprocessors build up an internal datastructure during reading, this reader avoids this and simply references memory within the files. In consequence performance benchmarks show that the runtime of the code is solely dominated by pulling the files into memory. 2108 function calls (2099 primitive calls) in 43.017 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 35 38.960 1.113 38.960 1.113 {method 'readinto' of '_io.BufferedReader' objects} 35 2.366 0.068 2.366 0.068 {built-in method io.open} 1 1.644 1.644 42.959 42.959 D3plot.py:2565(_read_state_bytebuffer) 71 0.043 0.001 0.043 0.001 {built-in method nt.stat} 2 0.002 0.001 0.057 0.028 BinaryBuffer.py:234(load) 70 0.000 0.000 0.001 0.000 ntpath.py:74(join) 142 0.000 0.000 0.000 0.000 ntpath.py:121(splitdrive) 1 0.000 0.000 0.019 0.019 D3plot.py:2738() 1 0.000 0.000 0.000 0.000 {built-in method nt.listdir} 36 0.000 0.000 0.000 0.000 {method 'match' of '_sre.SRE_Pattern' objects} 84 0.000 0.000 0.000 0.000 {built-in method numpy.core.multiarray.frombuffer} 1 0.000 0.000 42.959 42.959 D3plot.py:1304(_read_states) ... In the table above the largest, first three performance issues are all related to loading files into memory, accounting for 99.89% of runtime. The routines reading the data arrays (deserialization) have an almost constant runtime of a few milliseconds and are independent of the filesize.","title":"D3plot"},{"location":"dyna/performance_info/#efficiency","text":"Note that writing such efficient and simple code in C or any other language is much more challenging than in Python, thus surprisingly this implementation can be expected to outperform most native codes and tools. Indeed tests show that when reading all results of a d3plot in a postprocessor, this library is devastatingly fast. For reading single node-fields this library can be slower though (see Improvements below).","title":"Efficiency"},{"location":"dyna/performance_info/#array-based-api","text":"Building objects is useful (e.g. neighbor search) but requires additional runtime overhead. By the principle of \"don't pay for what you don't use\" it was decided to avoid object orientation, thus providing a majorly array-based API. This is perfectly suitable for data analysis as well as machine learning.","title":"Array-based API"},{"location":"dyna/performance_info/#improvements","text":"A speedup 'could' be achieved by using memory-mapping, thus pulling only fractions of the files into the RAM which hold the required arrays. Postprocessors sometimes do this when reading certain fields, outperforming this library in such a case (e.g. node displacements). Since dyna litters most arrays across the entire file though, this method was not considered worth the effort and thus this library always reads everything.","title":"Improvements"},{"location":"dyna/performance_info/#binout","text":"The binout is used to store arbitrary binary data at a much higher frequency than the d3plot. As a result the data is dumped in an internal 'state folder'. Since different results may be dumped at different frequencies some state folders might contain more information than others. This inherently prevents efficient memory reading. The python version used here is slower than the original C-based version but one therefore gains better portability accross operating systems.","title":"Binout"},{"location":"femzip/","text":"Femzip Documentation of the Femzip module. The D3plot reader uses this module to access femzip file data through the femzip API. It also allows to decompress files directly or use some additional utility functions such as a femzip file check if desired. Example >>> from lasso.femzip import FemzipAPI >>> from ctypes import * >>> filepath = \"path/to/d3plot.fz\" >>> # Initialize API >>> api = FemzipAPI () Here we check if we can use the extended FEMZIP-API. The extended FEMZIP-API allows reading selected arrays, but reqires a license with the feature \"FEMUNZIPLIB-DYNA\", which can be attained from SIDACT or femzip distributors. >>> api . has_femunziplib_license () True Check if a file is femzipped: >>> # check if file is femzipped >>> api . is_sidact_file ( filepath ) True Check the file and library version. This is usually not neccessary. >>> api . is_femunzip_version_ok ( filepath ) True It's efficient to get the memory demand for arrays beforehand and hand this memory info to other functions. It is often not mandatory though and a mere speedup. >>> # read memory demand info first >>> buffer_info = api . get_buffer_info ( filepath ) >>> # buffer info is a c struct, but we can print it >>> api . struct_to_dict ( buffer_info ) { 'n_timesteps' : 12 , 'timesteps' : < lasso . femzip . femzip_api . LP_c_float object at 0x0000028A8F6B21C0 > , 'size_geometry' : 537125 , 'size_state' : 1462902 , 'size_displacement' : 147716 , 'size_activity' : 47385 , 'size_post' : 1266356 , 'size_titles' : 1448 } >>> for i_timestep in range ( buffer_info . n_timesteps ): >>> print ( buffer_info . timesteps [ i_timestep ]) 0.0 0.9998100399971008 1.9998900890350342 2.9999701976776123 3.9997801780700684 Here we read the geometry buffer. The file is kept open so that we can read states afterwards. >>> mview = api . read_geometry ( filepath , buffer_info , close_file = False ) Femzip can handle only one file per process. In case of issues close the current file (shown later). We can check the API status as follows >>> print ( api . struct_to_dict ( api . get_femzip_status ())) { 'is_file_open' : 1 , 'is_geometry_read' : 1 , 'is_states_open' : 0 , 'i_timestep_state' : - 1 , 'i_timestep_activity' : - 1 } Get the memory of a single state. Must start at 0. Femzip does not allow reading arbitrary states inbetween. >>> mview = api . read_single_state ( i_timestep = 0 , buffer_info = buffer_info ) It is also possible to read the state memory directly into an already allocated buffer. >>> BufferType = c_float * ( buffer_info . size_state ) >>> mview = memoryview ( BufferType ()) >>> api . read_single_state ( 1 , buffer_info = buffer_info , state_buffer = mview ) Let's close the file manually. This ensures that femzip resets its internal state. >>> api . close_current_file ()","title":"Overview"},{"location":"femzip/#femzip","text":"Documentation of the Femzip module. The D3plot reader uses this module to access femzip file data through the femzip API. It also allows to decompress files directly or use some additional utility functions such as a femzip file check if desired.","title":"Femzip"},{"location":"femzip/#example","text":">>> from lasso.femzip import FemzipAPI >>> from ctypes import * >>> filepath = \"path/to/d3plot.fz\" >>> # Initialize API >>> api = FemzipAPI () Here we check if we can use the extended FEMZIP-API. The extended FEMZIP-API allows reading selected arrays, but reqires a license with the feature \"FEMUNZIPLIB-DYNA\", which can be attained from SIDACT or femzip distributors. >>> api . has_femunziplib_license () True Check if a file is femzipped: >>> # check if file is femzipped >>> api . is_sidact_file ( filepath ) True Check the file and library version. This is usually not neccessary. >>> api . is_femunzip_version_ok ( filepath ) True It's efficient to get the memory demand for arrays beforehand and hand this memory info to other functions. It is often not mandatory though and a mere speedup. >>> # read memory demand info first >>> buffer_info = api . get_buffer_info ( filepath ) >>> # buffer info is a c struct, but we can print it >>> api . struct_to_dict ( buffer_info ) { 'n_timesteps' : 12 , 'timesteps' : < lasso . femzip . femzip_api . LP_c_float object at 0x0000028A8F6B21C0 > , 'size_geometry' : 537125 , 'size_state' : 1462902 , 'size_displacement' : 147716 , 'size_activity' : 47385 , 'size_post' : 1266356 , 'size_titles' : 1448 } >>> for i_timestep in range ( buffer_info . n_timesteps ): >>> print ( buffer_info . timesteps [ i_timestep ]) 0.0 0.9998100399971008 1.9998900890350342 2.9999701976776123 3.9997801780700684 Here we read the geometry buffer. The file is kept open so that we can read states afterwards. >>> mview = api . read_geometry ( filepath , buffer_info , close_file = False ) Femzip can handle only one file per process. In case of issues close the current file (shown later). We can check the API status as follows >>> print ( api . struct_to_dict ( api . get_femzip_status ())) { 'is_file_open' : 1 , 'is_geometry_read' : 1 , 'is_states_open' : 0 , 'i_timestep_state' : - 1 , 'i_timestep_activity' : - 1 } Get the memory of a single state. Must start at 0. Femzip does not allow reading arbitrary states inbetween. >>> mview = api . read_single_state ( i_timestep = 0 , buffer_info = buffer_info ) It is also possible to read the state memory directly into an already allocated buffer. >>> BufferType = c_float * ( buffer_info . size_state ) >>> mview = memoryview ( BufferType ()) >>> api . read_single_state ( 1 , buffer_info = buffer_info , state_buffer = mview ) Let's close the file manually. This ensures that femzip resets its internal state. >>> api . close_current_file ()","title":"Example"},{"location":"femzip/FemzipAPI/","text":"FemzipAPI FemzipAPI contains wrapper functions around the femzip library. api : CDLL property Returns the loaded, shared object library of the native interface Returns: Name Type Description shared_object_lib CDLL Loaded shared object library. close_current_file () Closes the current file handle(use not recommended) Notes Closes a currently opened file by the API. There is no arg because femzip can process only one file at a time. This can also be used in case of bugs. Examples: >>> api.close_current_file() copy_struct ( src , dest ) staticmethod Copies all fields from src struct to dest Parameters: Name Type Description Default src Structure src struct required src Structure destination struct required Examples: >>> err1 = FemzipError() >>> err1.ier = -1 >>> err1.msg = b\"Oops\" >>> err2 = FemzipError() >>> api.copy_struct(err1, err2) >>> err2.ier -1 >>> err2.msg b'Oops' get_buffer_info ( filepath ) Get the dimensions of the buffers for femzip Parameters: Name Type Description Default filepath str path to femzip file required Returns: Name Type Description buffer_info FemzipBufferInfo c struct with infos about the memory required by femzip Examples: >>> # read memory demand info first >>> buffer_info = api.get_buffer_info(filepath) >>> # buffer info is a c struct, but we can print it >>> api.struct_to_dict(buffer_info) {'n_timesteps': 12, 'timesteps': , 'size_geometry': 537125, 'size_state': 1462902, 'size_displacement': 147716, 'size_activity': 47385, 'size_post': 1266356, 'size_titles': 1448} >>> for i_timestep in range(buffer_info.n_timesteps): >>> print(buffer_info.timesteps[i_timestep]) 0.0 0.9998100399971008 1.9998900890350342 2.9999701976776123 3.9997801780700684 get_femzip_status () Check the status of the femzip api Returns: Name Type Description femzip_status FemzipAPIStatus c struct with info about femzip API Notes This reports whether a file is currently opened and how far it was processed. This internal state is used to avoid internal conflicts and crashes, thus is useful for debugging. Examples: >>> print(api.struct_to_dict(api.get_femzip_status())) {'is_file_open': 0, 'is_geometry_read': 0, 'is_states_open': 0, 'i_timestep_state': -1, 'i_timestep_activity': -1} get_file_metadata ( filepath ) Get infos about the femzip variables in the file Parameters: Name Type Description Default filepath str path to femzip file required Returns: Name Type Description file_metadata FemzipFileMetadata c struct with infos about the femzip file Notes This is for direct interaction with the C-API, thus should not be used by users. Examples: >>> file_metadata = api.get_file_metadata(\"path/to/d3plot.fz\") >>> # print general internals >>> api.struct_to_dict(file_metadata) {'version_zip': 605.0, 'activity_flag': 1, 'number_of_variables': 535, ...} >>> # We can iterate the variable names contained in the file >>> print( [file_metadata.variable_infos[i_var].name.decode(\"utf8\").strip() for i_var in range(file_metadata.number_of_variables)] ) ['global', 'Parts: Energies and others', 'coordinates', 'velocities', ...] get_part_titles ( filepath , buffer_info = None ) Get the part title section Parameters: Name Type Description Default filepath str path to femzip file required buffer_info Union [None, FemzipBufferInfo ] buffer info if previously fetched None Returns: Name Type Description mview memoryview memory of the part title section has_femunziplib_license () Checks whether the extended libraries are available Returns: Name Type Description has_license bool Examples: >>> api.has_femunziplib_license() False is_femunzip_version_ok ( filepath ) Checks if the femunzip version can be handled Parameters: Name Type Description Default filepath str path to the femzpi file required Returns: Name Type Description version_ok bool Examples: >>> api.is_femunzip_version_ok(\"path/to/d3plot.fz\") True is_sidact_file ( filepath ) Tests if a filepath points at a sidact file Parameters: Name Type Description Default filepath str required Returns: Name Type Description is_sidact_file bool Examples: >>> api.is_sidact_file(\"path/to/d3plot.fz\") True >>> api.is_sidact_file(\"path/to/d3plot\") False >>> api.is_sidact_file(\"path/to/non/existing/file\") False load_dynamic_library ( path ) staticmethod Load a library and check for correct execution Parameters: Name Type Description Default path str path to the library required Returns: Name Type Description library CDLL loaded library read_geometry ( filepath , buffer_info = None , close_file = True ) Read the geometry buffer from femzip Parameters: Name Type Description Default filepath str path to femzpi file required buffer_info Union [ FemzipBufferInfo , None] struct with info regarding required memory for femzip None close_file bool it is useful to leave the file open if states are processed right afterwards True Returns: Name Type Description buffer memoryview memoryview of buffer Notes If the file isn't closed appropriately bugs and crashes might occur. Examples: >>> mview = api.read_geometry(filepath, buffer_info) read_single_state ( i_timestep , buffer_info , state_buffer = None ) Read a single state Parameters: Name Type Description Default i_timestep int timestep to be read required buffer_info FemzipBufferInfo infos about buffer sizes required state_buffer Union [None, memoryview ] buffer in which the states are stored None Notes It is unclear to us why the state buffer needs to be given in order to terminate state reading. Examples: >>> # get info about required memory >>> buffer_info = api.get_buffer_info(filepath) >>> # first read geometry and leave file open >>> mview_geom = api.read_geometry(filepath, buffer_info, False) >>> # now read a state >>> mview_state = api.read_single_state(0, buffer_info=buffer_info) >>> # close file >>> api.close_current_file() read_state_deletion_info ( buffer_info , state_filter = None ) Get information which elements are alive Parameters: Name Type Description Default buffer_info FemzipBufferInfo infos about buffer sizes required state_filter Union [ Set [ int ], None] usable to read only specific states None Notes The `buffer` must have the size of at least `buffer_info.size_activity`. Examples: >>> # get info about required memory >>> buffer_info = api.get_buffer_info(filepath) >>> # first read geometry and leave file open! >>> mview_geom = api.read_geometry(filepath, buffer_info, False) >>> # now read deletion info >>> array_deletion = api.read_state_activity(buffer_info) >>> # close file >>> api.close_current_file() read_states ( filepath , buffer_info = None , state_filter = None ) Reads all femzip state information Parameters: Name Type Description Default filepath str path to femzip file required buffer_info Union [ FemzipBufferInfo , None] struct with info regarding required memory for femzip None state_filter Union [ Set [ int ], None] usable to load only specific states None Returns: Name Type Description buffer memoryview buffer containing all state data Examples: >>> buffer_info = api.get_buffer_info(\"path/to/d3plot.fz\") >>> array_states = api.read_states(\"path/to/d3plot.fz\", buffer_info) read_variables ( file_metadata , n_parts , n_rigid_walls , n_rigid_wall_vars , n_airbag_particles , n_airbags , state_filter = None ) Read specific variables from Femzip Parameters: Name Type Description Default file_metadata FemzipFileMetadata metadata of file including which variables to read required n_parts int number of parts in the file required n_rigid_walls int number of rigid walls required n_rigid_wall_vars int number of rigid wall variables required n_airbag_particles int number of airbag particles in the file required n_airbags int required state_filter Union [ Set [ int ], None] used to read specific arrays None Returns: Name Type Description arrays dict dictionary with d3plot arrays struct_to_dict ( struct ) staticmethod Converts a ctypes struct into a dict Parameters: Name Type Description Default struct Structure required Returns: Name Type Description fields Dict [ str , Any ] struct as dict Examples: >>> api.struct_to_dict(api.get_femzip_status()) {'is_file_open': 1, 'is_geometry_read': 1, 'is_states_open': 0, 'i_timestep_state': -1, 'i_timestep_activity': -1}","title":"FemzipAPI"},{"location":"femzip/FemzipAPI/#femzipapi","text":"FemzipAPI contains wrapper functions around the femzip library.","title":"FemzipAPI"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.api","text":"Returns the loaded, shared object library of the native interface Returns: Name Type Description shared_object_lib CDLL Loaded shared object library.","title":"api"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.close_current_file","text":"Closes the current file handle(use not recommended)","title":"close_current_file()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.close_current_file--notes","text":"Closes a currently opened file by the API. There is no arg because femzip can process only one file at a time. This can also be used in case of bugs. Examples: >>> api.close_current_file()","title":"Notes"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.copy_struct","text":"Copies all fields from src struct to dest Parameters: Name Type Description Default src Structure src struct required src Structure destination struct required Examples: >>> err1 = FemzipError() >>> err1.ier = -1 >>> err1.msg = b\"Oops\" >>> err2 = FemzipError() >>> api.copy_struct(err1, err2) >>> err2.ier -1 >>> err2.msg b'Oops'","title":"copy_struct()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.get_buffer_info","text":"Get the dimensions of the buffers for femzip Parameters: Name Type Description Default filepath str path to femzip file required Returns: Name Type Description buffer_info FemzipBufferInfo c struct with infos about the memory required by femzip Examples: >>> # read memory demand info first >>> buffer_info = api.get_buffer_info(filepath) >>> # buffer info is a c struct, but we can print it >>> api.struct_to_dict(buffer_info) {'n_timesteps': 12, 'timesteps': , 'size_geometry': 537125, 'size_state': 1462902, 'size_displacement': 147716, 'size_activity': 47385, 'size_post': 1266356, 'size_titles': 1448} >>> for i_timestep in range(buffer_info.n_timesteps): >>> print(buffer_info.timesteps[i_timestep]) 0.0 0.9998100399971008 1.9998900890350342 2.9999701976776123 3.9997801780700684","title":"get_buffer_info()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.get_femzip_status","text":"Check the status of the femzip api Returns: Name Type Description femzip_status FemzipAPIStatus c struct with info about femzip API","title":"get_femzip_status()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.get_femzip_status--notes","text":"This reports whether a file is currently opened and how far it was processed. This internal state is used to avoid internal conflicts and crashes, thus is useful for debugging. Examples: >>> print(api.struct_to_dict(api.get_femzip_status())) {'is_file_open': 0, 'is_geometry_read': 0, 'is_states_open': 0, 'i_timestep_state': -1, 'i_timestep_activity': -1}","title":"Notes"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.get_file_metadata","text":"Get infos about the femzip variables in the file Parameters: Name Type Description Default filepath str path to femzip file required Returns: Name Type Description file_metadata FemzipFileMetadata c struct with infos about the femzip file","title":"get_file_metadata()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.get_file_metadata--notes","text":"This is for direct interaction with the C-API, thus should not be used by users. Examples: >>> file_metadata = api.get_file_metadata(\"path/to/d3plot.fz\") >>> # print general internals >>> api.struct_to_dict(file_metadata) {'version_zip': 605.0, 'activity_flag': 1, 'number_of_variables': 535, ...} >>> # We can iterate the variable names contained in the file >>> print( [file_metadata.variable_infos[i_var].name.decode(\"utf8\").strip() for i_var in range(file_metadata.number_of_variables)] ) ['global', 'Parts: Energies and others', 'coordinates', 'velocities', ...]","title":"Notes"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.get_part_titles","text":"Get the part title section Parameters: Name Type Description Default filepath str path to femzip file required buffer_info Union [None, FemzipBufferInfo ] buffer info if previously fetched None Returns: Name Type Description mview memoryview memory of the part title section","title":"get_part_titles()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.has_femunziplib_license","text":"Checks whether the extended libraries are available Returns: Name Type Description has_license bool Examples: >>> api.has_femunziplib_license() False","title":"has_femunziplib_license()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.is_femunzip_version_ok","text":"Checks if the femunzip version can be handled Parameters: Name Type Description Default filepath str path to the femzpi file required Returns: Name Type Description version_ok bool Examples: >>> api.is_femunzip_version_ok(\"path/to/d3plot.fz\") True","title":"is_femunzip_version_ok()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.is_sidact_file","text":"Tests if a filepath points at a sidact file Parameters: Name Type Description Default filepath str required Returns: Name Type Description is_sidact_file bool Examples: >>> api.is_sidact_file(\"path/to/d3plot.fz\") True >>> api.is_sidact_file(\"path/to/d3plot\") False >>> api.is_sidact_file(\"path/to/non/existing/file\") False","title":"is_sidact_file()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.load_dynamic_library","text":"Load a library and check for correct execution Parameters: Name Type Description Default path str path to the library required Returns: Name Type Description library CDLL loaded library","title":"load_dynamic_library()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_geometry","text":"Read the geometry buffer from femzip Parameters: Name Type Description Default filepath str path to femzpi file required buffer_info Union [ FemzipBufferInfo , None] struct with info regarding required memory for femzip None close_file bool it is useful to leave the file open if states are processed right afterwards True Returns: Name Type Description buffer memoryview memoryview of buffer","title":"read_geometry()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_geometry--notes","text":"If the file isn't closed appropriately bugs and crashes might occur. Examples: >>> mview = api.read_geometry(filepath, buffer_info)","title":"Notes"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_single_state","text":"Read a single state Parameters: Name Type Description Default i_timestep int timestep to be read required buffer_info FemzipBufferInfo infos about buffer sizes required state_buffer Union [None, memoryview ] buffer in which the states are stored None","title":"read_single_state()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_single_state--notes","text":"It is unclear to us why the state buffer needs to be given in order to terminate state reading. Examples: >>> # get info about required memory >>> buffer_info = api.get_buffer_info(filepath) >>> # first read geometry and leave file open >>> mview_geom = api.read_geometry(filepath, buffer_info, False) >>> # now read a state >>> mview_state = api.read_single_state(0, buffer_info=buffer_info) >>> # close file >>> api.close_current_file()","title":"Notes"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_state_deletion_info","text":"Get information which elements are alive Parameters: Name Type Description Default buffer_info FemzipBufferInfo infos about buffer sizes required state_filter Union [ Set [ int ], None] usable to read only specific states None","title":"read_state_deletion_info()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_state_deletion_info--notes","text":"The `buffer` must have the size of at least `buffer_info.size_activity`. Examples: >>> # get info about required memory >>> buffer_info = api.get_buffer_info(filepath) >>> # first read geometry and leave file open! >>> mview_geom = api.read_geometry(filepath, buffer_info, False) >>> # now read deletion info >>> array_deletion = api.read_state_activity(buffer_info) >>> # close file >>> api.close_current_file()","title":"Notes"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_states","text":"Reads all femzip state information Parameters: Name Type Description Default filepath str path to femzip file required buffer_info Union [ FemzipBufferInfo , None] struct with info regarding required memory for femzip None state_filter Union [ Set [ int ], None] usable to load only specific states None Returns: Name Type Description buffer memoryview buffer containing all state data Examples: >>> buffer_info = api.get_buffer_info(\"path/to/d3plot.fz\") >>> array_states = api.read_states(\"path/to/d3plot.fz\", buffer_info)","title":"read_states()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.read_variables","text":"Read specific variables from Femzip Parameters: Name Type Description Default file_metadata FemzipFileMetadata metadata of file including which variables to read required n_parts int number of parts in the file required n_rigid_walls int number of rigid walls required n_rigid_wall_vars int number of rigid wall variables required n_airbag_particles int number of airbag particles in the file required n_airbags int required state_filter Union [ Set [ int ], None] used to read specific arrays None Returns: Name Type Description arrays dict dictionary with d3plot arrays","title":"read_variables()"},{"location":"femzip/FemzipAPI/#lasso.femzip.femzip_api.FemzipAPI.struct_to_dict","text":"Converts a ctypes struct into a dict Parameters: Name Type Description Default struct Structure required Returns: Name Type Description fields Dict [ str , Any ] struct as dict Examples: >>> api.struct_to_dict(api.get_femzip_status()) {'is_file_open': 1, 'is_geometry_read': 1, 'is_states_open': 0, 'i_timestep_state': -1, 'i_timestep_activity': -1}","title":"struct_to_dict()"},{"location":"femzip/FemzipAPIStatus/","text":"FemzipAPIStatus Bases: Structure This struct summarizes the state of the femzip API library. The library has a shared, global state which is stored in static variables. The state of the gloval vars is tracked by this struct. Attributes: Name Type Description is_file_open c_int32 Whether a femzip file is opened and being processed. is_geometry_read c_int32 Whether the geometry was already read. is_states_open c_int32 Whether processing of the states was started. i_timestep_state c_int32 Counter of timestep processing. i_timestep_activity c_int32 Counter of activity data for timesteps.","title":"FemzipAPIStatus"},{"location":"femzip/FemzipAPIStatus/#femzipapistatus","text":"Bases: Structure This struct summarizes the state of the femzip API library. The library has a shared, global state which is stored in static variables. The state of the gloval vars is tracked by this struct. Attributes: Name Type Description is_file_open c_int32 Whether a femzip file is opened and being processed. is_geometry_read c_int32 Whether the geometry was already read. is_states_open c_int32 Whether processing of the states was started. i_timestep_state c_int32 Counter of timestep processing. i_timestep_activity c_int32 Counter of activity data for timesteps.","title":"FemzipAPIStatus"},{"location":"femzip/FemzipBufferInfo/","text":"FemzipBufferInfo Bases: Structure This struct describes necessary buffer sizes for reading the file Attributes: Name Type Description n_timesteps c_uint64 Number of timesteps timesteps POINTER ( c_float ) Time for each timestep size_geometry c_uint64 Size of the geometry buffer size_state c_uint64 Size of the state buffer size_displacement c_uint64 Size for displacement array size_activity c_uint64 Size for activity array (deletion stuff) size_post c_uint64 Size of the post region of which I currently don't know anymore what it was. size_titles c_uint64 Size of the titles region behind the geomtry.","title":"FemzipBufferInfo"},{"location":"femzip/FemzipBufferInfo/#femzipbufferinfo","text":"Bases: Structure This struct describes necessary buffer sizes for reading the file Attributes: Name Type Description n_timesteps c_uint64 Number of timesteps timesteps POINTER ( c_float ) Time for each timestep size_geometry c_uint64 Size of the geometry buffer size_state c_uint64 Size of the state buffer size_displacement c_uint64 Size for displacement array size_activity c_uint64 Size for activity array (deletion stuff) size_post c_uint64 Size of the post region of which I currently don't know anymore what it was. size_titles c_uint64 Size of the titles region behind the geomtry.","title":"FemzipBufferInfo"},{"location":"femzip/FemzipError/","text":"FemzipError Bases: Structure Struct representing femzip errors in c-code Attributes: Name Type Description ier c_int32 Error code msg c_char_p Error message","title":"FemzipError"},{"location":"femzip/FemzipError/#femziperror","text":"Bases: Structure Struct representing femzip errors in c-code Attributes: Name Type Description ier c_int32 Error code msg c_char_p Error message","title":"FemzipError"},{"location":"femzip/FemzipFileMetadata/","text":"FemzipFileMetadata Bases: Structure This struct contains metadata about femzip files. Attributes: Name Type Description version_zip c_float activity_flag c_int32 number_of_variables c_int32 number_of_nodes c_int32 number_of_solid_elements c_int32 number_of_thick_shell_elements c_int32 number_of_1D_elements c_int32 number_of_tool_elements c_int32 number_of_shell_elements c_int32 number_of_solid_element_neighbors c_int32 number_of_rbe_element_neighbors c_int32 number_of_bar_elements c_int32 number_of_beam_elements c_int32 number_of_plotel_elements c_int32 number_of_spring_elements c_int32 number_of_damper_elements c_int32 number_of_joint_elements c_int32 number_of_joint_element_neighbors c_int32 number_of_bar_element_neighbors c_int32 number_of_beamcross_elements c_int32 number_of_spotweld_elements c_int32 number_of_rbe_elements c_int32 number_of_hexa20_elements c_int32 number_of_rigid_shell_elements c_int32 number_of_timesteps c_int32 variable_infos POINTER ( VariableInfo )","title":"FemzipFileMetadata"},{"location":"femzip/FemzipFileMetadata/#femzipfilemetadata","text":"Bases: Structure This struct contains metadata about femzip files. Attributes: Name Type Description version_zip c_float activity_flag c_int32 number_of_variables c_int32 number_of_nodes c_int32 number_of_solid_elements c_int32 number_of_thick_shell_elements c_int32 number_of_1D_elements c_int32 number_of_tool_elements c_int32 number_of_shell_elements c_int32 number_of_solid_element_neighbors c_int32 number_of_rbe_element_neighbors c_int32 number_of_bar_elements c_int32 number_of_beam_elements c_int32 number_of_plotel_elements c_int32 number_of_spring_elements c_int32 number_of_damper_elements c_int32 number_of_joint_elements c_int32 number_of_joint_element_neighbors c_int32 number_of_bar_element_neighbors c_int32 number_of_beamcross_elements c_int32 number_of_spotweld_elements c_int32 number_of_rbe_elements c_int32 number_of_hexa20_elements c_int32 number_of_rigid_shell_elements c_int32 number_of_timesteps c_int32 variable_infos POINTER ( VariableInfo )","title":"FemzipFileMetadata"},{"location":"femzip/FemzipVariableCategory/","text":"FemzipVariableCategory Bases: enum . Enum Enum for femzip variable categories Attributes: Name Type Description GEOMETRY int -5 PART int -2 GLOBAL int -1 NODE int 0 SOLID int 1 THICK_SHELL int 2 BEAM int 3 TOOLS int 4 SHELL int 5 SPH int 6 FPM int 7 CFD int 8 CPM_FLOAT_VAR int 9 CPM_AIRBAG int 10 CPM_INT_VAR int 11 RADIOSS_STATE_DATA int 12 HEXA20 int 13 from_int ( number ) staticmethod Deserializes an integer into an enum Parameters: Name Type Description Default number int number to turn into an enum required Returns: Name Type Description enum_value FemzipVariableCategory","title":"FemzipVariableCategory"},{"location":"femzip/FemzipVariableCategory/#femzipvariablecategory","text":"Bases: enum . Enum Enum for femzip variable categories Attributes: Name Type Description GEOMETRY int -5 PART int -2 GLOBAL int -1 NODE int 0 SOLID int 1 THICK_SHELL int 2 BEAM int 3 TOOLS int 4 SHELL int 5 SPH int 6 FPM int 7 CFD int 8 CPM_FLOAT_VAR int 9 CPM_AIRBAG int 10 CPM_INT_VAR int 11 RADIOSS_STATE_DATA int 12 HEXA20 int 13","title":"FemzipVariableCategory"},{"location":"femzip/FemzipVariableCategory/#lasso.femzip.fz_config.FemzipVariableCategory.from_int","text":"Deserializes an integer into an enum Parameters: Name Type Description Default number int number to turn into an enum required Returns: Name Type Description enum_value FemzipVariableCategory","title":"from_int()"},{"location":"femzip/VariableInfo/","text":"VariableInfo Bases: Structure Struct for details about a single femzip variable Attributes: Name Type Description var_index c_int32 Index of the variable name c_char_p Name from femzip var_type c_int32 Variable type. See FemzipVariableCategory for translation. var_size c_int32 Array size of the field variable.","title":"VariableInfo"},{"location":"femzip/VariableInfo/#variableinfo","text":"Bases: Structure Struct for details about a single femzip variable Attributes: Name Type Description var_index c_int32 Index of the variable name c_char_p Name from femzip var_type c_int32 Variable type. See FemzipVariableCategory for translation. var_size c_int32 Array size of the field variable.","title":"VariableInfo"},{"location":"coverage/","text":"article h1, article > a, .md-sidebar--secondary { display: none !important; } var coviframe = document.getElementById(\"coviframe\"); function resizeIframe() { coviframe.style.height = coviframe.contentWindow.document.documentElement.offsetHeight + 'px'; } coviframe.contentWindow.document.body.onclick = function() { coviframe.contentWindow.location.reload(); }","title":"Code Coverage Report"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..63a949c --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,158 @@ + + + + https://open-lasso-python.github.io/lasso-python/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/changelog/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/contributing/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/diffcrash/diffcrash/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/diffcrash/diffcrash_run/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/diffcrash/run/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/DimredRun/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/KeywordTypes/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/clustering_betas/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/command_line_interface/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/plot_beta_clusters/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/pod_functions/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/subsampling_methods/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dimred/svd/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dyna/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dyna/ArrayType/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dyna/Binout/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dyna/D3plot/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dyna/D3plotHeader/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dyna/FilterType/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/dyna/performance_info/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/FemzipAPI/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/FemzipAPIStatus/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/FemzipBufferInfo/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/FemzipError/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/FemzipFileMetadata/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/FemzipVariableCategory/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/femzip/VariableInfo/ + 2023-04-28 + daily + + + https://open-lasso-python.github.io/lasso-python/coverage/ + 2023-04-28 + daily + + \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz new file mode 100644 index 0000000..8e214a2 Binary files /dev/null and b/sitemap.xml.gz differ diff --git a/src/lasso/__init__.py b/src/lasso/__init__.py deleted file mode 100644 index ab9d95a..0000000 --- a/src/lasso/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from importlib.metadata import PackageNotFoundError, version - - -try: - __version__ = version("lasso-python") -except PackageNotFoundError: - # package is not installed - pass diff --git a/src/lasso/diffcrash/__init__.py b/src/lasso/diffcrash/__init__.py deleted file mode 100644 index 1ead786..0000000 --- a/src/lasso/diffcrash/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .diffcrash_run import DiffcrashRun - - -__all__ = ["DiffcrashRun"] diff --git a/src/lasso/diffcrash/diffcrash_run.py b/src/lasso/diffcrash/diffcrash_run.py deleted file mode 100644 index 553af7a..0000000 --- a/src/lasso/diffcrash/diffcrash_run.py +++ /dev/null @@ -1,1328 +0,0 @@ -import argparse -import glob -import logging -import os -import platform -import re -import shutil -import subprocess -import sys -import time -import typing -from concurrent import futures -from pathlib import Path -from typing import Union - -import psutil - -from lasso.logging import str_error, str_info, str_running, str_success, str_warn - - -# pylint: disable = too-many-lines - -DC_STAGE_SETUP = "SETUP" -DC_STAGE_IMPORT = "IMPORT" -DC_STAGE_MATH = "MATH" -DC_STAGE_EXPORT = "EXPORT" -DC_STAGE_MATRIX = "MATRIX" -DC_STAGE_EIGEN = "EIGEN" -DC_STAGE_MERGE = "MERGE" -DC_STAGES = [ - DC_STAGE_SETUP, - DC_STAGE_IMPORT, - DC_STAGE_MATH, - DC_STAGE_EXPORT, - DC_STAGE_MATRIX, - DC_STAGE_EIGEN, - DC_STAGE_MERGE, -] - - -def get_application_header(): - """Prints the header of the command line tool""" - - return """ - - ==== D I F F C R A S H ==== - - an open-lasso-python utility script - """ - - -def str2bool(value) -> bool: - """Converts some value from the cmd line to a boolean - - Parameters - ---------- - value: `str` or `bool` - - Returns - ------- - bool_value: `bool` - value as boolean - """ - - if isinstance(value, bool): - return value - if value.lower() in ("yes", "true", "t", "y", "1"): - return True - if value.lower() in ("no", "false", "f", "n", "0"): - return False - raise argparse.ArgumentTypeError("Boolean value expected.") - - -def parse_diffcrash_args(): - """Parse the arguments from the command line - - Returns - ------- - args : `argparse.Namespace` - parsed arguments - """ - - # print title - print(get_application_header()) - - parser = argparse.ArgumentParser( - description="Python utility script for Diffcrash written by OPEN-LASSO." - ) - - parser.add_argument( - "--reference-run", type=str, required=True, help="filepath of the reference run." - ) - parser.add_argument( - "--exclude-runs", type=str, nargs="*", default=[], help="Runs to exclude from the analysis." - ) - parser.add_argument( - "--crash-code", - type=str, - required=True, - help="Which crash code is used ('dyna', 'pam' or 'radioss').", - ) - parser.add_argument( - "--start-stage", - type=str, - nargs="?", - default=DC_STAGES[0], - help=f"At which specific stage to start the analysis ({', '.join(DC_STAGES)}).", - ) - parser.add_argument( - "--end-stage", - type=str, - nargs="?", - default=DC_STAGES[-1], - help=f"At which specific stage to stop the analysis ({', '.join(DC_STAGES)}).", - ) - parser.add_argument( - "--diffcrash-home", - type=str, - default=os.environ["DIFFCRASHHOME"] if "DIFFCRASHHOME" in os.environ else "", - nargs="?", - required=False, - help=( - "Home directory where Diffcrash is installed." - " Uses environment variable 'DIFFCRASHHOME' if unspecified." - ), - ) - parser.add_argument( - "--use-id-mapping", - type=str2bool, - nargs="?", - const=True, - default=False, - help="Whether to use id-based mapping (default is nearest neighbour).", - ) - parser.add_argument( - "--project-dir", - type=str, - nargs="?", - default="project", - help="Project dir to use for femzip.", - ) - parser.add_argument( - "--config-file", type=str, nargs="?", default="", help="Path to the config file." - ) - parser.add_argument( - "--parameter-file", type=str, nargs="?", default="", help="Path to the parameter file." - ) - parser.add_argument( - "--n-processes", - type=int, - nargs="?", - default=max(1, psutil.cpu_count() - 1), - help="Number of processes to use (default: max-1).", - ) - parser.add_argument( - "simulation_runs", - type=str, - nargs="*", - help="Simulation runs or patterns used to search for simulation runs.", - ) - - if len(sys.argv) < 2: - parser.print_help() - sys.exit(0) - - return parser.parse_args(sys.argv[1:]) - - -def run_subprocess(args): - """Run a subprocess with the specified arguments - - Parameters: - ----------- - args : `list` of `str` - - Returns - ------- - rc : `int` - process return code - - Notes - ----- - Suppresses stderr. - """ - return subprocess.Popen(args, stderr=subprocess.DEVNULL).wait() - - -class DiffcrashRun: - """Class for handling the settings of a diffcrash run""" - - # pylint: disable = too-many-instance-attributes - - # pylint: disable = too-many-arguments - def __init__( - self, - project_dir: str, - crash_code: str, - reference_run: str, - simulation_runs: typing.Sequence[str], - exclude_runs: typing.Sequence[str], - diffcrash_home: str = "", - use_id_mapping: bool = False, - config_file: str = None, - parameter_file: str = None, - n_processes: int = 1, - logfile_dir: str = None, - ): - """Object handling a diffcrash run - - Parameters - ---------- - project_dir : `str` - directory to put all buffer files etc., in - crash_code : `str` - crash code to use. - reference_run : `str` - filepath to the reference run - simulation_runs: `list` of `str` - patterns used to search for simulation runs - diffcrash_home : `str` - home directory of diffcrash installation. Uses environment - variable DIFFCRASHHOME if not set. - use_id_mapping : `bool` - whether to use id mapping instead of nearest neighbor mapping - config_file : `str` - filepath to a config file - parameter_file : `str` - filepath to the parameter file - n_processes : `int` - number of processes to spawn for worker pool - logfile_dir : `str` - directory to put logfiles in - """ - - # settings - self._msg_option = "{:16s}: {}" - self._log_formatter = logging.Formatter("%(levelname)s:%(asctime)s %(message)s") - - # logdir - if logfile_dir is not None: - self.logfile_dir = Path(logfile_dir) - else: - self.logfile_dir = Path(project_dir) / "Log" - self.logfile_filepath = self.logfile_dir / "DiffcrashRun.log" - - # logger - self.logger = self._setup_logger() - - # make some space in the log - self.logger.info(get_application_header()) - - # diffcrash home - self.diffcrash_home = Path(self._parse_diffcrash_home(diffcrash_home)) - self.diffcrash_home = self.diffcrash_home / "bin" - self.diffcrash_lib = self.diffcrash_home.parent / "lib" - - if platform.system() == "Linux": - os.environ["PATH"] += f":{self.diffcrash_home}:{self.diffcrash_lib}" - if platform.system() == "Windows": - os.environ["PATH"] += f";{self.diffcrash_home};{self.diffcrash_lib}" - - # project dir - self.project_dir = self._parse_project_dir(project_dir) - - # crashcode - self.crash_code = self._parse_crash_code(crash_code) - - # reference run - self.reference_run = self._parse_reference_run(reference_run) - - # mapping - self.use_id_mapping = self._parse_use_id_mapping(use_id_mapping) - - # exlude runs - self.exclude_runs = exclude_runs - - # simulation runs - self.simulation_runs = self._parse_simulation_runs( - simulation_runs, self.reference_run, self.exclude_runs - ) - - # config file - self.config_file = self._parse_config_file(config_file) - - # parameter file - self.parameter_file = self._parse_parameter_file(parameter_file) - - # n processes - self.n_processes = self._parse_n_processes(n_processes) - - def _setup_logger(self) -> logging.Logger: - # better safe than sorry - os.makedirs(self.logfile_dir, exist_ok=True) - - # create console log channel - # streamHandler = logging.StreamHandler(sys.stdout) - # streamHandler.setLevel(logging.INFO) - # streamHandler.setFormatter(self._log_formatter) - - # create file log channel - file_handler = logging.FileHandler(self.logfile_filepath) - file_handler.setLevel(logging.INFO) - file_handler.setFormatter(self._log_formatter) - - # create logger - logger = logging.getLogger("DiffcrashRun") - logger.setLevel(logging.INFO) - # logger.addHandler(streamHandler) - logger.addHandler(file_handler) - - return logger - - def _parse_diffcrash_home(self, diffcrash_home) -> str: - diffcrash_home_ok = len(diffcrash_home) != 0 - - msg = self._msg_option.format("diffcrash-home", diffcrash_home) - print(str_info(msg)) - self.logger.info(msg) - - if not diffcrash_home_ok: - err_msg = ( - "Specify the path to the Diffcrash installation either " - + "with the environment variable 'DIFFCRASHHOME' or the option --diffcrash-home." - ) - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - return diffcrash_home - - def _parse_crash_code(self, crash_code) -> str: - # these guys are allowed - valid_crash_codes = ["dyna", "radioss", "pam"] - - # do the thing - crash_code_ok = crash_code in valid_crash_codes - - print(str_info(self._msg_option.format("crash-code", crash_code))) - self.logger.info(self._msg_option.format("crash-code", crash_code)) - - if not crash_code_ok: - err_msg = f"Invalid crash code '{crash_code}'. Please use one of: {valid_crash_codes!s}" - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - return crash_code - - def _parse_reference_run(self, reference_run) -> str: - reference_run_ok = Path(reference_run).is_file() - - msg = self._msg_option.format("reference-run", reference_run) - print(str_info(msg)) - self.logger.info(msg) - - if not reference_run_ok: - err_msg = f"Filepath '{reference_run}' is not a file." - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - return reference_run - - def _parse_use_id_mapping(self, use_id_mapping) -> bool: - msg = self._msg_option.format("use-id-mapping", use_id_mapping) - print(str_info(msg)) - self.logger.info(msg) - - return use_id_mapping - - def _parse_project_dir(self, project_dir): - project_dir = Path(project_dir).resolve() - - msg = self._msg_option.format("project-dir", project_dir) - print(str_info(msg)) - self.logger.info(msg) - - return project_dir - - def _parse_simulation_runs( - self, - simulation_run_patterns: typing.Sequence[str], - reference_run: str, - exclude_runs: typing.Sequence[str], - ): - # search all denoted runs - simulation_runs = [] - for pattern in simulation_run_patterns: - simulation_runs += glob.glob(pattern) - simulation_runs = [filepath for filepath in simulation_runs if Path(filepath).is_file()] - - # search all excluded runs - runs_to_exclude = [] - for pattern in exclude_runs: - runs_to_exclude += glob.glob(pattern) - runs_to_exclude = [filepath for filepath in runs_to_exclude if Path(filepath).is_file()] - - n_runs_before_filtering = len(simulation_runs) - simulation_runs = [ - filepath for filepath in simulation_runs if filepath not in runs_to_exclude - ] - n_runs_after_filtering = len(simulation_runs) - - # remove the reference run - if reference_run in simulation_runs: - simulation_runs.remove(reference_run) - - # sort it because we can! - def atoi(text): - return int(text) if text.isdigit() else text - - def natural_keys(text): - return [atoi(c) for c in re.split(r"(\d+)", text)] - - simulation_runs = sorted(simulation_runs, key=natural_keys) - - # check - simulation_runs_ok = len(simulation_runs) != 0 - - msg = self._msg_option.format("# simul.-files", len(simulation_runs)) - print(str_info(msg)) - self.logger.info(msg) - - msg = self._msg_option.format( - "# excluded files", (n_runs_before_filtering - n_runs_after_filtering) - ) - print(str_info(msg)) - self.logger.info(msg) - - if not simulation_runs_ok: - err_msg = ( - "No simulation files could be found with the specified patterns. " - "Check the argument 'simulation_runs'." - ) - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - return simulation_runs - - def _parse_config_file(self, config_file) -> Union[str, None]: - _msg_config_file = "" - if len(config_file) > 0 and not Path(config_file).is_file(): - config_file = None - _msg_config_file = f"Can not find config file '{config_file}'" - - # missing config file - else: - config_file = None - _msg_config_file = ( - "Config file missing. Consider specifying the path with the option '--config-file'." - ) - - msg = self._msg_option.format("config-file", config_file) - print(str_info(msg)) - self.logger.info(msg) - - if _msg_config_file: - print(str_warn(_msg_config_file)) - self.logger.warning(_msg_config_file) - - return config_file - - def _parse_parameter_file(self, parameter_file) -> Union[None, str]: - _msg_parameter_file = "" - if len(parameter_file) > 0 and not Path(parameter_file).is_file(): - parameter_file = None - _msg_parameter_file = f"Can not find parameter file '{parameter_file}'" - # missing parameter file - else: - parameter_file = None - _msg_parameter_file = ( - "Parameter file missing. Consider specifying the " - "path with the option '--parameter-file'." - ) - - msg = self._msg_option.format("parameter-file", parameter_file) - print(str_info(msg)) - self.logger.info(msg) - - if _msg_parameter_file: - print(str_warn(_msg_parameter_file)) - self.logger.warning(_msg_parameter_file) - - return parameter_file - - def _parse_n_processes(self, n_processes) -> int: - print(str_info(self._msg_option.format("n-processes", n_processes))) - - if n_processes <= 0: - err_msg = f"n-processes is '{n_processes}' but must be at least 1." - self.logger.error(err_msg) - raise ValueError(str_error(err_msg)) - - return n_processes - - def create_project_dirs(self): - """Creates all project relevant directores - - Notes - ----- - Created dirs: - - logfile_dir - - project_dir - """ - os.makedirs(self.project_dir, exist_ok=True) - os.makedirs(self.logfile_dir, exist_ok=True) - - def run_setup(self, pool: futures.ThreadPoolExecutor): - """Run diffcrash setup - - Parameters - ---------- - pool : `concurrent.futures.ThreadPoolExecutor` - multiprocessing pool - """ - - # SETUP - msg = "Running Setup ... " - print(str_running(msg) + "\r", end="", flush="") - self.logger.info(msg) - - args = [] - if self.config_file is None and self.parameter_file is None: - args = [ - self.diffcrash_home / f"DFC_Setup_{self.crash_code}_fem", - self.reference_run, - self.project_dir, - ] - elif self.config_file is not None and self.parameter_file is None: - args = [ - self.diffcrash_home / f"DFC_Setup_{self.crash_code}_fem", - self.reference_run, - self.project_dir, - "-C", - self.config_file, - ] - elif self.config_file is None and self.parameter_file is not None: - if ".fz" in self.reference_run: - args = [ - self.diffcrash_home / f"DFC_Setup_{self.crash_code}_fem", - self.reference_run, - self.project_dir, - "-P", - self.parameter_file, - ] - else: - args = [ - self.diffcrash_home / f"DFC_Setup_{self.crash_code}", - self.reference_run, - self.project_dir, - "-P", - self.parameter_file, - ] - elif self.config_file is not None and self.parameter_file is not None: - if ".fz" in self.reference_run: - args = [ - self.diffcrash_home / f"DFC_Setup_{self.crash_code}_fem", - self.reference_run, - self.project_dir, - "-C", - self.config_file, - "-P", - self.parameter_file, - ] - else: - args = [ - self.diffcrash_home / f"DFC_Setup_{self.crash_code}", - self.reference_run, - self.project_dir, - "-C", - self.config_file, - "-P", - self.parameter_file, - ] - start_time = time.time() - - # submit task - return_code_future = pool.submit(run_subprocess, args) - return_code = return_code_future.result() - - # check return code - if return_code != 0: - err_msg = f"Running Setup ... done in {time.time() - start_time:.2f}s" - print(str_error(err_msg)) - self.logger.error(err_msg) - - err_msg = "Process somehow failed." - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - # check log - messages = self.check_if_logfiles_show_success("DFC_Setup.log") - if messages: - err_msg = f"Running Setup ... done in {time.time() - start_time:.2f}s" - print(str_error(err_msg)) - self.logger.error(err_msg) - - # print failed logs - for msg in messages: - print(str_error(msg)) - self.logger.error(msg) - - err_msg = "Setup failed." - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - # print success - err_msg = f"Running Setup ... done in {time.time() - start_time:.2f}s" - print(str_success(msg)) - self.logger.info(msg) - - def run_import(self, pool: futures.ThreadPoolExecutor): - """Run diffcrash import of runs - - Parameters - ---------- - pool : `concurrent.futures.ThreadPoolExecutor` - multiprocessing pool - """ - - # pylint: disable = too-many-locals, too-many-branches, too-many-statements - - # list of arguments to run in the command line - import_arguments = [] - - # id 1 is the reference run - # id 2 and higher are the imported runs - counter_offset = 2 - - # assemble arguments for running the import - # entry 0 is the reference run, thus we start at 1 - # pylint: disable = consider-using-enumerate - for i_filepath in range(len(self.simulation_runs)): - # parameter file missing - if self.parameter_file is None: - if self.use_id_mapping: - args = [ - self.diffcrash_home / f"DFC_Import_{self.crash_code}_fem", - "-id", - self.simulation_runs[i_filepath], - self.project_dir, - str(i_filepath + counter_offset), - ] - else: - args = [ - self.diffcrash_home / f"DFC_Import_{self.crash_code}_fem", - self.simulation_runs[i_filepath], - self.project_dir, - str(i_filepath + counter_offset), - ] - # indeed there is a parameter file - elif self.use_id_mapping: - args = [ - self.diffcrash_home / f"DFC_Import_{self.crash_code}", - "-ID", - self.simulation_runs[i_filepath], - self.project_dir, - str(i_filepath + counter_offset), - ] - else: - args = [ - self.diffcrash_home / f"DFC_Import_{self.crash_code}", - self.simulation_runs[i_filepath], - self.project_dir, - str(i_filepath + counter_offset), - ] - - # append args to list - import_arguments.append(args) - - # do the thing - msg = "Running Imports ...\r" - print(str_running(msg), end="", flush=True) - self.logger.info(msg) - start_time = time.time() - return_code_futures = [pool.submit(run_subprocess, args) for args in import_arguments] - - # wait for imports to finish (with a progressbar) - n_imports_finished = sum( - return_code_future.done() for return_code_future in return_code_futures - ) - while n_imports_finished != len(return_code_futures): - # check again - n_new_imports_finished = sum( - return_code_future.done() for return_code_future in return_code_futures - ) - - # print - percentage = n_new_imports_finished / len(return_code_futures) * 100 - - if n_imports_finished != n_new_imports_finished: - # pylint: disable = consider-using-f-string - msg = ( - f"Running Imports ... [{n_new_imports_finished}/{len(return_code_futures)}] - " - f"{percentage:3.2f}%\r" - ) - - print(str_running(msg), end="", flush=True) - self.logger.info(msg) - - n_imports_finished = n_new_imports_finished - - # wait a little bit - time.sleep(0.25) - - return_codes = [return_code_future.result() for return_code_future in return_code_futures] - - # print failure - if any(return_code != 0 for return_code in return_codes): - n_failed_runs = 0 - for i_run, return_code in enumerate(return_codes): - if return_code != 0: - _err_msg = str_error( - f"Run {i_run} failed to import with error code '{return_code}'." - ) - print(str_error(_err_msg)) - self.logger.error(_err_msg) - n_failed_runs += 1 - - err_msg = f"Running Imports ... done in {time.time() - start_time:.2f}s " - print(str_error(err_msg)) - self.logger.error(err_msg) - - err_msg = f"Import of {n_failed_runs} runs failed." - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - # check log files - messages = self.check_if_logfiles_show_success("DFC_Import_*.log") - if messages: - # print failure - msg = f"Running Imports ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.info(msg) - - # print failed logs - for msg in messages: - self.logger.error(msg) - print(str_error(msg)) - - err_msg = ( - f"At least one import failed. Please check the log files in '{self.logfile_dir}'." - ) - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - # print success - print(str_success(f"Running Imports ... done in {time.time() - start_time:.2f}s ")) - - def run_math(self, pool: futures.ThreadPoolExecutor): - """Run diffcrash math - - Parameters - ---------- - pool : `concurrent.futures.ThreadPoolExecutor` - multiprocessing pool - """ - - msg = "Running Math ... \r" - print(str_running(msg), end="", flush=True) - self.logger.info(msg) - - start_time = time.time() - return_code_future = pool.submit( - run_subprocess, [self.diffcrash_home / f"DFC_Math_{self.crash_code}", self.project_dir] - ) - return_code = return_code_future.result() - - # check return code - if return_code != 0: - msg = f"Running Math ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - err_msg = f"Caught a nonzero return code '{return_code}'" - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - # check logs - messages = self.check_if_logfiles_show_success("DFC_MATH*.log") - if messages: - # print failure - msg = f"Running Math ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - # print failed logs - for msg in messages: - print(str_error(msg)) - self.logger.error(msg) - - err_msg = ( - "Logfile does indicate a failure. " - f"Please check the log files in '{self.logfile_dir}'." - ) - self.logger.error(err_msg) - raise RuntimeError(str_error(err_msg)) - - # print success - msg = f"Running Math ... done in {time.time() - start_time:.2f}s " - print(str_success(msg)) - self.logger.info(msg) - - def run_export(self, pool: futures.ThreadPoolExecutor): - """Run diffcrash export - - Parameters - ---------- - pool : `concurrent.futures.ThreadPoolExecutor` - multiprocessing pool - """ - - msg = "Running Export ... " - print(str_running(msg) + "\r", end="", flush=True) - self.logger.info(msg) - - if self.config_file is None: - export_item_list = [] - - # check for pdmx - pdmx_filepath_list = list(self.project_dir.glob("*_pdmx")) - if pdmx_filepath_list: - export_item_list.append(pdmx_filepath_list[0].name) - - # check for pdij - pdij_filepath_list = list(self.project_dir.glob("*_pdij")) - if pdij_filepath_list: - export_item_list.append(pdij_filepath_list[0].name) - - else: - export_item_list = self.read_config_file(self.config_file) - - # remove previous existing exports - for export_item in export_item_list: - export_item_filepath = self.project_dir / f"{export_item}.d3plot.fz" - if export_item_filepath.is_file(): - export_item_filepath.unlink() - - # do the thing - start_time = time.time() - return_code_futures = [ - pool.submit( - run_subprocess, - [ - self.diffcrash_home / f"DFC_Export_{self.crash_code}", - self.project_dir, - export_item, - ], - ) - for export_item in export_item_list - ] - - return_codes = [result_future.result() for result_future in return_code_futures] - - # check return code - if any(rc != 0 for rc in return_codes): - msg = f"Running Export ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - for i_export, export_return_code in enumerate(return_codes): - if export_return_code != 0: - msg = ( - f"Return code of export '{export_item_list[i_export]}' " - f"was nonzero: '{export_return_code}'" - ) - self.logger.error(msg) - print(str_error(msg)) - - msg = "At least one export process failed." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # check logs - messages = self.check_if_logfiles_show_success("DFC_Export_*") - if messages: - # print failure - msg = f"Running Export ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - # print logs - for msg in messages: - print(str_error(msg)) - self.logger.error(msg) - - msg = f"At least one export failed. Please check the log files in '{self.logfile_dir}'." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # print success - msg = f"Running Export ... done in {time.time() - start_time:.2f}s " - print(str_success(msg)) - self.logger.info(msg) - - def run_matrix(self, pool: futures.ThreadPoolExecutor): - """Run diffcrash matrix - - Parameters - ---------- - pool : `concurrent.futures.ThreadPoolExecutor` - multiprocessing pool - """ - - msg = "Running Matrix ... " - print(str_running(msg) + "\r", end="", flush=True) - self.logger.info(msg) - - start_time = time.time() - - # create the input file for the process - matrix_inputfile = self._create_matrix_input_file(self.project_dir) - - # run the thing - return_code_future = pool.submit( - run_subprocess, - [ - self.diffcrash_home / f"DFC_Matrix_{self.crash_code}", - self.project_dir, - matrix_inputfile, - ], - ) - - # please hold the line ... - return_code = return_code_future.result() - - # check return code - if return_code != 0: - # print failure - msg = f"Running Matrix ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - msg = "The DFC_Matrix process failed somehow." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # check log file - messages = self.check_if_logfiles_show_success("DFC_Matrix_*") - if messages: - # print failure - msg = f"Running Matrix ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.info(msg) - - # print why - for msg in messages: - print(str_error(msg)) - self.logger.error(msg) - - msg = f"DFC_Matrix failed. Please check the log files in '{self.logfile_dir}'." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # print success - msg = f"Running Matrix ... done in {time.time() - start_time:.2f}s " - print(str_success(msg)) - self.logger.info(msg) - - def run_eigen(self, pool: futures.ThreadPoolExecutor): - """Run diffcrash eigen - - Parameters - ---------- - pool : `concurrent.futures.ThreadPoolExecutor` - multiprocessing pool - """ - - msg = "Running Eigen ... " - print(str_running(msg) + "\r", end="", flush=True) - self.logger.info(msg) - - # create input file for process - eigen_inputfile = self._create_eigen_input_file(self.project_dir) - - # run the thing - start_time = time.time() - return_code_future = pool.submit( - run_subprocess, - [ - self.diffcrash_home / f"DFC_Eigen_{self.crash_code}", - self.project_dir, - eigen_inputfile, - ], - ) - - # please hold the line ... - return_code = return_code_future.result() - - # check return code - if return_code != 0: - msg = f"Running Eigen ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - msg = "The process failed somehow." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # check log file - messages = self.check_if_logfiles_show_success("DFC_Matrix_*") - if messages: - # print failure - msg = f"Running Eigen ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - # print why - for msg in messages: - print(str_error(msg)) - self.logger.error(msg) - - msg = f"DFC_Eigen failed. Please check the log files in '{self.logfile_dir}'." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # print success - msg = f"Running Eigen ... done in {time.time() - start_time:.2f}s " - print(str_success(msg)) - self.logger.info(msg) - - def run_merge(self, pool: futures.ThreadPoolExecutor): - """Run diffcrash merge - - Parameters - ---------- - pool : `concurrent.futures.ThreadPoolExecutor` - multiprocessing pool - """ - - msg = "Running Merge ... " - print(str_running(msg) + "\r", end="", flush=True) - self.logger.info(msg) - - # create ionput file for merge - merge_inputfile = self._create_merge_input_file(self.project_dir) - - # clear previous merges - for filepath in self.project_dir.glob("mode_*"): - if filepath.is_file(): - filepath.unlink() - - # run the thing - start_time = time.time() - return_code_future = pool.submit( - run_subprocess, - [ - self.diffcrash_home / f"DFC_Merge_All_{self.crash_code}", - self.project_dir, - merge_inputfile, - ], - ) - return_code = return_code_future.result() - - # check return code - if return_code != 0: - msg = f"Running Merge ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.info(msg) - - msg = "The process failed somehow." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # check logfiles - messages = self.check_if_logfiles_show_success("DFC_Merge_All.log") - if messages: - msg = f"Running Merge ... done in {time.time() - start_time:.2f}s " - print(str_error(msg)) - self.logger.error(msg) - - for msg in messages: - print(str_error(msg)) - self.logger.info(msg) - - msg = "DFC_Merge_All failed. Please check the log files in '{self.logfile_dir}'." - self.logger.error(msg) - raise RuntimeError(str_error(msg)) - - # print success - msg = f"Running Merge ... done in {time.time() - start_time:.2f}s " - print(str_success(msg)) - self.logger.info(msg) - - def is_logfile_successful(self, logfile: Path) -> bool: - """Checks if a logfile indicates a success - - Parameters - ---------- - logfile : `str` - filepath to the logfile - - Returns - ------- - success : `bool` - """ - - with open(logfile, encoding="utf-8") as fp: - for line in fp: - if "successfully" in line: - return True - return False - - def _create_merge_input_file(self, directory: Path) -> Path: - """Create an input file for the merge executable - - Notes - ----- - From the official diffcrash docs. - """ - - # creates default inputfile for DFC_Merge - filepath = directory / "merge_all.txt" - with open(filepath, "w", encoding="utf-8") as merge_input_file: - merge_input_file.write("eigen_all ! Name of eigen input file\n") - merge_input_file.write( - "mode_ ! Name of Output file " - + "(string will be appended with mode information)\n" - ) - merge_input_file.write("1 1 ! Mode number to be generated\n") - merge_input_file.write("'d+ d-' ! Mode type to be generated\n") - # TIMESTEPSFILE optional - merge_input_file.write( - " ! Optional: Timestepfile (specify timesteps used for merge)\n" - ) - # PARTSFILE optional - merge_input_file.write( - " ! Optional: Partlistfile (specify parts used for merge)\n" - ) - - return filepath - - def _create_eigen_input_file(self, directory: Path) -> Path: - """Create an input file for the eigen executable - - Notes - ----- - From the official diffcrash docs. - """ - - # creates default inputfile for DFC_Eigen - filepath = directory / "eigen_all.txt" - with open(filepath, "w", encoding="utf-8") as eigen_input_file: - eigen_input_file.write("matrix_all\n") - eigen_input_file.write('""\n') - eigen_input_file.write("1 1000\n") - eigen_input_file.write('""\n') - eigen_input_file.write("0 0\n") - eigen_input_file.write('""\n') - eigen_input_file.write("eigen_all\n") - eigen_input_file.write('""\n') - eigen_input_file.write("0 0\n") - - return filepath - - def _create_matrix_input_file(self, directory: Path) -> Path: - """Create an input file for the matrix executable - - Notes - ----- - From the official diffcrash docs. - """ - filepath = directory / "matrix.txt" - # creates default inputfile for DFC_Matrix - with open(filepath, "w", encoding="utf-8") as matrix_input_file: - matrix_input_file.write("0 1000 ! Initial and final time stept to consider\n") - matrix_input_file.write('"" ! not used\n') - matrix_input_file.write('"" ! not used\n') - matrix_input_file.write("matrix_all ! Name of matrix file set (Output)\n") - - return filepath - - def clear_project_dir(self): - """Clears the entire project dir""" - - # disable logging - for handler in self.logger.handlers: - handler.close() - self.logger.removeHandler(handler) - - # delete folder - if self.project_dir.is_dir(): - shutil.rmtree(self.project_dir) - - # reinit logger - self.logger = self._setup_logger() - - def read_config_file(self, config_file: str) -> list[str]: - """Read a diffcrash config file - - Parameters - ---------- - config_file : `str` - path to the config file - - Notes - ----- - From the official diffcrash docs ... seriously. - """ - - # Just to make it clear, this is not code from OPEN-LASSO - # ... - - # pylint: disable = too-many-locals - # pylint: disable = consider-using-enumerate - # pylint: disable = too-many-nested-blocks - # pylint: disable = too-many-branches - # pylint: disable = too-many-statements - - with open(config_file, encoding="utf-8") as conf: - conf_lines = conf.readlines() - line = 0 - - for i in range(len(conf_lines)): - if conf_lines[i].find("FUNCTION") >= 0: - line = i + 1 - break - - export_item_list = [] - j = 1 - if line != 0: - while 1: - while 1: - for i in range(len(conf_lines[line])): - if conf_lines[line][i] == "<": - element_start = i + 1 - if conf_lines[line][i] == ">": - element_end = i - elem = conf_lines[line][element_start:element_end] - check = conf_lines[line + j][:-1] - - if check.find(elem) >= 0: - line = line + j + 1 - j = 1 - break - j += 1 - items = check.split(" ") - pos = -1 - for n in range(len(items)): - if items[n].startswith("!"): - msg = f"FOUND at {n}" - print(msg) - self.logger.info(msg) - pos = n - break - pos = len(items) - - for n in range(pos): - if items[n] == "PDMX" or items[n] == "pdmx": - break - if items[n] == "PDXMX" or items[n] == "pdxmx": - break - if items[n] == "PDYMX" or items[n] == "pdymx": - break - if items[n] == "PDZMX" or items[n] == "pdzmx": - break - if items[n] == "PDIJ" or items[n] == "pdij": - break - if items[n] == "STDDEV" or items[n] == "stddev": - break - if items[n] == "NCOUNT" or items[n] == "ncount": - break - if items[n] == "MISES_MX" or items[n] == "mises_mx": - break - if items[n] == "MISES_IJ" or items[n] == "mises_ij": - break - - for k in range(n, pos): - postval = None - for m in range(n): - if items[m] == "coordinates": - items[m] = "geometry" - if postval is None: - postval = items[m] - else: - postval = postval + "_" + items[m] - postval = postval.strip("_") - - # hotfix - # sometimes the engine writes 'Geometry' instead of 'geometry' - postval = postval.lower() - - items[k] = items[k].strip() - - if items[k] != "" and items[k] != "\r": - if postval.lower() == "sigma": - export_item_list.append( - elem + "_" + postval + "_" + "001_" + items[k].lower() - ) - export_item_list.append( - elem + "_" + postval + "_" + "002_" + items[k].lower() - ) - export_item_list.append( - elem + "_" + postval + "_" + "003_" + items[k].lower() - ) - else: - export_item_list.append( - elem + "_" + postval + "_" + items[k].lower() - ) - if export_item_list[-1].endswith("\r"): - export_item_list[-1] = export_item_list[-1][:-1] - - if conf_lines[line].find("FUNCTION") >= 0: - break - else: - export_item_list = ["NODE_geometry_pdmx", "NODE_geometry_pdij"] - - return export_item_list - - def check_if_logfiles_show_success(self, pattern: str) -> list[str]: - """Check if a logfiles with given pattern show success - - Parameters - ---------- - pattern : `str` - file pattern used to search for logfiles - - Returns - ------- - messages : `list` - list with messages of failed log checks - """ - - _msg_logfile_nok = str_error("Logfile '{0}' reports no success.") - messages = [] - - for filepath in self.logfile_dir.glob(pattern): - if not self.is_logfile_successful(filepath): - messages.append(_msg_logfile_nok.format(filepath)) - - return messages diff --git a/src/lasso/diffcrash/run.py b/src/lasso/diffcrash/run.py deleted file mode 100644 index f10bd27..0000000 --- a/src/lasso/diffcrash/run.py +++ /dev/null @@ -1,110 +0,0 @@ -from concurrent import futures - -from lasso.diffcrash.diffcrash_run import ( - DC_STAGE_EIGEN, - DC_STAGE_EXPORT, - DC_STAGE_IMPORT, - DC_STAGE_MATH, - DC_STAGE_MATRIX, - DC_STAGE_MERGE, - DC_STAGE_SETUP, - DC_STAGES, - DiffcrashRun, - parse_diffcrash_args, -) -from lasso.logging import str_error - - -def _parse_stages(start_stage: str, end_stage: str): - # check validity - if start_stage not in DC_STAGES or end_stage not in DC_STAGES: - raise ValueError( - str_error(f"{start_stage} is not a valid stage. Try: {', '.join(DC_STAGES)}.") - ) - - # get indexes - start_stage_index = DC_STAGES.index(start_stage) - end_stage_index = DC_STAGES.index(end_stage) - - # check if start and end are in correct order - if start_stage_index > end_stage_index: - raise ValueError( - str_error( - f"The specified end stage '{end_stage}' comes before " - f"the start stage ({start_stage}). " - f"Try the order: {', '.join(DC_STAGES)}" - ) - ) - - return start_stage_index, end_stage_index - - -def main(): - """Main function for running diffcrash""" - - # parse command line stuff - parser = parse_diffcrash_args() - - # parse settings from command line - diffcrash_run = DiffcrashRun( - project_dir=parser.project_dir, - crash_code=parser.crash_code, - reference_run=parser.reference_run, - exclude_runs=parser.exclude_runs, - simulation_runs=parser.simulation_runs, - diffcrash_home=parser.diffcrash_home, - use_id_mapping=parser.use_id_mapping, - config_file=parser.config_file, - parameter_file=parser.parameter_file, - n_processes=parser.n_processes, - ) - - # determine start and end stages - start_stage_index, end_stage_index = _parse_stages(parser.start_stage, parser.end_stage) - - # remove old stuff - if start_stage_index == 0: - diffcrash_run.clear_project_dir() - diffcrash_run.create_project_dirs() - - # do the thing - print() - print(" ---- Running Routines ---- ") - print() - - # initiate threading pool for handling jobs - with futures.ThreadPoolExecutor(max_workers=diffcrash_run.n_processes) as pool: - # setup - if start_stage_index <= DC_STAGES.index(DC_STAGE_SETUP) <= end_stage_index: - diffcrash_run.run_setup(pool) - - # import - if start_stage_index <= DC_STAGES.index(DC_STAGE_IMPORT) <= end_stage_index: - diffcrash_run.run_import(pool) - - # math - if start_stage_index <= DC_STAGES.index(DC_STAGE_MATH) <= end_stage_index: - diffcrash_run.run_math(pool) - - # export - if start_stage_index <= DC_STAGES.index(DC_STAGE_EXPORT) <= end_stage_index: - diffcrash_run.run_export(pool) - - # matrix - if start_stage_index <= DC_STAGES.index(DC_STAGE_MATRIX) <= end_stage_index: - diffcrash_run.run_matrix(pool) - - # eigen - if start_stage_index <= DC_STAGES.index(DC_STAGE_EIGEN) <= end_stage_index: - diffcrash_run.run_eigen(pool) - - # merge - if start_stage_index <= DC_STAGES.index(DC_STAGE_MERGE) <= end_stage_index: - diffcrash_run.run_merge(pool) - - # final spacing - print() - - -if __name__ == "__main__": - main() diff --git a/src/lasso/dimred/__init__.py b/src/lasso/dimred/__init__.py deleted file mode 100644 index 11d3365..0000000 --- a/src/lasso/dimred/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .dimred_run import DimredRun, DimredStage - - -__all__ = ["DimredRun", "DimredStage"] diff --git a/src/lasso/dimred/dimred_run.py b/src/lasso/dimred/dimred_run.py deleted file mode 100644 index 2c245ea..0000000 --- a/src/lasso/dimred/dimred_run.py +++ /dev/null @@ -1,1078 +0,0 @@ -import argparse -import enum -import glob -import os -import re -import shutil -import sys -import time -from collections.abc import Sequence -from concurrent.futures.process import ProcessPoolExecutor -from typing import Union - -import h5py -import numpy as np -import psutil -from rich.console import Console -from rich.progress import BarColumn, Progress -from rich.table import Table -from rich.text import Text - -from lasso.dimred.svd.clustering_betas import ( - create_cluster_arg_dict, - create_detector_arg_dict, - group_betas, -) -from lasso.dimred.svd.plot_beta_clusters import plot_clusters_js -from lasso.dimred.svd.pod_functions import calculate_v_and_betas -from lasso.dimred.svd.subsampling_methods import create_reference_subsample, remap_random_subsample -from lasso.utils.rich_progress_bars import PlaceHolderBar, WorkingDots - - -# pylint: disable = too-many-lines - - -class DimredRunError(Exception): - """Custom exception for errors during the dimensionality reduction""" - - def __init__(self, msg): - self.message = msg - - -def get_application_header(): - """Prints the header of the command line tool""" - - return """ - - ==== LASSO - AI ==== - - visit us: [link=http://www.lasso.de/en]www.lasso.de/en[/link] - mail: lasso@lasso.de - """ - - -def timestamp() -> str: - """Get current timestamp as string - - Returns - ------- - timestamp : str - current timestamp as string - """ - - def add_zero(in_str) -> str: - if len(in_str) == 1: - return "0" + in_str - return in_str - - loc_time = time.localtime()[3:6] - h_str = add_zero(str(loc_time[0])) - m_str = add_zero(str(loc_time[1])) - s_str = add_zero(str(loc_time[2])) - t_str = "[" + h_str + ":" + m_str + ":" + s_str + "]" - return t_str - - -def parse_dimred_args(): - """Parse the arguments from the command line - - Returns - ------- - args : `argparse.Namespace` - parsed arguments - """ - - parser = argparse.ArgumentParser( - description="Python utility script for dimensionality reduction written by LASSO GmbH." - ) - - parser.add_argument( - "simulation_runs", - type=str, - nargs="*", - help="Simulation runs or patterns used to search for simulation runs.", - ) - parser.add_argument( - "--reference-run", - type=str, - help="Optional. Set the reference run instead of using the first entry in simulation runs.", - ) - parser.add_argument( - "--exclude-runs", - type=str, - nargs="*", - default=[], - help="Optional. Runs to exclude from the analysis.", - ) - parser.add_argument( - "--start-stage", - type=str, - nargs="?", - default=DIMRED_STAGES[0], - help="Optional. " - f"At which specific stage to start the analysis ({', '.join(DIMRED_STAGES)}).", - ) - parser.add_argument( - "--end-stage", - type=str, - nargs="?", - default=DIMRED_STAGES[-1], - help="Optional. " - f"At which specific stage to stop the analysis ({', '.join(DIMRED_STAGES)}).", - ) - parser.add_argument( - "--project-dir", - type=str, - required=True, - help="Project dir for temporary files. Must be specified to allow" - + " restart at specific steps", - ) - parser.add_argument( - "--embedding-images", - type=str, - default="", - help="Optional. Path to folder containing images of runs. Sample names must be numbers", - ) - parser.add_argument( - "--logfile-filepath", - type=str, - nargs="?", - default="", - help="Optional. Path for the logfile. A file will be created automatically" - + "in the project dir if not specified.", - ) - parser.add_argument( - "--n-processes", - type=int, - nargs="?", - default=max(1, psutil.cpu_count() - 1), - help="Optional. Number of processes to use (default: n_cpu-1).", - ) - parser.add_argument( - "--part-ids", - type=str, - nargs="*", - default=[], - help="Optional. Part ids to process. By default all are taken.", - ) - parser.add_argument( - "--timestep", - type=int, - default="-1", - help="Optional. Sets timestep to analyse. Uses last timestep if not set.", - ) - parser.add_argument( - "--html-name", - type=str, - default="3d-beta-plot", - help="Optional. Sets the name of the generated 3D visualization. " - + "Default is '3d_beta_plot'", - ) - parser.add_argument( - "--html-timestamp", - action="store_true", - help="""Optional. If set, the visualization will include a timestamp of yymmdd_hhmmss, - else the previous file will be overwritten""", - ) - parser.add_argument( - "--cluster-args", - type=str, - nargs="*", - help="Optional. Arguments for clustering algorithms. " - + "If not set, clustering will be skipped.", - ) - parser.add_argument( - "--outlier-args", - type=str, - nargs="*", - help="Optional. Arguments for outlier detection before clustering.", - ) - - if len(sys.argv) < 2: - parser.print_help() - sys.exit(0) - - return parser.parse_args(sys.argv[1:]) - - -class DimredStage(enum.Enum): - """Enum for all stages of the dimenstionality reduction""" - - REFERENCE_RUN = "REFERENCE_RUN" - IMPORT_RUNS = "IMPORT_RUNS" - REDUCTION = "REDUCTION" - CLUSTERING = "CLUSTERING" - EXPORT_PLOT = "EXPORT_PLOT" - - -DIMRED_STAGES = ( - DimredStage.REFERENCE_RUN.value, - DimredStage.IMPORT_RUNS.value, - DimredStage.REDUCTION.value, - DimredStage.CLUSTERING.value, - DimredStage.EXPORT_PLOT.value, -) - - -class HDF5FileNames(enum.Enum): - """Enum for arrays in the hdf5 file""" - - SUBSAMPLE_SAVE_NAME = "subsample" - SUBSAMPLED_GROUP_NAME = "subsampled_runs" - BETAS_GROUP_NAME = "betas" - V_ROB_SAVE_NAME = "v_rob" - PLOT_LOAD_TIME = "t_load" - SUBSAMPLE_PROCESS_TIME = "t_total" - NR_CLUSTER = "nr_clusters" - HAS_OUTLIERS = "has_outliers" - OUTLIERS = "outlier" - CLUSTER = "cluster" - - -class DimredRun: - """Class to control and run the dimensionality reduction process""" - - # pylint: disable = too-many-instance-attributes - - reference_run: str - simulation_runs: Sequence[str] - exclude_runs: Sequence[str] - project_dir: str - img_path: Union[None, str] - logfile_filepath: str - n_processes: int - part_ids: Sequence[int] - timestep: int - start_stage_index: int - end_stage_index: int - skip_valid: bool - html_name: str - html_set_timestamp: bool - show_output: bool - cluster_type: Union[None, str] - detector_type: Union[None, str] - cluster_args: Union[None, dict] - detector_args: Union[None, dict] - h5file: Union[None, h5py.File] - use_folder_name: bool - - def __init__( - self, - simulation_runs: Sequence[str], - start_stage: str, - end_stage: str, - project_dir: str, - html_name: str = "3d-beta-plot", - html_set_timestamp: bool = False, - reference_run: Union[str, None] = None, - console: Union[Console, None] = None, - img_path: Union[None, str] = None, - exclude_runs: Union[None, Sequence[str]] = None, - logfile_filepath: Union[str, None] = None, - n_processes: int = 1, - part_id_filter: Union[None, Sequence[int]] = None, - timestep: int = -1, - show_output: bool = True, - cluster_args: Union[None, Sequence[str]] = None, - outlier_args: Union[None, Sequence[str]] = None, - ): - """Class handling a dimensionality reduction - - Parameters - ---------- - simulation_runs : Sequence[str] - simulation runs to analyze - start_stage: str - where to start - end_stage: str - where to stop - project_dir : Union[None, str] - required project directory for creation of buffer files. Allows restart in between. - html_name: str - Name of the output .html file - html_set_timestamp: bool - If true, the output .html will include a timestamp (hh_mm_ss) at the end of the filename - reference_run : str - filepath to the reference run. - If not set, first entry in simulation_runs will be used as reference run. - console: Union[rich.console.Console, None], default: None - Console for information printing and logging. - Rich offers pretty text printing, syntax highlighting etc. - img_path: Union[None, str] - optional image directory to show images in visualization. - exclude_runs: Union[Sequence[str], None] - optional list of runs to exclude from processing - logfile_filepath : Union[str, None] - path of the log file (always appends) - n_processes: int - number of processes to use during execution - part_id_filter: Union[Sequence[int], None] - which part ids to process - timestep: int, default: -1 - specifies timestep to analyze in clustering and show in output visualization - show_output: bool, default: True - Set to false not to show the output html in the browser - cluster_args: Union[None, [str]], default: None - Arguments for cluster algorithm - outlier_args: Union[None, [str]], default: None - Arguments for outlier detection algorithm - - Notes - ----- - Using a project directory allows to restart stages of the entire - process. - """ - - # pylint: disable = too-many-arguments, too-many-locals - - # settings - # Set up Rich Console and Rich logging - self.console = console - if self.console: - self.console.print(get_application_header(), style="success", highlight=True) - - self.logfile_filepath = ( - logfile_filepath - if logfile_filepath - else os.path.join(project_dir, "logfile") - if project_dir - else "" - ) - - self._msg_option = "{:16s}: {}" - - # run variables - # table is a rich format containing information of the variables - table = Table(show_header=False) - self.n_processes = self._parse_n_processes(n_processes, table) - - # check for correctly parsed simulation-runs - if len(simulation_runs) == 0: - err_msg = "No entries in positional argument 'simulation-runs'." - err_msg += "\nIt is recommended to set the 'simulation-runs' arguments first!" - self.raise_error(err_msg) - - # parse simulation and reference run - # if no reference run was set use first simulation run - (self.simulation_runs, self.reference_run, self.exclude_runs) = ( - self._parse_simulation_and_reference_runs( - simulation_runs, reference_run, () if not exclude_runs else exclude_runs, table - ) - ) - - # check if basename or foldername serves as unique identifier - self.use_folder_name = os.path.basename(self.simulation_runs[0]) == os.path.basename( - self.simulation_runs[1] - ) - - # set project dir and simulation runs - self.project_dir = self._parse_project_dir(project_dir, table) - self.part_ids = part_id_filter if part_id_filter is not None else () - if self.part_ids is not None and len(self.part_ids) != 0: - table.add_row("selected parts", ",".join(str(entry) for entry in self.part_ids)) - self.timestep = timestep - if timestep != -1: - table.add_row("Timestep: ", str(timestep)) - - # check if start_stage_index and end_stage_index are valid - self.start_stage_index, self.end_stage_index = self._parse_stages(start_stage, end_stage) - if self.console: - self.console.print(table) - - # check valid image path - self.img_path = self._check_img_path(img_path) if img_path else None - - # set cluster and outlier arguments - self._parse_cluster_and_outlier_args(cluster_args, outlier_args) - - self.html_name = self._parse_html_name(html_name) - self.html_set_timestamp = html_set_timestamp - self.show_output = show_output - - self.pool = None - - def log(self, msg: str, style: Union[str, None] = None, highlight: bool = False): - """Log a message - - Parameters - ---------- - msg : str - message to log - style : Union[str, None] - style of the message - highlight : bool - whether to highlight the message or not - """ - if self.console: - self.console.print(timestamp() + msg, style=style, highlight=highlight) - - def raise_error(self, err_msg: str): - """ - Parameters - ---------- - err_msg : str - error message to be raised - - Raises - ------ - RuntimeError - raises an exception with error msg - - Notes - ----- - Logs correctly and deals with open file handles. - """ - - err_msg_text = Text(err_msg, style="error") - - if not self.console: - raise DimredRunError(err_msg) - - try: - self.h5file.close() - self.console.print("closed hdf5 file") - except AttributeError: - self.console.print("no hdf5 file to close") - - self.console.print(err_msg_text, style="error") - if self.logfile_filepath: - self.console.save_html(self.logfile_filepath) - - raise DimredRunError(err_msg) - - # pylint believes this function has different return statements - # whereas it only has one. - # pylint: disable = inconsistent-return-statements - def _check_img_path(self, img_path: str) -> str: - """checks if provided image path is valid""" - - if os.path.isdir(img_path): - abs_path = os.path.abspath(img_path) - js_path = re.sub(r"\\", "/", abs_path) - return js_path - - err_msg = "provided argument --embedding.images is not a folder" - self.raise_error(err_msg) - - def _parse_stages(self, start_stage: str, end_stage: str): - # check validity - if start_stage not in DIMRED_STAGES: - err_msg = f"{start_stage} is not a valid stage. Try: {', '.join(DIMRED_STAGES)}." - self.raise_error(err_msg) - - if end_stage not in DIMRED_STAGES: - err_msg = f"{end_stage} is not a valid stage. Try: {', '.join(DIMRED_STAGES)}." - self.raise_error(err_msg) - - # get indexes - start_stage_index = DIMRED_STAGES.index(start_stage) - end_stage_index = DIMRED_STAGES.index(end_stage) - - # check if start and end are in correct order - if start_stage_index > end_stage_index: - err_msg = ( - f"The specified end stage '{end_stage}' " - f"comes before the start stage ({start_stage}). " - f"Try the order: {', '.join(DIMRED_STAGES)}" - ) - self.raise_error(err_msg) - - return start_stage_index, end_stage_index - - def _check_valid_stage_skip(self): - # check if stage skip is valid - if self.start_stage_index == DIMRED_STAGES.index(DimredStage.IMPORT_RUNS.value): - self.log("Skipped setup stage", style="warning") - if HDF5FileNames.SUBSAMPLE_SAVE_NAME.value not in self.h5file: # type: ignore - msg = "no reference sample found" - self.raise_error(msg) - elif self.start_stage_index == DIMRED_STAGES.index(DimredStage.REDUCTION.value): - self.log("Skipped import stage", style="warning") - if HDF5FileNames.SUBSAMPLED_GROUP_NAME.value not in self.h5file: # type: ignore - msg = "no subsampled samples found" - self.raise_error(msg) - elif self.start_stage_index == DIMRED_STAGES.index(DimredStage.CLUSTERING.value): - self.log("Skipped reduction stage", style="warning") - if ( - HDF5FileNames.V_ROB_SAVE_NAME.value not in self.h5file # type: ignore - or HDF5FileNames.BETAS_GROUP_NAME.value not in self.h5file - ): # type: ignore - err_msg = "Could not find reduced betas and V_ROB" - self.raise_error(err_msg) - elif self.start_stage_index == DIMRED_STAGES.index(DimredStage.CLUSTERING.value): - self.log("Skipped clustering stage", style="warning") - - def _parse_part_ids(self, part_ids: Union[Sequence[int], None]) -> Sequence[int]: - if not part_ids: - return () - - if not all(isinstance(pid, int) for pid in part_ids): - raise TypeError("All part ids must be of type 'int'") - - return part_ids - - def _parse_project_dir(self, project_dir: Union[str, None], table: Table): - if not project_dir: - return "" - - project_dir = os.path.abspath(project_dir) - - if os.path.isfile(project_dir): - err_msg = ( - f"The project path '{project_dir}' is pointing at an existing file." - " Change either the project path or move the file." - ) - self.raise_error(err_msg) - - if not os.path.exists(project_dir): - os.makedirs(project_dir, exist_ok=True) - - table.add_row("project-dir", project_dir) - return project_dir - - def _parse_simulation_and_reference_runs( - self, - simulation_run_patterns: Sequence[str], - reference_run_pattern: Union[None, str], - exclude_runs: Sequence[str], - table: Table, - ) -> tuple[Sequence[str], str, Sequence[str]]: - # pylint: disable = too-many-locals - - # search all denoted runs - simulation_runs = [] - for pattern in simulation_run_patterns: - simulation_runs += glob.glob(pattern) - simulation_runs = [ - os.path.normpath(filepath) for filepath in simulation_runs if os.path.isfile(filepath) - ] - - # search all excluded runs - runs_to_exclude = [] - for pattern in exclude_runs: - runs_to_exclude += glob.glob(pattern) - runs_to_exclude = [ - os.path.normpath(filepath) for filepath in runs_to_exclude if os.path.isfile(filepath) - ] - - n_runs_before_filtering = len(simulation_runs) - simulation_runs = [ - filepath for filepath in simulation_runs if filepath not in runs_to_exclude - ] - n_runs_after_filtering = len(simulation_runs) - - # check if simulation runs are valid - - simulation_runs_ok = len(simulation_runs) != 0 - - if not simulation_runs_ok: - err_msg = ( - "No simulation files could be found with the specified patterns. " - "Check the argument 'simulation_runs'." - ) - self.raise_error(err_msg) - - table.add_row("# simul.-files", str(len(simulation_runs))) - - table.add_row("# excluded files", f"{n_runs_before_filtering - n_runs_after_filtering}") - - # check for valid reference run - reference_run = "" - if reference_run_pattern: - reference_run_ok = os.path.isfile(reference_run_pattern) - if not reference_run_ok: - err_msg = f"Filepath '{reference_run_pattern}' is not a file." - self.raise_error(err_msg) - - reference_run = os.path.normpath(reference_run_pattern) - # use first simulation run if no reference run was provided - # check if enough simulation runs remain - elif len(simulation_runs) > 1: - reference_run = simulation_runs[0] - else: - err_msg = "Number of Simulation runs after using first as reference run is zero." - self.raise_error(err_msg) - - # add to table - table.add_row("reference-run", reference_run) - - # remove the reference run from simulation runs - if reference_run and reference_run in simulation_runs: - simulation_runs.remove(reference_run) - - # sort it because we can! - def atoi(text): - return int(text) if text.isdigit() else text - - def natural_keys(text): - return [atoi(c) for c in re.split(r"(\d+)", text)] - - simulation_runs = sorted(simulation_runs, key=natural_keys) - - return simulation_runs, reference_run, runs_to_exclude - - def _parse_cluster_and_outlier_args( - self, cluster_args: Union[Sequence[str], None], outlier_args: Union[Sequence[str], None] - ): - """verifies correct oultier and cluster args, if provided""" - - # creates a valid argument dict for clustering arguments - if cluster_args is None: - self.cluster_type = None - self.cluster_args = None - else: - result = create_cluster_arg_dict(cluster_args) - - # check for errors - if isinstance(result, str): - self.raise_error(result) - else: - self.cluster_type, self.cluster_args = result[0], result[1] - - # creates a valid argument dict for outlier detection arguments - self.detector_type = None - self.detector_args = {} - - if outlier_args: - result = create_detector_arg_dict(outlier_args) - # check for errors - if isinstance(result, str): - self.raise_error(result) - self.detector_type = result[0] - self.detector_args = result[1] - - def _parse_n_processes(self, n_processes: int, table: Table) -> int: - if n_processes <= 0: - err_msg = f"n-processes is '{n_processes}' but must be at least 1." - self.raise_error(err_msg) - - table.add_row("n-processes", str(n_processes)) - return n_processes - - def _parse_html_name(self, html_name_string: str) -> str: - html_name, replace_count = re.subn(r"[!ยง$%&/()=?\"\[\]{}\\.,;:<>|]", "", html_name_string) - html_name = html_name.replace(" ", "-") - - if replace_count > 0: - msg = ( - f"Replaced {replace_count} invalid characters for the html file name. " - f"The new html name is: {html_name}" - ) - self.log(msg) - - return html_name - - def __enter__(self): - self.pool = ProcessPoolExecutor(max_workers=self.n_processes) - self.h5file = h5py.File(os.path.join(self.project_dir, "project_buffer.hdf5"), "a") - self._check_valid_stage_skip() - return self - - def __exit__(self, exception_type, exception_value, traceback): - self.pool = None - self.h5file.close() - self.h5file = None - - def _perform_context_check(self): - if self.pool is None: - msg = "The class function can only be used in a 'with' block on the instance itself." - self.raise_error(msg) - - def reset_project_dir(self): - """resets the project directory entirely""" - - # delete folder - if os.path.exists(self.project_dir): - shutil.rmtree(self.project_dir) - - if self.project_dir: - os.makedirs(self.project_dir, exist_ok=True) - - def process_reference_run(self): - """Process the reference run""" - - # is a process pool up - self._perform_context_check() - - msg = "Reference Subsample" - self.log(msg) - - # init progress bar - if self.console: - prog = Progress("", WorkingDots()) - else: - prog = PlaceHolderBar() - with prog: - ref_task = prog.add_task("", total=1) - - # Delete existing reference subsample - if HDF5FileNames.SUBSAMPLE_SAVE_NAME.value in self.h5file: # type: ignore - del self.h5file[HDF5FileNames.SUBSAMPLE_SAVE_NAME.value] - - reference_sample = create_reference_subsample(self.reference_run, self.part_ids) - - prog.advance(ref_task) # type: ignore - - if isinstance(reference_sample, str): - self.raise_error(reference_sample) - - # create dataset in h5file - h5_ref = self.h5file.create_dataset( - HDF5FileNames.SUBSAMPLE_SAVE_NAME.value, data=reference_sample[0] - ) - h5_ref.attrs[HDF5FileNames.PLOT_LOAD_TIME.value] = reference_sample[2] - h5_ref.attrs[HDF5FileNames.SUBSAMPLE_PROCESS_TIME.value] = reference_sample[1] - - # log time and success - self.log("Loadtime Reference subsample: " + str(reference_sample[2])[:5]) - self.log("Total time for Reference subsample: " + str(reference_sample[1])[:5]) - self.log("Reference subsample completed", style="success") - - def subsample_to_reference_run(self): - """Subsamples all runs""" - - # pylint: disable = too-many-branches,too-many-locals - - self._perform_context_check() - self.log("Subsampling") - - # init progress bar - if self.console: - prog = Progress( - "[progress.description]{task.description}", - WorkingDots(), - BarColumn(), - "{task.completed} of {task.total};", - # SubsamplingWaitTime(self.n_processes) - ) - else: - prog = PlaceHolderBar() - - with prog: - # define progressbar task - task1 = prog.add_task( - "[cyan]Subsampling plots [/cyan]", total=len(self.simulation_runs) - ) - h5_ref = self.h5file[HDF5FileNames.SUBSAMPLE_SAVE_NAME.value] - # prog.columns[4].update_avrg(h5_ref.attrs[HDF5FileNames.plot_load_time.value]) - - submitted_samples = [] - - # delete previous subsample entries - if HDF5FileNames.SUBSAMPLED_GROUP_NAME.value in self.h5file: # type: ignore - del self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value] - - # submit all simulation runs - for _, entry in enumerate(self.simulation_runs): - name = "overwrite_this" - if self.use_folder_name: - name = os.path.basename(os.path.split(entry)[0]) - else: - name = os.path.basename(entry) - - try: - future = self.pool.submit( - remap_random_subsample, entry, self.part_ids, h5_ref[:] - ) - - submitted_samples.append(np.array([name, future])) - except Exception: - break - - # check if an error occurred - # pylint: disable = protected-access, undefined-loop-variable - if self.pool._broken and "entry" in locals(): - msg = f"Failed to load file: {entry}" - self.raise_error(msg) - - # we measure required time here - t_cum = 0 - t_cum_io = 0 - - # prepare hdf5 file - self.h5file.create_group(HDF5FileNames.SUBSAMPLED_GROUP_NAME.value) - # This isn't very elegant, there must be a better way - while not prog.finished: - for i, sub in enumerate(submitted_samples): - if sub[1].done(): - try: - if isinstance(sub[1].result()[0], str): - self.raise_error(sub[1].result()) - h5_sample = self.h5file[ - HDF5FileNames.SUBSAMPLED_GROUP_NAME.value - ].create_dataset(sub[0], data=sub[1].result()[0]) - h5_sample.attrs[HDF5FileNames.PLOT_LOAD_TIME.value] = sub[1].result()[2] - h5_sample.attrs[HDF5FileNames.SUBSAMPLE_PROCESS_TIME.value] = sub[ - 1 - ].result()[1] - # FIXME: loop-iterator-mutation (B909) - # Mutation to loop iterable `submitted_samples` during iteration - # See: https://docs.astral.sh/ruff/rules/loop-iterator-mutation/ - submitted_samples.pop(i) # noqa B909 - prog.advance(task1) # type: ignore - t_cum_io += sub[1].result()[2] - t_cum += sub[1].result()[1] - except RuntimeError: - err_msg = f"Error while loading {sub}" - self.raise_error(err_msg) - time.sleep(0.5) - - # calculate required time - t_avrg = t_cum / len(self.simulation_runs) - t_avrg_io = t_cum_io / len(self.simulation_runs) - - # log results - self.log("Average Time per Subsampling Process: " + str(t_avrg)[0:5]) - self.log("Average Loadtime per sample: " + str(t_avrg_io)[0:5]) - - self.log("Subsampling completed", style="success") - - # Finished: We either have all sub-sampled runs in the project_dir, - # or a list containing all sub-sampled runs - # Problem: we might be running into issues with available RAM? - # 1000 runs, 30 timesteps, sub-sampled onto 2000 points -> 1,34GB - - def dimension_reduction_svd(self): - """Calculate V_ROB and Betas""" - - # pylint: disable = too-many-locals - - # applying pod_functions.py - # (TODO: lots of stuff in the pod_functions.py has to be overhauled) - # save if appropriate into project_dir - self.log("Dimension Reduction") - - if self.console: - # prog = Progress("", WorkingDots()) - prog = Progress( - "[progress.description]{task.description}", - WorkingDots(), - BarColumn(), - "{task.completed} of {task.total} timesteps;", - # SubsamplingWaitTime(self.n_processes) - ) - else: - prog = PlaceHolderBar() - with prog: - # deletes old files - if HDF5FileNames.BETAS_GROUP_NAME.value in self.h5file: # type: ignore - del self.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] - if HDF5FileNames.V_ROB_SAVE_NAME.value in self.h5file: # type: ignore - del self.h5file[HDF5FileNames.V_ROB_SAVE_NAME.value] - - beta_group = self.h5file.create_group(HDF5FileNames.BETAS_GROUP_NAME.value) - - excluded_entries = [ - ( - os.path.basename(os.path.split(entry)[0]) - if self.use_folder_name - else os.path.basename(entry) - ) - for entry in self.exclude_runs - ] - - valid_entries = [ - entry - for entry in self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value].keys() - if entry not in excluded_entries - ] - - run_timesteps = np.array([ - self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value][entry].shape[0] - for entry in valid_entries - ]) - - min_step = np.min(run_timesteps) - max_step = np.max(run_timesteps) - - if min_step != max_step: - warn_msg = ( - "The timesteps fo the samples don't match, only " - + "processing up to timestep {}. Skipped {} timesteps" - ) - warn_msg = warn_msg.format(min_step, max_step - min_step) - self.log(warn_msg, style="warning") - - # add task after checking condition, else output looks wonky - beta_task = prog.add_task("[cyan]Reducing Plots [/cyan]", total=int(min_step)) - - sub_displ = np.stack([ - self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value][entry][:min_step, :] - for entry in valid_entries - ]) - - result = calculate_v_and_betas(sub_displ, progress_bar=prog, task_id=beta_task) # type: ignore - # returns string if samplesize to small - if isinstance(result, str): - self.raise_error(result) - - v_rob, betas = result - for i, sample in enumerate( - self.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value].keys() - ): - beta_group.create_dataset(sample, data=betas[i]) - - self.h5file.create_dataset(HDF5FileNames.V_ROB_SAVE_NAME.value, data=v_rob) - - self.log("Dimension Reduction completed", style="success") - - def clustering_results(self): - """clustering results""" - - # pylint: disable = too-many-locals - - self._perform_context_check() - # delete old entries - betas_group = self.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] - if HDF5FileNames.HAS_OUTLIERS.value in betas_group.attrs: - del betas_group.attrs[HDF5FileNames.HAS_OUTLIERS.value] - - if HDF5FileNames.NR_CLUSTER.value in betas_group.attrs: - del betas_group.attrs[HDF5FileNames.NR_CLUSTER.value] - - if not self.cluster_type and not self.detector_type: - msg = "No arguments provided for clustering, clustering aborted" - self.log(msg) - return - - self.log("Clustering") - - # init progress bar - if self.console: - prog = Progress("", WorkingDots()) - else: - prog = PlaceHolderBar() - with prog: - cluster_task = prog.add_task("", total=1) - - # performs clustering with provided arguments - - excluded_entries = [ - ( - os.path.basename(os.path.split(entry)[0]) - if self.use_folder_name - else os.path.basename(entry) - ) - for entry in self.exclude_runs - ] - - beta_index = np.stack([ - key for key in betas_group.keys() if key not in excluded_entries - ]) - try: - betas = np.stack([ - betas_group[entry][self.timestep, :3] for entry in beta_index - ]) # betas_group.keys()]) - except ValueError: - log_msg = ( - "Invalid parameter for timestep. Set a valid timestep with --timestep.\n" - "To save time, you can restart the tool with --start-stage CLUSTERING." - ) - self.log(log_msg, style="warning") - t_max = betas_group[beta_index[0]][:].shape[0] - err_msg = ( - f"Timestep {self.timestep} is not a valid timestep. " - f"Samples have {t_max} timesteps. " - f"Choose a timestep between 0 and {t_max - 1}" - ) - self.raise_error(err_msg) - - result = group_betas( - beta_index, - betas, - cluster=self.cluster_type, - cluster_params=self.cluster_args, - detector=self.detector_type, - detector_params=self.detector_args, - ) - - if isinstance(result, str): - self.raise_error(result) - - id_cluster = result[1] - - # Save clusters - if len(id_cluster) > 1: - betas_group.attrs.create(HDF5FileNames.NR_CLUSTER.value, len(id_cluster)) - if self.detector_type is not None: - # if attribute has_outliers is set, the first cluster contains the outliers - # so all outliers can be found by searching for the cluster attribute "0" - betas_group.attrs.create(HDF5FileNames.HAS_OUTLIERS.value, len(id_cluster[0])) - for index, cluster in enumerate(id_cluster): - for entry in cluster: - # Enter appropriate cluster as attribute - sample = betas_group[entry] - sample.attrs.create(HDF5FileNames.CLUSTER.value, index) - - prog.advance(cluster_task) # type: ignore - - self.log("Clustering completed", style="success") - - def visualize_results(self): - """creates an output .html file""" - - self._perform_context_check() - self.log("Creating .html viz") - betas_group = self.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] - mark_outliers = False - - excluded_entries = [ - ( - os.path.basename(os.path.split(entry)[0]) - if self.use_folder_name - else os.path.basename(entry) - ) - for entry in self.exclude_runs - ] - - # check if clustering was performed, else load all betas into one pseudo-cluster - if HDF5FileNames.NR_CLUSTER.value not in betas_group.attrs: - # plotfunction expects list of cluster - # we have no clusters -> we claim all is in one cluster - - # Create and load ids - id_cluster = [ - np.stack([key for key in betas_group.keys() if key not in excluded_entries]) - ] - - # Create and load betas - beta_cluster = [np.stack([betas_group[entry][-1] for entry in id_cluster[0]])] - - else: - # check if outlier where detected - if HDF5FileNames.HAS_OUTLIERS.value in betas_group.attrs: - mark_outliers = True - - # index of all runs - id_data = np.stack([key for key in betas_group.keys() if key not in excluded_entries]) - - # create an index referencing each run to a cluster - cluster_index = np.stack([ - betas_group[entry].attrs[HDF5FileNames.CLUSTER.value] for entry in id_data - ]) - - # load betas & ids - beta_data = np.stack([betas_group[entry][-1] for entry in id_data]) - - # create list containing list of clusters - beta_cluster = [] - id_cluster = [] - for i, cluster in enumerate(range(betas_group.attrs[HDF5FileNames.NR_CLUSTER.value])): - chosen = np.where(cluster_index == cluster)[0] - if len(chosen) > 0: - beta_cluster.append(beta_data[chosen]) - id_cluster.append(id_data[chosen]) - elif len(chosen) == 0 and i == 0: - mark_outliers = False - - plot_clusters_js( - beta_cluster, - id_cluster, - save_path=self.project_dir, - img_path=self.img_path, - mark_outliers=mark_outliers, - mark_timestamp=self.html_set_timestamp, - filename=self.html_name, - show_res=self.show_output, - ) - self.log("Finished creating viz", style="success") diff --git a/src/lasso/dimred/graph_laplacian.py b/src/lasso/dimred/graph_laplacian.py deleted file mode 100644 index 21a04c3..0000000 --- a/src/lasso/dimred/graph_laplacian.py +++ /dev/null @@ -1,159 +0,0 @@ -from typing import Union - -import numpy as np -from scipy.sparse import csgraph, dok_matrix -from scipy.sparse.linalg import eigsh -from sklearn.neighbors import KDTree - - -def run_graph_laplacian( - points: np.ndarray, - n_eigenmodes: int = 5, - min_neighbors: Union[int, None] = None, - sigma: Union[float, None] = None, - search_radius: Union[float, None] = None, -): - """ - Compute a graph laplacian. - - Parameters - ---------- - points : np.ndarray - points with features - n_eigenmodes : int - number of eigenmodes to compute - min_neighbors : int - The minimum number of neighbors of a point to be considered for the laplacian - weights. Can be used to avoid unconnected points. - sigma : float - The standard deviation of the gaussian normal distribution function used to - transform the distances for the inverse distance based weighting. - search_radius: - - - Returns - ------- - eigenvalues : np.ndarray - eigenvalues from the graph - eigenvectors : np.ndarray - eigenvectors with shape (n_points x n_eigenvectors) - """ - with np.warnings.catch_warnings(): - regex_string = ( - r"the matrix subclass is not the recommended way to represent" - + r"matrices or deal with linear algebra" - ) - np.warnings.filterwarnings("ignore", regex_string) - lapl = _laplacian_gauss_idw(points, min_neighbors, sigma, search_radius) - return _laplacian(lapl, n_eigenmodes) - - -def _laplacian_gauss_idw( - points: np.ndarray, - min_neighbors: Union[int, None] = None, - sigma: Union[float, None] = None, - search_radius: Union[float, None] = None, -): - """ - Calculates the laplacian matrix for the sample points of a manifold. The inverse - of the gauss-transformed distance is used as weighting of the neighbors. - - Parameters - ---------- - points: array-like, shape (n_points, n_components) : - The sampling points of a manifold. - min_neighbors: int - The minimum number of neighbors of a point to be considered for the laplacian - weights. Can be used to avoid unconnected points. - sigma: float - The standard deviation of the gaussian normal distribution function used to - transform the distances for the inverse distance based weighting. - search_radius : float - radius search parameter for nearest neighbors - - Returns - ------- - L: array-like, shape (n_points, n_points) - The laplacian matrix for manifold given by its sampling `points`. - """ - if points.ndim != 2: - raise TypeError("Only 2D arrays are supported.") - - if min_neighbors is None: - min_neighbors = points.shape[1] - - tree = KDTree(points) - - if sigma is None: - d, _ = tree.query(points, 2 + 2 * points.shape[1], return_distance=True) - sigma = np.sum(d[:, -2:]) - sigma /= 3 * len(points) - - if search_radius is None: - search_radius = 3 * sigma - - graph = dok_matrix((len(points), len(points)), dtype=np.double) - - for i, (j, d, e, k) in enumerate( - zip( - *tree.query_radius(points, return_distance=True, r=search_radius), - *tree.query(points, return_distance=True, k=1 + min_neighbors), strict=False, - ) - ): - # Always search for k neighbors, this prevents strongly connected local areas - # a little, attracting the eigenfield - - d, j = e, k - k = j != i - d, j = d[k], j[k] - d **= 2 - d /= -2 * sigma**2 - graph[i, j] = d = np.exp(d) - graph[j, i] = d[:, np.newaxis] - - if not np.array_equal(graph, graph.T): - raise RuntimeError("graph matrix is not symetric.") - - return csgraph.laplacian(graph, normed=True) - - -def _laplacian(lapl: csgraph, n_eigenmodes: int = 5): - """ - Compute the laplacian of a graph L - - Parameters - ---------- - L : csgraph - sparse cs graph from scipy - n_eigenmodes : int - number of eigenmodes to compute - points : np.ndarray - coordinates of graph nodes (only for plotting) - - Returns - ------- - eigen_values : np.ndarray - eingenvalues of the graph - eigen_vecs : np.ndarray - eigenvectors of each graph vector (iNode x nEigenmodes) - """ - - n_nonzero_eigenvalues = 0 - n_eigenvalues = int(n_eigenmodes * 1.5) - - eigen_vals = np.empty((0,)) - eigen_vecs = np.empty((0, 0)) - - while n_nonzero_eigenvalues < n_eigenmodes: - eigen_vals, eigen_vecs = map(np.real, eigsh(lapl, n_eigenvalues, which="SA")) - - i_start = np.argmax(eigen_vals > 1e-7) - n_nonzero_eigenvalues = len(eigen_vals) - i_start - - if n_nonzero_eigenvalues >= n_eigenmodes: - eigen_vecs = eigen_vecs[:, i_start : i_start + n_eigenmodes] - eigen_vals = eigen_vals[i_start : i_start + n_eigenmodes] - - n_eigenvalues = int(n_eigenvalues * 1.5) - - return eigen_vals, eigen_vecs diff --git a/src/lasso/dimred/hashing.py b/src/lasso/dimred/hashing.py deleted file mode 100644 index a800455..0000000 --- a/src/lasso/dimred/hashing.py +++ /dev/null @@ -1,656 +0,0 @@ -import multiprocessing -import os -import time -from collections.abc import Sequence -from typing import Union - -import h5py -import numpy as np -from scipy import integrate -from sklearn.neighbors import KDTree - -from lasso.math.stochastic import jensen_shannon_entropy - - -def _match_modes( - hashes1: np.ndarray, - hashes2: np.ndarray, - eigenvectors_sub1: np.ndarray, - eigenvectors_sub2: np.ndarray, -): - """Match the eigenvalue modes - - Parameters - ---------- - hashes1 : np.ndarray - hashes of first model - hashes2 : np.ndarray - hashes of second model - eigenvectors_sub1 : np.ndarray - eigenvector field of first model - eigenvectors_sub2 : np.ndarray - eigenvector field of second model - - Returns - ------- - matches : list(tuple(int.int)) - indexes of the matched modes - """ - - matches = [] - mode1_hash_indexes = list(range(len(hashes1))) - mode2_hash_indexes = list(range(len(hashes2))) - - for i_hash in mode1_hash_indexes: - field1 = eigenvectors_sub1[:, i_hash] - - found_match = False - for j_entry, j_hash in enumerate(mode2_hash_indexes): - field2 = eigenvectors_sub2[:, j_hash] - - if is_mode_match(field1, field2): - matches.append((i_hash, j_hash)) - del mode2_hash_indexes[j_entry] - found_match = True - break - - if not found_match: - break - - return matches - - -def is_orientation_flip_required(eigenvectors1: np.ndarray, eigenvectors2: np.ndarray): - """Checks whether the eigenfields require to be flipped - - Parameters - ---------- - eigenvectors1 : np.ndarray - eigenvector_field of mesh1. - eigenvectors2 : np.ndarray - eigenvector_field of mesh2. - - Returns - ------- - flip_required : bool or list(bool) - whether a flip of the eigenvector field is required. - - Note - ---- - If the eigenvector field has multiple modes (e.g. shape n_nodes,n_modes) - then for every mode a flip value is returned - - The eigenmodes require switching if the dot product of the knn-eigenfields yield - a negative result. - """ - if eigenvectors1.shape != eigenvectors2.shape: - raise AssertionError( - f"shape mismatch detected. {eigenvectors1.shape} not equal to {eigenvectors2.shape}" - ) - - # one eigenmode only - if eigenvectors1.ndim == 1: - knn_error_basic = np.dot(eigenvectors1, eigenvectors2) - return knn_error_basic < 0 - - # multiple eigenmodes - n_modes = min(eigenvectors1.shape[1], eigenvectors2.shape[1]) - errors = [ - np.dot(eigenvectors1[:, i_mode], eigenvectors2[:, i_mode]) for i_mode in range(n_modes) - ] - - return np.array([err < 0 for err in errors]) - - -def _compute_mode_similarities( - hashes1: np.ndarray, - hashes2: np.ndarray, - eigenvectors_sub1: np.ndarray, - eigenvectors_sub2: np.ndarray, - matches: list[tuple[int, int]], -) -> list[float]: - """Compute the mode similarity between different meshes - - Parameters - ---------- - hashes1 : np.ndarray - hashes of first model - hashes2 : np.ndarray - hashes of second model - eigenvectors_sub1 : np.ndarray - eigenvector field of first model - eigenvectors_sub2 : np.ndarray - eigenvector field of second model - matches : list(tuple(int, int)) - matches of modes (every match will be computed) - - Returns - ------- - mode_similarities : list(float) - similarities of the matched modes - - Notes - ----- - This function cannot deal with unequal sampling of the input hashes. - """ - - mode_similarities = [] - for i_hash, j_hash in matches: - if hashes1.shape[2] != hashes2.shape[2]: - raise AssertionError( - f"Unequal number of columns. {hashes1.shape[2]} is not equal to {hashes2.shape[2]}" - ) - - field1 = eigenvectors_sub1[:, i_hash] - field2 = eigenvectors_sub2[:, j_hash] - - # flip orientation of eigenvector field and hash if required - if is_orientation_flip_required(field1, field2): - field2 *= -1 - # hdf5 can not handle negative slicing - mode_ = np.array(hashes2[j_hash, 1], copy=True) - mode_ = mode_[::-1] - else: - mode_ = hashes2[j_hash, 1, :] - - # Warning: x is usually originally hashes[i_mode, 0] - x = np.linspace(0, 1, hashes1.shape[2]) - norm1 = curve_normalizer(x, hashes1[i_hash, 1]) - norm2 = curve_normalizer(x, mode_) - if norm1 != 0 and norm2 != 0: - mode_similarities.append( - integrate.simps(hashes1[i_hash, 1] * mode_ / np.sqrt(norm1 * norm2), x=x) - ) - else: - mode_similarities.append(0) - - return mode_similarities - - -def _join_hash_comparison_thread_files( - comparison_filepath: str, thread_filepaths: Sequence[str], n_runs: int -): - # pylint: disable = too-many-locals - - if os.path.exists(comparison_filepath): - if os.path.isfile(comparison_filepath): - os.remove(comparison_filepath) - else: - raise OSError("Can not delete directory", comparison_filepath) - - with h5py.File(comparison_filepath, "w") as hdf5_file: - smatrix = hdf5_file.create_dataset( - "similarity_matrix", - shape=(n_runs, n_runs, 25), - maxshape=(n_runs, n_runs, None), - dtype="float64", - compression="gzip", - ) - ds_matches = hdf5_file.create_dataset( - "matches", - shape=(n_runs, n_runs, 25, 2), - maxshape=(n_runs, n_runs, None, 2), - dtype="int64", - compression="gzip", - ) - ds_weights = hdf5_file.create_dataset( - "weights", - shape=(n_runs, n_runs, 25), - maxshape=(n_runs, n_runs, None), - dtype="float64", - compression="gzip", - ) - - for thread_filepath in thread_filepaths: - # open thread file - with h5py.File(thread_filepath, "r") as thread_file: - # insert matrix entries - matrix_indexes = thread_file["matrix_indexes"] - matrix_similarities = thread_file["matrix_similarities"] - matrix_matches = thread_file["matrix_matches"] - thread_weights = thread_file["weights"] - - for (i_row, i_col), values, matches in zip( - matrix_indexes, matrix_similarities, matrix_matches, strict=False - ): - smatrix[i_row, i_col] = values - ds_matches[i_row, i_col] = matches - ds_weights[i_row, i_col] = (thread_weights[i_row] + thread_weights[i_col]) / 2 - - # delete thread file - os.remove(thread_filepath) - - -def run_hash_comparison( - comparison_filepath: str, - hashes_filepaths: list[str], - n_threads: int = 1, - print_progress: bool = False, -): - """Compare two hashes of a simulation run part - - Parameters - ---------- - comparison_filepath: str - filepath to the hdf5 in which the result of the comparison will be - stored - hashes_filepaths: List[str] - filepath to the stored hashes - n_threads: int - number of threads used for the comparison - print_progress: bool - whether to print the progress - """ - - # pylint: disable = too-many-locals, too-many-statements - - if n_threads <= 0: - raise ValueError("Number of threads cannot be negative or zero.") - - # fixed settings - hdf5_dataset_compression = "gzip" - - # ! this is an inlined function ! - # the actual function starts way much down - - def _threading_run_comparison(run_indices, comparison_filepath, comm_q): - # pylint: disable = too-many-statements - - n_comparisons_thread = len(run_indices) - - # setup storage file - if os.path.exists(comparison_filepath): - if os.path.isfile(comparison_filepath): - os.remove(comparison_filepath) - else: - raise OSError("Can not delete directory", comparison_filepath) - - hdf5_file = h5py.File(comparison_filepath, "w") - - max_len = np.max([len(entry) for entry in hashes_filepaths]) - hashes_filepaths_ascii = [entry.encode("ascii", "ignore") for entry in hashes_filepaths] - - hdf5_file.require_dataset( - "filepaths", - data=hashes_filepaths_ascii, - shape=(len(hashes_filepaths_ascii), 1), - dtype=f"S{max_len}", - ) - - n_modes_estimated = 25 - - # could be compressed to one per run only! - ds_weights = hdf5_file.create_dataset( - "weights", - (n_runs, n_modes_estimated), - maxshape=(n_runs, None), - dtype="float64", - compression=hdf5_dataset_compression, - ) - ds_matrix_indexes = hdf5_file.create_dataset( - "matrix_indexes", - (n_comparisons_thread, 2), - dtype="float64", - compression=hdf5_dataset_compression, - ) - ds_matrix_values = hdf5_file.create_dataset( - "matrix_similarities", - (n_comparisons_thread, n_modes_estimated), - maxshape=(n_comparisons_thread, None), - dtype="float64", - compression=hdf5_dataset_compression, - ) - - # info only! - ds_matrix_matches = hdf5_file.create_dataset( - "matrix_matches", - (n_comparisons_thread, n_modes_estimated, 2), - maxshape=(n_comparisons_thread, None, 2), - dtype="int64", - compression=hdf5_dataset_compression, - ) - - def _save_data(computed_results, counter): - start = counter + 1 - len(computed_results) - for i_result, result in enumerate(computed_results): - i_run, j_run = result["matrix_index"] - similarities = result["similarities"] - matches_tmp = result["matches"] - - ds_matrix_indexes[start + i_result, :] = i_run, j_run - ds_matrix_values[start + i_result, : len(similarities)] = similarities - ds_matrix_matches[start + i_result, : len(matches_tmp)] = matches_tmp - weights1 = result["weights1"] - n_weights1 = len(weights1) - ds_weights[i_run, :n_weights1] = weights1 - weights2 = result["weights2"] - n_weights2 = len(weights2) - ds_weights[j_run, :n_weights2] = weights2 - - computed_results.clear() - - # log - computation_times = [] - io_times = [] - - counter = None # bugfix - computed_results = [] - for counter, (i_run, j_run) in enumerate(run_indices): - start = time.time() - - # get data (io) - fp1 = h5py.File(hashes_filepaths[i_run], "r") - fp2 = h5py.File(hashes_filepaths[j_run], "r") - hashes1 = fp1["hashes"] - hashes2 = fp2["hashes"] - xyz1, xyz2 = fp1["subsample_xyz"], fp2["subsample_xyz"] - eigenvalues1, eigenvalues2 = fp1["eigenvalues"], fp2["eigenvalues"] - - # hdf5 can only handle increasing indexes ... thus we need to copy the field - eigenvectors_sub1 = np.array(fp1["eigenvectors"], copy=True) - eigenvectors_sub2 = np.array(fp2["eigenvectors"], copy=True) - - # time - io_times.append(time.time() - start) - start = time.time() - - # match points roughly in xyz - tree = KDTree(xyz1) - knn_indexes = tree.query(xyz2, return_distance=False, k=1) - eigenvectors_sub1 = np.squeeze(eigenvectors_sub1[knn_indexes]) - - # match modes - matches = _match_modes(hashes1, hashes2, eigenvectors_sub1, eigenvectors_sub2) - - # mode weights - weights1 = get_mode_weights_inv(eigenvalues1) - weights2 = get_mode_weights_inv(eigenvalues2) - - # compute mode similarity - mode_similarities = _compute_mode_similarities( - hashes1, hashes2, eigenvectors_sub1, eigenvectors_sub2, matches - ) - - # time - computation_times.append(time.time() - start) - - # assemble computations - computation_result = { - "matrix_index": [i_run, j_run], - "matches": matches, # info only - "similarities": mode_similarities, - "weights1": weights1.tolist(), - "weights2": weights2.tolist(), - } - computed_results.append(computation_result) - - # save to file occasionally - if counter % 500 == 0: - _save_data(computed_results, counter) - - # print status - if comm_q and not comm_q.full(): - comm_q.put( - { - "i_entry": counter + 1, - "n_entries": len(run_indices), - "io_time": np.mean(io_times), - "computation_time": np.mean(computation_times), - }, - False, - ) - - # dump at end (if anything was computed) - if counter: - _save_data(computed_results, counter) - - # <-- FUNCTION STARTS HERE - - # helper vars - n_runs = len(hashes_filepaths) - - # THREADS - if n_threads == 1: - matrix_entries = [] - for i_run in range(n_runs): - for j_run in range(i_run + 1, n_runs): - matrix_entries.append((i_run, j_run)) - _threading_run_comparison(matrix_entries, comparison_filepath, None) - else: - # enlist runs - thread_matrix_entries = [[] for i_thread in range(n_threads)] - i_thread = 0 - for i_run in range(n_runs): - for j_run in range(i_run + 1, n_runs): - thread_matrix_entries[i_thread % n_threads].append((i_run, j_run)) - i_thread += 1 - - # comm queues - queues = [multiprocessing.Queue(1) for i_thread in range(n_threads)] - - # run threads - thread_filepaths = [ - comparison_filepath + f"_thread{i_thread}" for i_thread in range(n_threads) - ] - threads = [ - multiprocessing.Process( - target=_threading_run_comparison, - args=(matrix_indexes, thread_filepaths[i_thread], queues[i_thread]), - ) - for i_thread, matrix_indexes in enumerate(thread_matrix_entries) - ] - for thread in threads: - thread.start() - - # logging - if print_progress: - thread_stats = [ - { - "i_entry": 0, - "n_entries": len(thread_matrix_entries[i_thread]), - "io_time": 0, - "computation_time": 0, - } - for i_thread in range(n_threads) - ] - - while any(thread.is_alive() for thread in threads): - # fetch data from channel - for i_thread, comm_q in enumerate(queues): - if not comm_q.empty(): - thread_stats[i_thread] = comm_q.get(False) - - # print msg - # pylint: disable = consider-using-f-string - thread_msg_list = [ - ( - f"Thread {i_thread}: " - f"{(100 * stats['i_entry'] / stats['n_entries']):.1f}% " - f"({stats['i_entry']}/{stats['n_entries']}) " - f"{stats['computation_time']:.2f}s | " - ) - for i_thread, stats in enumerate(thread_stats) - ] - msg = "| " + "".join(thread_msg_list) + "\r" - print(msg, end="") - time.sleep(0.35) - - # print completion message - thread_msg_list = [ - ( - f"Thread {i_thread}: " - f"{(100 * stats['i_entry'] / stats['n_entries']):.1f}% " - f"({stats['i_entry']}/{stats['n_entries']}) " - f"{stats['computation_time']:.2f}s | " - ) - for i_thread, stats in enumerate(thread_stats) - ] - msg = "| " + "".join(thread_msg_list) + "\r" - print(msg, end="") - - print("") - print("done.") - - # join thread worker files - for thread in threads: - thread.join() - _join_hash_comparison_thread_files(comparison_filepath, thread_filepaths, n_runs) - - -def is_mode_match( - eigenvectors1: np.ndarray, - eigenvectors2: np.ndarray, - knn_indexes: Union[np.ndarray, None] = None, -): - """Detect a mode match from the eigenvector field - - Parameters - ---------- - eigenvectors1 : np.ndarray - subsample eigenvector field from model 1 - eigenvectors2 : np.ndarray - subsample eigenvector field from model 2 - knn_indexes : np.ndarray - kdd_indexes obtained for matching xyz1 and xyz2 of the eigenvectorfields - so that only the coordinates of near points will be compared - - Returns - ------- - is_matched : bool - - Notes - ----- - A mode match is detected by watching the distribution - of the eigenvector field errors. In case of a mode switch - a correct orientation of the field is (obviously) not possible. - In such a case will the probability distribution of the - basic error and inverted error be quite similar, since both are wrong. - - A matching orientation (empirically) seems to have a normal - distribution like character. A non-matching orientation - is more like a uniform distribution (constantly wrong across - the entire model). - """ - - # pylint: disable = too-many-locals - - # if the jensen-shannon-divergence is below this value - # then a mode switch is assumed - distance_limit = 0.1 - - # number of bins for probability distribution - n_bins = 25 - - # (1) match sub-samples in xyz - # tree = KDTree(xyz1) - # indexes = tree.query(xyz2, return_distance=False, k=1) - - # (2) compute field errors of normal field and inverted field - if knn_indexes: - tmp1 = eigenvectors1[knn_indexes].flatten() - eigenvectors2 - tmp2 = eigenvectors1[knn_indexes].flatten() + eigenvectors2 - else: - tmp1 = eigenvectors1 - eigenvectors2 - tmp2 = eigenvectors1 + eigenvectors2 - - # (3) create a probability distribution for each error vector - - # bin the values - xmin = min(tmp1.min(), tmp2.min()) - xmax = max(tmp1.max(), tmp2.max()) - bins = np.linspace(xmin, xmax, n_bins) - indexes_p1 = np.digitize(tmp1, bins) - indexes_p2 = np.digitize(tmp2, bins) - p1 = np.bincount(indexes_p1) / len(tmp1) - p2 = np.bincount(indexes_p2) / len(tmp2) - - # align bin vector size - p1_tmp = np.zeros(max(len(p1), len(p2))) - p2_tmp = np.zeros(max(len(p1), len(p2))) - p1_tmp[: len(p1)] = p1 - p2_tmp[: len(p2)] = p2 - p1 = p1_tmp - p2 = p2_tmp - - # compute similarity - similarity_js = jensen_shannon_entropy(p1, p2) - - return similarity_js > distance_limit - - -def get_mode_weights_inv(vec: np.ndarray): - """Inverse value weights (higher decay than softmax)""" - val = 1.0 / (vec[:]) - return val / np.sum(val) - - -def curve_normalizer(x: np.ndarray, y: np.ndarray): - """Compute the curve normalizer for a curve dot product - - Parameters - ---------- - x : np.ndarray - array of x values - y : np.ndarray - array of y values - - Returns - ------- - norm : float - normalizing factor - """ - return integrate.simps(y**2, x=x) - - -def compute_hashes( - eig_vecs: np.ndarray, result_field: np.ndarray, n_points: int = 100, bandwidth: float = 0.05 -) -> list[tuple[np.ndarray, np.ndarray]]: - """Compute hashes for a result field - - Parameters - ---------- - eig_vecs : np.ndarray - eigenvector field of the component with (n_samples, n_modes) - result_field : np.ndarray - result field to hash - n_points : resolution of the hash - Number of equidistant points to use for smoothing. - Should be determined from the mesh size (2.5 times average elem size). - bandwidth : float - Bandwidth in percent of the kernel. - Recommended as 5 times global element size median. - - Returns - ------- - hash_functions : list(tuple(np.ndarray, np.ndarray)) - list of the computed hash functions. Every item is the hash for - an eigenmode. The hash consists of a pair of two functions: (x,y). - For comparison, only y is usually used. - """ - - if eig_vecs.shape[0] != len(result_field): - raise AssertionError( - f"Unequal number of rows detected. {eig_vecs.shape[0]} " - f"is not equal to {len(result_field)}" - ) - - # Note: needs to be vectorized to speed it up - - hash_functions = [] - for i_eigen in range(eig_vecs.shape[1]): - xmin = eig_vecs[:, i_eigen].min() - xmax = eig_vecs[:, i_eigen].max() - - x = np.linspace(xmin, xmax, n_points) - y = np.zeros(n_points) - - local_bandwidth = bandwidth * (xmax - xmin) - c = -0.5 / local_bandwidth**2 - - for ii, point in enumerate(x): - y[ii] = np.dot(result_field, np.exp(c * np.square(point - eig_vecs[:, i_eigen]))) - y /= np.sqrt(2 * np.pi) * bandwidth - - hash_functions.append((x, y)) - - return hash_functions diff --git a/src/lasso/dimred/hashing_sphere.py b/src/lasso/dimred/hashing_sphere.py deleted file mode 100644 index 0fd7582..0000000 --- a/src/lasso/dimred/hashing_sphere.py +++ /dev/null @@ -1,264 +0,0 @@ -import os -import warnings - -import h5py -import numpy as np - -# scipy is C-code which causes invalid linter warning about ConvexHull not -# being around. -# pylint: disable = no-name-in-module -from scipy.spatial import ConvexHull -from scipy.stats import binned_statistic_2d -from sklearn.preprocessing import normalize - - -warnings.simplefilter(action="ignore", category=FutureWarning) - - -def _create_sphere_mesh(diameter: np.ndarray) -> tuple[np.ndarray, np.ndarray]: - """Compute the alpha and beta increments for a - meshed sphere for binning the projected values - - Parameters - ---------- - diameter : np.ndarray - sphere diameter - - Returns - ------- - bin_alpha : np.ndarray - alpha bin boundaries - bin_beta : np.ndarray - beta bin boundaries - """ - - if diameter.dtype != np.float32: - raise TypeError("diameter array must be of type `np.float32`.") - - # partition latitude - n_alpha = 145 - - # sphere radius - r = diameter / 2 - - # sphere area - a_sphere = 4 * np.pi * r**2 - - # number of elements - n_ele = 144**2 - - # area of one element - a_ele = a_sphere / n_ele - - # bin values for alpha and the increment - bin_alpha, delt_alpha = np.linspace(0, 2 * np.pi, n_alpha, retstep=True) - - # for beta axis binning - count = np.linspace(0.0, 144.0, 145) - # compute required bin boundaries to ensure area of each element is the same - tmp = count * a_ele - tmp /= r**2 * delt_alpha - bin_beta = 1 - tmp - - # In case of trailing floats (-1.00000004 for example) - bin_beta[-1] = max(bin_beta[-1], -1) - - bin_beta = np.arccos(bin_beta) - - return bin_alpha, bin_beta - - -def _project_to_sphere( - points: np.ndarray, centroid: np.ndarray, axis: str = "Z" -) -> tuple[np.ndarray, np.ndarray]: - """compute the projection vectors of centroid to each point in terms of spherical coordinates - - Parameters - ---------- - points : np.ndarray - hashes of first model - centroid : np.ndarray - hashes of first model - AXIS : str - global axis position - - Returns - ------- - proj_alpha : np.ndarray - alpha angles of all points - proj_beta : np.ndarray - beta angle of all points - """ - # standard global axis - indexes = [0, 1, 2] - - # correct the indexes based on user input - if axis == "Z": - indexes = [0, 1, 2] # z axis aligned with global z-axis - elif axis == "Y": - indexes = [0, 2, 1] # z axis aligned with global y-axis - elif axis == "X": - indexes = [2, 1, 0] # z axis aligned with global x-axis - - # projection - vec = points - centroid - - # normalize - vec = normalize(vec, axis=1, norm="l2") - - # alpha based on sphere axis alignment - ang = np.arctan2(vec[:, indexes[1]], vec[:, indexes[0]]) - - # atan2 returns neg angles for values greater than 180 - neg_indexes = np.where(ang < 0) - ang[neg_indexes] += 2 * np.pi - - proj_alpha = ang - proj_beta = np.arccos(vec[:, indexes[2]]) - - return proj_alpha, proj_beta - - -def sphere_hashing( - bin_numbers: np.ndarray, bin_counts: np.ndarray, field: np.ndarray -) -> np.ndarray: - """Compute average field values for all the binned values - - Parameters - ---------- - bin_numbers : np.ndarray - bin numbers for the respective index for the x and y-axis - bin_counts : np.ndarray - number of points that fall into each bin - field : np.ndarray - a fields value (p_strain,velocity etc..) - - Returns - ------- - binned_field : np.ndarray - the averaged field values for each field - """ - # bin_numbers holds the bin_number for its respective index and must have - # same length as the number of points - if not len(bin_numbers[0] == len(field)): - raise AssertionError( - "bin_numbers holds the bin_number for its respective index and" - "must have same length as the number of points." - ) - # check data types - if not np.issubdtype(bin_numbers.dtype, np.integer): - raise TypeError(f"Expected int dtype got {bin_numbers.dtype}") - if not np.issubdtype(bin_counts.dtype, np.floating): - raise TypeError(f"Expected float dtype got {bin_counts.dtype}.") - - n_rows = bin_counts.shape[0] - n_cols = bin_counts.shape[1] - - # bin x and y indexes for each point in field - binx = np.asarray(bin_numbers[0]) - 1 - biny = np.asarray(bin_numbers[1]) - 1 - - # bincout for averaging - bin_count = np.zeros((n_rows, n_cols)) - - # averaged result to return - binned_field = np.zeros((n_rows, n_cols)) - - # bin the field values - binned_field[binx[:], biny[:]] += field[:] - # count - bin_count[binx[:], biny[:]] += 1 - - binned_field = binned_field.flatten() - bin_count = bin_count.flatten() - - # exclude all zero entries - nonzero_inds = np.where(bin_count != 0) - # average the fields - binned_field[nonzero_inds] /= bin_count[nonzero_inds] - - return binned_field - - -def compute_hashes( - source_path: str, target_path: str = None, n_files: int = None, ret_vals: bool = False -): - """Compute the hashes using spherical projection of the field values - - Parameters - ---------- - source_path : str - path to source directory from which the displacements/strains are - loaded, this directory should contain HDF5 files of the data - target_path : str (optional) - directory in which the hashes are to be written to - n_files : int (optional) - number of files to process, useful for verification and quick visualization - ret_vals : bool (optional) - return the hashes, setting this to true, be aware that the hash list can - take up a lot of ram - - Returns - ------- - hashes : np.ndarray - hashed field values - - Notes - ----- - Key for node_displacements for all timesteps: 'xyz' - Key for field values for all timesteps: 'fields' - """ - - # pylint: disable = too-many-locals - - node_displacement_key = "xyz" - fields_key = "fields" - file_name = "run_" - counter = 0 - - hashed_data = [] - # if n_files is none get total number of files in directory - if n_files is None: - n_files = len(os.listdir(source_path)) - - # load the displacements and compute the hashes for each run and consider - # the last time step only - for ii in range(n_files): - with h5py.File(source_path + file_name + str(ii) + ".h5", "r") as hf: - node_displacements = hf[node_displacement_key] - fields = hf[fields_key] - - xyz = node_displacements[:, 0, :] - - # centorid of point cloud - centroid = np.mean(xyz, axis=0) - - # convex hull of point cloud - hull = ConvexHull(xyz) - dist = np.linalg.norm(hull.max_bound - hull.min_bound) - - # compute the bin intervals for alpha and beta split into 144 elements - bins_a, bins_b = _create_sphere_mesh(dist) - - # compute the point projections - proj_alpha, proj_beta = _project_to_sphere(xyz, centroid, axis="Y") - - # bin the spherical coordinates in terms of alpha and beta - histo = binned_statistic_2d( - proj_alpha, proj_beta, None, "count", bins=[bins_a, bins_b], expand_binnumbers=True - ) - # get the field value - p_strains = fields[:, -1] - - # compute hashes - hashes = sphere_hashing(histo.binnumber, histo.statistic, p_strains) - - if target_path: - # write the hashes for each timestep to file - with h5py.File(target_path + "hashes_sphere_" + str(counter) + ".h5", "w") as hf: - hf.create_dataset("hashes", data=hashes) - - if ret_vals: - hashed_data.append(hashes) - - return np.asarray(hashed_data) diff --git a/src/lasso/dimred/run.py b/src/lasso/dimred/run.py deleted file mode 100644 index 3c1b225..0000000 --- a/src/lasso/dimred/run.py +++ /dev/null @@ -1,103 +0,0 @@ -from rich.console import Console -from rich.theme import Theme - -from lasso.dimred.dimred_run import ( - DIMRED_STAGES, - DimredRun, - DimredRunError, - DimredStage, - parse_dimred_args, -) - - -def main(): - """Runs the dimensionality reduction CLI""" - - # parse command line stuff - parser = parse_dimred_args() - log_theme = Theme({ - "info": "royal_blue1", - "success": "green", - "warning": "dark_orange3", - "error": "bold red", - }) - console = Console(theme=log_theme, record=True, highlight=False) - - try: - # parse settings from command line - dimred_run = DimredRun( - reference_run=parser.reference_run, - simulation_runs=parser.simulation_runs, - console=console, - exclude_runs=parser.exclude_runs, - project_dir=parser.project_dir, - html_name=parser.html_name, - html_set_timestamp=parser.html_timestamp, - img_path=parser.embedding_images, - logfile_filepath=parser.logfile_filepath, - n_processes=parser.n_processes, - part_id_filter=parser.part_ids, - start_stage=parser.start_stage, - end_stage=parser.end_stage, - timestep=parser.timestep, - cluster_args=parser.cluster_args, - outlier_args=parser.outlier_args, - ) - - # do the thing - console.print() - console.print(" ---- Running Routines ---- ") - console.print() - - # initiate threading pool for handling jobs - with dimred_run: - # setup - if ( - dimred_run.start_stage_index - <= DIMRED_STAGES.index(DimredStage.REFERENCE_RUN.value) - <= dimred_run.end_stage_index - ): - dimred_run.process_reference_run() - - # import - if ( - dimred_run.start_stage_index - <= DIMRED_STAGES.index(DimredStage.IMPORT_RUNS.value) - <= dimred_run.end_stage_index - ): - dimred_run.subsample_to_reference_run() - - # math - if ( - dimred_run.start_stage_index - <= DIMRED_STAGES.index(DimredStage.REDUCTION.value) - <= dimred_run.end_stage_index - ): - dimred_run.dimension_reduction_svd() - - # clustering - if ( - dimred_run.start_stage_index - <= DIMRED_STAGES.index(DimredStage.CLUSTERING.value) - <= dimred_run.end_stage_index - ): - dimred_run.clustering_results() - - # export - if ( - dimred_run.start_stage_index - <= DIMRED_STAGES.index(DimredStage.EXPORT_PLOT.value) - <= dimred_run.end_stage_index - ): - dimred_run.visualize_results() - - # print logfile - console.save_html(dimred_run.logfile_filepath) - - # Catch if DimredrunError was called - except DimredRunError as err: - print(err) - - -if __name__ == "__main__": - main() diff --git a/src/lasso/dimred/sphere/__init__.py b/src/lasso/dimred/sphere/__init__.py deleted file mode 100644 index acea405..0000000 --- a/src/lasso/dimred/sphere/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# from .algorithms import * diff --git a/src/lasso/dimred/sphere/algorithms.py b/src/lasso/dimred/sphere/algorithms.py deleted file mode 100644 index 5b8fb92..0000000 --- a/src/lasso/dimred/sphere/algorithms.py +++ /dev/null @@ -1,228 +0,0 @@ -import numpy as np - -# scipy is C-code which causes invalid linter warning about ConvexHull not -# being around. -# pylint: disable = no-name-in-module -from scipy.spatial import ConvexHull -from scipy.stats import binned_statistic_2d -from scipy.stats._binned_statistic import BinnedStatistic2dResult -from sklearn.preprocessing import normalize - - -def to_spherical_coordinates(points: np.ndarray, centroid: np.ndarray, axis: str = "Z"): - """Converts the points to spherical coordinates. - - Parameters - ---------- - points: np.ndarray - The point cloud to be sphered. - centroid: np.ndarray - Centroid of the point cloud. - axis: str - Sphere axis in the global coordinate system. - - Returns - ------- - az : np.ndarray - Azimuthal angle vector. - po: np.ndarray - Polar angle vector. - - Notes - ----- - The local x-axis is set as the zero marker for azimuthal angles. - """ - indexes = [0, 1, 2] - # set the correct indexes for swapping if the sphere - # axis is not aligned with the global z axis - if axis == "Y": - indexes = [0, 2, 1] # sphere z axis aligned with global y-axis - elif axis == "X": - indexes = [2, 1, 0] # sphere z axis aligned with global x-axis - - # vectors from centroid to points - vec = points - centroid - vec = normalize(vec, axis=1, norm="l2") - - # azimuthal angles on the local xy plane - # x-axis is the zero marker, and we correct - # all negative angles - az = np.arctan2(vec[:, indexes[1]], vec[:, indexes[0]]) - neg_indexes = np.where(az < 0) - az[neg_indexes] += 2 * np.pi - - # polar angles - po = np.arccos(vec[:, indexes[2]]) - - return az, po - - -def sphere_hashing(histo: BinnedStatistic2dResult, field: np.ndarray): - """Compute the hash of each bucket in the histogram by mapping - the bin numbers to the field values and scaling the field values - by the number of counts in each bin. - - Parameters - ---------- - histo: BinnedStatistic2dResult - 3D histogram containing the indexes of all points of a simulation - mapped to their projected bins. - field: ndarray - - Returns - ------- - hashes: np.ndarray - The hashing result of all points mapped to an embedding space. - - """ - bin_n = histo.binnumber - - if not len(bin_n[0] == len(field)): - raise AssertionError( - "bin_numbers holds the bin_number for its respective index and" - "must have same length as the number of points." - ) - - # get dims of the embedding space - n_rows = histo.statistic.shape[0] - n_cols = histo.statistic.shape[1] - - # bin stores the indexes of the points - # index 0 stores the azimuthal angles - # index 1 stores the polar angles - # we want zero indexing - binx = np.asarray(bin_n[0]) - 1 - biny = np.asarray(bin_n[1]) - 1 - - # allocate arrays - bin_count = np.zeros((n_rows, n_cols)) - hashes = np.zeros((n_rows, n_cols)) - - # sum all the field values to each bin - hashes[binx[:], biny[:]] += field[:] - bin_count[binx[:], biny[:]] += 1 - - hashes = hashes.flatten() - bin_count = bin_count.flatten() - - # exclude all zero entries - nonzero_inds = np.where(bin_count != 0) - - # average the fields - hashes[nonzero_inds] /= bin_count[nonzero_inds] - - return hashes - - -def create_sphere(diameter: float): - """Creates two vectors along the alpha and beta axis of a sphere. Alpha represents - the angle from the sphere axis to the equator. Beta between vectors from the - center of the sphere to one of the poles and the equator. - - Parameters - ---------- - diameter: - Diameter of the sphere. - - Returns - ------- - bin_beta: np.ndarray - Bin bounds for the beta angles. - - bin_alpha: np.ndarray - Bin bounds for the alpha angles. - - """ - # number of partitions for equator - n_alpha = 145 - # number of partitions for longitude - n_beta = 144 - - r = diameter / 2.0 - - # area of sphere - a_sphere = 4 * np.pi * r**2 - n_ele = n_beta**2 - a_ele = a_sphere / n_ele - - # alpha angles around the equator and the size of one step - bin_alpha, delt_alpha = np.linspace(0, 2 * np.pi, n_alpha, retstep=True) - - # bins for beta axis in terms of axis coorindates between -1 and 1 - count = np.linspace(0.0, float(n_beta), 145) - tmp = count * a_ele - tmp /= r**2 * delt_alpha - bin_beta = 1 - tmp - bin_beta[-1] = max(bin_beta[-1], -1) - - bin_beta = np.arccos(bin_beta) - return bin_alpha, bin_beta - - -def compute_similarity(embeddings: np.ndarray) -> np.ndarray: - """Computes the similarity of each embedding. - - Parameters - ---------- - embeddings: np.ndarray - Model embeddings. - - Returns - ------- - smatrix: np.ndarray - Similarity matrix. - """ - - n_runs = len(embeddings) - smatrix = np.empty((n_runs, n_runs), dtype=np.float32) - for ii in range(n_runs): - for jj in range(n_runs): - smatrix[ii, jj] = np.dot(embeddings[ii], embeddings[jj]) / np.sqrt( - np.dot(embeddings[ii], embeddings[ii]) * np.dot(embeddings[jj], embeddings[jj]) - ) - - return smatrix - - -def create_histogram( - cloud: np.ndarray, sphere_axis: str = "Z", planar: bool = False -) -> BinnedStatistic2dResult: - """Builds a histogram using the blocks of a sphered globe and returns a - binned statistics result for two dimensions. - - Parameters - ---------- - cloud: np.ndarray - Point cloud around which we create an embedding. - sphere_axis: str - Axis of the sphere. This is aligned with the global axis system. - planar: bool - Set to true for planar point clouds and false for higher dimensions. - - Returns - ------- - stats: BinnedStatistic2dResult - Returns a 2D histogram of the sphere with bin numbers and bin statistics. - """ - # casting to array because of typing - centroid = np.array(np.mean(cloud, axis=0)) - - qhull_options = "" - if planar: - qhull_options = "QJ" - - hull = ConvexHull(cloud, qhull_options=qhull_options) - - # we need to determine the largest distance in this point - # cloud, so we can give the sphere a dimension - # we can also create a sphere of random size but this could - # skew the results - dist = np.linalg.norm(hull.max_bound - hull.min_bound) - - bins_a, bins_b = create_sphere(dist) - - cloud_alpha, cloud_beta = to_spherical_coordinates(cloud, centroid, axis=sphere_axis) - - return binned_statistic_2d( - cloud_alpha, cloud_beta, None, "count", bins=[bins_a, bins_b], expand_binnumbers=True - ) diff --git a/src/lasso/dimred/svd/clustering_betas.py b/src/lasso/dimred/svd/clustering_betas.py deleted file mode 100644 index 22286ae..0000000 --- a/src/lasso/dimred/svd/clustering_betas.py +++ /dev/null @@ -1,711 +0,0 @@ -from collections.abc import Sequence -from typing import Union - -import numpy as np -from sklearn.cluster import DBSCAN, OPTICS, KMeans, SpectralClustering -from sklearn.ensemble import IsolationForest -from sklearn.neighbors import LocalOutlierFactor -from sklearn.svm import OneClassSVM - -from .keyword_types import ClusterType, DetectorType - - -def __apply_spectral_clustering(betas, runids, datasets, idsets, random_state=11, **kwargs): - """ - Method to group the input Betas. - Default keyword arguments: affinity='nearest_neighbors', random_state=11 - - Parameters - ---------- - betas: np.ndarray - Betas that shall be grouped into clusters - run_ids: np.ndarray - Ids matching to each Beta - datasets: list - List where each grouped Betas will be added - idsets: list - List where the grouped ids corresponding to the grouped Betas will be saved - **kwargs: keyword arguments - Keyword arguments specific for the SpectralClustering algorithm - - See Also - -------- - Detailed Documentation of the function parameters can be found on sklearn. - Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.SpectralClustering.html#sklearn.cluster.SpectralClustering - """ # noqa pylint: disable = line-too-long - clustering = SpectralClustering(random_state=random_state, **kwargs).fit(betas) - - indexes = clustering.labels_ - - clusters = np.unique(indexes) - - for clump in clusters: - clump_index = np.where(indexes == clump)[0] - clump_betas = betas[clump_index] - clump_runs = runids[clump_index] - datasets.append(clump_betas) - idsets.append(clump_runs.tolist()) - - -def __apply_k_means(betas, runids, datasets, idsets, random_state=11, **kwargs): - """ - Method to group the input Betas. - Recommended keyword arguments: n_clusters=3, random_state=11 - - Parameters - ---------- - betas: np.ndarray - Betas that shall be grouped into clusters - run_ids: np.ndarray - Ids matching to each Beta - datasets: list - List where each grouped Betas will be added - idsets: list - List where the grouped ids corresponding to the grouped Betas will be saved - **kwargs: keyword arguments - Keyword arguments specific for the KMeans algorithm - - See Also - -------- - Detailed Documentation of the function parameters can be found on sklearn. - Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn.cluster.KMeans - """ # noqa: E501 pylint: disable = line-too-long - kmeans = KMeans(random_state=random_state, **kwargs).fit(betas) - indexes = kmeans.labels_ - - clusters = np.unique(indexes) - - for clump in clusters: - clump_index = np.where(indexes == clump)[0] - clump_betas = betas[clump_index] - clump_runs = runids[clump_index] - datasets.append(clump_betas) - idsets.append(clump_runs.tolist()) - - -def __apply_dbscan(betas, runids, datasets, idsets, **kwargs): - """ - Method to group the input Betas. - Default keyword arguments: eps=0.08 - - Parameters - ---------- - betas: np.ndarray - Betas that shall be grouped into clusters - run_ids: np.ndarray - Ids matching to each Beta - datasets: list - List where each grouped Betas will be added - idsets: list - List where the grouped ids corresponding to the grouped Betas will be saved - **kwags: keyword arguments - Keyword arguments for the DBSCAN algorithm - - See Also - -------- - Detailed Documentation of the function parameters can be found on sklearn. - Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN.html#sklearn.cluster.DBSCAN - """ # noqa: E501 pylint: disable = line-too-long - deutsche_bahn = DBSCAN(**kwargs).fit(betas) - indexes = deutsche_bahn.labels_ - - clusters = np.unique(indexes) - - for clump in clusters: - clump_index = np.where(indexes == clump)[0] - clump_betas = betas[clump_index] - clump_runs = runids[clump_index] - datasets.append(clump_betas) - idsets.append(clump_runs.tolist()) - - -def __apply_optics(betas, runids, datasets, idsets, **kwargs): - """ - Method to group the input Betas. - Default keyword parameters: eps=0.05, min_cluster_size=10 - - Parameters - ---------- - betas: np.ndarray - Betas that shall be grouped into clusters - run_ids: np.ndarray - Ids matching to each Beta - datasets: list - List where each grouped Betas will be added - idsets: list - List where the grouped ids corresponding to the grouped Betas will be saved - **kwargs: keyword arguments - Keyword arguments specific to the OPTICS function. - - See Also - ------- - Detailed Documentation of the function parameters can be found on sklearn. - Link: https://scikit-learn.org/stable/modules/generated/sklearn.cluster.OPTICS.html#sklearn.cluster.OPTICS - """ # noqa: E501 pylint: disable = line-too-long - lense = OPTICS(**kwargs).fit(betas) - indexes = lense.labels_ - - clusters = np.unique(indexes) - - for clump in clusters: - clump_index = np.where(indexes == clump)[0] - clump_betas = betas[clump_index] - clump_runs = runids[clump_index] - datasets.append(clump_betas) - idsets.append(clump_runs.tolist()) - - -def __detect_outliers_isolation_forest( - betas, ids, beta_clusters, id_clusters, random_state=11, **kwargs -): - """ - Detects outliers based on the IsolationForest algorithm from sklearn. - Detected outliers will be appended into the provided lists - Default keyword parameters: random_state=12, behaviour="new", contamination=0.005 - - Parameters - ---------- - betas: np.ndarray - Numpy array containing the betas - ids: np.ndarray - Numpy array containing the ids of each beta - beta_clusters: list - List where each cluster of betas will be appended - id_clusters: list - List where each cluster of ids will be appended - **kwargs: keyword argument - Keywords specific to the IsolationForest algorithm - Returns - ------- - inlier_betas: np.array - Numpy array containing the betas that are not outliers - inlier_ids: np.array - Numpy array containing the ids of betas that are not outliers - - See Also - -------- - Detailed Documentation of the function parameters can be found on sklearn. - Link: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html - """ # noqa: E501 pylint: disable = line-too-long - outcasts = IsolationForest(random_state=random_state, **kwargs).fit(betas).predict(betas) - - outlier_key = np.where(outcasts == -1)[0] - inlier_key = np.where(outcasts == 1)[0] - beta_clusters.append(betas[outlier_key]) - id_clusters.append(ids[outlier_key].tolist()) - - return betas[inlier_key], ids[inlier_key] - - -def __detect_outliers_local_outlier_factor(betas, ids, beta_clusters, id_clusters, **kwargs): - """ - Detects outliers based on the LocalOutlierFactor algorithm from sklearn. - Detected outliers will be appended into the provided lists - Default keyword parameters: contamination=0.01 - - Parameters - ---------- - betas: np.ndarray - Numpy array containing the betas - ids: np.ndarray - Numpy array containing the ids of each beta - beta_clusters: list - List where each cluster of betas will be appended - id_clusters: list - List where each cluster of ids will be appended - **kwargs: keyword argument - Keywords specific to the LocalOutlierFactor algorithm. - Returns - ------- - inlier_betas: np.ndarray - Numpy array containing the betas that are not outliers - inlier_ids: np.ndarray - Numpy array containing the ids of betas that are not outliers - - See Also - -------- - Detailed Documentation of the function parameters can be found on sklearn. - Link:https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.LocalOutlierFactor.html#sklearn.neighbors.LocalOutlierFactor - """ # noqa pylint: disable = line-too-long - outcasts = LocalOutlierFactor(**kwargs).fit_predict(betas) - - outlier_key = np.where(outcasts == -1)[0] - inlier_key = np.where(outcasts == 1)[0] - beta_clusters.append(betas[outlier_key]) - id_clusters.append(ids[outlier_key].tolist()) - - return betas[inlier_key], ids[inlier_key] - - -def __detect_outliers_one_class_svm(betas, ids, beta_clusters, id_clusters, **kwargs): - """ - Detects outliers based on the OneClassSVM algorithm from sklearn. - Detected outliers will be appended into the provided lists - Default keyword arguments: gamma=0.1, nu=0.01 - - Parameters - ---------- - betas: np.ndarray - Numpy array containing the betas - ids: np.ndarray - Numpy array containing the ids of each beta - beta_clusters: list - List where each cluster of betas will be appended - id_clusters: list - List where each cluster of ids will be appended - **kwargs: keyword argument - Keywords specific to the OneClassSVM algorithm. - - Returns - ------- - inlier_betas: np.ndarray - Numpy array containing the betas that are not outliers - inlier_ids: np.ndarray - Numpy array containing the ids of betas that are not outliers - - See Also - -------- - Detailed Documentation of the function parameters can be found on sklearn. - Link: https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html#sklearn.svm.OneClassSVM - """ # noqa: E501 pylint: disable = line-too-long - - outcasts = OneClassSVM(**kwargs).fit_predict(betas) - - outlier_key = np.where(outcasts == -1)[0] - inlier_key = np.where(outcasts == 1)[0] - beta_clusters.append(betas[outlier_key]) - id_clusters.append(ids[outlier_key].tolist()) - - return betas[inlier_key], ids[inlier_key] - - -def __experimental_outlier_detector(betas, ids, **kwargs): - """ - Detects outliers by applying LocalOutlierFactor algorithm from sklearn over multiple slices of betas . - Detected outliers will be appended into the provided lists - Default keyword arguments: contamination=0.01 - Parameters - ---------- - betas: np.ndarray - Numpy array containing the betas - ids: np.ndarray - Numpy array containing the ids of each beta - **kwargs: keyword argument - Keywords specific to the LocalOutlierFactor algorithm - Returns - ------- - outliers: np.array - Numpy array containing the sample names identified as outliers - outlier_index: np.array - Array containing the indexes of outliers - inlier_index: np.array - Array of booleans to get inlier(not outliers) betas and IDs - - See Also - -------- - Detailed Documentation of the function parameters can be found on sklearn. - Link:https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.LocalOutlierFactor.html#sklearn.neighbors.LocalOutlierFactor - """ # noqa pylint: disable = line-too-long - - # pylint: disable = too-many-locals - - loops = betas.shape[1] - 2 - alertlist = [] - for dadoop in range(loops): - slicer = dadoop + 3 - beta_slice = betas[:, dadoop:slicer] - - sanitizer = LocalOutlierFactor(**kwargs).fit_predict(beta_slice) - outlier_key = np.where(sanitizer == -1)[0] - alertlist.append(outlier_key) - - suspects = np.concatenate(alertlist) - individuals = np.unique(suspects) - crimecounter = np.array([np.where(suspects == tracked)[0].shape[0] for tracked in individuals]) - - the_cases = np.where(crimecounter > 2)[0] - the_judged = ids[individuals[the_cases]] - - innocents = np.full(ids.shape, True) - - if the_judged.shape != (0,): - judged_index = np.array([np.where(ids == convict)[0] for convict in the_judged])[:, 0] - - innocents[judged_index] = False - else: - return False - - return the_judged, judged_index, innocents - - -def __rescale_betas(betas): - """ - utility function to rescale betas into the range of [0, 1]. - Expects only positive betas - - Parameters - ---------- - betas: np.ndarray - Numpy array containing the betas to be scaled. Expects betas of shape (samples, nr_betas) - - Returns - ------- - betas_scaled: np.ndarray - Betas scaled to range [0, 1] - maxb: np.ndarray - Array to rescale betas back to original values - """ - if len(betas.shape) != 2: - raise TypeError("only 2D arrays are supported.") - ref_betas = np.abs(betas) - maxb = np.array([np.max(ref_betas[:, i]) for i in range(betas.shape[1])]) - # return np.array([(betas[:, i]/maxb[i]) for i in range(betas.shape[1])]).T - return betas / (maxb.T), maxb.T - - -def list_detectors_and_cluster(): - """ - Prints out all keywords for outlier detection and clustering functions - - See Also - -------- - list_detectors_and_cluster(keyword)""" - - print("Implemented Detectors:") - for entry in __detector_dict: - print(" " + entry) - print("Implemented Clustering Functions") - for entry in __cluster_dict: - print(" " + entry) - - -def document_algorithm(keyword): - """ - prints out the docstring of the function related to the input keyword - - Parameters - ---------- - keyword: str - String keyword referencing the outlier detection or clustering function - - See Also - -------- - list_detectors_and_cluster() - """ - print(__doc_dict[keyword]) - - -__doc_dict = { - DetectorType.IsolationForest: __detect_outliers_isolation_forest.__doc__, - DetectorType.OneClassSVM: __detect_outliers_one_class_svm.__doc__, - DetectorType.LocalOutlierFactor: __detect_outliers_local_outlier_factor.__doc__, - # DetectorType.Experimental: __experimental_outlier_detector.__doc__, - ClusterType.OPTICS: __apply_optics.__doc__, - ClusterType.DBSCAN: __apply_dbscan.__doc__, - ClusterType.KMeans: __apply_k_means.__doc__, - ClusterType.SpectralClustering: __apply_spectral_clustering.__doc__, -} - -__detector_dict = { - DetectorType.IsolationForest: __detect_outliers_isolation_forest, - DetectorType.OneClassSVM: __detect_outliers_one_class_svm, - DetectorType.LocalOutlierFactor: __detect_outliers_local_outlier_factor, - # DetectorType.Experimental: __experimental_outlier_detector -} -__cluster_dict = { - ClusterType.OPTICS: __apply_optics, - ClusterType.DBSCAN: __apply_dbscan, - ClusterType.KMeans: __apply_k_means, - ClusterType.SpectralClustering: __apply_spectral_clustering, -} - - -def create_cluster_arg_dict(args: Sequence[str]) -> Union[tuple[str, dict], str]: - """Determines which cluster to use and creates a python dictionary to use as cluster_params - - Parameters - ---------- - args: Sequence[str] - List of strings containing parameters and arguments - - Returns - ------- - cluster_type: str - determines which cluster algorithm to use - cluster_arg_dict: dict - dictionary containing arguments and values for specific cluster_type - err_msg: str - message containing error, mostly unrecognised keywords""" - - # first argument must be cluster type - cluster_key = args[0].lower() - cluster_arg_dict = {} - cluster_type = None - param_type = [] - - # all following arguments are a parameter, followed by their respective value - parameters = [] - values = [] - if len(args) % 3 == 0: - # check if amount of parameters is valid - err_msg = ( - "Invalid cluster arguments, first argument must be the chosen clustering algorithm," - " and each optional subsequent parameter must be followed by its type and value" - ) - return err_msg - if len(args) > 1: - # check if we even have parameters - parameters = args[1:-2:3] - param_type = args[2:-1:3] - values = args[3::3] - - for cluster_option in ClusterType.get_cluster_type_name(): - if cluster_key == cluster_option.lower(): - cluster_type = cluster_option - - if not cluster_type: - err_msg = ( - f"No existing clustering method matching {args[0]}" - f"possible clustering methods are: {str(ClusterType.get_cluster_type_name())[1:-1]}" - ) - return err_msg - - for ind, param in enumerate(parameters): - p_t = param_type[ind] - v_type = None - if p_t == "str": - v_type = str - elif p_t == "float": - v_type = float - elif p_t == "int": - v_type = int - else: - err_msg = f"Clustering: Invalid type identifier {p_t}" - return err_msg - - try: - val = v_type(values[ind]) - except ValueError: - err_msg = ( - f"Clustering: Invalid value {values[ind]} for parameter {param} of type {v_type}" - ) - return err_msg - cluster_arg_dict[param] = val - - return cluster_type, cluster_arg_dict - - -def create_detector_arg_dict(args: Sequence[str]) -> Union[tuple[str, dict], str]: - """Determines which detector to use and creates a python dictionary to use as detector_params - - Parameters - ---------- - args: Sequence[str] - List of strings containing parameters and arguments - - Returns - ------- - detector_type: str - determines which cluster algorithm to use - detector_arg_dict: dict - dictionary containing arguments and values for specific cluster_type - err_mgs: str - message containing error, mostly unrecognised keywords""" - - # first argument must be detector type: - detector_key = args[0].lower() - detector_arg_dict = {} - detector_type = None - param_type = [] - - # all following arguments are a parameter, followed by their respective value - parameters = [] - values = [] - if len(args) % 3 == 0: - # check if amount of parameters is valid - err_msg = ( - "Invalid outlier detector arguments, first argument must be " - "the chosen detector algorithm, and each optional subsequent " - "parameter must be followed by its type and value" - ) - return err_msg - if len(args) > 1: - # check if we even have parameters - parameters = args[1:-2:3] - param_type = args[2:-1:3] - values = args[3::3] - - for detector_option in DetectorType.get_detector_type_name(): - if detector_key == detector_option.lower(): - detector_type = detector_option - - if not detector_type: - err_msg = ( - f"No existing outlier detection method matching {args[0]} " - f"possible outlier detection methods are: " - f"{str(DetectorType.get_detector_type_name())[1:-1]}" - ) - return err_msg - - for ind, param in enumerate(parameters): - p_t = param_type[ind] - v_type = None - if p_t == "str": - v_type = str - elif p_t == "float": - v_type = float - elif p_t == "int": - v_type = int - else: - err_msg = f"Outlier Detection: Invalid type identifier {p_t}" - return err_msg - - try: - val = v_type(values[ind]) - except ValueError: - err_msg = ( - f"Outlier Detection: Invalid value {values[ind]} " - "for parameter {param} of type {v_type}" - ) - return err_msg - detector_arg_dict[param] = val - - return detector_type, detector_arg_dict - - -def group_betas( - beta_index, - betas, - scale_betas=False, - cluster=None, - detector=None, - cluster_params=None, - detector_params=None, -) -> Union[tuple[list, list], str]: - """ - Base function to to group betas into groups, detect outliers. Provides that all different - clustering and outlier detection algorithms are implemented in an easy to access environment. - To select different clustering and outlier detection algoyrthms, please use appropriate - KeywordTypes. A description of each function can be accessed with document_algorithm(keyword) - A list of all functions can be accessed with list_detectors_and_clusters() - - Parameters - ---------- - beta_index: np.ndarray - Array containing the file names specific to the betas with the same index in the beta array - betas: np.ndarray - Numpy array containing the betas. - Betas are expected to be of shape (samples, timestep, 3) - The three entries per beta can either be dimensions (x,y,z) or any three betas/eigenvalues - cluster: str, optional, default : "KMeans". - String specifying which clustering algorithm shall be applied. - Use ClusterTypefor easier access - detector: str, optional, default: None. - String specifying which outlier detection algorithm shall be applied. - Use DetectorType for easier access - cluster_params: dict, optional - Dictionary containing parameters for the clustering algorithms. - See the sklearn documentation for the function to learn more. - detector_params: dict, optional - Dictionary containing parameters for the outlier detection algorithms. - See the sklearn documentation for the function to learn more - - Returns - ------- - beta_clusters: list - List containing Numpy Arrays of betas in one cluster. - If a detector was selected, or the clustering algorithm has its - own outlier detection, the first entry in the list will be oultier betas - id_clusters: list - List containing lists of beta ids. Each id corresponds to the beta in - the same place in the beta_clusters list - err_msg: str - Error message if wrong keywords for detector or cluster algorithms were used - - Notes - -------- - document_algorithm: - Prints docstring of each function into console - list_detectors_and_clusters: - Prints out all detection and clustering algorithms into console - Sklearn Userguide chapter 2.3 Clustering: - https://scikit-learn.org/stable/modules/clustering.html - Detailed overview of different clustering algorithms - Sklearn Examples outlier detection: - https://scikit-learn.org/stable/auto_examples/plot_anomaly_comparison.html - Example of different used outlier detection algorithms - """ - - # pylint: disable = too-many-arguments, too-many-locals, too-many-branches - - if cluster_params is None: - cluster_params = {} - - if detector_params is None: - detector_params = {} - - beta_clusters = [] - id_clusters = [] - - if scale_betas: - betas, _ = __rescale_betas(betas) - - if detector == "Experimental": - experimental_results = __detector_dict[detector](betas, beta_index, **detector_params) - if not isinstance(experimental_results, bool): - outlier_betas, outlier_index, inlier_index = experimental_results - beta_clusters.append(betas[outlier_index]) - id_clusters.append(outlier_betas.tolist()) - betas = betas[inlier_index] - beta_index = beta_index[inlier_index] - else: - empty_list = [] - beta_clusters.append(empty_list) - id_clusters.append(empty_list) - - detector = None - - if detector is not None: - try: - betas_det, index_det = __detector_dict[detector]( - betas, beta_index, beta_clusters, id_clusters, **detector_params - ) - - except TypeError as key_err: - err_msg = ( - f"During Outlier Detection, a TypeError came up:\n{str(key_err)}\n" - "Please check your outlier detection arguments" - ) - return err_msg - - except ValueError as val_err: - err_msg = ( - f"During Outlier Detection, a ValueError came up:\n{str(val_err)}\n" - "Please check your outlier detection arguments" - ) - return err_msg - else: - betas_det, index_det = betas, beta_index - - if cluster is not None: - try: - __cluster_dict[cluster]( - betas_det, index_det, beta_clusters, id_clusters, **cluster_params - ) - except TypeError as key_err: - err_msg = ( - f"During Clustering, a TypeError came up:\n{str(key_err)}\n" - "Please check your outlier detection arguments" - ) - return err_msg - - except ValueError as val_err: - err_msg = ( - f"During Clustering, a ValueError came up:\n{str(val_err)}\n" - "Please check your outlier detection arguments" - ) - return err_msg - else: - beta_clusters, id_clusters = [*beta_clusters, betas_det], [*id_clusters, index_det] - - return beta_clusters, id_clusters diff --git a/src/lasso/dimred/svd/html_str_eles.py b/src/lasso/dimred/svd/html_str_eles.py deleted file mode 100644 index 00dc666..0000000 --- a/src/lasso/dimred/svd/html_str_eles.py +++ /dev/null @@ -1,818 +0,0 @@ -OVERHEAD_STRING = """ - - 3D Beta Embedding - - - - - -
    - × - - - - - - - -
    - Options - - -""" # noqa: E501 - -TRACE_STRING = """ - {_traceNr_} = - {{ - name: '{_name_}', - color: '{_color_}', - border: '#555555', - text: {_runIDs_}, - x: {_x_}, - y: {_y_}, - z: {_z_}, - vertices: [] - }}, -""" - -CONST_STRING = """ - {_three_min_} - - - -""" # noqa: E501 diff --git a/src/lasso/dimred/svd/keyword_types.py b/src/lasso/dimred/svd/keyword_types.py deleted file mode 100644 index ffaaccf..0000000 --- a/src/lasso/dimred/svd/keyword_types.py +++ /dev/null @@ -1,57 +0,0 @@ -class ClusterType: - """Specifies names of specific clustering algorithms - - Attributes - ---------- - OPTICS: str - OPTICS - DBSCAN: str - DBSCAN - KMeans: str - KMeans - SpectralClustering: str - SpectralClustering - """ - - OPTICS = "OPTICS" - DBSCAN = "DBSCAN" - KMeans = "KMeans" - SpectralClustering = "SpectralClustering" - - @staticmethod - def get_cluster_type_name() -> list[str]: - """Get the name of the clustering algorithms""" - return [ - ClusterType.OPTICS, - ClusterType.DBSCAN, - ClusterType.KMeans, - ClusterType.SpectralClustering, - ] - - -class DetectorType: - """Specifies names of different outlier detector algorithms - - Attributes - ---------- - IsolationForest: str - IsolationForest - OneClassSVM: str - OneClassSVM - LocalOutlierFactor: str - LocalOutlierFactor - """ - - IsolationForest = "IsolationForest" - OneClassSVM = "OneClassSVM" - LocalOutlierFactor = "LocalOutlierFactor" - # Experimental = "Experimental" - - @staticmethod - def get_detector_type_name() -> list[str]: - """Get the name of the detector algorithms""" - return [ - DetectorType.IsolationForest, - DetectorType.OneClassSVM, - DetectorType.LocalOutlierFactor, - ] diff --git a/src/lasso/dimred/svd/plot_beta_clusters.py b/src/lasso/dimred/svd/plot_beta_clusters.py deleted file mode 100644 index 1638378..0000000 --- a/src/lasso/dimred/svd/plot_beta_clusters.py +++ /dev/null @@ -1,175 +0,0 @@ -import os -import re -import time -import webbrowser -from collections.abc import Sequence -from typing import Union - -import numpy as np - -from lasso.dimred.svd.html_str_eles import ( - CONST_STRING, - OVERHEAD_STRING, - SCRIPT_STRING, - TRACE_STRING, -) -from lasso.plotting.plot_shell_mesh import _read_file - - -def timestamp() -> str: - """ - Creates a timestamp string of format yymmdd_hhmmss_ - """ - - def add_zero(in_str) -> str: - if len(in_str) == 1: - return "0" + in_str - return in_str - - year, month, day, hour, minute, second, _, _, _ = time.localtime() - y_str = str(year)[2:] - mo_str = add_zero(str(month)) - d_str = add_zero(str(day)) - h_str = add_zero(str(hour)) - mi_str = add_zero(str(minute)) - s_str = add_zero(str(second)) - t_str = y_str + mo_str + d_str + "_" + h_str + mi_str + s_str + "_" - return t_str - - -# pylint: disable = inconsistent-return-statements -def plot_clusters_js( - beta_cluster: Sequence, - id_cluster: Union[np.ndarray, Sequence], - save_path: str, - img_path: Union[None, str] = None, - mark_outliers: bool = False, - mark_timestamp: bool = True, - filename: str = "3d_beta_plot", - write: bool = True, - show_res: bool = True, -) -> Union[None, str]: - """ - Creates a .html visualization of input data - - Parameters - ---------- - beta_cluster: np.ndarray - Numpy array containing beta clusters - id_cluster: Union[np.ndarray, Sequence] - Numpy array or sequence containing the ids samples in clusters. - Must be of same structure as beta_clusters - save_path: str - Where to save the .html visualization - img_path: Union[None, str], default: None - Path to images of samples - mark_outliers: bool, default: False - Set to True if first entry in beta_cluster are outliers - mark_timestamp: bool, default: True - Set to True if name of visualization shall contain time of creation. - If set to False, visualization will override previous file - filename: str, default "3d_beta_plot" - Name of .html file - write: bool, default: True - Set to False to not write .html file and return as string instead - show_res: bool, default: True - Set to False to not open resulting page in webbrowser - - Returns - ------- - html_str_formatted: str - If **write=False** returns .html file as string, else None - """ - - # pylint: disable = too-many-arguments, too-many-locals - - if not isinstance(img_path, str): - img_path = "" - - colorlist = [ - "#1f77b4", - "#ff7f0e", - "#2ca02c", - "#d62728", - "#9467bd", - "#8c564b", - "#e377c2", - "#7f7f7f", - "#bcbd22", - "#17becf", - ] - tracelist = [] - - # rescaling betas to better fit in viz - scale_multiplier = 300 - max_val = ( - max(*[max(np.max(cluster), abs(np.min(cluster))) for cluster in beta_cluster]) - if len(beta_cluster) > 1 - else max(np.max(beta_cluster[0]), abs(np.min(beta_cluster[0]))) - ) - - beta_cluster = [cluster / max_val * scale_multiplier for cluster in beta_cluster] - - id_nr = [] - for group in id_cluster: - id_group = [] - for entry in group: - nr = re.findall(r"\d+", entry)[0] - id_group.append(nr) - id_nr.append(id_group) - - # pylint: disable = consider-using-f-string - _three_min_ = ''.format( - _read_file( - os.path.join( - # move path to "~/lasso/" - os.path.split(os.path.split(os.path.dirname(__file__))[0])[0], - "plotting/resources/three_latest.min.js", - ) - ) - ) - - html_str_formatted = OVERHEAD_STRING + CONST_STRING.format( - _three_min_=_three_min_, _path_str_=img_path, _runIdEntries_=id_nr - ) - for index, cluster in enumerate(beta_cluster): - name = "Error, my bad" - color = "pink" - if (index == 0) and mark_outliers: - name = "outliers" - color = "black" - else: - name = f"cluster {index}" - color = colorlist[(index - 1) % 10] - formatted_trace = TRACE_STRING.format( - _traceNr_=f"trace{index}", - _name_=name, - _color_=color, - _runIDs_=id_cluster[index].tolist(), - _x_=np.around(cluster[:, 0], decimals=5).tolist(), - _y_=np.around(cluster[:, 1], decimals=5).tolist(), - _z_=np.around(cluster[:, 2], decimals=5).tolist(), - ) - tracelist.append(f"trace{index}") - html_str_formatted += formatted_trace - trace_list_string = " traceList = [" - for trace in tracelist: - trace_list_string += trace + ", " - trace_list_string += "]" - html_str_formatted += trace_list_string - html_str_formatted += SCRIPT_STRING - - if write: - os.makedirs(save_path, exist_ok=True) - - # Timestamp for differentiating different viz / not override previous viz - stamp = timestamp() if mark_timestamp else "" - - output_filepath = os.path.join(save_path, stamp + filename + ".html") - with open(output_filepath, "w", encoding="utf-8") as f: - f.write(html_str_formatted) - if show_res: - webbrowser.open("file://" + os.path.realpath(output_filepath)) - else: - # only needed for testcases - return html_str_formatted diff --git a/src/lasso/dimred/svd/plotly_latest.min.js b/src/lasso/dimred/svd/plotly_latest.min.js deleted file mode 100644 index 759dc1c..0000000 --- a/src/lasso/dimred/svd/plotly_latest.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/** -* plotly.js v1.33.0 -* Copyright 2012-2018, Plotly, Inc. -* All rights reserved. -* Licensed under the MIT license -*/ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return i(r||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;oMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],40:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=i(),f=a(),h=o();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new n({turntable:u,orbit:f,matrix:h},c)};var i=t("turntable-camera-controller"),a=t("orbit-camera-controller"),o=t("matrix-camera-controller"),s=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+u;if((r=a-u-f[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)(r=(e=t[n]).y+e.dy+u-a)>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(h).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(f[1]-(t.length-1)*u)/e.sum(t,s)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),d.forEach(function(e){e.dy=e.value*t})}(),n();for(var l=1;t>0;--t)!function(t){function r(t){return o(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,s);n.y+=(i-o(n))*t}})})}(l*=.99),n(),function(t){function r(t){return o(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,s);n.y+=(i-o(n))*t}})})}(l),n()}function a(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}h.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),h.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function o(t){return t.y+t.dy/2}function s(t){return t.value}var l={},c=24,u=8,f=[1,1],h=[],d=[];return l.nodeWidth=function(t){return arguments.length?(c=+t,l):c},l.nodePadding=function(t){return arguments.length?(u=+t,l):u},l.nodes=function(t){return arguments.length?(h=t,l):h},l.links=function(t){return arguments.length?(d=t,l):d},l.size=function(t){return arguments.length?(f=t,l):f},l.layout=function(r){return h.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),d.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=h[t.source]),"number"==typeof n&&(n=t.target=h[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),h.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,s),e.sum(t.targetLinks,s))}),t(),i(r),a(),l},l.relayout=function(){return a(),l},l.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,f=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+f+"C"+s+","+f+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},l},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":120,"d3-collection":121,"d3-interpolate":125}],42:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":165,"gl-vao":259,"weak-map":573}],43:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=t[o]),t[o]>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3])),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t.str2RgbaArray=function(t,n){var i,a;if("string"!=typeof t)return t;if(i=[],"#"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),a=parseInt(t,16),i[0]=a>>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3]),a[4]?i[3]=parseFloat(a[4]):i[3]=1),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t}()},{}],51:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!h(t[o],e[o],r,n))return!1;return!0}(t,e,r,s))}return r?t===e:t==e}function d(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function p(t,e,r){h(t,e,!0)&&u(t,e,r,"notDeepStrictEqual",p)}function m(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function g(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&u(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&v.isError(i),s=!t&&i&&!r;if((o&&a&&m(i,r)||s)&&u(i,r,"Got unwanted exception"+n),t&&i&&r&&!m(i,r)||!t&&i)throw i}var v=t("util/"),y=Object.prototype.hasOwnProperty,x=Array.prototype.slice,b="foo"===function(){}.name,_=e.exports=f,w=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return l(c(t.actual),128)+" "+t.operator+" "+l(c(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=u,_.ok=f,_.equal=function(t,e,r){t!=e&&u(t,e,r,"==",_.equal)},_.notEqual=function(t,e,r){t==e&&u(t,e,r,"!=",_.notEqual)},_.deepEqual=function(t,e,r){h(t,e,!1)||u(t,e,r,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,e,r){h(t,e,!0)||u(t,e,r,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,e,r){h(t,e,!1)&&u(t,e,r,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=p,_.strictEqual=function(t,e,r){t!==e&&u(t,e,r,"===",_.strictEqual)},_.notStrictEqual=function(t,e,r){t===e&&u(t,e,r,"!==",_.notStrictEqual)},_.throws=function(t,e,r){g(!0,t,e,r)},_.doesNotThrow=function(t,e,r){g(!1,t,e,r)},_.ifError=function(t){if(t)throw t};var M=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":563}],52:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],53:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(f):f<0&&(u=u.ushln(-f)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":56,"./is-rat":58,"./lib/is-bn":62,"./lib/num-to-bn":63,"./lib/rationalize":64,"./lib/str-to-bn":65}],58:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":62}],59:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":73}],60:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},{"bit-twiddle":71,"double-bits":131}],62:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":73}],63:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":73,"double-bits":131}],64:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},{"./bn-sign":59,"./num-to-bn":63}],65:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":73}],66:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":64}],67:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":59}],68:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":64}],69:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(h=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":60,"./lib/ctz":61}],70:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],71:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],72:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s){for(var l=0;l=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}function c(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function f(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function h(){f.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){f.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){f.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){f.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function v(t){g.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var y;try{y=t("buffer").Buffer}catch(t){}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,l=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],b=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?x[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=b[t],u=_[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modn(u).toString(t);r=(f=f.idivn(u)).isZero()?h+r:x[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==y),this.toArrayLike(y,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,d=0|o[1],p=8191&d,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],D=8191&z,I=z>>>13,P=0|o[8],O=8191&P,F=P>>>13,R=0|o[9],N=8191&R,j=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(F,U)|0,a=Math.imul(F,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(F,H)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,X))+Math.imul(j,W)|0,a=Math.imul(j,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,K)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,K))+Math.imul(j,J)|0,a=Math.imul(j,K),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(F,rt)|0,a=a+Math.imul(F,nt)|0,n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(F,at)|0,a=a+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,at),i=(i=Math.imul(N,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(F,lt)|0,a=a+Math.imul(F,ct)|0,n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(I,ft)|0,a=a+Math.imul(I,ht)|0;var zt=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(N,lt),i=(i=Math.imul(N,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(F,ft)|0,a=a+Math.imul(F,ht)|0;var Dt=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var It=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(F,pt)|0))<<13)|0;c=((a=a+Math.imul(F,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Pt=(c+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=Dt,l[17]=It,l[18]=Pt,0!==c&&(l[19]=c,r.length++),r};Math.imul||(w=l),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},u.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e)},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,f=1;0==(r.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var h;return(h=0===e.cmpn(1)?i:o).cmpn(0)<0&&h.iadd(t),h},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new g(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var M={k256:null,p224:null,p192:null,p25519:null};f.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},f.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},f.prototype.split=function(t,e){t.iushrn(this.n,0,e)},f.prototype.imulK=function(t){return t.imul(this.k)},i(h,f),h.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},h.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(M[t])return M[t];var e;if("k256"===t)e=new h;else if("p224"===t)e=new d;else if("p192"===t)e=new p;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new m}return M[t]=e,e},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new v(t)},i(v,g),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},v.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},v.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],74:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var f,h=l.mallocDouble(2*s*a),d=l.mallocInt32(a);if((a=i(t,s,h,d))>0){if(1===s&&n)c.init(a),f=c.sweepComplete(s,r,0,a,h,d,0,a,h,d);else{var p=l.mallocDouble(2*s*o),m=l.mallocInt32(o);(o=i(e,s,p,m))>0&&(c.init(a+o),f=1===s?c.sweepBipartite(s,r,0,a,h,d,0,o,p,m):u(s,r,n,a,h,d,o,p,m),l.free(p),l.free(m))}l.free(h),l.free(d)}return f}}}function o(t,e){s.push([t,e])}e.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return s=[],a(t,t,o,!0),s}(t);case 2:return"function"==typeof e?a(t,t,e,!0):function(t,e){return s=[],a(t,e,o,!1),s}(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var s,l=t("typedarray-pool"),c=t("./lib/sweep"),u=t("./lib/intersect")},{"./lib/intersect":77,"./lib/sweep":81,"typedarray-pool":554}],76:[function(t,e,r){"use strict";function n(t){function e(e,r){var s=function(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),s=["function ",n,"(",_.join(),"){","var ",l,"=2*",i,";"],w="for(var i="+c+","+d+"="+l+"*"+c+";i<"+u+";++i,"+d+"+="+l+"){var x0="+f+"["+a+"+"+d+"],x1="+f+"["+a+"+"+d+"+"+i+"],xi="+h+"[i];",M="for(var j="+p+","+y+"="+l+"*"+p+";j<"+m+";++j,"+y+"+="+l+"){var y0="+g+"["+a+"+"+y+"],"+(r?"y1="+g+"["+a+"+"+y+"+"+i+"],":"")+"yi="+v+"[j];";return t?s.push(w,b,":",M):s.push(M,b,":",w),r?s.push("if(y1"+m+"-"+p+"){"),t?(e(!0,!1),M.push("}else{"),e(!1,!1)):(M.push("if("+s+"){"),e(!0,!0),M.push("}else{"),e(!0,!1),M.push("}}else{if("+s+"){"),e(!1,!0),M.push("}else{"),e(!1,!1),M.push("}")),M.push("}}return "+r);var k=n.join("")+M.join("");return new Function(k)()}var i="d",a="ax",o="vv",s="fp",l="es",c="rs",u="re",f="rb",h="ri",d="rp",p="bs",m="be",g="bb",v="bi",y="bp",x="rv",b="Q",_=[i,a,o,c,u,f,h,p,m,g,v];r.partial=n(!1),r.full=n(!0)},{}],77:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){var c=M*t;A[c]=e,A[c+1]=r,A[c+2]=n,A[c+3]=i,A[c+4]=a,A[c+5]=o;var u=k*t;T[u]=s,T[u+1]=l}function i(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,m=i*f;p0;){var P=(D-=1)*M,O=A[P],F=A[P+1],R=A[P+2],N=A[P+3],j=A[P+4],B=A[P+5],U=D*k,V=T[U],q=T[U+1],H=1&B,G=!!(16&B),Y=d,W=S,X=L,Z=C;if(H&&(Y=L,W=C,X=d,Z=S),!(2&B&&(R=x(t,O,F,R,Y,W,q),F>=R)||4&B&&(F=b(t,O,F,R,Y,W,V))>=R)){var J=R-F,K=j-N;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),y=d("lo===p0",["p0"]),x=d("lor&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p>>1,h=2*t,d=f,p=s[h*f+e];c=x?(d=y,p=x):v>=_?(d=g,p=v):(d=b,p=_):x>=_?(d=y,p=x):_>=v?(d=g,p=v):(d=b,p=_);for(var w=h*(u-1),M=h*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],80:[function(t,e,r){"use strict";function n(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>1,g=m-h,v=m+h,y=d,x=g,b=m,_=v,w=p,M=t+1,k=e-1,A=0;l(y,x,r)&&(A=y,y=x,x=A),l(_,w,r)&&(A=_,_=w,w=A),l(y,b,r)&&(A=y,y=b,b=A),l(x,b,r)&&(A=x,x=b,b=A),l(y,_,r)&&(A=y,y=_,_=A),l(b,_,r)&&(A=b,b=_,_=A),l(x,w,r)&&(A=x,x=w,w=A),l(x,b,r)&&(A=x,x=b,b=A),l(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*x],S=r[2*x+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*b,D=2*w,I=2*d,P=2*m,O=2*p,F=0;F<2;++F){var R=r[C+F],N=r[z+F],j=r[D+F];r[I+F]=R,r[P+F]=N,r[O+F]=j}a(g,t,r),a(v,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&i(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(o(B,M,k,r),++M,--k):(i(B,k,r),--k);break}if(--k>>1;s(m,S);var E=0,L=0;for(M=0;M=l)n(f,h,L--,C=C-l|0);else if(C>=0)n(c,u,E--,C);else if(C<=-l){C=-C-l|0;for(var z=0;z>>1;s(m,E);var L=0,C=0,z=0;for(k=0;k>1==m[2*k+3]>>1&&(I=2,k+=1),D<0){for(var P=-(D>>1)-1,O=0;O>1)-1,0===I?n(c,u,L--,P):1===I?n(f,h,C--,P):2===I&&n(d,p,z--,P)}},scanBipartite:function(t,e,r,a,o,f,h,d,p,g,v,y){var x=0,b=2*t,_=e,w=e+t,M=1,k=1;a?k=l:M=l;for(var A=o;A>>1;s(m,L);var C=0;for(A=0;A=l?(D=!a,T-=l):(D=!!a,T-=1),D)i(c,u,C++,T);else{var I=y[T],P=b*T,O=v[P+e+1],F=v[P+e+1+t];t:for(var R=0;R>>1;s(m,M);var k=0;for(x=0;x=l)c[k++]=b-l;else{var T=d[b-=1],S=g*b,E=h[S+e+1],L=h[S+e+1+t];t:for(var C=0;C=0;--C)if(c[C]===b){for(P=C+1;PP)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?function(t,e,r){if(e<0||t.byteLength=P)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P.toString(16)+" bytes");return 0|t}function u(t,e){if(i.isBuffer(t))return t.length;if(C(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function f(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,z(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:p(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,c,u,f;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(f=(15&a)<<12|(63&l)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(f=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function k(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function A(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),I.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),I.write(t,e,r,n,52,8),r+8}function S(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function E(t){return D.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function z(t){return t!=t}var D=t("base64-js"),I=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var P=2147483647;r.kMaxLength=P,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){M(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,!n){M(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var n,a=[],o=e;o0?u-4:u;var f=0;for(e=0,r=0;e>16&255,c[f++]=a>>8&255,c[f++]=255&a;return 2===o?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,c[f++]=255&a):1===o&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,c[f++]=a>>8&255,c[f++]=255&a),c},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",s=[],l=0,c=r-n;lc?c:l+16383));return 1===n?(e=t[r-1],i+=o[e>>2],i+=o[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=o[e>>10],i+=o[e>>4&63],i+=o[e<<2&63],i+="="),s.push(i),s.join("")};for(var o=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=c.length;u0;){for(var d=r.pop(),p=(u=-1,f=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),n(t,e,r,u,s,f),n(t,e,r,s,f,u),n(t,e,r,f,d,u),n(t,e,r,d,u,f))}}},{"binary-search-bounds":89,"robust-in-sphere":513}],86:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}var a=t("binary-search-bounds");e.exports=function(t,e,r){var a=function(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var p=0;p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var v=function(t,e,r){for(var n=0,i=0;i1&&h(r[u[d-2]],r[u[d-1]],n)>0;)t.push([u[d-1],u[d-2],i]),d-=1;u.length=d,u.push(i);var p=c.upperIds;for(d=p.length;d>1&&h(r[p[d-2]],r[p[d-1]],n)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var r;return(r=t.a[0]v[0]&&l.push(new i(v,g,m,f),new i(g,v,p,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),x=[new n([y,1],[y,0],-1,[],[],[],[])],b=[],_=(f=0,l.length);f<_;++f){var w=l[f],M=w.type;M===d?s(b,x,t,w.a,w.idx):M===m?c(x,0,w):u(x,0,w)}return b}},{"binary-search-bounds":89,"robust-orientation":515}],88:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],90:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],94:[function(t,e,r){"use strict";function n(t){var e=m(t);return[v(e,-1/0),v(e,1/0)]}function i(t){for(var e=new Array(t.length),r=0;re[2]?1:0)}function l(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[o=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=b;b=_,_=k}x[0]=b;var A,T=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===o;){var S,E=(S=n[--a])[1];i?e.push([T,E,A]):e.push([T,E]),T=E}i?e.push([T,_,A]):e.push([T,_])}return s}(t,e,o,c,r));return l(e,u,r),!!u||(o.length>0||c.length>0)}e.exports=function(t,e,r){var n;if(r){n=e;for(var o=new Array(e.length),s=0;s>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:93}],98:[function(t,e,r){"use strict";e.exports={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],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],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],rebeccapurple:[102,51,153],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]}},{}],99:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:93,"color-rgba":101,dtype:133}],100:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1);c=1,(h=u.length)<=4?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1];s=u=f.replace(/a$/,"");var h="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===u&&l.push(1),c=void 0===l[h]?1:l[h],l=l.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":98,defined:129,"is-plain-obj":286}],101:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?(e=Array(3),e[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:93,"color-parse":100,"color-space/hsl":102}],102:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return a=255*l,[a,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":103}],103:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],104:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],105:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,c,u,f,h,d,p,m,g,v,y,x=[],b=[],_=[],w=[];if(a.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!s[h])throw Error(h+" not a supported colorscale");f=o(s[h])}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);f=o(h)}if(f.length>p)throw new Error(h+" map requires nshades to be at least size "+f.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:o(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=f.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y=0}e.exports=function(t,e,r,o){var s=i(e,r,o);if(0===s){var l=a(i(t,e,r)),c=a(i(t,e,o));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,o)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,o)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:a(c-l)}var f=i(t,e,r);return f>0?s>0&&i(t,e,o)>0?1:-1:f<0?s>0||i(t,e,o)>0?1:-1:i(t,e,o)>0?1:n(t,e,r)?1:-1};var i=t("robust-orientation"),a=t("signum"),o=t("two-sum"),s=t("robust-product"),l=t("robust-sum")},{"robust-orientation":515,"robust-product":516,"robust-sum":520,signum:522,"two-sum":553}],107:[function(t,e,r){function n(t,e){return t-e}e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]);return i(l,t[2])-i(c,e[2])||i(l+t[2],o)-i(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+d-(p+m+g+v)||i(u,f,h,d)-i(p,m,g,v,p)||i(u+f,u+h,u+d,f+h,f+d,h+d)-i(p+m,p+g,p+v,m+g,m+v,g+v)||i(u+f+h,u+f+d,u+h+d,f+h+d)-i(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),x=e.slice().sort(n),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],111:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":45,"incremental-convex-hull":278}],113:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],114:[function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r;return(r=parseInt(e.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var u=e.substr(0,i),f=e.substr(i+1,l-(i+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=o(f[1]),m=o(f[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),h];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],115:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],116:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":118}],117:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(l=0;l0&&v.push("var "+y.join(",")),l=0;l3&&v.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&v.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var A=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",A,"(",g.join(","),"){",v.join("\n"),"} return ",A].join(""))()}},{uniq:556}],118:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u=0?(a>=b?10:a>=_?5:a>=w?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=b?10:a>=_?5:a>=w?2:1)}function n(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=b?i*=10:a>=_?i*=5:a>=w&&(i*=2),ee?1:t>=e?0:NaN},o=function(t){return 1===t.length&&(t=function(t){return function(e,r){return a(t(e),r)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},s=o(a),l=s.right,c=s.left,u=function(t){return null===t?NaN:+t},f=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},h=function(t,e){var r=f(t,e);return r?Math.sqrt(r):r},d=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},A=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},T=function(t){if(!(a=t.length))return[];for(var e=-1,r=A(t,i),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=h,t.extent=d,t.histogram=function(){function t(t){var a,o,s=t.length,c=new Array(s);for(a=0;ah;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)(m=g[a]=[]).x0=a>0?d[a-1]:f,m.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=A,t.pairs=function(t,r){null==r&&(r=e);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l=u.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,c,f,h=-1,d=e.length,p=u[n++],m=r(),g=i();++hu.length)return t;var n,i=f[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],f=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return f[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},t.set=l,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],122:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=E.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=L.exec(t))?i(parseInt(e[1],16)):(e=C.exec(t))?new l(e[1],e[2],e[3],1):(e=z.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=D.exec(t))?a(e[1],e[2],e[3],e[4]):(e=I.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=P.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=O.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,r,n)}function u(t,e,i,a){return 1===arguments.length?function(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;var e=(t=t.rgb()).r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new f(l,c,u,t.opacity)}(t):new f(t,e,i,null==a?1:a)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function h(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function d(t){if(t instanceof m)return new m(t.l,t.a,t.b,t.opacity);if(t instanceof _){var e=t.h*R;return new m(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/j),s=g((.2126729*r+.7151522*n+.072175*i)/B);return new m(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/U)),t.opacity)}function p(t,e,r,n){return 1===arguments.length?d(t):new m(t,e,r,null==n?1:n)}function m(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>G?Math.pow(t,1/3):t/H+V}function v(t){return t>q?t*t*t:H*(t-V)}function y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function b(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof _)return new _(t.h,t.c,t.l,t.opacity);t instanceof m||(t=d(t));var e=Math.atan2(t.b,t.a)*N;return new _(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function w(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,s=(X*(r-i)-Y*a)/W,c=Math.sqrt(s*s+a*a)/(X*i*(1-i)),u=c?Math.atan2(s,a)*N-120:NaN;return new M(u<0?u+360:u,c,i,t.opacity)}(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var k=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},A="\\s*([+-]?\\d+)\\s*",T="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E=/^#([0-9a-f]{3})$/,L=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[A,A,A]+"\\)$"),z=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),D=new RegExp("^rgba\\("+[A,A,A,T]+"\\)$"),I=new RegExp("^rgba\\("+[S,S,S,T]+"\\)$"),P=new RegExp("^hsl\\("+[T,S,S]+"\\)$"),O=new RegExp("^hsla\\("+[T,S,S,T]+"\\)$"),F={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};k(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),k(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),k(f,u,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(h(t>=240?t-240:t+120,i,n),h(t,i,n),h(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var R=Math.PI/180,N=180/Math.PI,j=.95047,B=1,U=1.08883,V=4/29,q=6/29,H=3*q*q,G=q*q*q;k(m,p,e(r,{brighter:function(t){return new m(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new m(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=B*v(t),e=j*v(e),r=U*v(r),new l(y(3.2404542*e-1.5371385*t-.4985314*r),y(-.969266*e+1.8760108*t+.041556*r),y(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),k(_,b,e(r,{brighter:function(t){return new _(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}));var Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=1.78277*X,K=1.78277*Y- -.14861*W;k(M,w,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*R,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(-.14861*n+1.78277*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=u,t.lab=p,t.hcl=b,t.cubehelix=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],123:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",i),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;ad+s||np+s||if.index){var l=d-a.x-a.vx,u=p-a.y-a.vy,v=l*l+u*u;vt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e=m)){(t.data!==o||t.next)&&(0===i&&(i=h(),u+=i*i),0===a&&(a=h(),u+=a*a),u1?(null==e?g.remove(t):g.set(t,s(e)),l):g.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,r=0,o=n.length;r180||r<-180?r-360*Math.round(r/360):r):x(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?o:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):x(isNaN(e)?r:e)}}function o(t,e){var r=e-t;return r?n(t,r):x(isNaN(t)?e:t)}function s(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:A(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:A(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:A(t,r)},{i:s-2,x:A(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:A(r,n)})),a=E.lastIndex;return a=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}function r(t){return t[0]}function n(t){return t[1]}function i(t,e,i){var o=new a(null==e?r:e,null==i?n:i,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function a(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function o(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var s=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},l=i.prototype=a.prototype;l.copy=function(){var t,e,r=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=o(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=o(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,r){var n,i,a,o,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new s(g,f,h,d,p)),null==r?r=1/0:(f=t-r,h=e-r,d=t+r,p=e+r,r*=r);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(a=c.y0)>p||(o=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(p+g)/2))?p=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--f}function o(){g=(m=y.now())+v,f=h=0;try{a()}finally{f=0,function(){var t,e,r=c,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);u=t,l(n)}(),g=0}}function s(){var t=y.now(),e=t-m;e>p&&(v-=e,m=t)}function l(t){if(!f){h&&(h=clearTimeout(h));var e=t-g;e>24?(t<1/0&&(h=setTimeout(o,e)),d&&(d=clearInterval(d))):(d||(m=g,d=setInterval(s,p)),f=1,x(o))}}var c,u,f=0,h=0,d=0,p=1e3,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,x="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||u===this||(u?u._next=this:c=this,u=this),this._call=t,this._time=n,l()},stop:function(){this._call&&(this._call=null,this._time=1/0,l())}};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},t.interval=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],128:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function s(t){return t.length}function l(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function u(t){return(t+="")===ua||t[0]===fa?fa+t:t}function f(t){return(t+="")[0]===fa?t.slice(1):t}function h(t){return u(t)in this._}function d(t){return(t=u(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(f(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ha.length;r0&&(t=t.slice(0,a));var s=wa.get(t);return s&&(t=s,o=G),a?e?function(){var a=o(e,ea(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}:n:e?b:function(){var e,r=new RegExp("^__on([^.]+)"+$i.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}}function H(t,e){return function(r){var n=$i.event;$i.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{$i.event=n}}}function G(t,e){var r=H(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}function Y(e){var n=".dragsuppress-"+ ++ka,i="click"+n,a=$i.select(r(e)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==Ma&&(Ma=!("onselectstart"in e)&&x(e.style,"userSelect")),Ma){var o=t(e).style,s=o[Ma];o[Ma]="none"}return function(t){if(a.on(n,null),Ma&&(o[Ma]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Aa<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=$i.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Aa=!(o.f||o.e),n.remove()}}return Aa?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function X(){return $i.event.changedTouches[0].identifier}function Z(t){return t>0?1:t<0?-1:0}function J(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function K(t){return t>1?0:t<-1?Ea:Math.acos(t)}function Q(t){return t>1?za:t<-1?-za:Math.asin(t)}function $(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return(t=Math.sin(t/2))*t}function et(){}function rt(t,e,r){return this instanceof rt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof rt?new rt(t.h,t.s,t.l):gt(""+t,vt,rt):new rt(t,e,r)}function nt(t,e,r){function n(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(a-i)*t/60:t<180?a:t<240?i+(a-i)*(240-t)/60:i}(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,a=r<=.5?r*(1+e):r+e-r*e,i=2*r-a,new ht(n(t+120),n(t),n(t-120))}function it(t,e,r){return this instanceof it?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof it?new it(t.h,t.c,t.l):lt(t instanceof ot?t.l:(t=yt((t=$i.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new it(t,e,r)}function at(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ot(r,Math.cos(t*=Da)*e,Math.sin(t)*e)}function ot(t,e,r){return this instanceof ot?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ot?new ot(t.l,t.a,t.b):t instanceof it?at(t.h,t.c,t.l):yt((t=ht(t)).r,t.g,t.b):new ot(t,e,r)}function st(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=ct(i)*Ua,n=ct(n)*Va,a=ct(a)*qa,new ht(ft(3.2404542*i-1.5371385*n-.4985314*a),ft(-.969266*i+1.8760108*n+.041556*a),ft(.0556434*i-.2040259*n+1.0572252*a))}function lt(t,e,r){return t>0?new it(Math.atan2(r,e)*Ia,Math.sqrt(e*e+r*r),t):new it(NaN,NaN,t)}function ct(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ut(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ft(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ht(t,e,r){return this instanceof ht?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ht?new ht(t.r,t.g,t.b):gt(""+t,ht,nt):new ht(t,e,r)}function dt(t){return new ht(t>>16,t>>8&255,255&t)}function pt(t){return dt(t)+""}function mt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function gt(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(bt(i[0]),bt(i[1]),bt(i[2]))}return(a=Ya.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function vt(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new rt(n,i,l)}function yt(t,e,r){var n=ut((.4124564*(t=xt(t))+.3575761*(e=xt(e))+.1804375*(r=xt(r)))/Ua),i=ut((.2126729*t+.7151522*e+.072175*r)/Va);return ot(116*i-16,500*(n-i),200*(i-ut((.0193339*t+.119192*e+.9503041*r)/qa)))}function xt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function _t(t){return"function"==typeof t?t:function(){return t}}function wt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Mt(e,r,t,n)}}function Mt(t,e,r,n){function i(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=$i.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=$i.event;$i.event=t;try{o.progress.call(a,l)}finally{$i.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ea(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},$i.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}function kt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return Xa?Xa.n=i:Wa=i,Xa=i,Za||(Ja=clearTimeout(Ja),Za=1,Ka(At)),i}function At(){var t=Tt(),e=St()-t;e>24?(isFinite(e)&&(clearTimeout(Ja),Ja=setTimeout(At,e)),Za=0):(Za=1,Ka(At))}function Tt(){for(var t=Date.now(),e=Wa;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function St(){for(var t,e=Wa,r=1/0;e;)e.c?(e.t1?Date.UTC.apply(this,arguments):arguments[0])}function Ct(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3)}(+n[0]),r+n[0].length):-1}function Bt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ut(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Vt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function qt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function Ht(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Gt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Yt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Wt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Xt(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=ca(e)/60|0,i=ca(e)%60;return r+Dt(n,"0",2)+Dt(i,"0",2)}function Zt(t,e,r){oo.lastIndex=0;var n=oo.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jt(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,f=i*l+u*Math.cos(s),h=u*o*Math.sin(s);ho.add(Math.atan2(h,f)),n=t,i=l,a=c}var e,r,n,i,a;po.point=function(o,s){po.point=t,n=(e=o)*Da,i=Math.cos(s=(r=s)*Da/2+Ea/4),a=Math.sin(s)},po.lineEnd=function(){t(e,r)}}function ne(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function oe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function se(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function le(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ce(t){return[Math.atan2(t[1],t[0]),Q(t[2])]}function ue(t,e){return ca(t[0]-e[0])=0;--s)i.point((f=u[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function xe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(we))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=$i.merge(d);var t=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;ho.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>Ea,A=p*x;if(ho.add(Math.atan2(A*w*Math.sin(M),m*b+A*Math.cos(M))),a+=k?_+w*La:_,k^h>=r^v>=r){var T=ae(ne(f),ne(t));le(T);var S=ae(i,T);le(S);var E=(k^_>=0?-1:1)*Q(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;h=v,p=x,m=b,f=t}}return(a<-Ta||a1}function Me(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:b,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ke(t,e){return((t=t.x)[0]<0?t[1]-za-Ta:za-t[1])-((e=e.x)[0]<0?e[1]-za-Ta:za-e[1])}function Ae(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,d=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>u&&(u=a)}else if(d>0){if(a0&&(i.a={x:l+u*h,y:c+u*d}),f<1&&(i.b={x:l+f*h,y:c+f*d}),i}}}}}}function Te(t,e,r,n){function i(n,i){return ca(n[0]-t)0?0:3:ca(n[0]-r)0?2:1:ca(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(a,s,l,c){var u=0,f=0;if(null==a||(u=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==f);else c.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function u(t,e){c(t,e)&&s.point(t,e)}function f(t,e){var r=c(t=Math.max(-Eo,Math.min(Eo,t)),e=Math.max(-Eo,Math.min(Eo,e)));if(d&&p.push([t,e]),_)m=t,g=e,v=r,_=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&b)s.point(t,e);else{var n={a:{x:y,y:x},b:{x:t,y:e}};A(n)?(b||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),w=!1):r&&(s.lineStart(),s.point(t,e),w=!1)}y=t,x=e,b=r}var h,d,p,m,g,v,y,x,b,_,w,M=s,k=Me(),A=Ae(t,e,r,n),T={point:u,lineStart:function(){T.point=f,d&&d.push(p=[]),_=!0,b=!1,y=x=NaN},lineEnd:function(){h&&(f(m,g),v&&b&&k.rejoin(),h.push(k.buffer())),T.point=u,b&&s.lineEnd()},polygonStart:function(){s=k,h=[],d=[],w=!0},polygonEnd:function(){s=M,h=$i.merge(h);var e=function(t){for(var e=0,r=d.length,n=t[1],i=0;in&&J(c,a,t)>0&&++e:a[1]<=n&&J(c,a,t)<0&&--e,c=a;return 0!==e}([t,n]),r=w&&e,i=h.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&ye(h,a,e,l,s),s.polygonEnd()),h=d=p=null}};return T}}function Se(t){var e=0,r=Ea/3,n=je(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Ea/180,r=t[1]*Ea/180):[e/Ea*180,r/Ea*180]},i}function Ee(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,Q((a-(t*t+r*r)*i*i)/(2*i))]},r}function Le(){function t(t,e){Co+=i*t-n*e,n=t,i=e}var e,r,n,i;Oo.point=function(a,o){Oo.point=t,e=n=a,r=i=o},Oo.lineEnd=function(){t(e,r)}}function Ce(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ze(t,e){vo+=t,yo+=e,++xo}function De(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);bo+=o*(e+t)/2,_o+=o*(r+n)/2,wo+=o,ze(e=t,r=n)}var e,r;Ro.point=function(n,i){Ro.point=t,ze(e=n,r=i)}}function Ie(){Ro.point=ze}function Pe(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);bo+=o*(n+t)/2,_o+=o*(i+e)/2,wo+=o,Mo+=(o=i*t-n*e)*(n+t),ko+=o*(i+e),Ao+=3*o,ze(n=t,i=e)}var e,r,n,i;Ro.point=function(a,o){Ro.point=t,ze(e=n=a,r=i=o)},Ro.lineEnd=function(){t(e,r)}}function Oe(t){function e(e){return(a?function(e){function n(r,n){r=t(r,n),e.point(r[0],r[1])}function i(){y=NaN,M.point=o,e.lineStart()}function o(n,i){var o=ne([n,i]),s=t(n,i);r(y,x,v,b,_,w,y=s[0],x=s[1],v=n,b=o[0],_=o[1],w=o[2],a,e),e.point(y,x)}function s(){M.point=n,e.lineEnd()}function l(){i(),M.point=c,M.lineEnd=u}function c(t,e){o(f=t,e),h=y,d=x,p=b,m=_,g=w,M.point=o}function u(){r(y,x,v,b,_,w,h,d,f,p,m,g,a,e),M.lineEnd=s,s()}var f,h,d,p,m,g,v,y,x,b,_,w,M={point:n,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),M.lineStart=l},polygonEnd:function(){e.polygonEnd(),M.lineStart=i}};return M}:function(e){return Re(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function r(e,a,o,s,l,c,u,f,h,d,p,m,g,v){var y=u-e,x=f-a,b=y*y+x*x;if(b>4*n&&g--){var _=s+d,w=l+p,M=c+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=ca(ca(M)-1)n||ca((y*C+x*z)/b-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(n)},e}function Fe(t){this.stream=t}function Re(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ne(t){return je(function(){return t})()}function je(t){function e(t){return t=o(t[0]*Da,t[1]*Da),[t[0]*f+s,l-t[1]*f]}function r(){o=ge(a=qe(g,v,x),i);var t=i(p,m);return s=h-t[0]*f,l=d+t[1]*f,n()}function n(){return c&&(c.valid=!1,c=null),e}var i,a,o,s,l,c,u=Oe(function(t,e){return t=i(t,e),[t[0]*f+s,l-t[1]*f]}),f=150,h=480,d=250,p=0,m=0,g=0,v=0,x=0,b=So,_=y,w=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=Be(b(a,u(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(b=null==t?(w=t,So):function(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t,e,r){var n=[1,0,0],a=ae(ne(t),ne(e)),o=ie(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=i*o/l,u=-i*s/l,f=ae(n,a),h=se(n,c);oe(h,se(a,u));var d=f,p=ie(h,d),m=ie(d,d),g=p*p-m*(ie(h,h)-1);if(!(g<0)){var v=Math.sqrt(g),y=se(d,(-p-v)/m);if(oe(y,h),y=ce(y),!r)return y;var x,b=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(ca(y[0]-b)Ea^(b<=y[0]&&y[0]<=_)){var T=se(d,(-p+v)/m);return oe(T,h),[y,ce(T)]}}}function n(e,r){var n=a?t:Ea-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var i=Math.cos(t),a=i>0,o=ca(i)>Ta;return _e(e,function(t){var i,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=e(f,h),g=a?m?0:n(f,h):m?n(f+(f<0?Ea:-Ea),h):0;if(!i&&(c=l=m)&&t.lineStart(),m!==l&&(d=r(i,p),(ue(i,d)||ue(p,d))&&(p[0]+=Ta,p[1]+=Ta,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=r(p,i),t.point(d[0],d[1])):(d=r(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(o&&i&&a^m){var v;g&s||!(v=r(p,i,!0))||(u=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||i&&ue(i,p)||t.point(p[0],p[1]),i=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},We(t,6*Da),a?[0,-t]:[-Ea,t-Ea])}((w=+t)*Da),n()):w},e.clipExtent=function(t){return arguments.length?(M=t,_=t?Te(t[0][0],t[0][1],t[1][0],t[1][1]):y,n()):M},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],r()):[h,d]},e.center=function(t){return arguments.length?(p=t[0]%360*Da,m=t[1]%360*Da,r()):[p*Ia,m*Ia]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Da,v=t[1]%360*Da,x=t.length>2?t[2]%360*Da:0,r()):[g*Ia,v*Ia,x*Ia]},$i.rebind(e,u,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&function(t){return(t=o.invert((t[0]-s)/f,(l-t[1])/f))&&[t[0]*Ia,t[1]*Ia]},r()}}function Be(t){return Re(t,function(e,r){t.point(e*Da,r*Da)})}function Ue(t,e){return[t,e]}function Ve(t,e){return[t>Ea?t-La:t<-Ea?t+La:t,e]}function qe(t,e,r){return t?e||r?ge(Ge(t),Ye(e,r)):Ge(t):e||r?Ye(e,r):Ve}function He(t){return function(e,r){return e+=t,[e>Ea?e-La:e<-Ea?e+La:e,r]}}function Ge(t){var e=He(t);return e.invert=He(-t),e}function Ye(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),Q(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),Q(u*n-s*i)]},r}function We(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Xe(r,i),a=Xe(r,a),(o>0?ia)&&(i+=o*La)):(i=t+o*La,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-za+Ta&&(e=-za+Ta):e>za-Ta&&(e=za-Ta);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Ea/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=Z(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-za]},r):rr}function er(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return ca(i)1&&J(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function lr(t,e){return t[0]-e[0]||t[1]-e[1]}function cr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ur(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function fr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function hr(t){var e=Ko.pop()||new function(){Sr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function dr(t){_r(t),Xo.remove(t),Ko.push(t),Sr(t)}function pr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];dr(t);for(var l=a;l.circle&&ca(r-l.circle.x)Ta)s=s.L;else{if(!((i=a-function(t,e){var r=t.N;if(r)return gr(r,e);var n=t.site;return n.y===e?n.x:1/0}(s,o))>Ta)){n>-Ta?(e=s.P,r=s):i>-Ta?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=hr(t);if(Xo.insert(e,l),e||r){if(e===r)return _r(e),r=hr(e.site),Xo.insert(l,r),l.edge=r.edge=Mr(e.site,l.site),br(e),void br(r);if(r){_r(e),_r(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,g=p.y-f,v=2*(h*g-d*m),y=h*h+d*d,x=m*m+g*g,b={x:(g*y-d*x)/v+u,y:(h*x-m*y)/v+f};kr(r.edge,c,p,b),l.edge=Mr(c,t,null,b),r.edge=Mr(t,p,null,b),br(e),br(r)}else l.edge=Mr(e.site,l.site)}}function gr(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function vr(t){this.site=t,this.edges=[]}function yr(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=Wo,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;oTa||ca(i-r)>Ta)&&(s.splice(o,0,new Ar(function(t,e,r){var n=new wr(t,null);return n.a=e,n.b=r,Yo.push(n),n}(a.site,u,ca(n-f)Ta?{x:f,y:ca(e-f)Ta?{x:ca(r-p)Ta?{x:h,y:ca(e-h)Ta?{x:ca(r-d)=-Sa)){var h=l*l+c*c,d=u*u+g*g,p=(g*h-c*d)/f,m=(l*d-u*h)/f,g=m+s,v=Qo.pop()||new function(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,x=Jo._;x;)if(v.y=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xa&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Nr(r,n)})),a=es.lastIndex;return a=0&&!(r=$i.interpolators[n](t,e)););return r}function Ur(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(tn(r)+"rotate(",null,")")-2,x:Nr(t,e)})):e&&r.push(tn(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(tn(r)+"skewX(",null,")")-2,x:Nr(t,e)}):e&&r.push(tn(r)+"skewX("+e+")")}(t.skew,e.skew,r,n),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(tn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Nr(t[0],e[0])},{i:i-2,x:Nr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(tn(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function pn(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++oi&&(n=r,i=e);return n}function An(t){return t.reduce(Tn,0)}function Tn(t,e){return t+e[1]}function Sn(t,e){return En(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function En(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Ln(t){return[$i.min(t),$i.max(t)]}function Cn(t,e){return t.value-e.value}function zn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Dn(t,e){t._pack_next=e,e._pack_prev=t}function In(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Pn(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,f=-1/0,h=1/0,d=-1/0;if(r.forEach(On),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(Nn(n,i,a=r[2]),e(a),zn(n,a),n._pack_prev=a,zn(a,i),i=n._pack_next,o=3;o2?Kn:Xn,l=n?nn:rn;return o=i(t,e,l,r),s=i(e,t,l,Br),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Jr)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ri(t,e)},a.tickFormat=function(e,r){return ni(t,e,r)},a.nice=function(e){return ti(t,e),i()},a.copy=function(){return Qn(t,e,r,n)},i()}function $n(t,e){return $i.rebind(t,e,"range","rangeRound","interpolate","clamp")}function ti(t,e){return Zn(t,Jn(ei(t,e)[2])),Zn(t,Jn(ei(t,e)[2])),t}function ei(t,e){null==e&&(e=10);var r=Yn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function ri(t,e){return $i.range.apply($i,ei(t,e))}function ni(t,e,r){var n=ei(t,e);if(r){var i=$a.exec(r);if(i.shift(),"s"===i[8]){var a=$i.formatPrefix(Math.max(ca(n[0]),ca(n[1])));return i[7]||(i[7]="."+ii(a.scale(n[2]))),i[8]="f",r=$i.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+function(t,e){var r=ii(e[2]);return t in ds?Math.abs(r-ii(Math.max(ca(e[0]),ca(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],n)),r=i.join("")}else r=",."+ii(n[2])+"f";return $i.format(r)}function ii(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ai(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Zn(n.map(i),r?Math:ms);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Yn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;h--)o.push(a(c)*h);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return ps;arguments.length<2?r=ps:"function"!=typeof r&&(r=$i.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function bi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,g=h-u,v=d-f,y=g*g+v*v,x=r-n,b=u*d-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,M=(-b*g-v*_)/y,k=(b*v+g*_)/y,A=(-b*g+v*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-c],[w*r/x,M*r/x]]}function _i(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],f=-1,h=e.length,d=_t(r),p=_t(n);++f1?t.join("L"):t+"Z"}function Mi(t){return t.join("L")+"Z"}function ki(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function Ii(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,f,h,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=kt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function Yi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Wi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function Xi(t){return t.toISOString()}function Zi(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=$i.bisect(Bs,n);return i==Bs.length?[e.year,ei(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Bs[i-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=Ji(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=Ji(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Yn(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],Ji(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Zi(t.copy(),e,r)},$n(n,t)}function Ji(t){return new Date(t)}function Ki(t){return JSON.parse(t.responseText)}function Qi(t){var e=ra.createRange();return e.selectNode(ra.body),e.createContextualFragment(t.responseText)}var $i={version:"3.5.17"},ta=[].slice,ea=function(t){return ta.call(t)},ra=this.document;if(ra)try{ea(ra.documentElement.childNodes)[0].nodeType}catch(t){ea=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),ra)try{ra.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var na=this.Element.prototype,ia=na.setAttribute,aa=na.setAttributeNS,oa=this.CSSStyleDeclaration.prototype,sa=oa.setProperty;na.setAttribute=function(t,e){ia.call(this,t,e+"")},na.setAttributeNS=function(t,e,r){aa.call(this,t,e,r+"")},oa.setProperty=function(t,e,r){sa.call(this,t,e+"",r)}}$i.ascending=n,$i.descending=function(t,e){return et?1:e>=t?0:NaN},$i.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},$i.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},$i.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return l/(u-1)},$i.deviation=function(){var t=$i.variance.apply(this,arguments);return t?Math.sqrt(t):t};var la=o(n);$i.bisectLeft=la.left,$i.bisect=$i.bisectRight=la.right,$i.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},$i.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},$i.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},$i.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var ca=Math.abs;$i.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){for(var e=1;t*e%1;)e*=10;return e}(ca(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,f,h,d=-1,p=o.length,m=a[s++],g=new c;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t($i.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},$i.set=function(t){var e=new v;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},$i.event=null,$i.requote=function(t){return t.replace(da,"\\$&")};var da=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,pa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},ma=function(t,e){return e.querySelector(t)},ga=function(t,e){return e.querySelectorAll(t)},va=function(t,e){var r=t.matches||t[x(t,"matchesSelector")];return(va=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(ma=function(t,e){return Sizzle(t,e)[0]||null},ga=Sizzle,va=Sizzle.matchesSelector),$i.selection=function(){return $i.select(ra.documentElement)};var ya=$i.selection.prototype=[];ya.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),ba.hasOwnProperty(r)?{space:ba[r],local:t}:t}},ya.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=$i.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ya.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=D(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},ya.sort=function(t){t=function(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.transition().duration(E)),e.call(t.event)}function o(){b&&b.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){L++||t({type:"zoomstart"})}function l(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=P.of(t,arguments),a=0,o=$i.select(r(t)).on(z,function(){a=1,i($i.mouse(t),u),l(n)}).on(D,function(){o.on(z,null).on(D,null),f(a),c(n)}),u=e($i.mouse(t)),f=Y(t);Cs.call(t),s(n)}function f(){function t(){var t=$i.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=$i.event.target;$i.select(e).on(b,o).on(_,h),w.push(e);for(var r=$i.event.changedTouches,n=0,i=r.length;n1){c=s[0];var u=s[1],f=c[0]-u[0],d=c[1]-u[1];v=f*f+d*d}}function o(){var t,e,r,a,o=$i.touches(p);Cs.call(p);for(var s=0,c=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++8?function(t){return t/r}:function(t){return t*r},symbol:t}});$i.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=$i.round(t,Et(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Qa[8+r/3]};var $a=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,to=$i.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=$i.round(t,Et(t,e))).toFixed(Math.max(0,Math.min(20,Et(t*(1+1e-15),e))))}}),eo=$i.time={},ro=Date;Lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){no.setUTCDate.apply(this._,arguments)},setDay:function(){no.setUTCDay.apply(this._,arguments)},setFullYear:function(){no.setUTCFullYear.apply(this._,arguments)},setHours:function(){no.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){no.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){no.setUTCMinutes.apply(this._,arguments)},setMonth:function(){no.setUTCMonth.apply(this._,arguments)},setSeconds:function(){no.setUTCSeconds.apply(this._,arguments)},setTime:function(){no.setTime.apply(this._,arguments)}};var no=Date.prototype;eo.year=Ct(function(t){return(t=eo.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),eo.years=eo.year.range,eo.years.utc=eo.year.utc.range,eo.day=Ct(function(t){var e=new ro(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),eo.days=eo.day.range,eo.days.utc=eo.day.utc.range,eo.dayOfYear=function(t){var e=eo.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=eo[t]=Ct(function(t){return(t=eo.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});eo[t+"s"]=r.range,eo[t+"s"].utc=r.utc.range,eo[t+"OfYear"]=function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)}}),eo.week=eo.sunday,eo.weeks=eo.sunday.range,eo.weeks.utc=eo.sunday.utc.range,eo.weekOfYear=eo.sundayOfYear;var io={"-":"",_:" ",0:"0"},ao=/^\s*\d+/,oo=/^%/;$i.locale=function(t){return{numberFormat:function(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:y;return function(t){var r=$a.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],f=r[7],h=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=to.get(d)||function(t){return t+""};var x=c&&f;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=$i.formatPrefix(t,h);t=l.scale(t),r=l.symbol+g}else t*=p;var b,_,w=(t=d(t,h)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(b=t,_=""):(b=t.substring(0,M),_=t.substring(M))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=a(b,1/0));var k=m.length+b.length+_.length+(x?0:i.length),A=k"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(x?t:A+t))+r}}}(t),timeFormat:function(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=_[o in io?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}var n=t.dateTime,i=t.date,a=t.time,o=t.periods,s=t.days,l=t.shortDays,c=t.months,u=t.shortMonths;e.multi=(e.utc=function(t){function r(t){try{var e=new(ro=Lt);return e._=t,n(e)}finally{ro=Date}}var n=e(t);return r.parse=function(t){try{ro=Lt;var e=n.parse(t);return e&&e._}finally{ro=Date}},r.toString=n.toString,r}).multi=Jt;var f=$i.map(),h=It(s),d=Pt(s),p=It(l),m=Pt(l),g=It(c),v=Pt(c),y=It(u),x=Pt(u);o.forEach(function(t,e){f.set(t.toLowerCase(),e)});var b={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Dt(t.getDate(),e,2)},e:function(t,e){return Dt(t.getDate(),e,2)},H:function(t,e){return Dt(t.getHours(),e,2)},I:function(t,e){return Dt(t.getHours()%12||12,e,2)},j:function(t,e){return Dt(1+eo.dayOfYear(t),e,3)},L:function(t,e){return Dt(t.getMilliseconds(),e,3)},m:function(t,e){return Dt(t.getMonth()+1,e,2)},M:function(t,e){return Dt(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Dt(t.getSeconds(),e,2)},U:function(t,e){return Dt(eo.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Dt(eo.mondayOfYear(t),e,2)},x:e(i),X:e(a),y:function(t,e){return Dt(t.getFullYear()%100,e,2)},Y:function(t,e){return Dt(t.getFullYear()%1e4,e,4)},Z:Xt,"%":function(){return"%"}},_={a:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){h.lastIndex=0;var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,n){return r(t,b.c.toString(),e,n)},d:Vt,e:Vt,H:Ht,I:Ht,j:qt,L:Wt,m:Ut,M:Gt,p:function(t,e,r){var n=f.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Yt,U:Ft,w:Ot,W:Rt,x:function(t,e,n){return r(t,b.x.toString(),e,n)},X:function(t,e,n){return r(t,b.X.toString(),e,n)},y:jt,Y:Nt,Z:Bt,"%":Zt};return e}(t)}};var so=$i.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});$i.format=so.numberFormat,$i.geo={},Kt.prototype={s:0,t:0,add:function(t){Qt(t,this.t,lo),Qt(lo.s,this.s,this),this.s?this.t+=lo.t:this.s=lo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var lo=new Kt;$i.geo.stream=function(t,e){t&&co.hasOwnProperty(t.type)?co[t.type](t,e):$t(t,e)};var co={Feature:function(t,e){$t(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ne([e*Da,r*Da]);if(v){var i=ae(v,n),a=ae([i[1],-i[0],0],i);le(a),a=ce(a);var o=e-p,l=o>0?1:-1,c=a[0]*Ia*l,m=ca(o)>180;if(m^(l*pd&&(d=g)}else if(c=(c+360)%360-180,m^(l*pd&&(d=r);m?es(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e):h>=u?(eh&&(h=e)):e>p?s(u,e)>s(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=h,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=ca(n)>180?n+(n>0?360:-360):n}else m=t,g=r;po.point(t,r),e(t,r)}function a(){po.lineStart()}function o(){i(m,g),po.lineEnd(),ca(y)>Ta&&(u=-(h=180)),b[0]=u,b[1]=h,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tTa?d=90:y<-Ta&&(f=-90),b[0]=u,b[1]=h}};return function(t){d=h=-(u=f=1/0),x=[],$i.geo.stream(t,_);if(i=x.length){x.sort(l);for(var e=1,r=[p=x[0]];es(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):r.push(p=a);for(var n,i,a,o=-1/0,p=(e=0,r[i=r.length-1]);e<=i;p=a,++e)a=r[e],(n=s(p[1],a[0]))>o&&(o=n,u=a[0],h=p[1])}return x=b=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[h,d]]}}(),$i.geo.centroid=function(t){mo=go=vo=yo=xo=bo=_o=wo=Mo=ko=Ao=0,$i.geo.stream(t,To);var e=Mo,r=ko,n=Ao,i=e*e+r*r+n*n;return i0?Ea:-Ea,l=ca(a-r);ca(l-Ea)0?za:-za),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Ea&&(ca(r-i)Ta?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*za,n.point(-Ea,i),n.point(0,i),n.point(Ea,i),n.point(Ea,0),n.point(Ea,-i),n.point(0,-i),n.point(-Ea,-i),n.point(-Ea,0),n.point(-Ea,i);else if(ca(t[0]-e[0])>Ta){var a=t[0]=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],f=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(l).point,n=o.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ta,f+.12*c+Ta],[u-.214*c-Ta,f+.234*c-Ta]]).stream(l).point,i=s.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ta,f+.166*c+Ta],[u-.115*c-Ta,f+.234*c-Ta]]).stream(l).point,t},t.scale(1070)};var Lo,Co,zo,Do,Io,Po,Oo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Co=0,Oo.lineStart=Le},polygonEnd:function(){Oo.lineStart=Oo.lineEnd=Oo.point=b,Lo+=ca(Co/2)}},Fo={point:function(t,e){tIo&&(Io=t),ePo&&(Po=e)},lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ro={point:ze,lineStart:De,lineEnd:Ie,polygonStart:function(){Ro.lineStart=Pe},polygonEnd:function(){Ro.point=ze,Ro.lineStart=De,Ro.lineEnd=Ie}};$i.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),$i.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Lo=0,$i.geo.stream(t,i(Oo)),Lo},t.centroid=function(t){return vo=yo=xo=bo=_o=wo=Mo=ko=Ao=0,$i.geo.stream(t,i(Ro)),Ao?[Mo/Ao,ko/Ao]:wo?[bo/wo,_o/wo]:xo?[vo/xo,yo/xo]:[NaN,NaN]},t.bounds=function(t){return Io=Po=-(zo=Do=1/0),$i.geo.stream(t,i(Fo)),[[zo,Do],[Io,Po]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||function(t){var e=Oe(function(e,r){return t([e*Ia,r*Ia])});return function(t){return Be(e(t))}}(t):y,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new function(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ce(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ce(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}:new function(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,La)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:b};return s}(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection($i.geo.albersUsa()).context(null)},$i.geo.transform=function(t){return{stream:function(e){var r=new Fe(e);for(var n in t)r[n]=t[n];return r}}},Fe.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},$i.geo.projection=Ne,$i.geo.projectionMutator=je,($i.geo.equirectangular=function(){return Ne(Ue)}).raw=Ue.invert=Ue,$i.geo.rotation=function(t){function e(e){return e=t(e[0]*Da,e[1]*Da),e[0]*=Ia,e[1]*=Ia,e}return t=qe(t[0]%360*Da,t[1]*Da,t.length>2?t[2]*Da:0),e.invert=function(e){return e=t.invert(e[0]*Da,e[1]*Da),e[0]*=Ia,e[1]*=Ia,e},e},Ve.invert=Ue,$i.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=qe(-t[0]*Da,-t[1]*Da,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Ia,t[1]*=Ia}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=We((e=+n)*Da,i*Da),t):e},t.precision=function(n){return arguments.length?(r=We(e*Da,(i=+n)*Da),t):i},t.angle(90)},$i.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Da,i=t[1]*Da,a=e[1]*Da,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},$i.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return $i.range(Math.ceil(a/g)*g,i,g).map(h).concat($i.range(Math.ceil(c/v)*v,l,v).map(d)).concat($i.range(Math.ceil(n/p)*p,r,p).filter(function(t){return ca(t%g)>Ta}).map(u)).concat($i.range(Math.ceil(s/m)*m,o,m).filter(function(t){return ca(t%v)>Ta}).map(f))}var r,n,i,a,o,s,l,c,u,f,h,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=Ze(s,o,90),f=Je(n,r,y),h=Ze(c,l,90),d=Je(a,i,y),t):y},t.majorExtent([[-180,-90+Ta],[180,90-Ta]]).minorExtent([[-180,-80-Ta],[180,80+Ta]])},$i.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=Ke,i=Qe;return t.distance=function(){return $i.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},$i.geo.interpolate=function(t,e){return function(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),c=i*Math.sin(t),u=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(tt(n-e)+i*o*tt(r-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,r=Math.sin(h-t)*d,n=r*l+e*u,i=r*c+e*f,o=r*a+e*s;return[Math.atan2(i,n)*Ia,Math.atan2(o,Math.sqrt(n*n+i*i))*Ia]}:function(){return[t*Ia,e*Ia]};return p.distance=h,p}(t[0]*Da,t[1]*Da,e[0]*Da,e[1]*Da)},$i.geo.length=function(t){return No=0,$i.geo.stream(t,jo),No};var No,jo={sphere:b,point:b,lineStart:function(){function t(t,i){var a=Math.sin(i*=Da),o=Math.cos(i),s=ca((t*=Da)-e),l=Math.cos(s);No+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;jo.point=function(i,a){e=i*Da,r=Math.sin(a*=Da),n=Math.cos(a),jo.point=t},jo.lineEnd=function(){jo.point=jo.lineEnd=b}},lineEnd:b,polygonStart:b,polygonEnd:b},Bo=$e(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});($i.geo.azimuthalEqualArea=function(){return Ne(Bo)}).raw=Bo;var Uo=$e(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);($i.geo.azimuthalEquidistant=function(){return Ne(Uo)}).raw=Uo,($i.geo.conicConformal=function(){return Se(tr)}).raw=tr,($i.geo.conicEquidistant=function(){return Se(er)}).raw=er;var Vo=$e(function(t){return 1/t},Math.atan);($i.geo.gnomonic=function(){return Ne(Vo)}).raw=Vo,rr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-za]},($i.geo.mercator=function(){return nr(rr)}).raw=rr;var qo=$e(function(){return 1},Math.asin);($i.geo.orthographic=function(){return Ne(qo)}).raw=qo;var Ho=$e(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});($i.geo.stereographic=function(){return Ne(Ho)}).raw=Ho,ir.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-za]},($i.geo.transverseMercator=function(){var t=nr(ir),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=ir,$i.geom={},$i.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=_t(r),a=_t(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+f;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Ta)*Ta,y:Math.round(o(t,e)/Ta)*Ta,i:e}})}var n=ar,i=or,a=n,o=i,s=$o;return t?e(t):(e.links=function(t){return zr(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return zr(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(xr),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,h=n>=u,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),f?i=c:s=c,h?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,f,h,d,p,m,g,v,y,x=_t(s),b=_t(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),f=[],h=[],p=t.length,o)for(d=0;dv&&(v=u.x),u.y>y&&(y=u.y),f.push(u.x),h.push(u.y);else for(d=0;dv&&(v=_),w>y&&(y=w),f.push(_),h.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null};if(A.add=function(t){a(A,t,+x(t,++d),+b(t,d),m,g,v,y)},A.visit=function(t){Or(t,A,m,g,v,y)},A.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,d){if(!(u>a||f>o||h=_)<<1|e>=b,M=w+4;w=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ns.get(r)||rs,n=is.get(n)||y,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}(n(r.apply(null,ta.call(arguments,1))))},$i.interpolateHcl=function(t,e){t=$i.hcl(t),e=$i.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return at(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateHsl=function(t,e){t=$i.hsl(t),e=$i.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return nt(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateLab=function(t,e){t=$i.lab(t),e=$i.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return st(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateRound=Jr,$i.transform=function(t){var e=ra.createElementNS($i.ns.prefix.svg,"g");return($i.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Kr(r?r.matrix:as)})(t)},Kr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var as={a:1,b:0,c:0,d:1,e:0,f:0};$i.interpolateTransform=en,$i.layout={},$i.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=kt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return pn(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=vn,r=mn,n=gn;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(dn(e,function(t){t.children&&(t.value=0)}),pn(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},$i.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&((o=l[$i.bisect(f,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Ln,i=Sn;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=_t(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return En(t,e)}:_t(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},$i.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,pn(s,function(t){t.r=+u(t.value)}),pn(s,Pn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;pn(s,function(t){t.r+=f}),pn(s,Pn),pn(s,function(t){t.r-=f})}return Rn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=$i.layout.hierarchy().sort(Cn),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},hn(t,r)},$i.layout.tree=function(){function t(t,l){var c=i.call(this,t,l),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;od.x&&(d=t),t.depth>p.depth&&(p=t)});var m=a(h,d)/2-h.x,g=o[0]/(d.x+a(d,h)/2+m),v=o[1]/(p.depth||1);dn(u,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return c}function e(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+a(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+a(t._,n._));t.parent.A=function(t,e,r){if(e){for(var n,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,f=s.m,h=l.m;s=Un(s),i=Bn(i),s&&i;)l=Bn(l),(o=Un(o)).a=t,(n=s.z+f-i.z-c+a(s._,i._))>0&&(!function(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}(function(t,e,r){return t.a.parent===e.parent?t.a:r}(s,t,r),t,n),c+=n,u+=n),f+=s.m,c+=i.m,h+=l.m,u+=o.m;s&&!Un(o)&&(o.t=s,o.m+=f-u),i&&!Bn(l)&&(l.t=i,l.m+=c-h,r=t)}return r}(t,n,t.parent.A||r[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function n(t){t.x*=o[0],t.y=t.depth*o[1]}var i=$i.layout.hierarchy().sort(null).value(null),a=jn,o=[1,1],s=null;return t.separation=function(e){return arguments.length?(a=e,t):a},t.size=function(e){return arguments.length?(s=null==(o=e)?n:null,t):s?null:o},t.nodeSize=function(e){return arguments.length?(s=null==(o=e)?null:n,t):s?o:null},hn(t,i)},$i.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;pn(l,function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(e),t.y=function(t){return 1+$i.max(t,function(t){return t.y})}(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Vn(l),f=qn(l),h=u.x-r(u,f)/2,d=f.x+r(f,u)/2;return pn(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=$i.layout.hierarchy().sort(null).value(null),r=jn,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},hn(t,e)},$i.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(a=f[s-1]),c.area+=a.area,"squarify"!==h||(o=function(t,e){var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;for(;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}(c,m))<=p?(f.pop(),p=o):(c.area-=c.pop().area,n(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(n(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function r(e){var i=e.children;if(i&&i.length){var a,o=u(e),s=i.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(n(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);i.forEach(r)}}function n(t,e,r,n){var i,a=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=$i.random.normal.apply($i,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=$i.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rf?0:1;if(c=Ca)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,x,b,_,w,M,k,A,T=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===bs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(S*=-1),c&&(S=Q(g/c*Math.sin(v))),t&&(T=Q(g/t*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var L=Math.abs(f-u-2*S)<=Ea?0:1;if(S&&xi(y,x,b,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),M=t*Math.sin(f-T),k=t*Math.cos(u+T),A=t*Math.sin(u+T);var z=Math.abs(u-f+2*T)<=Ea?0:1;if(T&&xi(w,M,k,A)===1-d^z){var D=(u+f)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(h>Ta&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ai,basis:Ei,"basis-open":function(t){if(t.length<4)return wi(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Li(ks,a)+","+Li(ks,o)),--n;++nEa)+",1 "+e}function n(t,e,r,n){return"Q 0,0 "+n}var i=Ke,a=Qe,o=Oi,s=gi,l=vi;return t.radius=function(e){return arguments.length?(o=_t(e),t):o},t.source=function(e){return arguments.length?(i=_t(e),t):i},t.target=function(e){return arguments.length?(a=_t(e),t):a},t.startAngle=function(e){return arguments.length?(s=_t(e),t):s},t.endAngle=function(e){return arguments.length?(l=_t(e),t):l},t},$i.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Ke,r=Qe,n=Fi;return t.source=function(r){return arguments.length?(e=_t(r),t):e},t.target=function(e){return arguments.length?(r=_t(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},$i.svg.diagonal.radial=function(){var t=$i.svg.diagonal(),e=Fi,r=t.projection;return t.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-za;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},$i.svg.symbol=function(){function t(t,n){return(As.get(e.call(this,t,n))||ji)(r.call(this,t,n))}var e=Ni,r=Ri;return t.type=function(r){return arguments.length?(e=_t(r),t):e},t.size=function(e){return arguments.length?(r=_t(e),t):r},t};var As=$i.map({circle:ji,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Ss)),r=e*Ss;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Ts),r=e*Ts/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ts),r=e*Ts/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});$i.svg.symbolTypes=As.keys();var Ts=Math.sqrt(3),Ss=Math.tan(30*Da);ya.transition=function(t){for(var e,r,n=Es||++Ds,i=Hi(t),a=[],o=Ls||{time:Date.now(),ease:function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){var t=$i.mouse(x),r=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||($i.event.altKey?(v||(v=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(t[0]=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(u=0;u<_.length;++u)h=(b=_[u])[0],b[0]=b[1],b[1]=h;return _}},{"incremental-convex-hull":278,uniq:556}],131:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]};function a(t,e){return i[0]=t,i[1]=e,n[0]}e.exports.pack=a;function o(t){return n[0]=t,i[0]}e.exports.lo=o;function s(t){return n[0]=t,i[1]}e.exports.hi=s}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]};function l(t,e){return i[1]=t,i[0]=e,n[0]}e.exports.pack=l;function c(t){return n[0]=t,i[1]}e.exports.lo=c;function u(t){return n[0]=t,i[0]}e.exports.hi=u}else r=!1}if(!r){var f=new t(8);e.exports=function(t){return f.writeDoubleLE(t,0,!0),[f.readUInt32LE(0,!0),f.readUInt32LE(4,!0)]};function h(t,e){return f.writeUInt32LE(t,0,!0),f.writeUInt32LE(e,4,!0),f.readDoubleLE(0,!0)}e.exports.pack=h;function d(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(0,!0)}e.exports.lo=d;function p(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(4,!0)}e.exports.hi=p}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:82}],132:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":43,"normalize-svg-path":460}],133:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],134:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=f&&c(ar.x)&&d(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=p(e,t);a(r,r.next)}}(m[o],r),r=a(r,r.next);return r}(t,e,u,r)),t.length>80*r){h=g=t[0],m=v=t[1];for(var _=r;_g&&(g=y),x>v&&(v=x);b=Math.max(g-h,v-m)}return o(u,f,r,h,m,b),f}function i(t,e,r,n,i){var a,o;if(i===y(t,e,r,n)>0)for(a=e;a=e;a-=n)o=m(a,t[a],t[a+1],o);return o&&f(o,o.next)&&(g(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!f(n,n.next)&&0!==u(n.prev,n,n.next))n=n.next;else{if(g(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,s,m){if(t){!m&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=l(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,s);for(var v,y,x=t;t.prev!==t.next;)if(v=t.prev,y=t.next,s?function(t,e,r,n){var i=t.prev,a=t,o=t.next;if(u(i,a,o)>=0)return!1;var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,d=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=l(s,f,e,r,n),m=l(h,d,e,r,n),g=t.nextZ;for(;g&&g.z<=m;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.nextZ}g=t.prevZ;for(;g&&g.z>=p;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}(t,n,i,s):function(t){var e=t.prev,r=t,n=t.next;if(u(e,r,n)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(c(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&u(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(v.i/r),e.push(t.i/r),e.push(y.i/r),g(t),t=y.next,x=y.next;else if((t=y)===x){m?1===m?o(t=function(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!f(i,a)&&h(i,n,n.next,a)&&d(i,a)&&d(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),g(n),g(n.next),n=t=a),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,s,2):2===m&&function(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&h(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&d(t,e)&&d(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(l,c)){var u=p(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}(t,e,r,n,i,s):o(a(t),e,r,n,i,s,1);break}}}function s(t,e){return t.x-e.x}function l(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function c(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function u(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function f(t,e){return t.x===e.x&&t.y===e.y}function h(t,e,r,n){return!!(f(t,e)&&f(r,n)||f(t,n)&&f(r,e))||u(t,e,r)>0!=u(t,e,n)>0&&u(r,n,t)>0!=u(r,n,e)>0}function d(t,e){return u(t.prev,t,t.next)<0?u(t,e,t.next)>=0&&u(t,t.prev,e)>=0:u(t,e,t.prev)<0||u(t,t.next,e)<0}function p(t,e){var r=new v(t.i,t.x,t.y),n=new v(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function m(t,e,r,n){var i=new v(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function g(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],136:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],139:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],140:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],141:[function(t,e,r){"use strict";function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";return"("+("=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?o(t.slice(1),"||"):"all"===e?o(t.slice(1),"&&"):"none"===e?c(o(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?c(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var a=i(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+a+"=== typeof "+o+"&&":"")+a+r+o}function o(t,e){return t.map(n).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(u)),n=i(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function u(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))};var f=["Unknown","Point","LineString","Polygon"]},{}],142:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var u=a.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},l.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":70,"cubic-hermite":115}],143:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&"string"!=typeof e||(e=new(n(e||"float32"))(a+r));var o=e.length-r;if(a!==o)throw new Error("source length "+a+" ("+i+"x"+t.length+") does not match destination length "+o);for(var s=0,l=r;s0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(t,e,r,n,i.right)}function f(t,e){this.tree=t,this._stack=e}function h(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}e.exports=function(t){return new s(t||function(t,e){return te?1:0},null)};var d=0,p=1,m=s.prototype;Object.defineProperty(m,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(m,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(d,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(h._color===p||i._color===p)break;var m=l[f-2];if(m.left===h)if(h.left===i){if(!(g=m.right)||g._color!==d){if(m._color=d,m.left=h.right,h._color=p,h.right=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).left===m?v.left=h:v.right=h}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else{if(!(g=m.right)||g._color!==d){if(h.right=i.left,m._color=d,m.left=i.right,i._color=p,i.left=h,i.right=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){(v=l[f-3]).left===m?v.left=i:v.right=i}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else if(h.right===i){if(!(g=m.left)||g._color!==d){if(m._color=d,m.right=h.left,h._color=p,h.left=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).right===m?v.right=h:v.left=h}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}else{var g;if(!(g=m.left)||g._color!==d){if(h.left=i.right,m._color=d,m.right=i.left,i._color=p,i.right=h,i.left=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){var v;(v=l[f-3]).right===m?v.right=i:v.left=i}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}}return l[0]._color=p,new s(r,l[0])},m.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return u(e,r,this._compare,t,this.root)}},Object.defineProperty(m,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(m,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),m.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},m.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},m.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},m.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},m.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},m.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},m.remove=function(t){var e=this.find(t);return e?e.remove():this},m.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var g=f.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new f(this.tree,this._stack.slice())},g.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if((r=e[e.length-1])._color===d){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=p);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===d)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=p,r._color=p,s._color=p,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),void(t[l-1]=n);if(n.left&&n.left._color===d)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).left===r?c.left=s:c.right=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.right=a(d,n));r.right=a(d,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=d,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11&&((c=t[l-2]).right===r?c.right=n:c.left=n),void(t[l-1]=n);if(n.right&&n.right._color===d)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).right===r?c.right=s:c.left=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.left=a(d,n));r.left=a(d,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=d,o(r),o(n),l>1){var c;(c=t[l-2]).right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),g.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(g,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),g.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},g.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(g,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],145:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],146:[function(t,e,r){function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}(t)===e?t:t.reverse()}var s=t("geojson-area");e.exports=n},{"geojson-area":146}],148:[function(t,e,r){"use strict";function n(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,r,a,o,s,l,c){if(r/=e,a/=e,l>=r&&c<=a)return t;if(l>a||c=r&&d<=a)u.push(p);else if(!(h>a||d=e&&s<=r&&i.push(o)}return i}(m,r,a,o):function(t,e,r,i,a,o){for(var s=[],l=0;lr?(b.push(a(c,p,e),a(c,p,r)),o||(b=n(s,b,g,v,y))):d>=e&&b.push(a(c,p,e)):h>r?dr&&(b.push(a(c,p,r)),o||(b=n(s,b,g,v,y))));c=m[x-1],(h=c[i])>=e&&h<=r&&b.push(c),f=b[b.length-1],o&&f&&(b[0][0]!==f[0]||b[0][1]!==f[1])&&b.push(b[0]),n(s,b,g,v,y)}return s}(m,r,a,o,s,3===g);v.length&&u.push(i(p.tags,g,v,p.id))}}return u.length?u:null};var i=t("./feature")},{"./feature":150}],149:[function(t,e,r){"use strict";function n(t,e,r){if(null!==e.geometry){var o,l,c,u,f=e.geometry,h=f.type,d=f.coordinates,p=e.properties,m=e.id;if("Point"===h)t.push(s(p,1,[a(d)],m));else if("MultiPoint"===h)t.push(s(p,1,i(d),m));else if("LineString"===h)t.push(s(p,2,[i(d,r)],m));else if("MultiLineString"===h||"Polygon"===h){for(c=[],o=0;o1?1:n,[r,n,0]}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),x=this.tiles[y]=h(t,v,r,n,b,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(x.source=t,l){if(e===p.maxZoom||e===l)continue;var w=1<1&&console.time("clipping");var M,k,A,T,S,E,L=.5*p.buffer/p.extent,C=.5-L,z=.5+L,D=1+L;M=k=A=T=null,S=u(t,v,r-L,r+z,0,a,x.min[0],x.max[0]),E=u(t,v,r+C,r+D,0,a,x.min[0],x.max[0]),S&&(M=u(S,v,n-L,n+z,1,o,x.min[1],x.max[1]),k=u(S,v,n+C,n+D,1,o,x.min[1],x.max[1])),E&&(A=u(E,v,n-L,n+z,1,o,x.min[1],x.max[1]),T=u(E,v,n+C,n+D,1,o,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(A||[],e+1,2*r+1,2*n),d.push(T||[],e+1,2*r+1,2*n+1))}else l&&(g=e)}return g},n.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,l=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var f,h=t,d=e,p=r;!f&&h>0;)h--,d=Math.floor(d/2),p=Math.floor(p/2),f=this.tiles[i(h,d,p)];if(!f||!f.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",h,d,p),s(f,a,n.buffer))return c.tile(f,a);o>1&&console.time("drilling down");var m=this.splitTile(f.source,h,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return c=s-n,u=l-i,c*c+u*u}(t[r],t[s],t[l]))>n&&(a=r,n=i);n>o?(t[a][2]=n,c.push(s),c.push(a),s=a):(l=c.pop(),s=c.pop())}}},{}],153:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){for(var o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},s=0;sf)&&(h.push(s),t.numSimplified++),t.numPoints++;3===c&&function(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;io.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1])}return o}},{}],154:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}e.exports=function(t,e){var r=new i(t);return r.update(e),r};var s=t("./lib/text.js"),l=t("./lib/lines.js"),c=t("./lib/background.js"),u=t("./lib/cube.js"),f=t("./lib/ticks.js"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),c=!1,u=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,c=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?c=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(c=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new a,new a,new a],m=[0,0,0],g={model:h,view:h,projection:h};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];d.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||h,i=t.view||h,a=t.projection||h,s=this.bounds,l=u(r,i,a,s),c=l.cubeEdges,f=l.axis,d=i[12],b=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*d+a[7]*b+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=c[k],this.lastCubeProps.axis[k]=f[k];var A=p;for(k=0;k<3;++k)o(p[k],k,this.bounds,c,f);e=this.gl;var T=m;for(k=0;k<3;++k)this.backgroundEnable[k]?T[k]=f[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];f[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(E=0;E<2;++E){L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var z=n(v,A[k].primalMinor),D=n(y,A[k].mirrorMinor),I=this.lineTickLength;for(E=0;E<3;++E){var P=M/r[5*E];z[E]*=I[E]*P,D[E]*=I[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,D,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){var O=A[k].primalMinor,F=n(x,A[k].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[k]&&(F[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],F,this.tickColor[k])}if(this.labelEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.labelPad[E]/r[5*E];F[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],F,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":158,"./lib/cube.js":159,"./lib/lines.js":160,"./lib/text.js":162,"./lib/ticks.js":163}],158:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=i(t,new Float32Array(e)),y=i(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=o(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new n(t,v,x,b)};var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders").bg,s=n.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":161,"gl-buffer":165,"gl-vao":259}],159:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<f[y][1]&&(O=y));var F=-1;for(y=0;y<3;++y)(N=O^1<f[R][0]&&(R=N))}var j=m;j[0]=j[1]=j[2]=0,j[a.log2(F^O)]=O&F,j[a.log2(O^R)]=O&R;var B=7^R;B===_||B===P?(B=7^F,j[a.log2(R^B)]=B&R):j[a.log2(F^B)]=B&F;var U=g,V=_;for(k=0;k<3;++k)U[k]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}","precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":243}],162:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}e.exports=function(t,e,r,o,l,c){var u=i(t),f=a(t,[{buffer:u,size:3}]),h=s(t);h.attributes.position.location=0;var d=new n(t,h,u,f);return d.update(e,r,o,l,c),d};var i=t("gl-buffer"),a=t("gl-vao"),o=t("vectorize-text"),s=t("./shaders").text,l=window||r.global||{},c=l.__TEXT_CACHE||{};l.__TEXT_CACHE={};var u=n.prototype,f=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.update=function(t,e,r,n,i){function a(t,e,r,n){var i=c[r];i||(i=c[r]={});var a=i[e];a||(a=i[e]=function(t,e){try{return o(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,f=a.cells,h=0,d=f.length;h=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(s.length/3|0)-f[d],l[d]=s.length/3|0;for(var p=0;p=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=o.malloc(t.length,e),n=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=o.malloc(t.size,r),u=l(n,t.shape);s.assign(u,t),this.length=i(this.gl,this.type,this.length,this.usage,e<0?n:n.subarray(0,t.size),e),o.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=i(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),o.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],166:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],167:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":166}],168:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a=1},u.isTransparent=function(){return this.opacity<1},u.drawTransparent=u.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();u.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m;(m=f.slice())[c]+=d[1][c],o.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":170,"gl-buffer":165,"gl-vao":259}],169:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&h.drawBuffersWEBGL(m[f]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=o(r,c,u,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=o(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=s(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=s(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=s(r,c,u,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),c=0;ca||r<0||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");var o=1;if("color"in(n=n||{})){if((o=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(o>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(o>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+o+" draw buffers")}}var s=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&o>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");s=t.FLOAT}else n.preferFloat&&o>0&&c&&(s=t.FLOAT);var u=!0;"depth"in n&&(u=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new l(t,e,r,s,o,u,g,i)};var f,h,d,p,m=null,g=l.prototype;Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return c(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,c(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,c(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),u.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},u.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),n=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=1/((h[2]=r[r.length-1])-d),g=1/((h[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var x=(v-1)*(y-1)*(f.length>>>1);this.numVertices=x;for(var b=o.mallocUint8(4*x),_=o.mallocFloat32(2*x),w=o.mallocUint8(2*x),M=o.mallocUint32(x),k=0,A=0;A FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":243}],177:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=p(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=s(e),a=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),u=h(new Array(1024),[256,1,4]),f=0;f<1024;++f)u.data[f]=255;var d=c(e,u);d.wrap=e.REPEAT;var g=new o(e,r,n,i,a,d);return g.update(t),g};var s=t("gl-buffer"),l=t("gl-vao"),c=t("gl-texture2d"),u=t("glsl-read-float"),f=t("binary-search-bounds"),h=t("ndarray"),d=t("./lib/shaders"),p=d.createShader,m=d.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v=o.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e0){for(var x=0;x<24;++x)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var b,_;Array.isArray(o[0])?(b=o[e-1],_=o[e]):b=_=o,3===b.length&&(b=[b[0],b[1],b[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,b[0],b[1],b[2],b[3],y[0],y[1],y[2],v[0],v[1],v[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(d),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,b=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*b,t[1]=(h+x)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(h-x)*_,t[5]=(1-(f+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,g=o*f,v=s*f,y=l*c,x=l*u,b=l*f,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+b)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(h+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(g-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-f-p,t[1]=u+v,t[2]=h-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,f,h,d,p,m,g=e[0],v=e[1],y=e[2],x=a[0],b=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":199,"./mat3.js":202,"./vec3.js":206,"./vec4.js":207}],205:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":199}],207:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[u]}return Math.abs(g-1)>.001?null:[f,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],210:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,g,v,y,x,b,_,w,k,A,T,S){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=M,this._view=M,this._projection=M,this._resolution=[1,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("gl-vao"),s=t("gl-texture2d"),l=t("normals"),c=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),f=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),p=t("typedarray-pool"),m=t("./lib/shaders"),g=t("./lib/closest-point"),v=m.meshShader,y=m.wireShader,x=m.pointShader,b=m.pickShader,_=m.pointPickShader,w=m.contourShader,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=n.prototype;k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){(p=this.triShader).bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){(p=this.lineShader).bind(),p.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){(p=this.pointShader).bind(),p.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p;(p=this.contourShader).bind(),p.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||M,n=t.view||M,i=t.projection||M,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};if((l=this.pickShader).bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l;(l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;al[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n]&&M&&(e[1^n]-=T*d*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=T*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],kl[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n+2]&&M&&(e[1^n]+=T*d*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],f=a[c+2]-u,h=.5*(o[c+2]+o[c]),d=o[c+2]-o[c],p=l[c],m=l[c+2]-p,g=s[c],v=s[c+2]-g;e[c]=2*f/d*m/v,t[c]=2*(u-h)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;w[x]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,b,w),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":218,"./lib/create-attributes":219,"./lib/create-uniforms":220,"./lib/reflect":221,"./lib/runtime-reflect":222,"./lib/shader-cache":223}],218:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}(n.prototype=new Error).name="GLError",n.prototype.constructor=n,e.exports=n},{}],219:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,s,f)}else{if(!(h.indexOf("mat")>=0))throw new o("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,s,f)}}}return s};var o=t("./GLError"),s=n.prototype;s.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(s,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":218}],220:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new o("","Unknown uniform data type for "+name+": "+r)}var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new o("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new o("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function u(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a4)throw new o("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new o("","Unknown uniform data type for "+name+": "+t)}}(r[c].type)}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function i(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!x&&U.autoResize){var t=b.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*U.pixelRatio),i=0|Math.ceil(r*U.pixelRatio);if(n!==b.width||i!==b.height){b.width=n,b.height=i;var a=b.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",O=!0}}}function r(){for(var t=z.length,e=P.length,r=0;r0&&0===I[e-1];)I.pop(),P.pop().dispose()}function g(){if(U.contextLost)return!0;_.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}function v(){if(!g()){e();var t=U.camera.tick();j.view=U.camera.matrix,O=O||t,F=F||t,E.pixelRatio=U.pixelRatio,C.pixelRatio=U.pixelRatio;var r=z.length,i=G[0],a=G[1];i[0]=i[1]=i[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;oM.distance)continue;for(var c=0;c>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),r=0;r>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,o),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/s,t[4]=2/l,t[6]=-2*o[0]/s-1,t[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=u<5,i.uniforms.pointSize=u,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var f=a.getParameter(a.BLEND),h=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),h&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),h&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":227,"gl-buffer":165,"gl-shader":228,"typedarray-pool":554}],236:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],237:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];if(r||(r=i[e]={}),t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(F[1])){var R=O;O=F,F=R,R=I,I=P,P=R;var N=z;z=D,D=N}O[0]<0&&(I[z]=-1),F[1]>0&&(P[D]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(d[4*z+C],2),B+=Math.pow(d[4*D+C],2);I[z]/=Math.sqrt(j),P[D]/=Math.sqrt(B),h.axes[0]=I,h.axes[1]=P,h.fragClipBounds[0]=l(A,S[0],E,-1e8),h.fragClipBounds[1]=l(A,S[1],E,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function u(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||v,s.view=n.view||v,s.projection=n.projection||v,x[0]=2/o.drawingBufferWidth,x[1]=2/o.drawingBufferHeight,s.screenSize=x,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}c(e,r,n,i),r.vao.unbind()}var f=t("gl-buffer"),h=t("gl-vao"),d=t("typedarray-pool"),p=t("gl-mat4/multiply"),m=t("./lib/shaders"),g=t("./lib/glyphs"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,r=m.createPerspective(e),n=m.createOrtho(e),i=m.createProject(e),o=m.createPickPerspective(e),s=m.createPickOrtho(e),l=m.createPickProject(e),c=f(e),u=f(e),d=f(e),p=f(e),g=new a(e,r,n,i,c,u,d,p,h(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return g.update(t),g};var y=a.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},y.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var x=[0,0],b=[0,0,0],_=[0,0,0],w=[0,0,0,1],M=[0,0,0,1],k=v.slice(),A=[0,0,0],T=[[0,0,0],[0,0,0]],S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];y.draw=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},y.drawTransparent=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},y.drawPick=function(t){u(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},y.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},y.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,c=t.color,u=t.size,f=t.angle,h=t.lineColor,p=0,m=0,v=0,y=n.length;t:for(var x=0;x0&&(C[0]=-a[0]*(1+k[0][0]));var q=w.cells,H=w.positions;for(_=0;_0){var v=r*u;o.drawBox(f-v,h-v,d+v,h+v,a),o.drawBox(f-v,p-v,d+v,p+v,a),o.drawBox(f-v,h-v,f+v,p+v,a),o.drawBox(d-v,h-v,d+v,p+v,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":240,"gl-buffer":165,"gl-shader":243}],242:[function(t,e,r){"use strict";function n(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}e.exports=function(t,e){return new n(t,i(t,e),a.mallocUint8(e[0]*e[1]*4))};var i=t("gl-fbo"),a=t("typedarray-pool"),o=t("ndarray"),s=t("bit-twiddle").nextPow2,l=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,x,_),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":244,"./lib/create-attributes":245,"./lib/create-uniforms":246,"./lib/reflect":247,"./lib/runtime-reflect":248,"./lib/shader-cache":249}],244:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],245:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":244,dup:219}],246:[function(t,e,r){arguments[4][220][0].apply(r,arguments)},{"./GLError":244,"./reflect":247,dup:220}],247:[function(t,e,r){arguments[4][221][0].apply(r,arguments)},{dup:221}],248:[function(t,e,r){arguments[4][222][0].apply(r,arguments)},{dup:222}],249:[function(t,e,r){arguments[4][223][0].apply(r,arguments)},{"./GLError":244,dup:223,"gl-format-compiler-error":172,"weakmap-shim":576}],250:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],251:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":243}],252:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders/index");e.exports=function(t,e){function r(t,e,r,n,i,a){var o=[t,e,r,0,0,0,1];o[n+3]=1,o[n]=i,s.push.apply(s,o),o[6]=-1,s.push.apply(s,o),o[n]=a,s.push.apply(s,o),s.push.apply(s,o),o[6]=1,s.push.apply(s,o),o[n]=i,s.push.apply(s,o)}var s=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=i(t,s),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=o(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new n(t,l,c,u);return f.update(e),f};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=n.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||s,o=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,d=u,p=0;p<3;++p)i&&i[p]<0?(h[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(h[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":251,"gl-buffer":165,"gl-vao":259}],253:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular_1_1(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":243}],254:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=s,this._contourShader=l,this._contourPickShader=c,this._contourBuffer=u,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=d,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function i(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||O,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=F.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],b(l,t.model,l);var c=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function a(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||C,n.view=t.view||C,n.projection=t.projection||C,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=_(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var o=n.clipBounds[a],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[a][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=j,n.vertexColor=this.vertexColor;var l=N;for(b(l,n.view,n.model),b(l,n.projection,l),_(l,l),a=0;a<3;++a)n.eyePosition[a]=l[12+a]/l[15];var c=l[15];for(a=0;a<3;++a)c+=this.lightPosition[a]*l[4*a+3];for(a=0;a<3;++a){var u=l[12+a];for(s=0;s<3;++s)u+=l[4*s+a]*this.lightPosition[s];n.lightPosition[a]=u/c}var f=i(n,this);if(f.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=f.projections[a],this._shader.uniforms.clipBounds=f.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(h.uniforms.permutation=D[a],r.lineWidth(this.contourWidth[a]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t};var O=[0,0,0],F={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},R={model:C,view:C,projection:C,inverseModel:C.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},N=C.slice(),j=[1,0,0,0,1,0,0,0,1];P.draw=function(t){return a.call(this,t,!1)},P.drawTransparent=function(t){return a.call(this,t,!0)};var B={model:C,view:C,projection:C,inverseModel:C,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};P.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=B;r.model=t.model||C,r.view=t.view||C,r.projection=t.projection||C,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=j;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=i(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=D[o],n=0;n>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=i+u,p=s+h,m=f*(h?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=w.le(this.contourLevels[y],c[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]Math.abs(b-c[y])&&(v[y]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},P.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=s(t.contourWidth,Number)),"showContour"in t&&(this.showContour=s(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=s(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=c(t.contourColor)),"contourProject"in t&&(this.contourProject=s(t.contourProject,function(t){return s(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=c(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=s(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=s(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(p.freeFloat(this._field[2].data),this._field[2].data=p.mallocFloat(u.nextPow2(n))),this._field[2]=y(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),o(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(p.freeFloat(this._field[a].data),this._field[a].data=p.mallocFloat(this._field[2].size)),this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(a=0;a<2;++a){var f=l[a];for(w=0;w<2;++w)if(f.shape[w]!==i[w])throw new Error("gl-surface: coords have incorrect shape");o(this._field[a],f)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var d=h[a];if((Array.isArray(d)||d.length)&&(d=y(d)),d.shape[0]!==i[a])throw new Error("gl-surface: invalid tick length");var b=y(d.data,i);b.stride[a]=d.stride[0],b.stride[1^a]=0,o(this._field[a],b)}}else{for(a=0;a<2;++a){var _=[0,0];_[a]=1,this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var w=0;w0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=p.mallocFloat(nt.length);for(a=0;ai||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function a(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function o(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function s(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function l(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,l,e,r,n,i)}var c=t("ndarray"),u=t("ndarray-ops"),f=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(h||function(t){h=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],d=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],p=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return l(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return l(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=n(e)?e:e.raw;if(r)return function(t,e,r,n,i,o){var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,l,r,n,i,o)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var l=o(n,e.stride.slice()),h=0;"float32"===r?h=t.FLOAT:"float64"===r?(h=t.FLOAT,l=!1,r="float32"):"uint8"===r?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,l=!1,r="uint8");var d=0;if(2===n.length)d=t.LUMINANCE,n=[n[0],n[1],1],e=c(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])d=t.ALPHA;else if(2===n[2])d=t.LUMINANCE_ALPHA;else if(3===n[2])d=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}h!==t.FLOAT||t.getExtension("OES_texture_float")||(h=t.UNSIGNED_BYTE,l=!1);var p,g,v=e.size;if(l)p=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[n[2],n[2]*n[0],1];g=f.malloc(v,r);var x=c(g,n,y,0);"float32"!==r&&"float64"!==r||h!==t.UNSIGNED_BYTE?u.assign(x,e):m(x,e),p=g.subarray(0,v)}var b=s(t);return t.texImage2D(t.TEXTURE_2D,0,d,n[0],n[1],0,d,h,p),l||f.free(g),new a(t,b,n[0],n[1],d,h)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var h=null,d=null,p=null,m=function(t,e){u.muls(t,e,255)},g=a.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),p.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),p.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(p.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),g.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},g.setPixels=function(t,e,r,i){var a=this.gl;this.bind(),Array.isArray(e)?(i=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),i=i||0;var s=n(t)?t:t.raw;if(s){this._mipLevels.indexOf(i)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(i)):a.texSubImage2D(a.TEXTURE_2D,i,e,r,this.format,this.type,s)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>i||r+t.shape[0]>this._shape[0]>>>i||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,n,i,a,s,l){var h=l.dtype,d=l.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,g=0,v=o(d,l.stride.slice());if("float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,v=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,v=!1,h="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],l=c(l.data,d,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])g=t.ALPHA;else if(2===d[2])g=t.LUMINANCE_ALPHA;else if(3===d[2])g=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}d[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(g=i),g!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),p===a&&v)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var b;b=a===t.FLOAT?f.mallocFloat32(y):f.mallocUint8(y);var _=c(b,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&a===t.UNSIGNED_BYTE?m(_,l):u.assign(_,l),x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,b.subarray(0,y)),a===t.FLOAT?f.freeFloat32(b):f.freeUint8(b)}}(a,e,r,i,this.format,this.type,this._mipLevels,t)}}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],256:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],265:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],266:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],267:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r-1?y:j.indexOf(t)>-1?v:g,e(z.join("")),C=l,E}return z.push(A),T=A,E+1}();break;case x:E=/[^\s]/g.test(A)?(e(z.join("")),C=l,E):(z.push(A),T=A,E+1);break;case l:z=z.length?[]:z,E="/"===T&&"*"===A?(O=L+E-1,C=u,T=A,E+1):"/"===T&&"/"===A?(O=L+E-1,C=f,T=A,E+1):"#"===A?(C=h,O=L+E,E):/\s/.test(A)?(C=x,O=L+E,E):(F=/\d/.test(A),R=/[^\w_]/.test(A),O=L+E,C=F?p:R?d:c,E)}if(r!==E)switch(N[r]){case"\n":P=0,++I;break;default:++P}}return L+=E,N=N.slice(E),D}function M(){return"\r"!==A&&"\n"!==A||"\\"===T?(z.push(A),T=A,E+1):(e(z.join("")),C=l,E)}function k(t){for(var r,n,a=0;;){if(r=i.indexOf(t.slice(0,t.length+a).join("")),n=i[r],-1===r){if(a--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),O+=n.length,(z=z.slice(n.length)).length}}var A,T,S,E=0,L=0,C=l,z=[],D=[],I=1,P=0,O=0,F=!1,R=!1,N="",j=a,B=n;return"300 es"===(t=t||{}).version&&(j=s,B=o),function(t){return D=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):(z.length&&e(z.join("")),C=b,e("(eof)"),D)}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,f=1,h=2,d=3,p=4,m=5,g=6,v=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":270,"./lib/builtins-300es":269,"./lib/literals":272,"./lib/literals-300es":271,"./lib/operators":273}],269:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":270}],270:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],271:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":272}],272:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],273:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],274:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=i.concat(r(t)),i=i.concat(r(null))}},{"./index":268}],275:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,c-=8);t[r+d-p]|=128*m}},{}],278:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return l(t.vertices,e.vertices)}function o(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=c[t];i||(i=c[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=s[t+1];return i||(i=s),n(i)}(t)),this.orient=i}e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),l=s.apply(void 0,a);if(0===l)throw new Error("Input not in general position");for(var c=new Array(i+1),u=0;u<=i;++u)c[u]=u;l<0&&(c[0]=1,c[1]=0);var f=new n(c,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var p=c.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);h[u]=v,d[u]=v}for(d[i+1]=f,u=0;u<=i;++u){p=h[u].vertices;var y=h[u].adjacent;for(m=0;m<=i;++m){var x=p[m];if(x<0)y[m]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[m]=h[b])}}var _=new o(i,a,d),w=!!e;for(u=i+1;u0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=o;++b)y[b]<0?(x=b,l[b]=t):l[b]=s[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=d.slice(),M=p.slice(),k=new n(w,M,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,M[m]=v,w[g]=-1,M[g]=e,p[g]=k,k.flip();for(b=0;b<=o;++b){var T=w[b];if(!(T<0||T===r)){for(var S=new Array(o-1),E=0,L=0;L<=o;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new i(S,k,b))}}}}}}h.sort(a);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":515,"simplicial-complex":526}],279:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?v:(r.splice(n,1),a(t,r),y)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,h),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);return 2===(o=this.left.remove(t))?(this.left=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return v;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);return 2===(o=this.right.remove(t))?(this.right=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:v;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(a=g.ge(this.leftPoints,t,h);athis.mid){if(this.right){var r;if(r=this.right.queryPoint(t,e))return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n;if(n=this.right.queryInterval(t,e,r))return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var b=m.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==v}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":70}],280:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r4))}},{}],288:[function(t,e,r){"use strict";function n(t,e,r,n,a){e=e||function(t){return t[0]},r=r||function(t){return t[1]},a=a||Array,this.nodeSize=n||64,this.points=t,this.ids=new a(t.length),this.coords=new a(2*t.length);for(var o=0;o=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(g))}}return u}},{}],290:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(o,Math.floor(r+(l-c)*f/l+h)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],291:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],g=e[2*p+1];n(m,g,r,i)<=c&&l.push(t[p]);var v=(u+1)%2;(0===u?r-a<=m:i-a<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?r+a>=m:i+a>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],292:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);this.nodeSize=e||64,this.coords=t.slice();var r=Math.floor(t.length/2);this.ids=Array(r);for(var i=0;in;){if(i-n>600){var l=i-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);o(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(i,Math.floor(r+(l-c)*f/l+h)),a)}var d=e[2*r+a],p=n,m=i;for(s(t,e,n,r),e[2*i+a]>d&&s(t,e,n,i);pd;)m--}e[2*n+a]===d?s(t,e,n,m):s(t,e,++m,i),m<=r&&(n=m+1),r<=m&&(i=m-1)}}function s(t,e,r,n){l(t,r,n),l(e,2*r,2*n),l(e,2*r+1,2*n+1)}function l(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype.range=function(t,e,r,n){for(var i,a,o=this.ids,s=this.coords,l=this.nodeSize,c=[0,o.length-1,0],u=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=l)for(var p=d;p<=h;p++)i=s[2*p],a=s[2*p+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[p]);else{var m=Math.floor((d+h)/2);i=s[2*m],a=s[2*m+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[m]);var g=(f+1)%2;(0===f?t<=i:e<=a)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?r>=i:n>=a)&&(c.push(m+1),c.push(h),c.push(g))}}return u},n.prototype.within=function(t,e,r){for(var n=this.ids,a=this.coords,o=this.nodeSize,s=[0,n.length-1,0],l=[],c=r*r;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(a[2*d],a[2*d+1],t,e)<=c&&l.push(n[d]);else{var p=Math.floor((h+f)/2),m=a[2*p],g=a[2*p+1];i(m,g,t,e)<=c&&l.push(n[p]);var v=(u+1)%2;(0===u?t-r<=m:e-r<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?t+r>=m:e+r>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],293:[function(t,e,r){"use strict";function n(t,e){var r;if(u(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],f=c||void 0!==t.property,h=c||!f,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],g=0;g=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?function(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:468}],295:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:563}],296:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{"../error/validation_error":295,"../util/extend":296,"../util/get_type":297,"./validate_array":300,"./validate_boolean":301,"./validate_color":302,"./validate_constants":303,"./validate_enum":304,"./validate_filter":305,"./validate_function":306,"./validate_layer":308,"./validate_number":310,"./validate_object":311,"./validate_source":313,"./validate_string":314}],300:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":295,"../util/get_type":297}],304:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298}],305:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f=8&&(f&&!t.valueSpec["property-function"]?d.push(new n(t.key,t.value,"property functions not supported")):h&&!t.valueSpec["zoom-function"]&&d.push(new n(t.key,t.value,"zoom functions not supported"))),d}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299,"./validate_array":300,"./validate_number":310,"./validate_object":311}],307:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":295,"./validate_string":314}],308:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],311:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],f=i(r);if("object"!==f)return[new n(e,r,"object expected, %s found",f)];for(var h in r){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299}],312:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":295,"./validate":299}],313:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298,"./validate_enum":304,"./validate_object":311}],314:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],315:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":316,"./validate/validate":299,"./validate/validate_constants":303,"./validate/validate_filter":305,"./validate/validate_glyphs_url":307,"./validate/validate_layer":308,"./validate/validate_layout_property":309,"./validate/validate_paint_property":312,"./validate/validate_source":313}],316:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":317}],317:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],318:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],319:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":433}],320:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},a=0;a1?p.name+b:p.name]=m[b]*g}}},n.VertexArrayType=function(t){return new c({members:t,alignment:4})},n.ElementArrayType=function(t){return new c({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":431,"../util/util":433,"./array_group":319,"./bucket/circle_bucket":321,"./bucket/fill_bucket":322,"./bucket/line_bucket":323,"./bucket/symbol_bucket":324,"./buffer_group":326,assert:51,"feature-filter":141}],321:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,(n.prototype=a.inherit(i,{})).addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],322:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,(n.prototype=a.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var h,d,p,m,g,v,y,x=r,b=f?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],g=c.sub(h)._unit()._perp());for(var w=0;w0){var S=h.dist(d);if(S>2*o){var E=h.sub(h.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?x:b;if(L&&"round"===C&&(An&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A100)M=g.clone();else{var z=m.x*g.y-m.y*g.x>0?-1:1,D=A*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(D*z)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var I=m.x*g.y-m.y*g.x>0,P=-Math.sqrt(A*A-1);if(I?(y=0,v=P):(v=0,y=P),_||this.addCurrentVertex(h,this.distance,m,v,y,!1),"fakeround"===C){for(var O,F=Math.floor(8*(.5-(k-.5))),R=0;R=0;N--)O=m.mult((N+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(h,this.distance,O,I)}p&&this.addCurrentVertex(h,this.distance,g,-v,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,g,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,g,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,g,-1,-1,!0),this.addCurrentVertex(h,this.distance,g,0,0,!1)));if(T&&w2*o){var B=h.add(p.sub(h)._mult(o/j)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),h=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,f=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],324:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),f=t("../../symbol/shaping"),h=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=f.shapeText,x=f.shapeIcon,b=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,(n.prototype=m.inherit(o,{})).serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var f="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,h=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,v=24*a["text-letter-spacing"],b=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var z=C||b;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,g,x,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,x=p.br,b=p.tex,_=p.anchorPoint,w=Math.max(f+Math.log(p.minScale)/Math.LN2,h),M=Math.min(f+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===h&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(u,_.x,_.y,g.x,g.y,b.x,b.y,w,M,h,k);i(u,_.x,_.y,v.x,v.y,b.x+b.w,b.y,w,M,h,k),i(u,_.x,_.y,y.x,y.y,b.x,b.y+b.h,w,M,h,k),i(u,_.x,_.y,x.x,x.y,b.x+b.w,b.y+b.h,w,M,h,k),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(I,P,O,F,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":382,"../../symbol/clip_line":384,"../../symbol/collision_feature":386,"../../symbol/get_anchors":388,"../../symbol/mergelines":391,"../../symbol/quads":392,"../../symbol/resolve_text":393,"../../symbol/shaping":394,"../../util/token":432,"../../util/util":433,"../bucket":320,"../load_geometry":328,"point-geometry":477}],325:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=l.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||h.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":433,"./bucket":320,assert:51}],329:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],330:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":433}],331:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":330}],332:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,f=t("gl-matrix"),h=f.vec4,d=f.mat4,p=f.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.locationCoordinate(this.center)._zoomTo(e),i=new a(n.column-.5,n.row-.5);return c.cover(e,[this.pointCoordinate(new a(0,0))._zoomTo(e),this.pointCoordinate(new a(this.width,0))._zoomTo(e),this.pointCoordinate(new a(this.width,this.height))._zoomTo(e),this.pointCoordinate(new a(0,this.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return i.dist(t)-i.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];h.transformMat4(e,e,this.pixelMatrixInverse),h.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,f=e[2]/n,d=r[2]/i,p=f===d?0:(0-f)/(d-f),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return h.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":320,"../source/tile_coord":360,"../util/interpolate":427,"../util/util":433,"./coordinate":329,"./lng_lat":330,"gl-matrix":198,"point-geometry":477}],333:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,f,h,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&b,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":354,"./create_uniform_pragmas":335}],337:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,h>>16),s.uniform2f(o.u_pixel_coord_lower,65535&f,65535&h),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}var i=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){var a=t.gl;a.enable(a.STENCIL_TEST);var o;if(o=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"],t.isOpaquePass===o){t.setDepthSublayer(1);for(var s=0;s0?1-1/(1.001-t):-t}(r.paint["raster-saturation"])),a.uniform1f(l.u_contrast_factor,function(t){return t>0?1/(1-t):1+t}(r.paint["raster-contrast"])),a.uniform3fv(l.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var c,u,f=o.source&&o.source.findLoadedParent(n,0,{}),h=function(t,e,r,n){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=n.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(a[0]=i.clamp(l,0,1),a[1]=1-a[0]):(a[0]=i.clamp(1-c,0,1),a[1]=1-a[0])}var h=r.paint["raster-opacity"];return a[0]*=h,a[1]*=h,a}(o,f,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o.texture),a.activeTexture(a.TEXTURE1),f?(a.bindTexture(a.TEXTURE_2D,f.texture),c=Math.pow(2,f.coord.z-o.coord.z),u=[o.coord.x*c%1,o.coord.y*c%1]):(a.bindTexture(a.TEXTURE_2D,o.texture),h[1]=0);a.uniform2fv(l.u_tl_parent,u||[0,0]),a.uniform1f(l.u_scale_parent,c||1),a.uniform1f(l.u_buffer_scale,1),a.uniform1f(l.u_opacity0,h[0]),a.uniform1f(l.u_opacity1,h[1]),a.uniform1i(l.u_image0,0),a.uniform1i(l.u_image1,1);var d=o.boundsBuffer||t.rasterBoundsBuffer;(o.boundsVAO||t.rasterBoundsVAO).bind(a,l,d),a.drawArrays(a.TRIANGLE_STRIP,0,d.length)}(t,e,r,l)}a.depthFunc(a.LEQUAL)}}var i=t("../util/util"),a=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new a({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":431,"../util/util":433}],343:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,l,c,u,f,h,d,p,m,g){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],345:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":320,"../data/buffer":325,"../source/pixels_to_tile_units":354,"../source/source_cache":358,"../util/browser":417,"../util/struct_array":431,"../util/util":433,"./create_uniform_pragmas":335,"./draw_background":336,"./draw_circle":337,"./draw_debug":339,"./draw_fill":340,"./draw_line":341,"./draw_raster":342,"./draw_symbol":343,"./frame_history":344,"./painter/use_program":347,"./vertex_array_object":348,"gl-matrix":198}],347:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=o[t],h="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":320,"../util/evented":425,"../util/util":433,"resolve-url":508}],350:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),f.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),f=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(f,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":416,"../util/util":433,"./geojson_wrapper":351,"./vector_tile_worker_source":362,"geojson-rewind":147,"geojson-vt":151,supercluster:538,"vt-pbf":570}],351:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},f=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rf-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var x=h.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,u=0;u=0&&v[1].y>=0){for(var y=[],x=0;x=0&&t%1==0),s(!isNaN(e)&&e>=0&&e%1==0),s(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hu.dy&&(l=c,c=u,u=l),c.dy>f.dy&&(l=c,c=f,f=l),u.dy>f.dy&&(l=u,u=f,f=l),c.dy&&a(f,c,n,o,s),u.dy&&a(f,u,n,o,s)}var s=t("assert"),l=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<0;a--)i+=(e&(n=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var o,l;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":425,"../util/mapbox":430,"../util/util":433,"./load_tilejson":353}],362:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new s(t);i.abort=this.loadVectorData(t,function(t,a){return delete this.loading[r][n],t?e(t):a?(i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][n]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=i.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":416,"./worker_tile":365,pbf:470,"vector-tile":564}],363:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,h=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new f;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new h(e.serialize(),f.serialize(),h.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":320,"../data/buffer":325,"../geo/lng_lat":330,"../render/draw_raster":342,"../render/vertex_array_object":348,"../util/ajax":416,"../util/evented":425,"../util/util":433,"./tile_coord":360,"point-geometry":477}],364:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)x(E,P[e]);b()}}function x(t,e){if(e.populateArrays(A,N,R),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=u.create({layer:w,index:z++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var F in L)0!==(k=L[F]).features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),I.push(k),"symbol"===k.type?P.push(k):O.push(k));var R={},N={},j=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(R),P[_].updateFont(N);for(var B in N)N[B]=Object.keys(N[B]).map(Number);R=Object.keys(R),r.send("get glyphs",{uid:this.uid,stacks:N},function(t,e){N=e,y(t)}),R.length?r.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)x(0,O[_]);if(0===P.length)return b()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),f=s.filter(i);return{result:{buckets:f.map(a),collisionTile:u.data},transferables:o(f).concat(u.transferables)}}},{"../data/bucket":320,"../data/feature_index":327,"../symbol/collision_box":385,"../symbol/collision_tile":387,"../symbol/symbol_instances":396,"../symbol/symbol_quads":397,"../util/dictionary_coder":423,"../util/util":433}],366:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],367:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":416,"../util/browser":417,"../util/evented":425,"../util/mapbox":430}],368:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":433,"./style_function":371,csscolorparser:114}],369:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire("error",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?f.getJSON(h(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),f=t("../util/ajax"),h=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),x=t("../source/source_cache"),b=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);return!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,f*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),f/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:f,to:a,toScale:1,t:n}}}(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var o=[],s=this.value.stops,l=0;l=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}},{}],384:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s=i&&h.x>=i||(f.x>=i?f=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}},{"point-geometry":477}],385:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":431,"../util/util":433,"point-geometry":477}],386:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=h-f,g=p-d;if(m>0)if(m=Math.max(10*s,m),u){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,f,p,h,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),f=-a/2,h=this.boxes,d=r,p=n+1,m=f;do{if(--p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return h;g=e[p].dist(e[p+1])}var x=y-m,b=e[p],_=e[p+1].sub(b)._unit()._mult(x)._add(b)._round(),w=i/2/Math.max(Math.abs(y-f)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return h}},{}],387:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),k=new i(c.x2,c.y1).matMult(w),A=new i(c.x1,c.y2).matMult(w),T=new i(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=c.maxScale}else _=c;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),f=this.tempCollisionBox;f.anchorX=u.x,f.anchorY=u.y,f.x1=0,f.y1=0,f.x2=r-t,f.y2=n-e,f.maxScale=a,a=f.maxScale;for(var h=[u.x+f.x1/a,u.y+f.y1/a*this.yStretch,u.x+f.x2/a,u.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m=a&&(o[y][x]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var f=Math.min(Math.max(s,l),Math.max(c,u)),h=i.maxScale,d=r.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&A=0&&T=0&&v+d<=p){var S=new a(A,T,M,x)._round();s&&!o(t,S,c,s,l)||y.push(S)}}g+=w}return f||y.length||u||(y=n(t,g/2,r,s,l,c,u,!0,h)),y}var i=t("../util/interpolate"),a=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,i,a,o,s,l,c){var u=i?.6*o*s:0,f=Math.max(i?i.right-i.left:0,a?a.right-a.left:0),h=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return e-f*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);o(i,function(t,r){for(var i=!t&&new s(new c(new Uint8Array(r))),a=0;an&&null!==f){var x=g[f+1].x;m=Math.max(x,m);for(var b=f+1;b<=v;b++)g[b].y+=r,g[b].x-=x;if(c){var _=f;a[g[f].codePoint]&&_--,i(g,e,d,_,c)}d=f+1,f=null,h+=x,p++}o[y.codePoint]&&(f=v)}var w=g[g.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;i(g,e,d,g.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(f?(clearTimeout(f),f=null,o("dblclick",e)):f=setTimeout(r,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){n.mousePos(l,t).equals(u)&&o("click",t)},!1),l.addEventListener("dblclick",function(t){o("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){c=t,t.preventDefault()},!1)}},{"../util/dom":419,"./handler/box_zoom":404,"./handler/dblclick_zoom":405,"./handler/drag_pan":406,"./handler/drag_rotate":407,"./handler/keyboard":408,"./handler/scroll_zoom":409,"./handler/touch_zoom_rotate":410,"point-geometry":477}],399:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&p.lng<0?p.lng+=360:c.center.lng<0&&p.lng>0&&(p.lng-=360));var y=c.zoomScale(m-f),x=c.point,b="center"in t?c.project(p).sub(u.div(y)):x,_=c.worldSize,w=t.curve,M=Math.max(c.width,c.height),k=M/y,A=b.sub(x).mag();if("minZoom"in t){var T=n.clamp(Math.min(t.minZoom,f,m),c.minZoom,c.maxZoom),S=M/c.zoomScale(T-f);w=Math.sqrt(S/A*2)}var E=w*w,L=r(0),C=function(t){return s(L)/s(L+w*t)},z=function(t){return M*((s(L)*function(t){return a(t)/s(t)}(L+w*t)-a(L))/E)/A},D=(r(1)-L)/w;if(Math.abs(A)<1e-6){if(Math.abs(M-k)<1e-6)return this.easeTo(t);var I=k=0)return!1;return!0})).join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],401:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":425,"../../util/util":433}],402:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433,"./control":401}],403:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],404:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":331,"../../util/dom":419,"../../util/util":433}],405:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],406:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,f=l.mult(-u/2);this._map.panBy(f,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],407:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=f*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433,"point-geometry":477}],408:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],409:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),c=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433}],410:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&a!==s){var f=.15*l/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),d=a+f*h/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:h,easing:o,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],411:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":433}],412:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),f=t("../style/animation_loop"),h=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),x=t("point-geometry"),b=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new f,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new b(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof x||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof x||"number"==typeof t[0]){e=[x.convert(t)]}else{var r=[x.convert(t[0]),x.convert(t[1])];e=[r[0],new x(r[1].x,r[0].y),r[1],new x(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new h(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":330,"../geo/lng_lat_bounds":331,"../geo/transform":332,"../render/painter":346,"../style/animation_loop":366,"../style/style":369,"../util/browser":417,"../util/canvas":418,"../util/dom":419,"../util/evented":425,"../util/util":433,"./bind_handlers":398,"./camera":399,"./control/attribution":400,"./hash":411,"point-geometry":477}],413:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":330,"../util/dom":419,"point-geometry":477}],414:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)r.appendChild(e);return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":330,"../util/dom":419,"../util/evented":425,"../util/util":433}],415:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],416:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":318}],418:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":433,"mapbox-gl-supported":318}],419:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var u=0;u=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i(e.y-t.y)*(r.x-t.x)}function a(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}(t,e[i-1],e[i])e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function s(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var n=0;n=3)for(var u=0;u1){if(n(t,e))return!0;for(var i=0;ithis.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],430:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}var a=t("./config"),o=t("./browser"),s=t("url"),l=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=s.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==s.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=s.parse(t);if("mapbox:"!==r.protocol)return t;return n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=s.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,s.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=s.parse(t,!0);if(!e)return t;if("mapbox:"!==s.parse(e).protocol)return t;var i=o.supportsWebp?".webp":"$1",c=o.devicePixelRatio>=2||512===r?"@2x":"";return s.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,c+i),query:function(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?l.extend({},t,{access_token:a.ACCESS_TOKEN}):t}(n.query)})}},{"./browser":417,"./config":422,"./util":433,url:559}],431:[function(t,e,r){"use strict";function n(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function a(t){return f[t].BYTES_PER_ELEMENT}function o(t){return t.toLowerCase()}function s(t,e){var r="this._pos"+a(t.type).toFixed(0)+" + "+(t.offset/a(t.type)+e).toFixed(0);return"this._structArray."+o(t.type)+"["+r+"]"}function l(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function c(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var u=t("assert");e.exports=function(t){function e(){l.apply(this,arguments)}function r(){c.apply(this,arguments),this.members=e.prototype.members}var d=JSON.stringify(t);if(h[d])return h[d];void 0===t.alignment&&(t.alignment=1);var p=0,m=0,g=["Uint8"];return(e.prototype=Object.create(l.prototype)).members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},u(r.name.length),u(r.type in f),g.indexOf(r.type)<0&&g.push(r.type);var n=a(r.type);m=Math.max(m,n),r.offset=p=i(p,Math.max(t.alignment,n));for(var o=0;othis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},c.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":329,unitbezier:557}],434:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],435:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],436:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ip[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":438,"gl-mat4/clone":180,"gl-mat4/create":181,"gl-mat4/determinant":182,"gl-mat4/invert":186,"gl-mat4/transpose":196,"gl-vec3/cross":260,"gl-vec3/dot":261,"gl-vec3/length":262,"gl-vec3/normalize":264}],438:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],439:[function(t,e,r){function n(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var a=t("gl-vec3/lerp"),o=t("mat4-recompose"),s=t("mat4-decompose"),l=t("gl-mat4/determinant"),c=t("quat-slerp"),u=n(),f=n(),h=n();e.exports=function(t,e,r,n){if(0===l(e)||0===l(r))return!1;var i=s(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),d=s(r,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!(!i||!d||(a(h.translate,u.translate,f.translate,n),a(h.skew,u.skew,f.skew,n),a(h.scale,u.scale,f.scale,n),a(h.perspective,u.perspective,f.perspective,n),c(h.quaternion,u.quaternion,f.quaternion,n),o(t,h.translate,h.scale,h.skew,h.perspective,h.quaternion),0))}},{"gl-mat4/determinant":182,"gl-vec3/lerp":263,"mat4-decompose":437,"mat4-recompose":440,"quat-slerp":490}],440:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":181,"gl-mat4/fromRotationTranslation":184,"gl-mat4/identity":185,"gl-mat4/multiply":188,"gl-mat4/scale":194,"gl-mat4/translate":195}],441:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var i=t("binary-search-bounds"),a=t("mat4-interpolate"),o=t("gl-mat4/invert"),s=t("gl-mat4/rotateX"),l=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];e.exports=function(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=n.prototype;p.recalcMatrix=function(t){var e=this._time,r=i.le(e,t),n=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)f[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&f[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)n[c]=f[c];else a(n,f,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],h(m,m);var g=this.computedInverse;o(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-n[2+4*c]*b}},p.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(i=0,o.length);i0;--d)r[f++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":515}],443:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==m.alt,m.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==m.shift,m.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==m.control,m.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==m.meta,m.meta=!!t.metaKey),e}function i(t,i){var a=n.x(i),o=n.y(i);"buttons"in i&&(t=0|i.buttons),(t!==h||a!==d||o!==p||r(i))&&(h=0|t,d=a||0,p=o||0,e&&e(h,d,p,m))}function a(t){i(0,t)}function o(){(h||d||p||m.shift||m.alt||m.meta||m.control)&&(d=p=0,h=0,m.shift=m.alt=m.control=m.meta=!1,e&&e(0,0,0,m))}function s(t){r(t)&&e&&e(h,d,p,m)}function l(t){0===n.buttons(t)?i(0,t):i(h,t)}function c(t){i(h|n.buttons(t),t)}function u(t){i(h&~n.buttons(t),t)}function f(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var h=0,d=0,p=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;f();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return g},set:function(e){e?f():g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":445}],444:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-o.left,r[1]=a-o.top,r}},{}],445:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<0;k=k-1&m)b.push(_+"["+A+"+"+g(k)+"]");for(b.push(v(0)),k=0;k=0;--e)L(e,0);var r=[];for(e=0;e0){",h(S[t]),"=1;"),D(t-1,e|1<0&&q.push(s(j,S[B-1])+"*"+o(S[B-1])),R.push(d(j,S[B])+"=("+q.join("-")+")|0")}for(j=0;j=0;--j)H.push(o(S[j]));R.push(k+"=("+H.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",A+"=0"),R.push(p(0)+"=0");for(B=1;B<1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return x(t.vertex,t.cell,t.phase,i,r,o)};var _="V",w="P",M="N",k="Q",A="X",T="T"},{"typedarray-pool":554}],448:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":119}],449:[function(t,e,r){"use strict";function n(t){if(t in o)return o[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){for(a.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");for(a.push("){grad",r,"(src.pick(",s.join(),")",c),l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join();if(v=s[r])return v;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],l=0;l<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:o,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":116}],453:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":454,ndarray:458}],454:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":116}],455:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[a.mallocUint8,a.freeUint8];case"uint16":return[a.mallocUint16,a.freeUint16];case"uint32":return[a.mallocUint32,a.freeUint32];case"int8":return[a.mallocInt8,a.freeInt8];case"int16":return[a.mallocInt16,a.freeInt16];case"int32":return[a.mallocInt32,a.freeInt32];case"float32":return[a.mallocFloat,a.freeFloat];case"float64":return[a.mallocDouble,a.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",f,"*n",f].join("")):s.push(["d",d,"=s",d].join("")),f=d);var p;0!=(p=t.length-1-l)&&(h>0?s.push(["e",p,"=s",p,"-e",h,"*n",h,",f",p,"=",c[p],"-f",h,"*n",h].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),h=p)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",o,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+a);var g=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var f=[],h=1;h1){for(o.push("dptr=0;sptr=ptr"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");for(o.push("dptr=cptr;sptr=cptr-s0"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));return o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c?new Function("malloc","free",o.join("\n"))(c[0],c[1]):new Function(o.join("\n"))()}(t,e);return g(v,function(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function s(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function l(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function c(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i)0!==(o=t[i])&&_.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function f(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++A;u(o,[n,i],!1,["comp=",s("ptr0"),"-",s("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else _.push(["if(",s(a(n)),">",s(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?c([e,r],!1,l("ptr0",s("ptr1"))):_.push(l(a(e),s(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;u(i,[r],!0,[e,"=",s("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",s(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?c([e,r],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(c([e,r,n],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?c([e,r],!0,[l("ptr0",s("ptr1")),"\n",l("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(l(a(e),s(a(r))),l(a(r),"pivot"+n))}function x(e,r){_.push(["if((",r,"-",e,")<=",o,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function b(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),c([e],!0,["if(",s("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",s(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?c(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",s("ptr1"),"\n","pivot2[pivot_ptr]=",s("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",s("ptr0"),"\n","y=",s("ptr2"),"\n","z=",s("ptr4"),"\n",l("ptr5","x"),"\n",l("ptr6","y"),"\n",l("ptr7","z")].join("")):_.push(["pivot1=",s(a("el2")),"\n","pivot2=",s(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",s(a("el1")),"\n","y=",s(a("el3")),"\n","z=",s(a("el5")),"\n",l(a("index1"),"x"),"\n",l(a("index3"),"y"),"\n",l(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),b("less",1,"++less"),b("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k?new Function("insertionSort","malloc","free",_.join("\n"))(r,k[0],k[1]):new Function("insertionSort",_.join("\n"))(r)}(t,e,v))}},{"typedarray-pool":554}],456:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":455}],457:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":119,"ndarray-linear-interpolate":451}],458:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");return new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],i)}var o=t("iota-array"),s=t("is-buffer"),l="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var o=i-1,u=1;o>=0;--o)r[o]=u,u*=e[o]}if(void 0===n)for(n=0,o=0;o>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},{"double-bits":131}],460:[function(t,e,r){function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function a(t,e,r,n,i,s,u,f,h,d){if(d)M=d[0],k=d[1],_=d[2],w=d[3];else{var p=o(t,e,-i);t=p.x,e=p.y;var m=(t-(f=(p=o(f,h,-i)).x))/2,g=(e-(h=p.y))/2,v=m*m/(r*r)+g*g/(n*n);v>1&&(r*=v=Math.sqrt(v),n*=v);var y=r*r,x=n*n,b=(s==u?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*m*m)/(y*g*g+x*m*m)));b==1/0&&(b=1);var _=b*r*g/n+(t+f)/2,w=b*-n*m/r+(e+h)/2,M=Math.asin(((e-w)/n).toFixed(9)),k=Math.asin(((h-w)/n).toFixed(9));M=t<_?l-M:M,k=f<_?l-k:k,M<0&&(M=2*l+M),k<0&&(k=2*l+k),u&&M>k&&(M-=2*l),!u&&k>M&&(k-=2*l)}if(Math.abs(k-M)>c){var A=k,T=f,S=h;k=M+c*(u&&k>M?1:-1);var E=a(f=_+r*Math.cos(k),h=w+n*Math.sin(k),r,n,i,0,u,T,S,[k,A,_,w])}var L=Math.tan((k-M)/4),C=4/3*r*L,z=4/3*n*L,D=[2*t-(t+C*Math.sin(M)),2*e-(e-z*Math.cos(M)),f+C*Math.sin(k),h-z*Math.cos(k),f,h];if(d)return D;E&&(D=D.concat(E));for(var I=0;I7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=d,b=p;"C"!=e&&"S"!=e||(x+=x-o,b+=b-l),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),v=i(d,p,f,h,v[1],v[2]);break;case"Q":f=v[1],h=v[2],v=i(d,p,v[1],v[2],v[3],v[4]);break;case"L":v=n(d,p,v[1],v[2]);break;case"H":v=n(d,p,v[1],p);break;case"V":v=n(d,p,d,v[1]);break;case"Z":v=n(d,p,c,u)}e=y,d=v[v.length-2],p=v[v.length-1],v.length>4?(o=v[v.length-4],l=v[v.length-3]):(o=d,l=p),r.push(v)}return r}},{}],461:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[c],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,M=(x+2)%3;b[x]+=_*(v[w]*m[M]-v[M]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0;for(c=0;c<3;++c)h[c]*=d;i[o]=h}return i}},{}],462:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var f=Math.sqrt(u+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,c);f=Math.sqrt(2*h-u+1),e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],464:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=s([r]),this.center=s(e),this.rotation=s(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),a(r=[].slice.call(r,0,4),r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var s=t("filtered-vector"),l=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),u=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),h=o.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d);u/=p,f/=p,h/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,x=m*u+g*f+v*h,b=n(m-=y*o+x*u,g-=y*s+x*f,v-=y*l+x*h);m/=b,g/=b,v/=b;var _=u*e+o*r,w=f*e+s*r,M=h*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*u,v=e*l+r*f,y=e*c+r*h,x=-(p*y-m*v),b=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=i(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*x+T*_-S*b,C=T*w+E*b+S*x-A*_,z=S*w+E*_+A*b-T*x,D=E*w-A*x-T*b-S*_;if(a){x=d,b=p,_=m;var I=Math.sin(a)/n(x,b,_);x*=I,b*=I,_*=I,D=D*(w=Math.cos(e))-(L=L*w+D*x+C*_-z*b)*x-(C=C*w+D*b+z*x-L*_)*b-(z=z*w+D*_+L*b-C*x)*_}var P=i(L,C,z,D);P>1e-6?(L/=P,C/=P,z/=P,D/=P):(L=C=z=0,D=1),this.rotation.set(t,L,C,z,D)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;l(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,c=0;c<3;++c)s+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;u(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":463,"filtered-vector":142,"gl-mat4/fromQuat":183,"gl-mat4/invert":186,"gl-mat4/lookAt":187}],465:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":507}],466:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:function(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?function(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=d.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&function(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,i,e)},writePackedSVarint:function(t,e){this.writeMessage(t,a,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,o,e)},writePackedDouble:function(t,e){this.writeMessage(t,s,e)},writePackedFixed32:function(t,e){this.writeMessage(t,c,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,u,e)},writePackedFixed64:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,h,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":469}],471:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":280,"typedarray-pool":554}],473:[function(t,e,r){"use strict";function n(t){return i[t]?i[t]:("string"==typeof t&&(t=i[t]=t.split(/\s*,\s*|\s+/)),t)}e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a0){o=c[u][i][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=c[f][i],d=0;d0&&(o=p,s=m,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=i(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],f=t,h=s[1],d=i(u,f,!0);if(n(e[u],e[f],e[h],e[d])<0)break;s.push(t),l=i(u,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;u0;){c[0][u].length;var m=a(u,d);o(0,m)?p.push.apply(p,m):(p.length>0&&h.push(p),p=m)}p.length>0&&h.push(p)}return h};var n=t("compare-angle")},{"compare-angle":106}],475:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){i[d=o.pop()]=!1;var c=r[d];for(s=0;s0})).length,g=new Array(m),v=new Array(m);for(d=0;d0;){var N=O.pop(),j=E[N];c(j,function(t,e){return t-e});var B,U=j.length,V=F[N];for(0===V&&(B=[H=p[N]]),d=0;d=0)&&(F[q]=1^V,O.push(q),0===V)){var H;r(H=p[q])||(H.reverse(),B.push(H))}}0===V&&R.push(B)}return R};var i=t("edges-to-adjacency-list"),a=t("planar-dual"),o=t("point-in-big-polygon"),s=t("two-product"),l=t("robust-sum"),c=t("uniq"),u=t("./lib/trim-leaves")},{"./lib/trim-leaves":475,"edges-to-adjacency-list":136,"planar-dual":474,"point-in-big-polygon":478,"robust-sum":520,"two-product":552,uniq:556}],477:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],478:[function(t,e,r){function n(){return!0}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var s=i.key,l=o(r,s[0],s[1]);if(s[0][0]0))return 0;a=-1,i=i.right}else if(l>0)i=i.left;else{if(!(l<0))return 0;a=1,i=i.right}}return a}}(g.slabs,g.coordinates);return 0===n.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(i(n),v)};var o=t("robust-orientation")[3],s=t("slab-decomposition"),l=t("interval-tree-1d"),c=t("binary-search-bounds")},{"binary-search-bounds":70,"interval-tree-1d":279,"robust-orientation":515,"slab-decomposition":532}],479:[function(t,e,r){function n(t,e,r){var n=i.segments(t),a=i.segments(e),o=r(i.combine(n,a));return i.polygon(o)}var i,a=t("./lib/build-log"),o=t("./lib/epsilon"),s=t("./lib/intersecter"),l=t("./lib/segment-chainer"),c=t("./lib/segment-selector"),u=t("./lib/geojson"),f=!1,h=o();i={buildLog:function(t){return!0===t?f=a():!1===t&&(f=!1),!1!==f&&f.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=s(!0,h,f);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:s(!1,h,f).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:c.union(t.combined,f),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:c.intersect(t.combined,f),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:c.difference(t.combined,f),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:c.differenceRev(t.combined,f),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:c.xor(t.combined,f),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,h,f),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(i,t)},polygonToGeoJSON:function(t){return u.fromPolygon(i,h,t)},union:function(t,e){return n(t,e,i.selectUnion)},intersect:function(t,e){return n(t,e,i.selectIntersect)},difference:function(t,e){return n(t,e,i.selectDifference)},differenceRev:function(t,e){return n(t,e,i.selectDifferenceRev)},xor:function(t,e){return n(t,e,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),e.exports=i},{"./lib/build-log":480,"./lib/epsilon":481,"./lib/geojson":482,"./lib/intersecter":483,"./lib/segment-chainer":485,"./lib/segment-selector":486}],480:[function(t,e,r){e.exports=function(){function t(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}var e,r=0,n=!1;return e={list:[],segmentId:function(){return r++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,n){return t("temp_status",{seg:e,above:r,below:n})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,n){return t("status",{seg:e,above:r,below:n})},vert:function(r){return r===n?e:(n=r,t("vert",{x:r}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}}}},{}],481:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],482:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}if(e.length<=0)return t.segments({inverted:!1,regions:[]});for(var n=r(e[0]),i=1;i0})}function s(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),m=!d&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;p&&(d||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var c=n.create(),f=[];!u.isEmpty();){var h=u.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=o(h),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(h.seg,!!p&&p.seg,!!m&&m.seg);var g=function(){if(p){var t=s(h,p);if(t)return t}return!!m&&s(h,m)}();if(g&&(t?(v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(g.seg),h.other.remove(),h.remove()),u.getHead()!==h){r&&r.rewind(h.seg);continue}if(t){var v;v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=v?!h.seg.myFill.below:h.seg.myFill.below}else if(null===h.seg.otherFill){var y;y=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?a:i,h.seg.otherFill={above:y,below:y}}r&&r.status(h.seg,!!p&&p.seg,!!m&&m.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(c.exists(x.prev)&&c.exists(x.next)&&s(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}f.push(h.seg)}u.getHead().remove()}return r&&r.done(),f}var u=n.create();return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p):(b=0,d>=0?(_=0,y=p):-d>=f?(_=1,y=f+2*d+p):y=d*(_=-d/f)+p);else if(_<0)_=0,h>=0?(b=0,y=p):-h>=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p;else{var w=1/x;y=(b*=w)*(c*b+u*(_*=w)+2*h)+_*(u*b+f*_+2*d)+p}else{var M,k,A,T;b<0?(k=f+d)>(M=u+h)?(A=k-M)>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p:(b=0,k<=0?(_=1,y=f+2*d+p):d>=0?(_=0,y=p):y=d*(_=-d/f)+p):_<0?(k=c+h)>(M=u+d)?(A=k-M)>=(T=c-2*u+f)?(_=1,b=0,y=f+2*d+p):y=(b=1-(_=A/T))*(c*b+u*_+2*h)+_*(u*b+f*_+2*d)+p:(_=0,k<=0?(b=1,y=c+2*h+p):h>=0?(b=0,y=p):y=h*(b=-h/c)+p):(A=f+d-u-h)<=0?(b=0,_=1,y=f+2*d+p):A>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p}var S=1-b-_;for(l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]);return n+a((t=t.replace(C,".")).split("."),e).join(".")}function s(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(e+=P((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=P(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:b}function u(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?I(t/k):t>>1,t+=I(t/e);t>D*w>>1;n+=b)t=I(t/D);return I(n+(D+1)*t/(t+M))}function h(t){var e,r,n,a,o,s,u,h,d,p,m=[],g=t.length,v=0,y=T,M=A;for((r=t.lastIndexOf(S))<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a=g&&i("invalid-input"),((h=c(t.charCodeAt(a++)))>=b||h>I((x-v)/s))&&i("overflow"),v+=h*s,d=u<=M?_:u>=M+w?w:u-M,!(hI(x/(p=b-d))&&i("overflow"),s*=p;M=f(v-o,e=m.length+1,0==o),I(v/e)>x-y&&i("overflow"),y+=I(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,c,h,d,p,m,g,v,y,M,k=[];for(g=(t=s(t)).length,e=T,r=0,o=A,l=0;l=e&&mI((x-r)/(v=n+1))&&i("overflow"),r+=(c-e)*v,e=c,l=0;lx&&i("overflow"),m==e){for(h=r,d=b;p=d<=o?_:d>=o+w?w:d-o,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=b-_,I=Math.floor,P=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:h,encode:d,toASCII:function(t){return o(t,function(t){return L.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return o(t,function(t){return E.test(t)?h(t.slice(4).toLowerCase()):t})}},p&&m)if(e.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],490:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":236}],491:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(f=m.substr(0,g),h=m.substr(g+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],492:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne?1:0};a>r;){if(a-r>600){var s=a-r+1,l=e-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-l*u/s+f)),Math.min(a,Math.floor(e+(s-l)*u/s+f)),o)}var h=t[e],d=r,p=a;for(i(t,r,e),o(t[a],h)>0&&i(t,r,a);d0;)p--}0===o(t[r],h)?i(t,r,p):i(t,++p,a),p<=e&&(r=p+1),e<=p&&(a=p-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],495:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":90,"compare-cell":107,"compare-oriented-cell":108}],500:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){function r(t){t?p(t):null===t&&m(),c()}function c(e){if("number"==typeof e)return d(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),k.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?d(r):t.draw=!0)})}function d(t){"number"==typeof t&&(t=k[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],g(t),t.after&&t.after(t))}function p(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(k=t.map(function(t,c){var u=k[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(k[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},M,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a2&&(t._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&x(e),e.thickness&&e.color&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],e.scaleRatio[0]>L||e.scaleRatio[1]>L?y(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.positions.length>=C)?y(e):v(e),e.after&&e.after(e)))}function m(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0;if(S=t.map(function(t,r){var s=S[r];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=l(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color stroke colors stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",after:"after callback done pass"}),s||(S[r]=s={id:r,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,offset:0,dashLength:0,hole:!0},t=o({},T,t)),c(s,t,[{thickness:parseFloat,opacity:parseFloat,miterLimit:parseFloat,overlay:Boolean,join:function(t){return t},after:function(t){return t},hole:function(t){return t||[]},positions:function(t,r,n){t=u(t,"float64");var i=Math.floor(t.length/2),o=a(t,2);return r.range||n.range||(n.range=o),r.count=i,r.bounds=o,e+=i,t},fill:function(t){return t?i(t,"uint8"):null},dashes:function(t,e,r){var n,i=e.dashLength;if(!t||t.length<2)i=1,n=new Uint8Array([255,255,255,255,255,255,255,255]);else{i=0;for(var a=0;a=4&&e.positions[0]===e.positions[e.positions.length-2]&&e.positions[1]===e.positions[e.positions.length-1]},positions:function(t,e,r){if(e.fill&&t.length){for(var n=[],i={},a=0,o=0,s=0,l=e.count;o 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord + translate) * scale;\n\tvec2 aBotPosition = (aBotCoord + translate) * scale;\n\n\tvec2 bTopPosition = (bTopCoord + translate) * scale;\n\tvec2 bBotPosition = (bBotCoord + translate) * scale;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = (aCoord + translate) * scaleRatio + viewport.xy;\n\tendCoord = (bCoord + translate) * scaleRatio + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1},bColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset+4},divisor:1},prevCoord:{buffer:w,stride:8,offset:function(t,e){return 8*e.offset},divisor:1},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},nextCoord:{buffer:w,stride:8,offset:function(t,e){return 24+8*e.offset},divisor:1}}},z)),y=t(o({vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float thickness, pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nconst float MAX_LINES = 256.;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n return (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n}\n\nvoid main() {\n\t// vec2 scaleRatio = scale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\tfloat depth = (MAX_LINES - 1. - id) / (MAX_LINES);\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scaleRatio);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},aCoordFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoordFract:{buffer:M,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},color:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1}}},z)),x=t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= opacity;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset}},positionFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset}}},blend:z.blend,depth:{enable:!1},scissor:z.scissor,stencil:z.stencil,viewport:z.viewport}),o(r,{update:m,draw:d,destroy:g,regl:t,gl:A,canvas:A.canvas,lines:S}),r}},{"array-bounds":48,"array-normalize":49,"color-normalize":99,earcut:135,"flatten-vertex-data":143,glslify:502,"object-assign":462,"pick-by-alias":473,"update-diff":558}],502:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],503:[function(t,e,r){"use strict";var n=t("color-normalize"),i=t("array-bounds"),a=t("color-id"),o=t("snap-points-2d"),s=t("object-assign"),l=t("glslify"),c=t("binary-search-bounds"),u=t("pick-by-alias"),f=t("update-diff"),h=t("flatten-vertex-data"),d=t("is-iexplorer"),p=t("to-float32"),m=p.float32,g=p.fract32;e.exports=function(t,e){function r(t){t?x(t):null===t&&M(),p()}function p(t){if("number"==typeof t)return v(t);Array.isArray(t)?t.forEach(function(t,e){if(null!=t)return t.length?v(t,e):v(t)}):O.forEach(function(t,e){t&&v(e)})}function v(e,r){"number"==typeof e&&(e=O[e]);var n;if(Array.isArray(e)&&(n=e,e=O[r]),e&&e.count&&e.opacity){var i;if(n){i=Array(e.count);for(var a=0;a1)){var g=m.offset,v=m.count+g,y=c.ge(f,i[0],g,v-1),x=c.lt(f,i[2],y,v-1)+1;if(!(x<=y))if(r){var b=n(t.data.subarray(y,x),r);l.push(s({},e,{elements:b,marker:F[h],offset:0,count:b.length}))}else l.push(s({},e,{elements:t.elements,marker:F[h],offset:y,count:x-y}))}}return l}function x(e){if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=0,n=0,a=0;O=e.map(function(e,l){var c=O[l];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=u(e,{positions:"positions data points",snap:"snap cluster",size:"sizes size radius",borderSize:"borderSizes borderSize stroke-width strokeWidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",palette:"palette swatch",marker:"markers marker shape",range:"range dataBox",viewport:"viewport viewBox",opacity:"opacity alpha"}),c||(O[l]=c={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,markerIds:[]},e=s({},P,e)),!e.positions||"marker"in e||(e.marker=c.marker,delete c.marker),f(c,e,[{snap:!0,size:function(t){return n+=t.length?1:0,t},borderSize:function(t){return n+=t.length?1:0,t},opacity:parseFloat,color:function(t){return t=w(t),a++,t},borderColor:function(t){return t=w(t),a++,t},positions:function(t,e,n){t=h(t,"float64");var a=e.count=Math.floor(t.length/2),o=e.bounds=a?i(t,2):null;return n.range||e.range||(delete e.range,n.range=o),e.offset=r,r+=a,n.marker||e.marker||(delete e.marker,n.marker=null),t}},{marker:function(t,e,r){if(e.markerIds.length=0,t&&"number"!=typeof t[0])for(var n=0,i=t.length;ni)){c.snap=!0;var h=c.x=Array(u),d=c.w=Array(u),p=void 0;if(n.length>1){p=Array(2*u);for(var m=0;m=0)return r;var n;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)n=e;else{n=new Uint8Array(e.length);for(var i=0,a=e.length;i 1.0) {\n discard;\n }\n\n float centerFraction = fragBorderSize == 0. ? 2. : fragSize / (fragSize + fragBorderSize + 1.25);\n\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, 1.);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n"]),vert:l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth, fragBorderSize, fragSize;\n\nvoid main() {\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n fragBorderSize = borderSize;\n fragSize = size;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragWidth = 1. / gl_PointSize;\n}\n"]),uniforms:{color:function(t,e){var r=e.color.length?e.color[0]:e.color;return D.slice(4*r,4*r+4).map(function(t){return t/255})},borderColor:function(t,e){var r=e.borderColor.length?e.borderColor[0]:e.borderColor;return D.slice(4*r,4*r+4).map(function(t){return t/255})},pixelRatio:t.context("pixelRatio"),palette:C,scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("marker")},attributes:{position:S,positionFract:E,size:B.attributes.size,borderSize:B.attributes.borderSize}}));else{var U=s({},B);U.frag=l(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float pixelRatio, opacity;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n //max-distance alpha\n if (dist < 0.003) discard;\n\n //null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a);\n return;\n }\n\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n}\n"]),U.vert=l(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius,\n\t\tfragWidth, fragBorderColorLevel, fragColorLevel;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pixelRatio;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),k=t(U);var V=s({},B);V.frag=l(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif(radius > 1.0 + delta) {\n\t\tdiscard;\n\t\treturn;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),V.vert=l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),A=t(V)}return s(r,{update:x,draw:p,destroy:M,regl:t,gl:z,canvas:z.canvas,groups:O,markers:R}),r}},{"array-bounds":48,"binary-search-bounds":504,"color-id":97,"color-normalize":99,"flatten-vertex-data":143,glslify:505,"is-iexplorer":284,"object-assign":462,"pick-by-alias":473,"snap-points-2d":534,"to-float32":547,"update-diff":558}],504:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{dup:89}],505:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],506:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){function t(t,e){this.id=j++,this.type=t,this.data=e}function e(t){if(0===t.length)return[];var r=t.charAt(0),n=t.charAt(t.length-1);if(1>>=e,r=(255>>=r,e|=r,r=(15>>=r,e|=r,r=(3>>r>>1}function c(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=G[l(t)>>2]).length?e.pop():new ArrayBuffer(t)}function u(t){G[l(t.byteLength)>>2].push(t)}function f(t,e,r,n,i,a){for(var o=0;o>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),s.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(ft).forEach(function(e){t+=ft[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;C.call(r);var a=E();return"number"==typeof t?A(a,0|t,"number"==typeof e?0|e:0|t):t?(z(r,t),T(a,t)):A(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,P(i),S(a,3553),D(r,3553),O(),L(a),s.profile&&(i.stats.size=M(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=$[i.internalformat],n.type=tt[i.type],n.mag=et[r.magFilter],n.min=rt[r.minFilter],n.wrapS=ot[r.wrapS],n.wrapT=ot[r.wrapT],n}var i=new I(3553);return ft[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return c(o,i),o.width=0,o.height=0,d(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,P(i),p(o,3553,e,r,a),O(),k(o),n},n.resize=function(e,r){var a=0|e,o=0|r||a;if(a===i.width&&o===i.height)return n;n.width=i.width=a,n.height=i.height=o,P(i);for(var l=0;i.mipmask>>l;++l)t.texImage2D(3553,l,i.format,a>>l,o>>l,0,i.format,i.type,null);return O(),s.profile&&(i.stats.size=M(i.internalformat,i.type,a,o,!1,!1)),n},n._reglType="texture2d",n._texture=i,s.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,o,l){function f(t,e,r,n,i,a){var o,l=h.texInfo;for(C.call(l),o=0;6>o;++o)g[o]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)T(g[0],t),T(g[1],e),T(g[2],r),T(g[3],n),T(g[4],i),T(g[5],a);else if(z(l,t),u(h,t),"faces"in t)for(t=t.faces,o=0;6>o;++o)c(g[o],h),T(g[o],t[o]);else for(o=0;6>o;++o)T(g[o],t)}else for(t=0|t||1,o=0;6>o;++o)A(g[o],t,t);for(c(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),o=0;6>o;++o)S(g[o],34069+o);for(D(l,34067),O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=$[h.internalformat],f.type=tt[h.type],f.mag=et[l.magFilter],f.min=rt[l.minFilter],f.wrapS=ot[l.wrapS],f.wrapT=ot[l.wrapT],o=0;6>o;++o)L(g[o]);return f}var h=new I(34067);ft[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,o,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return c(a,h),a.width=0,a.height=0,d(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,P(h),p(a,34069+t,r,n,i),O(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,s.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);D(e.texInfo,e.target)})}}}function A(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function T(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);H(l).forEach(e),l={},H(c).forEach(e),c={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,u={},r.shaderCount=0},program:function(t,e,i){var a=u[e];a||(a=u[e]={});var o=a[t];return o||(o=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(e,t),r.shaderCount++,s(o),a[t]=o,f.push(o)),o},restore:function(){l={},c={};for(var t=0;t="+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",u,"=",s,".createStream(",34962,",",i,".buffer);","}else{",u,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l})}),o}(r),u.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=P(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=O(e,function(t,r){return t.invoke(r,e)})}),n}(o),u}function w(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a),i(n,".",a,"=",r[a].append(t,e),";")}),e(i)}function M(t,e,r,n){var i,a=(s=t.shared).gl,o=s.framebuffer;J&&(i=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",a,".bindFramebuffer(",36160,",",t,".framebuffer);"),J&&e(i,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),J&&e(i,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function k(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,l=n.current,c=n.next,u=t.cond(l,".dirty");$.forEach(function(e){if(!((e=g(e))in r.state)){var n,f;if(e in o){n=o[e],f=a[e];var h=s(K[e].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(h.map(function(t,e){return t+"!=="+f+"["+e+"]"}).join("||")).then(i,".",rt[e],"(",h,");",h.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";"))}else n=u.def(c,".",e),h=t.cond(n,"!==",l,".",e),u(h),e in et?h(t.cond(n).then(i,".enable(",et[e],");").else(i,".disable(",et[e],");"),l,".",e,"=",n,";"):h(i,".",rt[e],"(",n,");",l,".",e,"=",n,";")}}),0===Object.keys(r.state).length&&u(l,".dirty=false;"),e(u)}function A(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;z(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(et[i]){var u=et[i];I(l)?e(s,c?".enable(":".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(v(c)){var f=a[i];e(s,".",rt[i],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",rt[i],"(",c,");",o,".",i,"=",c,";")}})}function T(t,e){X&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function S(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(h,".count+=",i,";"):t(h,".count++;"),p&&(n?(u=e.def(),t(u,"=",m,".getNumPendingQueries();")):t(m,".beginQuery(",h,");"))}function s(t){t(h,".cpuTime+=",a(),"-",c,";"),p&&(n?t(m,".pushScopeStats(",u,",",m,".getNumPendingQueries(),",h,");"):t(m,".endQuery();"))}function l(t){var r=e.def(d,".profile");e(d,".profile=",t,";"),e.exit(d,".profile=",r,";")}var c,u,f=t.shared,h=t.stats,d=f.current,m=f.timer;if(r=r.profile){if(I(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(d,".profile");o(f=t.block()),e("if(",r,"){",f,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function F(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(yt))return;var c=t.scopeAttrib(s);o={},Object.keys(new Y).forEach(function(t){o[t]=e.def(c,".",t)})}!function(r,n,i){function o(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",d.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",d.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),X&&(a=i.divisor,e("if(",u,".divisor!==",a,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,a],");",u,".divisor=",a,";}"))}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",ht.map(function(t,e){return u+"."+t+"!=="+h[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",h,");",ht.map(function(t,e){return u+"."+t+"="+h[e]+";"}).join(""),"}")}var l=a.gl,c=e.def(r,".location"),u=e.def(a.attributes,"[",c,"]");r=i.state;var f=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];1===r?o():2===r?s():(e("if(",r,"===",1,"){"),o(),e("}else{"),s(),e("}"))}(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)})}function R(t,r,n,i,a){for(var o,l=t.shared,c=l.gl,u=0;u>1)",m],");")}function e(){r(g,".drawArraysInstancedANGLE(",[h,d,p,m],");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[h,d,p]+");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,f=function(){var i=u.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","elements"),i&&a("if("+i+")"+l+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),h=i("primitive"),d=i("offset"),p=function(){var i=u.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","count"),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,g;X&&(m=i("instances"),g=t.instancing);var v=f+".type",y=u.elements&&I(u.elements);X&&("number"!=typeof m||0<=m)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function U(t,e,r,n,i){return e=b(),i=e.proc("body",i),X&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function V(t,e,r,n){T(t,e),F(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),j(t,e,e,r)}function q(t,e,r,n){function i(){return!0}t.batchId="a1",T(t,e),F(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),j(t,e,e,r)}function H(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}T(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&w(t,u,r.context),r.needsFramebuffer&&M(t,u,r.framebuffer),A(t,u,r.state,i),r.profile&&i(r.profile)&&S(t,u,r,!1,!0),n?(F(t,c,r,n.attributes,a),F(t,u,r,n.attributes,i),R(t,c,r,n.uniforms,a),R(t,u,r,n.uniforms,i),j(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link(function(e){return U(q,t,r,e,2)}),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function G(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];B.isDynamic(n)&&(n=t.invoke(e,n),e(u,".",r,"=",n,";"))})}var i=e.static[r];if(i&&function(t){if("object"==typeof t&&!v(t)){for(var e=Object.keys(t),r=0;r":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},gt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vt={cw:2304,ccw:2305},yt=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===it.length)E&&E.update(),lt=null;else{lt=U.next(e),h();for(var t=it.length-1;0<=t;--t){var r=it[t];r&&r(D,null,0)}y.flush(),E&&E.update()}}function r(){!lt&&0=it.length&&n()}var r=R(it,t);it[r]=e}}}function f(){var t=rt.viewport,e=rt.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=y.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=y.drawingBufferHeight}function h(){D.tick+=1,D.time=v(),f(),et.procs.poll()}function g(){f(),et.procs.refresh(),E&&E.update()}function v(){return(V()-L)/1e3}if(!(t=a(t)))return null;var y=t.gl,x=y.getContextAttributes();y.isContextLost();var b=function(t,e){function r(e){e=e.toLowerCase();var r;try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;i(i=l)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=s,0>s&&(i=4,1===(s=n.buffer.dimension)&&(i=0),2===s&&(i=1),3===s&&(i=4)),n.primType=i}function s(t){n.elementsCount--,delete l[t.id],t.buffer.destroy(),t.buffer=null}var l={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function l(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,s=0,h=0;Array.isArray(t)||q(t)||o(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=J[t.usage]),"primitive"in t&&(n=tt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?s=0|t.length:(s=i,5123===h||5122===h?s*=2:5125!==h&&5124!==h||(s*=4))),a(f,e,r,n,i,s,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return l}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,l(t),l._reglType="elements",l._elements=f,l.subdata=function(t,e){return c.subdata(t,e),l},l.destroy=function(){s(f)},l},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){H(l).forEach(s)}}}(y,M,P,w),j=(C=function(t,e,r,n,i){for(t=r.maxAttributes,e=Array(t),r=0;r=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach(function(e){t+=u[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(a=e.shape,n=0|a[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height?o:(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){H(u).forEach(o)},restore:function(){H(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}}(y,M,0,w,t),X=function(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?(t=n.create2D({width:t,height:e,format:a,type:s}),t._texture.refCount=0,new o(3553,t,null)):(t=i.create({width:t,height:e,format:a}),t._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=M++,k[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete k[e.id]}function v(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){H(k).forEach(g)},restore:function(){H(k).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}})}(y,M,I,G,W,w),et=F(y,_,M,I,P,O,0,X,{},C,j,{elements:null,primitive:4,count:-1,offset:0,instances:-1},D,E,t),rt=(_=S(y,X,et.procs.poll,D),et.next),nt=y.canvas,it=[],at=[],ot=[],st=[t.onDestroy],lt=null;nt&&(nt.addEventListener("webglcontextlost",i,!1),nt.addEventListener("webglcontextrestored",s,!1));var ht=X.setFBO=l({framebuffer:B.define.call(null,1,"framebuffer")});return g(),x=N(l,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)ht(N({framebuffer:t.framebuffer.faces[e]},t),c);else ht(t,c);else c(0,t)},prop:B.define.bind(null,1),context:B.define.bind(null,2),this:B.define.bind(null,3),draw:l({}),buffer:function(t){return P.create(t,34962,!1,!1)},elements:function(t){return O.create(t,!1)},texture:G.create2D,cube:G.createCube,renderbuffer:W.create,framebuffer:X.create,framebufferCube:X.createCube,attributes:x,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=at;break;case"restore":r=ot;break;case"destroy":r=st}return r.push(e),{cancel:function(){for(var t=0;t=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,r)}},{}],508:[function(t,e,r){!function(t,n){"object"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",i(t.slice(0,e)),",",i(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function o(t){return!0&t?"-":""}function s(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===n?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?i[t]:i)}var i=t("robust-determinant"),a=6,o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:d(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+f*(g-v)+h*(y-x),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(h));return b>_||-b>_?b:p(t,e,r,n)}];!function(){for(;m.length<=h;)m.push(s(m.length));for(var t=[],r=["slow"],n=0;n<=h;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=h;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(c+=1)=n?(i=h,(c+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(f=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(f,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],522:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],523:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":74,"reduce-simplicial-complex":499}],524:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,a=new Array(t+1);a[0]=[[]];for(var o=1;o<=t;++o)for(var s=a[o]=i(o),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--o){o>1,s=n(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(i=o-1)}return a}function l(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==n(t[g],o)););}return r}function c(t,e){if(e<0)return[];for(var r=[],n=(1<>>u&1&&c.push(i[u]);e.push(c)}return a(e)},r.skeleton=c,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=l(t);if(!(r>=0&&e0){var t=A[0];return o(0,S-1),S-=1,c(0),t}return-1}function h(t,e){var r=A[t];return x[r]===e?t:(x[r]=-1/0,u(t),f(),x[r]=e,S+=1,u(S-1))}function d(t){if(!b[t]){b[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],a(e)),T[r]>=0&&h(T[r],a(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),x=new Array(m),b=new Array(m),_=0;_>1;_>=0;--_)c(_);for(;;){var E=f();if(E<0||x[E]>r)break;d(E)}var L=[];for(_=0;_=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":515,"simplicial-complex":528}],531:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var a=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?a-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],a=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=i(r,a,s),c=i(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=i(s,o,a),c=i(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var i=t("robust-orientation")},{"robust-orientation":515}],532:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=a(t.right,e))return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}e.exports=function(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var c=this.horizontal[e];if(c.length>0){var h=l.ge(c,t[1],i);if(h=c.length)return n;d=c[h]}}if(d.start)if(o){var p=u(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":531,"binary-search-bounds":70,"functional-red-black-tree":144,"robust-orientation":515}],533:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],f=a[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function i(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function a(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function o(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],f=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=f}function s(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function l(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function u(t,e,r,h,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,x=y-m,b=y+m,_=g,w=x,M=y,k=b,A=v,T=t+1,S=e-1,E=0;l(_,w,r,h,d)&&(E=_,_=w,w=E),l(k,A,r,h,d)&&(E=k,k=A,A=E),l(_,M,r,h,d)&&(E=_,_=M,M=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(_,k,r,h,d)&&(E=_,_=k,k=E),l(M,k,r,h,d)&&(E=M,M=k,k=E),l(w,A,r,h,d)&&(E=w,w=A,A=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(k,A,r,h,d)&&(E=k,k=A,A=E);var L=r[w],C=h[2*w],z=h[2*w+1],D=d[w],I=p[w],P=r[k],O=h[2*k],F=h[2*k+1],R=d[k],N=p[k],j=_,B=M,U=A,V=g,q=y,H=v,G=r[j],Y=r[B],W=r[U];r[V]=G,r[q]=Y,r[H]=W;for(var X=0;X<2;++X){var Z=h[2*j+X],J=h[2*B+X],K=h[2*U+X];h[2*V+X]=Z,h[2*q+X]=J,h[2*H+X]=K}var Q=d[j],$=d[B],tt=d[U];d[V]=Q,d[q]=$,d[H]=tt;var et=p[j],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,a(x,t,r,h,d,p),a(b,e,r,h,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,0,D,r,h,d))it!==T&&i(it,T,r,h,d,p),++T;else if(!c(it,P,O,0,R,r,h,d))for(;;){if(c(S,P,O,0,R,r,h,d)){c(S,L,C,0,D,r,h,d)?(o(it,T,S,r,h,d,p),++T,--S):(i(it,S,r,h,d,p),--S);break}if(--S=Math.max(.9*d,32)){var _=c+s>>>1;l(g,v,f,h,_,u+1),h=_}l(g,v,f,h,y,u+1),h=y}}}var c=t.length>>>1;if(c<1)return[];e||(e=Array(c)),r||(r=Array(c)),s||(s=[]);for(var u=0;u=s[2]||s[1]>=s[3]){var f=o(t,2);f[0]===f[2]&&(f[2]+=1),f[1]===f[3]&&(f[3]+=1),s[0]=f[0],s[1]=f[1],s[2]=f[2],s[3]=f[3]}var h=s[0],d=s[1],p=s[2],m=s[3],g=1/(p-h),v=1/(m-d),y=Math.max(p-h,m-d),x=new Int32Array(c),b=0;l(h,d,y,0,c,0),a(x,t,e,r,c);var _=[],w=0,M=c;for(b=c-1;b>=0;--b){t[2*b]=(t[2*b]-h)*g,t[2*b+1]=(t[2*b+1]-d)*v;var k=x[b];k!==w&&(_.push(new i(y*Math.pow(.5,k),b+1,M-(b+1))),M=b+1,w=k)}return _.push(new i(y*Math.pow(.5,k+1),0,M)),_}},{"./lib/sort":533,"array-bounds":48}],535:[function(t,e,r){"use strict";function n(t,e){var r=o(a(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||o>0&&u<0){var f=i(s,u,l,o);r.push(f),a.push(f.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}},e.exports.positive=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r},e.exports.negative=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}},{"robust-dot-product":512,"robust-sum":520}],536:[function(t,e,r){!function(){"use strict";function t(e){return function(e,r){var i,a,o,s,l,c,u,f,h,d=1,p=e.length,m="";for(a=0;a=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}n.json.test(s[8])?m+=i:(!n.number.test(s[8])||f&&!s[3]?h="":(h=f?"+":"-",i=i.toString().replace(n.sign,"")),c=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",u=s[6]-(h+i).length,l=s[6]&&u>0?c.repeat(u):"",m+=s[5]?h+i+l:"0"===c?h+l+i:l+h+i)}return m}(function(t){if(i[t])return i[t];var e,r=t,a=[],o=0;for(;r;){if(null!==(e=n.text.exec(r)))a.push(e[0]);else if(null!==(e=n.modulo.exec(r)))a.push("%");else{if(null===(e=n.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],l=e[2],c=[];if(null===(c=n.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=n.key_access.exec(l)))s.push(c[1]);else{if(null===(c=n.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(e)}r=r.substring(e[0].length)}return i[t]=a}(e),arguments)}function e(e,r){return t.apply(null,[e].concat(r||[]))}var n={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},i=Object.create(null);void 0!==r&&(r.sprintf=t,r.vsprintf=e),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},{}],537:[function(t,e,r){"use strict";e.exports=function(t){function e(e){var r=[e],c=[e];for(n[e]=i[e]=u,a[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(o[e]=0&&l[e].push(s[m])}o[e]=p}else{if(i[e]===n[e]){var g=[],v=[],y=0;for(p=r.length-1;p>=0;--p){var x=r[p];if(a[x]=!1,g.push(x),v.push(l[x]),y+=l[x].length,s[x]=f.length,x===e){r.length=p;break}}f.push(g);var b=new Array(y);for(p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function u(t){return t.x}function f(t){return t.y}var h=t("kdbush");e.exports=function(t){return new n(t)},n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(i);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var o=+Date.now();this.trees[a+1]=h(n,u,f,this.options.nodeSize,Float32Array),n=this._cluster(n,a),e&&console.log("z%d: %d clusters in %dms",a,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=h(n,u,f,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(s(t[0]),l(t[3]),s(t[2]),l(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+g[b]+"*c");var T=p[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+T+"*("+p[b].join("+")+A+")/("+m[b].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var E=[];for(c=0;c<1<1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,m=void 0===p?0:p,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(d*i/360),b=Math.cos(d*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var M=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);M>1&&(u*=Math.sqrt(M),f*=Math.sqrt(M));var k=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(d,2),y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,M=(h-x)/a,k=(d-b)/o,A=(-h-x)/a,T=(-d-b)/o,S=s(1,0,M,k),E=s(M,k,A,T);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,m,v,x,b,_,w),A=n(k,4),T=A[0],S=A[1],E=A[2],L=A[3],C=Math.max(Math.ceil(Math.abs(L)/(i/4)),1);L/=C;for(var z=0;ze[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":43,assert:51,"is-svg-path":287,"normalize-svg-path":543,"parse-svg-path":466}],543:[function(t,e,r){"use strict";function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,d=0,p=0,m=t.length;p4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=d),r.push(g)}return r};var a=t("svg-arc-to-cubic-bezier")},{"svg-arc-to-cubic-bezier":541}],544:[function(t,e,r){(function(r){"use strict";var n=t("svg-path-bounds"),i=t("parse-svg-path"),a=t("draw-svg-path"),o=t("is-svg-path"),s=t("bitmap-sdf"),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");e||(e={});var u,f;e.shape?(u=e.shape[0],f=e.shape[1]):(u=l.width=e.w||e.width||200,f=l.height=e.h||e.height||200);var h=Math.min(u,f),d=e.stroke||0,p=e.viewbox||e.viewBox||n(t),m=[u/(p[2]-p[0]),f/(p[3]-p[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d)),c.translate(.5*u,.5*f),c.scale(g,g),r.Path2D){var v=new Path2D(t);c.fill(v),d&&c.stroke(v)}else{var y=i(t);a(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bitmap-sdf":72,"draw-svg-path":132,"is-svg-path":287,"parse-svg-path":466,"svg-path-bounds":542}],545:[function(t,e,r){(function(r){"use strict";function n(t,e,r){r=r||{};var a=o[t];a||(a=o[t]={" ":{data:new Float32Array(0),shape:.2}});var s=a[e];if(!s)if(e.length<=1||!/\d/.test(e))s=a[e]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var d=new Float32Array(u),p=0,m=-.5*f;for(h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;t=_(t,360),e=_(e,100),r=_(r,100);if(0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(e.h,i,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=b(n),{ok:s,format:e.format||l,r:I(255,P(r.r,0)),g:I(255,P(r.g,0)),b:I(255,P(r.b,0)),a:n}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=D(100*this._a)/100,this._format=n.format||i.format,this._gradientType=n.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=i.ok,this._tc_id=z++}function n(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n,i,a=P(t,e,r),o=I(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(r(i));return o}function x(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function b(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=I(r,P(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function w(t){return I(1,P(0,t))}function M(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function A(t){return t<=1&&(t=100*t+"%"),t}function T(e){return t.round(255*parseFloat(e)).toString(16)}function S(t){return M(t)/255}function E(t){return!!N.CSS_UNIT.exec(t)}var L=/^\s+/,C=/\s+$/,z=0,D=t.round,I=t.min,P=t.max,O=t.random;r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=b(t),this._roundA=D(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),n=D(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),i=D(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return a(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var a=[k(D(t).toString(16)),k(D(e).toString(16)),k(D(r).toString(16)),k(T(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(100*_(this._r,255))+"%",g:D(100*_(this._g,255))+"%",b:D(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%)":"rgba("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+o(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(u,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:A(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:O(),g:O(),b:O()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=function(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(n)).level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,c=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=r(e[u]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var F=r.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(F),N=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],547:[function(t,e,r){"use strict";function n(t){if(t instanceof Float32Array)return t;if("number"==typeof t)return new Float32Array([t])[0];var e=new Float32Array(t);return e.set(t),e}e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t){if("number"==typeof t)return n(t-n(t));for(var e=n(t),r=0,i=e.length;r1)n=function(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(o);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":!function(t){t.forEach(a)}(t.arcs)}}var s,l=[],c=[];return o(e),c.forEach(null==r?function(t){l.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var i,s,l=1,u=a(n[0]);lu&&(s=n[0],n[0]=n[l],n[l]=s,u=i);return n})}}var a=function(t){return t},o=function(t){if(null==(e=t.transform))return a;var e,r,n,i=e.scale[0],o=e.scale[1],s=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+s,t[1]=(n+=t[1])*o+l,t}},s=function(t){function e(t){l[0]=t[0],l[1]=t[1],s(l),l[0]f&&(f=l[0]),l[1]h&&(h=l[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,s=o(t),l=new Array(2),c=1/0,u=c,f=-c,h=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]h&&(h=l[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,f,h]}return n},l=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},c=function(t,e){function r(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}var n={},i={},a={},o=[],s=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++s],e[s]=r,e[n]=i)}),e.forEach(function(e){var r,n,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,n=i[l]){delete i[n.start];var c=n===r?r:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[r.start]=a[r.end]=r;else if(r=i[l])if(delete i[r.start],r.unshift(e),r.start=s,n=a[s]){delete a[n.end];var u=n===r?r:n.concat(r);i[u.start=n.start]=a[u.end=r.end]=u}else i[r.start]=a[r.end]=r;else i[(r=[e]).start=s]=a[r.end=l]=r}),r(a,i),r(i,a),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=s(t),o=a[0],l=(a[2]-o)/(e-1)||1,c=a[1],u=(a[3]-c)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,s=t.length,f=t[0],h=f[0]=Math.round((f[0]-o)/l),d=f[1]=Math.round((f[1]-c)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,l){this.center=s(r),this.up=s(n),this.right=s(i),this.radius=s([a]),this.angle=s([o,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];u(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=h(r,p)/s,g=h(i,p)/s;c=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)};var s=t("filtered-vector"),l=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),u=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),h=t("gl-vec3/dot"),d=o.prototype;d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];var s=Math.sqrt(i),l=0;for(o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;var c=Math.sqrt(l);for(o=0;o<3;++o)r[o]/=c;var h=this.computedToward;u(h,e,r),f(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,M=x,k=-g*x,A=-v*x,T=y,S=this.computedEye,E=this.computedMatrix;for(o=0;o<3;++o){var L=_*r[o]+w*h[o]+M*e[o];E[4*o+1]=k*r[o]+A*h[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],D=E[9],I=E[2],P=E[6],O=E[10],F=z*O-D*P,R=D*I-C*O,N=C*P-z*I,j=n(F,R,N);F/=j,R/=j,N/=j,E[0]=F,E[4]=R,E[8]=N;for(o=0;o<3;++o)S[o]=b[o]+E[2+4*o]*d;for(o=0;o<3;++o){l=0;for(var B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,p);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d),m=(u/=p)*e+o*r,g=(f/=p)*e+s*r,v=(h/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var c=e[o],u=e[o+4],f=e[o+8];if(a){var h=Math.abs(c),d=Math.abs(u),p=Math.abs(f),m=Math.max(h,d,p);h===m?(c=c<0?-1:1,u=f=0):p===m?(f=f<0?-1:1,c=u=0):(u=u<0?-1:1,c=f=0)}else{var g=n(c,u,f);c/=g,u/=g,f/=g}var v=e[s],y=e[s+4],x=e[s+8],b=v*c+y*u+x*f,_=n(v-=c*b,y-=u*b,x-=f*b),w=u*(x/=_)-f*(y/=_),M=f*(v/=_)-c*x,k=c*y-u*v,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,c,u,f),this.right.jump(t,v,y,x);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*v+L*y+C*x,D=E*w+L*M+C*k;T=F<0?-Math.PI/2:Math.PI/2,S=Math.atan2(D,z)}else{var I=e[2],P=e[6],O=e[10],F=I*c+P*u+O*f,R=I*v+P*y+O*x,N=I*w+P*M+O*k;T=Math.asin(i(F)),S=Math.atan2(N,R)}this.angle.jump(t,S,T),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*W,G-B*W,Y-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(u,f,h);if(!(d<1e-6)){u/=d,f/=d,h/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,x=n(m-=y*o,g-=y*s,v-=y*l);if(!(x<.01&&(m=s*h-l*f,g=l*u-o*h,v=o*f-s*u,(x=n(m,g,v))<1e-6))){m/=x,g/=x,v/=x,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var b=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(b,_,w),k=o*u+s*f+l*h,A=m*u+g*f+v*h,T=(b/=M)*u+(_/=M)*f+(w/=M)*h,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);D0?r.pop():new ArrayBuffer(t)}function o(t){return new Uint8Array(a(t),0,t)}function s(t){return new Uint16Array(a(2*t),0,t)}function l(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function u(t){return new Int16Array(a(2*t),0,t)}function f(t){return new Int32Array(a(4*t),0,t)}function h(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function p(t){return x?new Uint8ClampedArray(a(t),0,t):o(t)}function m(t){return new DataView(a(t),0,t)}function g(t){t=v.nextPow2(t);var e=v.log2(t),r=w[e];return r.length>0?r.pop():new n(t)}var v=t("bit-twiddle"),y=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var x="undefined"!=typeof Uint8ClampedArray,b=e.__TYPEDARRAY_POOL;b.UINT8C||(b.UINT8C=y([32,0])),b.BUFFER||(b.BUFFER=y([32,0]));var _=b.DATA,w=b.BUFFER;r.free=function(t){if(n.isBuffer(t))w[v.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|v.log2(e);_[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){i(t.buffer)},r.freeArrayBuffer=i,r.freeBuffer=function(t){w[v.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return o(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return c(t);case"int16":return u(t);case"int32":return f(t);case"float":case"float32":return h(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return g(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=o,r.mallocUint16=s,r.mallocUint32=l,r.mallocInt8=c,r.mallocInt16=u,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=h,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=p,r.mallocDataView=m,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)b.UINT8[t].length=0,b.UINT16[t].length=0,b.UINT32[t].length=0,b.INT8[t].length=0,b.INT16[t].length=0,b.INT32[t].length=0,b.FLOAT[t].length=0,b.DOUBLE[t].length=0,b.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":71,buffer:82,dup:134}],555:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],558:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),h=["%","/","?",";","#"].concat(f),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=t("querystring");n.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?I+="x":I+=D[P];if(!I.match(p)){var F=C.slice(0,A),R=C.slice(A+1),N=D.match(m);N&&(F.push(N[1]),R.unshift(N[2])),R.length&&(u="/"+R.join(".")+u),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=a.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[w])for(A=0,z=f.length;A0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=M.slice(-1)[0],T=(r.host||t.host||M.length>1)&&("."===A||".."===A)||""===A,S=0,E=M.length;E>=0;E--)"."===(A=M[E])?M.splice(E,1):".."===A?(M.splice(E,1),S++):S&&(M.splice(E,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),T&&"/"!==M.join("/").substr(-1)&&M.push("");var L=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=L?"":M.length?M.shift():"";var C;(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(_=_||r.host&&M.length)&&!L&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":560,punycode:489,querystring:493}],560:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],561:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],562:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],563:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&b(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return p(i)||(i=s(t,i,n)),i}var a=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),v=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),x(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(b(e)){var _=e.name?": "+e.name:"";return t.stylize("[Function"+_+"]","special")}if(g(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(y(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return l(e)}var w="",k=!1,A=["{","}"];if(u(e)&&(k=!0,A=["[","]"]),b(e)){w=" [Function"+(e.name?": "+e.name:"")+"]"}if(g(e)&&(w=" "+RegExp.prototype.toString.call(e)),y(e)&&(w=" "+Date.prototype.toUTCString.call(e)),x(e)&&(w=" "+l(e)),0===o.length&&(!k||0==e.length))return A[0]+w+A[1];if(n<0)return g(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var T;return T=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(T,w,A)}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),l||(t.seen.indexOf(c.value)<0?(l=h(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+l.split("\n").map(function(t){return" "+t}).join("\n")):l=t.stylize("[Circular]","special")),m(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+l}function u(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function h(t){return null===t}function d(t){return"number"==typeof t}function p(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return v(t)&&"[object RegExp]"===_(t)}function v(t){return"object"==typeof t&&null!==t}function y(t){return v(t)&&"[object Date]"===_(t)}function x(t){return v(t)&&("[object Error]"===_(t)||t instanceof Error)}function b(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!p(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":566}],568:[function(t,e,r){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":569}],569:[function(t,e,r){"use strict";function n(t,e,r,n){var i=function(t,e){var r=a(t,128);return e?s(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,n),o=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}var o=t("pbf"),s=t("./vector-tile-pb"),l=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new l(t[r].features),e[r].name=r;return n({layers:e})},e.exports.GeoJSONWrapper=l},{"./lib/geojson_wrapper":571,"./vector-tile-pb":572,pbf:470}],571:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e=0?e[o]:a})},has___:{value:i(function(e){var i=n(e);return i?r in i:t.indexOf(e)>=0})},set___:{value:i(function(i,a){var o,s=n(i);return s?s[r]=a:(o=t.indexOf(i))>=0?e[o]=a:(o=t.length,e[o]=a,t[o]=i),this})},delete___:{value:i(function(i){var a,o,s=n(i);return s?r in s&&delete s[r]:!((a=t.indexOf(i))<0||(o=t.length-1,t[a]=void 0,e[a]=e[o],t[a]=t[o],t.length=o,e.length=o,0))})}})};b.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?function(){function r(){this instanceof b||a();var e,r=new s,n=void 0,l=!1;return e=o?function(t,e){return r.set(t,e),r.has(t)||(n||(n=new b),n.set(t,e)),this}:function(t,e){if(l)try{r.set(t,e)}catch(r){n||(n=new b),n.set___(t,e)}else r.set(t,e);return this},Object.create(b.prototype,{get___:{value:i(function(t,e){return n?r.has(t)?r.get(t):n.get___(t,e):r.get(t,e)})},has___:{value:i(function(t){return r.has(t)||!!n&&n.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!r.delete(t);return n?n.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=b.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=b)}}()},{}],574:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":575}],575:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],576:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":574}],577:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":156}],578:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,a=this._validateYear(t,i.local.invalidyear),s=h[a-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(n=o.newDate(l,c,u)).add(4-(n.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,i.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var a=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var p=0;p>9&4095,v=m>>5&15,y=31&m,x=new Date(g,v-1,y+l);return a.year=x.getFullYear(),a.month=1+x.getMonth(),a.day=x.getDate(),a}(t,s,r,a);return o.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=o.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1;var l,c=(o=h[a.year-h[0]])>>9&4095,u=o>>5&15,d=31&o,p=new Date(c,u-1,d),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-p)/864e5);var g,v=f[a.year-f[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l>13;return!x||g=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:a[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var a={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":595,"object-assign":462}],584:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":595,"object-assign":462}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main");t("object-assign")(n.prototype=new a.baseCalendar,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),a.calendars.hebrew=n},{"../main":595,"object-assign":462}],586:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":595,"object-assign":462}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),i.calendars.julian=n},{"../main":595,"object-assign":462}],588:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main");t("object-assign")(n.prototype=new o.baseCalendar,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);t%=400,t+=t<0?400:0;return e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":595,"object-assign":462}],589:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),i.calendars.nanakshahi=n},{"../main":595,"object-assign":462}],590:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),r=e.year(),n=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":595,"object-assign":462}],592:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),i.calendars.taiwan=n},{"../main":595,"object-assign":462}],593:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),i.calendars.thai=n},{"../main":595,"object-assign":462}],594:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,i.local.invalidMonth).toJD()-24e5+.5,n=0,o=0;or)return a[n]-a[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),o=12*(n.year()-1)+n.month()-15292;return n.day()+a[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,o=Math.floor((i-1)/12),s=o+1,l=i-12*o,c=e-a[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var a=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":595,"object-assign":462}],595:[function(t,e,r){function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),l(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":462}],596:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n1}),u=function(t,e,r,n){var i=""+e;if(c(t,n))for(;i.length1},x=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=m;for(var E=this.daysInMonth(h,d);p>E;E=this.daysInMonth(h,d))d++,p-=E}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":595,"object-assign":462}],597:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":116}],598:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":597}],599:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;a(t,e,r,c);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},g=0;g<2;g++){var v=d[g],y=i.coerceRef(t,e,m,v,"","paper");if(i.coercePosition(e,m,c,y,v,.5),h){var x="a"+v,b=i.coerceRef(t,e,m,x,"pixel");"pixel"!==b&&b!==y&&(b=e[x]="pixel");var _="pixel"===b?p[g]:.4;i.coercePosition(e,m,c,b,x,_)}c(v+"anchor"),c(v+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":743,"../../plots/cartesian/axes":789,"./attributes":601,"./common_defaults":604}],600:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],601:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}}},{"../../plots/cartesian/constants":794,"../../plots/font_attributes":816,"./arrow_paths":600}],602:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,s=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=1,s[t.yref]=1});for(var l in s){var c=a.getFromId(t,l);if(c&&c.autorange)return i.syncOrAsync([o,n],t)}}}},{"../../lib":743,"../../plots/cartesian/axes":789,"./draw":607}],603:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,i=n(t,e),o=i.on,s=i.off.concat(i.explicitOff),l={};if(o.length||s.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var a=N.selectAll("a");if(1===a.size()&&a.text()===N.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(P.node())}var c=C.select(".annotation-text-math-group"),h=!c.empty(),v=f.bBox((h?c:N).node()),y=v.width,L=v.height,D=e.width||y,R=e.height||L,j=Math.round(D+2*I),B=Math.round(R+2*I);e._w=D,e._h=R;for(var U=!1,V=["x","y"],q=0;q1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;H=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],H=_.l+_.w*Y):(Y=1-e[Z],H=_.t+_.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=H;var st=e["a"+Z];X=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=H+st,G=X+st),at.text=at.tail+X;var lt=b["x"===Z?"width":"height"];if("paper"===J&&(at.head=l.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*r(W,nt),at.text=H+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)C.remove();else{var ft=0,ht=0;if("left"!==e.align&&(ft=(D-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(R-L)*("middle"===e.valign?.5:1)),h)c.select("svg").attr({x:I+ft-1,y:I+ht}).call(f.setClipUrl,O?M:null);else{var dt=I+ht-v.top,pt=I+ft-v.left;N.call(d.positionText,pt,dt).call(f.setClipUrl,O?M:null)}F.select("rect").call(f.setRect,I,I,D,R),P.call(f.setRect,z/2,z/2,j-z,B-z),C.call(f.setTranslate,Math.round(k.x.text-j/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+A+","+k.x.text+","+k.y.text+")"});var mt=function(r,a){T.selectAll(".annotation-arrow-g").remove();var c=k.x.head,h=k.y.head,d=k.x.tail+r,p=k.y.tail+a,v=k.x.text+r,y=k.y.text+a,b=l.rotationXYMatrix(A,v,y),M=l.apply2DTransform(b),E=l.apply2DTransform2(b),L=+P.attr("width"),z=+P.attr("height"),D=v-.5*L,I=D+L,O=y-.5*z,F=O+z,R=[[D,O,D,F],[D,F,I,F],[I,F,I,O],[I,O,D,O]].map(E);if(!R.reduce(function(t,e){return t^!!l.segmentsIntersect(c,h,c+1e6,h+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=l.segmentsIntersect(d,p,c,h,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var N=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,U=T.append("g").style({opacity:u.opacity(j)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+h).style("stroke-width",N+"px").call(u.stroke,u.rgb(j));if(g(V,B,e),w.annotationPosition&&V.node().parentNode&&!n){var q=c,H=h;if(e.standoff){var G=Math.sqrt(Math.pow(c-d,2)+Math.pow(h-p,2));q+=e.standoff*(d-c)/G,H+=e.standoff*(p-h)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-q)+","+(p-H),transform:"translate("+q+","+H+")"}).style("stroke-width",N+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),gd:t,prepFn:function(){var t=f.getTranslate(C);W=t.x,X=t.y,Y={},i&&i.autorange&&(Y[i._name+".autorange"]=!0),s&&s.autorange&&(Y[s._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(W,X),a=n[0]+t,o=n[1]+r;C.call(f.setTranslate,a,o),Y[x+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,Y[x+".y"]=s?s.p2r(s.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(Y[x+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[x+".ay"]=s.p2r(s.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+A+","+a+","+o+")"})},doneFn:function(){o.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),E){var gt,vt;m.init({element:C.node(),gd:t,prepFn:function(){vt=S.attr("transform"),gt={}},moveFn:function(t,r){var a="pointer";if(e.showarrow)e.axref===e.xref?gt[x+".ax"]=i.p2r(i.r2p(e.ax)+t):gt[x+".ax"]=e.ax+t,e.ayref===e.yref?gt[x+".ay"]=s.p2r(s.r2p(e.ay)+r):gt[x+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)gt[x+".x"]=e.x+t/i._m;else{var o=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-o/2;gt[x+".x"]=m.align(l+t/_.w,o,0,1,e.xanchor)}if(s)gt[x+".y"]=e.y+r/s._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;gt[x+".y"]=m.align(u-r/_.h,c,0,1,e.yanchor)}i&&s||(a=m.getCursor(i?.5:gt[x+".x"],s?.5:gt[x+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+vt}),p(C,a)},doneFn:function(){p(C),o.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}var y,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,x=n+".annotations["+r+"]"):(y="annotation",x="annotations["+r+"]"),b._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+b._uid+"_ann"+r;if(e._input&&!1!==e.visible){var k={x:{},y:{}},A=+e.textangle||0,T=b._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=T.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:a.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){h.loneUnhover(b._hoverlayer.node())});var z=e.borderwidth,D=e.borderpad,I=z+D,P=C.append("rect").attr("class","bg").style("stroke-width",z+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),O=e.width||e.height,F=b._topclips.selectAll("#"+M).data(O?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),F.exit().remove();var R=e.font,N=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?N.call(d.makeEditable,{delegate:C,gd:t}).call(c).on("edit",function(r){e.text=r,this.call(c);var n={};n[x+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),s&&s.autorange&&(n[s._name+".autorange"]=!0),o.relayout(t,n)}):N.call(c)}else a.selectAll("#"+M).remove()}var a=t("d3"),o=t("../../plotly"),s=t("../../plots/plots"),l=t("../../lib"),c=t("../../plots/cartesian/axes"),u=t("../color"),f=t("../drawing"),h=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,x=d.backoff*m+r.standoff,b=p.backoff*g+r.startstandoff;if("line"===h.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var _=l.x-c.x,w=l.y-c.y;if(u=Math.atan2(w,_),f=u+Math.PI,x&&b&&x+b>Math.sqrt(_*_+w*w))return void o();if(x){if(x*x>_*_+w*w)return void o();var M=x*Math.cos(u),k=x*Math.sin(u);c.x+=M,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>_*_+w*w)return void o();var A=b*Math.cos(u),T=b*Math.sin(u);l.x-=A,l.y-=T,t.attr({x1:l.x,y1:l.y})}}else if("path"===h.nodeName){var S=h.getTotalLength(),E="";if(S1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l.pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":841,"../annotations/draw":607}],614:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);1!==n.getAlpha()&&(n=i(o.combine(t,c)));return(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e0?E>=O:E<=O));L++)E>R&&E0?E>=O:E<=O));L++)E>C[0]&&E1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[K+X,K+G-X],et.setScale();var st=T._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");et._axislayer=st.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ut,ft=S.l+(k.x+Y)*S.w,ht=et.titlefont.size;ut="top"===k.titleside?(1-(K+G-X))*S.h+S.t+3+.75*ht:(1-(K+X))*S.h+S.t-3-.25*ht,A(et._id+"title",{attributes:{x:ft,y:ut,"text-anchor":"start"}})}var dt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),a=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+et._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=parseInt(r.node().style.fontSize,10)*v),o?(ct=d.bBox(o).height)>s&&(a[1]-=(ct-s)/2):r.node()&&!r.classed(w.jsPlaceholder)&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===k.titleside)et.domain[1]-=ct/S.h,a[1]*=-1;else{et.domain[0]+=ct/S.h;var c=g.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(S.h*(1-et.domain[1]))+")"),et._axislayer.attr("transform","translate(0,"+Math.round(-S.t)+")");var f=st.select(".cbfills").selectAll("rect.cbfill").data(D);f.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(D[e]+D[e-1])/2,e===D.length-1?C[1]:(D[e]+D[e+1])/2].map(et.c2p).map(Math.round);e!==D.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=P(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var h=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?z:[]);return h.enter().append("path").classed(w.cbline,!0),h.exit().remove(),h.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+k.line.width/2%1)+"h"+V).call(d.lineGroupStyle,k.line.width,I(t),k.line.dash)}),et._axislayer.selectAll("g."+et._id+"tick,path").remove(),et._pos=Z+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),et.side="right",u.syncOrAsync([function(){return l.doTicks(t,et,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=et.titlefont.size,r=et._offset+et._length/2,i=S.l+(et.position||0)*S.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));A("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:k.titleside,offsetLeft:S.l,offsetTop:0,maxShift:T.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var r=V+k.outlinewidth/2+d.bBox(et._axislayer.node()).width;if((j=lt.select("text")).node()&&!j.classed(w.jsPlaceholder)){var n,i=lt.select(".h"+et._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(k.titleside)?d.bBox(i).width:d.bBox(lt.node()).right-Z-S.l,r=Math.max(r,n)}var a=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,s=Q-$;st.select(".cbbg").attr({x:Z-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:$-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:$+k.ypad+("top"===k.titleside?ct:0),width:Math.max(V,2),height:Math.max(s-2*k.ypad-ct,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var l=({center:.5,right:1}[k.xanchor]||0)*a;st.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:a*({right:1,center:.5}[k.xanchor]||0),r:a*({left:1,center:.5}[k.xanchor]||0),t:s*({bottom:1,middle:.5}[k.yanchor]||0),b:s*({top:1,middle:.5}[k.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition){var pt,mt,gt;c.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),h(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),mt=c.align(J+t/S.w,q,0,1,k.xanchor),gt=c.align(K-e/S.h,G,0,1,k.yanchor);var r=c.getCursor(mt,gt,k.xanchor,k.yanchor);h(st,r)},doneFn:function(){h(st),void 0!==mt&&void 0!==gt&&a.restyle(t,{"colorbar.x":mt,"colorbar.y":gt},M().index)}})}return dt}T._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":743,"./flip_scale":630,"./scales":637}],626:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":732,"./attributes":624,"./scales.js":637}],627:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":637}],628:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,g=p[h+"min"],v=p[h+"max"],y=p.colorscale;c(f+h+"auto",!(n(g)&&n(v)&&g=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],631:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":627,"./is_valid_scale_array":635,"./scales":637}],632:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],639:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":743}],640:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function i(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t("mouse-event-offset"),o=t("has-hover"),s=t("../../plotly"),l=t("../../lib"),c=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),f=e.exports={};f.align=t("./align"),f.getCursor=t("./cursor");var h=t("./unhover");f.unhover=h.wrapped,f.unhoverRaw=h.raw;var d=l.eventListenerOptionsSupported();f.init=function(t){function e(e){_._dragged=!1,_._dragging=!0;var s=i(e);return h=s[0],p=s[1],x=e.target,y=e,b=e.buttons&&2===e.buttons||e.ctrlKey,(m=(new Date).getTime())-_._mouseDownTimeM&&(w=Math.max(w-1,1)),_._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(w,y),!b){var n;try{n=new MouseEvent("click",e)}catch(t){var c=i(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,c[0],c[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}x.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&s.plot(t)}(_),_._dragged=!1,l.pauseEvent(e)}_._dragged=!1}var h,p,m,g,v,y,x,b,_=t.gd,w=1,M=u.DBLCLICKDELAY,k=t.element;_._mouseDownTime||(_._mouseDownTime=0),k.style.pointerEvents="all",k.onmousedown=e,d?(k._ontouchstart&&k.removeEventListener("touchstart",k._ontouchstart),k._ontouchstart=e,k.addEventListener("touchstart",e,{passive:!1})):k.ontouchstart=e;var A=t.clampFn||function(t,e,r){return Math.abs(t)=200?k:"")}function i(t,e,r,n){var i=l.select(t.node().parentNode),a=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",o=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=n?n/.8+1:0,c=(m.lineCount(t)-1)*v+1,u=S[o]*s,f=.75*r+S[a]*s+(S[a]-1)*c*r/2;t.attr("text-anchor",o),i.attr("transform","translate("+u+","+f+")")}function a(t,e){var r=t.ts||e.textfont.size;return c(r)&&r>0?r:0}function o(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],c=Math.pow(i*i+a*a,E/2),u=Math.pow(o*o+s*s,E/2),f=(u*u*i-c*c*o)*n,h=(u*u*a-c*c*s)*n,d=3*u*(c+u),p=3*c*(c+u);return[[l.round(e[0]+(d&&f/d),2),l.round(e[1]+(d&&h/d),2)],[l.round(e[0]-(p&&f/p),2),l.round(e[1]-(p&&h/p),2)]]}function s(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var l=t("d3"),c=t("fast-isnumeric"),u=t("tinycolor2"),f=t("../../registry"),h=t("../color"),d=t("../colorscale"),p=t("../../lib"),m=t("../../lib/svg_text_utils"),g=t("../../constants/xmlns_namespaces"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../constants/interactions").DESELECTDIM,x=t("../../traces/scatter/subtypes"),b=t("../../traces/scatter/make_bubble_size_func"),_=e.exports={};_.font=function(t,e,r,n){p.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(h.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,i){t.call(_.setPosition,e,r).call(_.setSize,n,i)},_.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(c(i)&&c(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},_.translatePoints=function(t,e,r){t.each(function(t){var n=l.select(this);_.translatePoint(t,n,e,r)})},_.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(e){var i=e[0].trace,a=i.xcalendar,o=i.ycalendar;t.selectAll(".point,.textpoint").each(function(t){_.hideOutsideRangePoint(t,l.select(this),r,n,a,o)})})}},_.crispRound=function(t,e,r){return e&&c(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";h.stroke(e,n||a.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,o=n||i.dash||"";l.select(this).call(h.stroke,r||i.color).call(_.dashLine,o,a)})},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},_.singleFillStyle=function(t){var e=(((l.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(h.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=l.select(this);try{r.call(h.fill,e[0].trace.fillcolor)}catch(e){p.error(e,t),r.remove()}})};var w=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(w).forEach(function(t){var e=w[t];_.symbolList=_.symbolList.concat([e.n,t,e.n+100,t+"-open"]),_.symbolNames[e.n]=t,_.symbolFuncs[e.n]=e.f,e.needLine&&(_.symbolNeedLines[e.n]=!0),e.noDot?_.symbolNoDot[e.n]=!0:_.symbolList=_.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(_.symbolNoFill[e.n]=!0)});var M=_.symbolNames.length,k="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";_.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=M||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0};_.gradient=function(t,e,r,n,i,a){var o=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],p.identity);o.exit().remove(),o.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=l.select(this);"horizontal"===n?t.attr(A):"vertical"===n&&t.attr(T),t.attr("id",r);var e=u(i),o=u(a);t.append("stop").attr({offset:"0%","stop-color":h.tinyRGB(o),"stop-opacity":o.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":h.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},_.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},_.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;!function(t,e,r,i,a,o,s,l){if(f.traceIs(r,"symbols")){var c=b(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:x.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var i=_.symbolNumber(t.mx||o.symbol)||0;return t.om=i%200>=100,n(i,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var u,d,p,m=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,u=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?h.defaultLine:s.color,Array.isArray(o.color)&&(u=h.defaultLine,m=!0),u="mc"in t?t.mcc=i(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(h.stroke,u).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=o.gradient,v=t.mgt;if(v?m=!0:v=g&&g.type,v&&"none"!==v){var y=t.mgc;y?m=!0:y=g.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(_.gradient,l,w,v,u,y)}else e.call(h.fill,u);p&&e.call(h.stroke,d)}}(t,e,r,i,a,s,s.line,o)},_.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=_.tryColorscale(n,""),a=_.tryColorscale(n,"line");t.each(function(t){_.singlePointStyle(t,l.select(this),e,i,a,r)})}},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},s=i.marker||{},c=a.opacity,u=o.opacity,d=s.opacity,p=void 0!==u,m=void 0!==d;t.each(function(t){var e,r=l.select(this),n=t.mo,i=void 0!==n;(i||p||m)&&(t.selected?p&&(e=u):e=m?d:y*(i?n:c)),void 0!==e&&r.style("opacity",e)});var g=o.color,v=s.color;(g||v)&&t.each(function(t){var e,r=l.select(this);t.selected?g&&(e=g):v&&(e=v),e&&h.fill(r,e)});var x=o.size,b=s.size,w=void 0!==x,M=void 0!==b;f.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=l.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?x/2:i:M?b/2:i,r.attr("d",n(_.symbolNumber(o),e)),t.mrc2=e})}},_.tryColorscale=function(t,e){var r=e?p.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?d.makeColorScaleFunc(d.extractScale(n,r.cmin,r.cmax)):p.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};_.textPointStyle=function(t,e,r){t.each(function(t){var n=l.select(this),o=p.extractOption(t,e,"tx","text");if(o){var s=t.tp||e.textposition,c=a(t,e);n.call(_.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).text(o).call(m.convertToTspans,r).call(i,s,c,t.mrc)}else n.remove()})},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},n=e.unselected||{};t.each(function(t){var o,s=l.select(this),c=t.tc||e.textfont.color,u=t.tp||e.textposition,f=a(t,e),d=(r.textfont||{}).color,p=(n.textfont||{}).color;t.selected?d&&(o=d):p?o=p:d||(o=h.addOpacity(c,y)),o&&h.fill(s,o),i(s,u,f,t.mrc2||t.mrc)})}};var E=.5;_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(_.savedBBoxes={},C=0),r&&(_.savedBBoxes[r]=v),C++,p.extendFlat({},v)},_.setClipUrl=function(t,e){if(e){var r="#"+e,n=l.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},_.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},_.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},_.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var z=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=l.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),o=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(z);t=1===e&&1===r?[]:["translate("+a+","+o+")","scale("+e+","+r+")","translate("+-a+","+-o+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../constants/xmlns_namespaces":723,"../../lib":743,"../../lib/svg_text_utils":766,"../../registry":873,"../../traces/scatter/make_bubble_size_func":1083,"../../traces/scatter/subtypes":1088,"../color":618,"../colorscale":633,"./symbol_defs":644,d3:128,"fast-isnumeric":140,tinycolor2:546}],644:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:128}],645:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],646:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=[];if(a.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(a),u=0;u0;t.each(function(t){var u,f=t[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(u=function(t){return t.id});var p=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||h.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,u);if(m.exit().remove(),t.length){h.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(m,e.layerClipId),m.each(function(t){var e=n.select(this),a=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}(t,s,l);if(!p||t.vis){var o;if(d.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var u=d.width;o="M"+(a.x-u)+","+a.yh+"h"+2*u+"m-"+u+",0V"+a.ys,a.noYS||(o+="m-"+u+",0h"+2*u);var f=e.select("path.yerror");!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(f=f.transition().duration(r.duration).ease(r.easing)),f.attr("d",o)}if(h.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var m=(h.copy_ystyle?d:h).width;o="M"+a.xh+","+(a.y-m)+"v"+2*m+"m0,-"+m+"H"+a.xs,a.noXS||(o+="m0,-"+m+"v"+2*m);var g=e.select("path.xerror");!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1088,"../drawing":643,d3:128,"fast-isnumeric":140}],651:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":618,d3:128}],652:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":816}],653:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||i.identity,Array.isArray(t)&&(e[0][r]=n(t))}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){function e(t){return function(e){return i.coerceHoverinfo({hoverinfo:e},{_module:t._module},o)}}for(var r=t.calcdata,o=t._fullLayout,s=0;s=0&&r.indextt.width||$<0||$>tt.height)return v.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(P="xval"in e?b.flat(m,e.xval):b.p2c(S,Q),O="yval"in e?b.flat(m,e.yval):b.p2c(E,$),!c(P[0])||!c(O[0]))return f.warn("Fx.hover failed",e,t),v.unhoverRaw(t,e)}var et=1/0;for(R=0;RY&&(Z.splice(0,Y),et=Z[0].distance),_._has("cartesian")&&0!==X&&0===Z.length){G.distance=X,G.index=!1;var ot=j._module.hoverPoints(G,q,H,"closest",_._hoverlayer);if(ot){var st,lt=ot.filter(function(t){return t.xa.showspikes});if(lt.length){var ct=lt[0];c(ct.x0)&&c(ct.y0)&&(st=d(ct),(!K.vLinePoint||K.vLinePoint.distance>st.distance)&&(K.vLinePoint=st))}var ut=ot.filter(function(t){return t.ya.showspikes});if(ut.length){var ft=ut[0];c(ft.x0)&&c(ft.y0)&&(st=d(ft),(!K.hLinePoint||K.hLinePoint.distance>st.distance)&&(K.hLinePoint=st))}}}}var ht={fullLayout:_,container:_._hoverlayer,outerContainer:_._paperdiv,event:e},dt=t._spikepoints,pt={vLinePoint:K.vLinePoint,hLinePoint:K.hLinePoint};if(t._spikepoints=pt,_._has("cartesian")&&0!==X&&0!==Z.length){var mt=u(Z.filter(function(t){return t.ya.showspikes}),X);K.hLinePoint=d(mt);var gt=u(Z.filter(function(t){return t.xa.showspikes}),X);K.vLinePoint=d(gt)}if(0===Z.length){var vt=v.unhoverRaw(t,e);return!_._has("cartesian")||null===K.hLinePoint&&null===K.vLinePoint||s(dt)&&o(K,ht),vt}_._has("cartesian")&&s(dt)&&o(K,ht),Z.sort(function(t,e){return t.distance-e.distance});var yt=t._hoverdata,xt=[];for(F=0;F1,wt=i(Z,{hovermode:I,rotateLabels:_t,bgColor:g.combine(_.plot_bgcolor||g.background,_.paper_bgcolor),container:_._hoverlayer,outerContainer:_._paperdiv,commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance},t);if(function(t,e,r){function n(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}var i,a,o,s,l,c,u,f=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?k:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});for(;!i&&f<=t.length;){for(f++,i=!0,s=0;s.01&&m.pmin===g.pmin&&m.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),h.splice(s+1,1),u=0,l=d.length-1;l>=0;l--)u+=d[l].dp;for(o=u/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;i=!1}else s++}h.forEach(n)}for(s=h.length-1;s>=0;s--){var v=h[s];for(l=v.length-1;l>=0;l--){var y=v[l],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(Z,_t?"xa":"ya",_),a(wt,_t),e.target&&e.target.tagName){var Mt=x.getComponentMethod("annotations","hasClickToShow")(t,xt);p(l.select(e.target),Mt?"pointer":"")}e.target&&!n&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,yt)&&(yt&&t.emit("plotly_unhover",{event:e,points:yt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,c=e.container,u=e.outerContainer,f=e.commonLabelOpts||{},h=e.fontFamily||_.HOVERFONT,p=e.fontSize||_.HOVERFONTSIZE,v=t[0],y=v.xa,x=v.ya,b="y"===a?"yLabel":"xLabel",M=v[b],k=(String(M)||"").split(" ")[0],A=u.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,z=v.distance<=e.hoverdistance&&("x"===a||"y"===a);for(n=0;n-1&&n.length>v&&(n=v>3?n.substr(0,v-3)+"...":n.substr(0,v))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
    "),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
    "),i+=(i?"z: ":"")+t.zLabel):z&&t[a+"Label"]===M?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
    ":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var y=e.select("text.nums").call(m.font,t.fontFamily||h,t.fontSize||p,t.fontColor||f).text(i).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==i?(x.call(m.font,t.fontFamily||h,t.fontSize||p,u).text(n).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*E):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:f});var _,k,A=y.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,I=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),F=A.width+S+E+b;t.ty0=T-A.top,t.bx=A.width+2*E,t.by=A.height+2*E,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,_=I+O/2+F<=C,k=I-O/2-F>=0,"top"!==t.idealAlign&&_||!k?_?(I+=O/2,t.anchor="start"):t.anchor="middle":(I-=O/2,t.anchor="end")):(t.pos=I,_=D+P/2+F<=L,k=D-P/2-F>=0,"left"!==t.idealAlign&&_||!k?_?(D+=P/2,t.anchor="start"):t.anchor="middle":(D-=P/2,t.anchor="end")),y.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+I+")"+(o?"rotate("+w+")":""))}),P}function a(t,e){t.each(function(t){var r=l.select(this);if(t.del)r.remove();else{var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(S+E),s=o+a*(t.txwidth+E),c=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-T,c=t.offset*A),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+c)+","+(S+u)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+c)+"V"+(u-S)+"Z"),i.call(d.positionText,o+c,u+t.ty0-t.by/2+E),t.tx2width&&(r.select("text.name").call(d.positionText,s+a*E+c,u+t.ty0-t.by/2+E),r.select("rect").call(m.setRect,s+(a-1)*t.tx2width/2+c,u-t.by/2-1,t.tx2width,t.by+2))}})}function o(t,e){var r,n,i=e.container,a=e.fullLayout,o=e.event,s=!!t.hLinePoint,l=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),l||s){var c=g.combine(a.plot_bgcolor,a.paper_bgcolor);if(s){var f,h,d=t.hLinePoint;r=d&&d.xa;"cursor"===(n=d&&d.ya).spikesnap?(f=o.pointerX,h=o.pointerY):(f=r._offset+(d.x0+d.x1)/2,h=n._offset+(d.y0+d.y1)/2);var p,v,y=u.readability(d.color,c)<1.5?g.contrast(c):d.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,M=(w.left+w.right)/2=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],670:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":816,"../color/attributes":617}],671:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],672:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,f,h,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,h="bottom"):(c=0,f="left",u=-.1,h="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",f),l("y",u),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":743,"../../plots/layout_attributes":843,"../../registry":873,"./attributes":670,"./helpers":676}],673:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*x;if(o){var l=d.bBox(o);n=l.height,i=l.width,d.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),u=m.lineCount(c),f=c.node();n=s*u,i=f?d.bBox(f).width:0;var h=s*(.3+(1-u)/2);m.positionText(c,40,h)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,o=f.traceIs(a,"pie"),s=a.index,u=o?n.label:a.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.edits.legendText&&!o?h.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(o.type))u[(a=n.trace.transforms)[a.length-1].direction+".name"]=t;else if(f.hasTransform(o,"groupby")){var h=f.getTransformIndices(o,"groupby"),d=h[h.length-1],p=c.keyedContainer(o,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),u=p.constructUpdate()}else u.name=t;return l.restyle(e,u,s)}):h.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(p.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){g(t,e,n)},k):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,g(t,e,n))}})}function a(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=w.isGrouped(i),l=0;if(i.width=0,i.height=0,w.isVertical(i))o&&e.each(function(t,e){d.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;d.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),l=40;else if(o){for(var c=[i.width],u=e.data(),f=0,h=u.length;fa+_-M,r.each(function(t){var e=t[0],r=g?40+t[0].width:x;a+b+M+r>n.width-(n.margin.r+n.margin.l)&&(b=0,v+=y,i.height=i.height+y,y=0),d.setTranslate(this,a+b,5+a+e.height/2+v),i.width+=M+r,i.height=Math.max(i.height,e.height),b+=M+r,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];s.select(this).select(".legendtoggle").call(d.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+l,r.height)})}function o(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center");var n="top";M.isBottomAnchor(e)?n="bottom":M.isMiddleAnchor(e)&&(n="middle"),u.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../../registry"),h=t("../dragelement"),d=t("../drawing"),p=t("../color"),m=t("../../lib/svg_text_utils"),g=t("./handle_click"),v=t("./constants"),y=t("../../constants/interactions"),x=t("../../constants/alignment").LINE_SPACING,b=t("./get_legend_data"),_=t("./style"),w=t("./helpers"),M=t("./anchor_utils"),k=y.DBLCLICKDELAY;e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(d.setTranslate,0,e),L.call(d.setRect,N,t,v.scrollBarWidth,v.scrollBarHeight),T.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,m="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&b(t.calcdata,y),w=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+m).remove(),void u.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=r._topdefs.selectAll("#"+m).data([0]);T.enter().append("clipPath").attr("id",m).append("rect");var S=A.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(p.stroke,y.bordercolor),S.call(p.fill,y.bgcolor),S.style("stroke-width",y.borderwidth+"px");var E=A.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var L=A.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(p.fill,"#808BA4");var C=E.selectAll("g.groups").data(x);C.enter().append("g").attr("class","groups"),C.exit().remove();var z=C.selectAll("g.traces").data(c.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(_,t).style("opacity",function(t){var e=t[0].trace;return f.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){s.select(this).call(n,t).call(i,t)});var D=0!==A.enter().size();D&&(a(t,C,z),o(t));var I=r.width,P=r.height;a(t,C,z),y.height>P?function(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center"),u.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}(t):o(t);var O=r._size,F=O.l+O.w*y.x,R=O.t+O.h*(1-y.y);M.isRightAnchor(y)?F-=y.width:M.isCenterAnchor(y)&&(F-=y.width/2),M.isBottomAnchor(y)?R-=y.height:M.isMiddleAnchor(y)&&(R-=y.height/2);var N=y.width,j=O.w;N>j?(F=O.l,N=j):(F+N>I&&(F=I-N),F<0&&(F=0),N=Math.min(I-F,y.width));var B=y.height,U=O.h;B>U?(R=O.t,B=U):(R+B>P&&(R=P-B),R<0&&(R=0),B=Math.min(P-R,y.height)),d.setTranslate(A,F,R);var V,q,H=B-v.scrollBarHeight-2*v.scrollBarMargin,G=y.height-B;if(y.height<=B||t._context.staticPlot)S.attr({width:N-y.borderwidth,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),d.setTranslate(E,0,0),T.select("rect").attr({width:N-2*y.borderwidth,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),E.call(d.setClipUrl,m);else{V=v.scrollBarMargin,q=E.attr("data-scroll")||0,S.attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),T.select("rect").attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-q}),E.call(d.setClipUrl,m),D&&e(V,q),A.on("wheel",null),A.on("wheel",function(){q=c.constrain(E.attr("data-scroll")-s.event.deltaY/H*G,-G,0),e(V=v.scrollBarMargin-q/G*H,q),0!==q&&q!==-G&&s.event.preventDefault()}),L.on(".drag",null),E.on(".drag",null);var Y=s.behavior.drag().on("drag",function(){V=c.constrain(s.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+H),q=-(V-v.scrollBarMargin)/H*G,e(V,q)});L.call(Y),E.call(Y)}if(t._context.edits.legendPosition){var W,X,Z,J;A.classed("cursor-move",!0),h.init({element:A.node(),gd:t,prepFn:function(){var t=d.getTranslate(A);Z=t.x,J=t.y},moveFn:function(t,e){var r=Z+t,n=J+e;d.setTranslate(A,r,n),W=h.align(r,0,O.l,O.l+O.w,y.xanchor),X=h.align(n,0,O.t+O.h,O.t,y.yanchor)},doneFn:function(){void 0!==W&&void 0!==X&&l.relayout(t,{"legend.x":W,"legend.y":X})},clickFn:function(e,n){var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===e?A._clickTimeout=setTimeout(function(){g(i,t,e)},k):2===e&&(A._clickTimeout&&clearTimeout(A._clickTimeout),g(i,t,e)))}})}}}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../../registry":873,"../color":618,"../dragelement":640,"../drawing":643,"./anchor_utils":669,"./constants":671,"./get_legend_data":674,"./handle_click":675,"./helpers":676,"./style":678,d3:128}],674:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var a,o,s={},l=[],c=!1,u={},f=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],f=u.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var m={},g={};h&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(f,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),h&&(s[0].mrc=3);var x=v.selectAll("g.pointtext").data(d?s:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)})}},{"../../lib":743,"../../registry":873,"../../traces/pie/style_one":1052,"../../traces/scatter/subtypes":1088,"../color":618,"../drawing":643,d3:128}],679:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=h.list(t,null,!0),f="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),i(x,r);h&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var b=function(t){for(var e=a.list({_fullLayout:t},null,!0),r=0;r0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;ad&&(d=f)));return d>=h?[h,d]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sH&&n>G&&!t.shiftKey?f.getCursor(i/r,1-a/n):"move";h(e,o),q=o.split("-")[0]}function c(n,o){if("path"===r.type){var s=function(t){return U(j(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};N&&"date"===N.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else d[x]=r.x0=U(m+n),d[b]=r.y0=V(g+o),d[_]=r.x1=U(v+n),d[w]=r.y1=V(y+o);e.attr("d",i(t,r))}function u(n,o){if("path"===r.type){var s=function(t){return U(j(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};N&&"date"===N.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else{var c=~q.indexOf("n")?M+o:M,u=~q.indexOf("s")?k+o:k,f=~q.indexOf("w")?A+n:A,h=~q.indexOf("e")?T+n:T;u-c>G&&(d[S]=r[z]=V(c),d[E]=r[D]=V(u)),h-f>H&&(d[L]=r[I]=U(f),d[C]=r[P]=U(h))}e.attr("d",i(t,r))}var d,m,g,v,y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P,O,F,R,N,j,B,U,V,q,H=10,G=10,Y={element:e.node(),gd:t,prepFn:function(e){R=l.getFromId(t,r.xref),N=l.getFromId(t,r.yref),j=p.getDataToPixel(t,R),B=p.getDataToPixel(t,N,!0),U=p.getPixelToData(t,R),V=p.getPixelToData(t,N,!0);var i="shapes["+n+"]";"path"===r.type?(O=r.path,F=i+".path"):(m=j(r.x0),g=B(r.y0),v=j(r.x1),y=B(r.y1),x=i+".x0",b=i+".y0",_=i+".x1",w=i+".y1");ml&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),s.log("Ignoring extra params in segment "+t)),i+c})}(e.path,n,a);var h=n(e.x0),m=n(e.x1),g=a(e.y0),v=a(e.y1);if("line"===o)return"M"+h+","+g+"L"+m+","+v;if("rect"===o)return"M"+h+","+g+"H"+m+"V"+v+"H"+h+"Z";var y=(h+m)/2,x=(g+v)/2,b=Math.abs(y-h),_=Math.abs(x-g),w="A"+b+","+_,M=y+b+","+x;return"M"+M+w+" 0 1,1 "+(y+","+(x-_))+w+" 0 0,1 "+M+"Z"}function a(t,e,r){return t.replace(d.segmentRE,function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),f=t("../dragelement"),h=t("../../lib/setcursor"),d=t("./constants"),p=t("./helpers");e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r0)){n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font);n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.steps;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":704,"./constants":705}],707:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-M.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=M.currentValueInset,i="left"}a.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(b.font,e.currentvalue.font).text(o).call(_.convertToTspans,e.gd);var s=_.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*k;return _.positionText(a,n,l),a}}function a(t,e,r){var n=t.selectAll("rect."+M.gripRectClass).data([0]);n.enter().append("rect").classed(M.gripRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:M.gripWidth,height:M.gripHeight,rx:M.gripRadius,ry:M.gripRadius}).call(x.stroke,r.bordercolor).call(x.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function o(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(b.font,r.font).text(e.step.label).call(_.convertToTspans,r.gd),n}function s(t,e){var r=t.selectAll("g."+M.labelsClass).data([0]);r.enter().append("g").classed(M.labelsClass,!0);var n=r.selectAll("g."+M.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(M.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=v.select(this);r.call(o,t,e),b.setTranslate(r,d(e,t.fraction),M.tickOffset+e.ticklen+e.font.size*k+M.labelOffset+e.currentValueTotalHeight)})}function l(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&c(t,e,r,a,!0,i)}function c(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(h,r,r.active/(r.steps.length-1),o),e.call(i,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&y.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function u(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=v.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+M.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),o.call(x.fill,t.activebgcolor);var s=p(t,v.mouse(i)[0]);l(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=p(t,v.mouse(i)[0]);l(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(x.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function f(t,e){var r=t.selectAll("rect."+M.tickRectClass).data(e.steps);r.enter().append("rect").classed(M.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=v.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(x.fill,e.tickcolor),b.setTranslate(i,d(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?M.tickOffset:M.minorTickOffset)+e.currentValueTotalHeight)})}function h(t,e,r,n){var i=t.select("rect."+M.gripRectClass),a=d(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*M.gripWidth)+","+e.currentValueTotalHeight+")")}}function d(t,e){return t.inputAreaStart+M.stepInset+(t.inputAreaLength-2*M.stepInset)*Math.min(1,Math.max(0,e))}function p(t,e){return Math.min(1,Math.max(0,(e-M.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*M.stepInset-2*t.inputAreaStart)))}function m(t,e,r){var n=t.selectAll("rect."+M.railTouchRectClass).data([0]);n.enter().append("rect").classed(M.railTouchRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,M.tickOffset+r.ticklen+r.labelHeight)}).call(x.fill,r.bgcolor).attr("opacity",0),b.setTranslate(n,0,r.currentValueTotalHeight)}function g(t,e){var r=t.selectAll("rect."+M.railRectClass).data([0]);r.enter().append("rect").classed(M.railRectClass,!0);var n=e.inputAreaLength-2*M.railInset;r.attr({width:n,height:M.railWidth,rx:M.railRadius,ry:M.railRadius,"shape-rendering":"crispEdges"}).call(x.stroke,e.bordercolor).call(x.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),b.setTranslate(r,M.railInset,.5*(e.inputAreaWidth-M.railWidth)+e.currentValueTotalHeight)}var v=t("d3"),y=t("../../plots/plots"),x=t("../color"),b=t("../drawing"),_=t("../../lib/svg_text_utils"),w=t("../legend/anchor_utils"),M=t("./constants"),k=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[M.name],n=[],i=0;i0?[0]:[]);if(l.enter().append("g").classed(M.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0),e.call(i,r).call(g,r).call(s,r).call(f,r).call(m,t,r).call(a,t,r),b.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(h,r,r.active/(r.steps.length-1),!1),e.call(i,r)}(t,v.select(this),e)}})}}},{"../../constants/alignment":716,"../../lib/svg_text_utils":766,"../../plots/plots":852,"../color":618,"../drawing":643,"../legend/anchor_utils":669,"./constants":705,d3:128}],708:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":704,"./constants":705,"./defaults":706,"./draw":707}],709:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),h=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){function d(t){s.syncOrAsync([p,m],t)}function p(e){var r;return M?(r="",M.rotate&&(r+="rotate("+[M.rotate,w.x,w.y]+")"),M.offset&&(r+="translate(0, "+M.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":S,"font-size":n.round(E,2)+"px",fill:c.rgb(L),opacity:C*c.opacity(L),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&D){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=i(_.pad)?_.pad:2,u=l.bBox(e.node()),f={left:0,top:0,right:A.width,bottom:A.height},h=_.maxShift||(f[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(h<0)r=h;else{var d=_.offsetLeft||0,p=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[a])+c))}),r=Math.min(h,r)}if(r>0||h<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,x=r.placeholder,b=r.traceIndex,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont||{},S=T.family,E=T.size,L=T.color,C=1,z=!1,D=(v.title||"").trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var I=t._context.edits[g];""===D?C=0:D.replace(h," % ")===x.replace(h," % ")&&(C=.2,z=!0,I||(D=""));var P=D||I;k||(k=A._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var O=k.selectAll("text").data(P?[0]:[]);return O.enter().append("text"),O.text(D).attr("class",e),O.exit().remove(),P?(O.call(d),I&&(D?O.on(".opacity",null):(C=0,z=!0,O.text(x).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),O.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),O.classed("js-placeholder",z),k):k}},{"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../color":618,"../drawing":643,d3:128,"fast-isnumeric":140}],710:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:{_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}},x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/font_attributes":816,"../../plots/pad_attributes":851,"../color/attributes":617}],711:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],712:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,o,r,n)}n("visible",function(t,e){function r(t,e){return i.coerce(n,a,l,t,e)}var n,a,o=t.buttons||[],s=e.buttons=[];for(var c=0;c0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.buttons;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":710,"./constants":711}],713:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e){return+t.attr(M.menuIndexAttrName)===e._index}function a(t,e,r,n,i,a,l,c){e._input.active=e.active=l,"buttons"===e.type?s(t,n,null,null,e):"dropdown"===e.type&&(i.attr(M.menuIndexAttrName,"-1"),o(t,n,i,a,e),c||s(t,n,i,a,e))}function o(t,e,r,n,a){var o=e.selectAll("g."+M.headerClassName).data([0]);o.enter().append("g").classed(M.headerClassName,!0).style("pointer-events","all");var c=a.active,u=a.buttons[c]||M.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},g={width:a.headerWidth,height:a.headerHeight};o.call(l,a,u,t).call(p,a,f,g);var v=e.selectAll("text."+M.headerArrowClassName).data([0]);v.enter().append("text").classed(M.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(x.font,a.font).text(M.arrowSymbol[a.direction]),v.attr({x:a.headerWidth-M.arrowOffsetX+a.pad.l,y:a.headerHeight/2+M.textOffsetY+a.pad.t}),o.on("click",function(){r.call(m),r.attr(M.menuIndexAttrName,i(r,a)?-1:String(a._index)),s(t,e,r,n,a)}),o.on("mouseover",function(){o.call(h)}),o.on("mouseout",function(){o.call(d,a)}),x.setTranslate(e,a.lx,a.ly)}function s(t,e,r,n,i){r||(r=e).attr("pointer-events","all");var o=function(t){return-1==+t.attr(M.menuIndexAttrName)}(r)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?M.dropdownButtonClassName:M.buttonClassName,c=r.selectAll("g."+s).data(o),u=c.enter().append("g").classed(s,!0),m=c.exit();"dropdown"===i.type?(u.attr("opacity","0").transition().attr("opacity","1"),m.transition().attr("opacity","0").remove()):m.remove();var y=0,x=0,b=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(b?x=i.headerHeight+M.gapButtonHeader:y=i.headerWidth+M.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(x=-M.gapButtonHeader+M.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-M.gapButtonHeader+M.gapButton-i.openWidth);var _={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:M.gapButton,xPad:M.gapButton,index:0},w={l:_.x+i.borderwidth,t:_.y+i.borderwidth};c.each(function(o,s){var u=g.select(this);u.call(l,i,o,t).call(p,i,_),u.on("click",function(){g.event.defaultPrevented||(a(t,i,0,e,r,n,s),o.execute&&v.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:i,button:o,active:i.active}))}),u.on("mouseover",function(){u.call(h)}),u.on("mouseout",function(){u.call(d,i),c.call(f,i)})}),c.call(f,i),b?(w.w=Math.max(i.openWidth,i.headerWidth),w.h=_.y-w.t):(w.w=_.x-w.l,w.h=Math.max(i.openHeight,i.headerHeight)),w.direction=i.direction,n&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,f=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(c.enter().append("g").classed(M.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,A=n.barLength+2*n.barPad,T=n.barWidth+2*n.barPad,S=p,E=g+v;E+T>c&&(E=c-T);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=L.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:E,width:A,height:T}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>M,z=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,I=p+m,P=g;I+z>l&&(I=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),C?(this.vbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:I,y:P,width:z,height:D}),this._vbarYMin=P+D/2,this._vbarTranslateMax=M-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=u-.5,N=C?f+z+.5:f+.5,j=h-.5,B=k?d+T+.5:d+.5,U=s._topdefs.selectAll("#"+F).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(R),y:Math.floor(j),width:Math.ceil(N)-Math.floor(R),height:Math.ceil(B)-Math.floor(j)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||C){var V=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":743,"../color":618,"../drawing":643,d3:128}],716:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],717:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],718:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],719:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],720:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],721:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],722:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],723:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],724:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.33.0",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":609,"./components/annotations3d":614,"./components/fx":660,"./components/images":668,"./components/legend":677,"./components/rangeselector":689,"./components/rangeslider":695,"./components/shapes":702,"./components/sliders":708,"./components/updatemenus":714,"./fonts/mathjax_config":725,"./lib/queue":757,"./locale-en":771,"./locale-en-us":770,"./plot_api/plot_schema":778,"./plot_api/register":779,"./plot_api/set_plot_config":780,"./plot_api/to_image":782,"./plot_api/validate":783,"./plotly":784,"./snapshot":878,"./snapshot/download":875,"./traces/scatter":1078,d3:128,"es6-promise":137}],725:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],726:[function(t,e,r){"use strict";var n=Math.PI;r.deg2rad=function(t){return t/180*n},r.rad2deg=function(t){return t/n*180},r.wrap360=function(t){var e=t%360;return e<0?e+360:e},r.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],727:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":721,"fast-isnumeric":140}],728:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}function s(t){return t.formatDate("yyyy")}var l=t("d3"),c=t("fast-isnumeric"),u=t("./loggers"),f=t("./mod"),h=t("../constants/numerical"),d=h.BADNUM,p=h.ONEDAY,m=h.ONEHOUR,g=h.ONEMIN,v=h.ONESEC,y=h.EPOCHJD,x=t("../registry"),b=l.time.format.utc,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,w=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,M=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?x.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:x.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?x.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var k,A;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*g)>=k&&t<=A?t:d;if("string"!=typeof t&&"number"!=typeof t)return d;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?w:_);if(!s)return d;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),b=Number(s[11]||0);if(i){if(2===l.length)return d;l=Number(l);var T;try{var S=x.getComponentMethod("calendars","getCal")(e);if(o){var E="i"===c.charAt(c.length-1);c=parseInt(c,10),T=S.newDate(l,S.toMonthIndex(l,c,E),u)}else T=S.newDate(l,Number(c),u)}catch(t){return d}return T?(T.toJD()-y)*p+f*m+h*g+b*v:d}l=2===l.length?(Number(l)+2e3-M)%100+M:Number(l),c-=1;var L=new Date(Date.UTC(2e3,c,u,f,h));return L.setUTCFullYear(l),L.getUTCMonth()!==c?d:L.getUTCDate()!==u?d:L.getTime()+b*v},k=r.MIN_MS=r.dateTime2ms("-9999"),A=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==d};var T=90*p,S=3*m,E=5*g;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=k&&t<=A))return d;e||(e=0);var i,o,s,l,c,u,h=Math.floor(10*f(t+.05,1)),_=Math.round(t-h/10);if(n(r)){var w=Math.floor(_/p)+y,M=Math.floor(f(t,p));try{i=x.getComponentMethod("calendars","getCal")(r).fromJD(w).formatDate("yyyy-mm-dd")}catch(t){i=b("G%Y-%m-%d")(new Date(_))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=k+p&&t<=A-p))return d;var e=Math.floor(10*f(t+.05,1)),r=new Date(Math.round(t-e/10));return a(l.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return u.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return u.error("unrecognized date",t),e;return t};var L=/%\d?f/g,C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,i,a){var l,c;if(a=n(a)&&a,e)return function(t,e,r,i){t=t.replace(L,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(n(i))try{t=x.getComponentMethod("calendars","worldCalFmt")(t,e,i)}catch(t){return"Invalid"}return r(t)(a)}(e,t,i,a);if(a)try{var u=Math.floor((t+.05)/p)+y,f=x.getComponentMethod("calendars","getCal")(a).fromJD(u);"y"===r?c=s(f):"m"===r?c=function(t){return t.formatDate("M yyyy")}(f):"d"===r?(l=s(f),c=function(t){return t.formatDate("M d")}(f)):(l=function(t){return t.formatDate("M d, yyyy")}(f),c=o(t,r))}catch(t){return"Invalid"}else{var h=new Date(Math.floor(t+.05));"y"===r?c=i("%Y")(h):"m"===r?c=i("%b %Y")(h):"d"===r?(l=i("%Y")(h),c=i("%b %-d")(h)):(l=i("%b %-d, %Y")(h),c=o(t,r))}return c+(l?"\n"+l:"")};var z=3*p;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=f(t,p);if(t=Math.round(t-i),r)try{var a=Math.round(t/p)+y,o=x.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-y)*p+i}catch(e){u.error("invalid ms "+t+" in calendar "+r)}var l=new Date(t+z);return l.setUTCMonth(l.getUTCMonth()+e)+i-z},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&x.getComponentMethod("calendars","getCal")(e),f=0;f0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function i(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,f=a-e,h=l-o,d=c-s,p=u*u+f*f,m=h*h+d*d,g=Math.min(i(u,f,p,o-t,s-e),i(u,f,p,l-t,c-e),i(h,d,m,t-o,e-s),i(h,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),f=t.getPointAtLength(a(r,e)),h={x:(4*f.x+i.x+c.x)/6,y:(4*f.y+i.y+c.y)/6,theta:u};return o[r]=h,h},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,f=t.getTotalLength(),h=f,d=n(u);d;){if((u+=d+r)>h)return;d=n(u)}for(d=n(h);d;){if(h-=d+r,u>h)return;d=n(h)}return{min:u,max:h,len:h-u,total:f,isClosed:0===u&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":750}],738:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],739:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(o(t))return u;var e=s(t);return e.length?e:u}function a(t){return o(t)?t:f}var o=t("fast-isnumeric"),s=t("color-normalize"),l=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,u=s(c),f=1;e.exports=function(t,e,r){var o,c,h,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,c=g?function(t,e){return void 0===t[e]?u:s(o(t[e]))}:i,h=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var x=0;x=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}(t))))}},{"../constants/string_mappings":722,"superscript-text":539}],742:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],743:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./angles");l.deg2rad=p.deg2rad,l.rad2deg=p.rad2deg,l.wrap360=p.wrap360,l.wrap180=p.wrap180;var m=t("./geometry2d");l.segmentsIntersect=m.segmentsIntersect,l.segmentDistance=m.segmentDistance,l.getTextLocation=m.getTextLocation,l.clearLocationCache=m.clearLocationCache,l.getVisibleSegment=m.getVisibleSegment,l.findPointOnPath=m.findPointOnPath;var g=t("./extend");l.extendFlat=g.extendFlat,l.extendDeep=g.extendDeep,l.extendDeepAll=g.extendDeepAll,l.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");l.log=v.log,l.warn=v.warn,l.error=v.error;var y=t("./regex");l.counterRegex=y.counter;var x=t("./throttle");l.throttle=x.throttle,l.throttleDone=x.done,l.clearThrottle=x.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n=0&&t%1==0}function a(e){return void 0!==e&&e1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l};var w=/%{([^\s%{}]*)}/g,M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(w,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n},l.eventListenerOptionsSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}},{"../constants/numerical":721,"./angles":726,"./clean_number":727,"./coerce":728,"./dates":729,"./ensure_array":730,"./extend":732,"./filter_unique":733,"./filter_visible":734,"./geometry2d":737,"./get_graph_div":738,"./identity":742,"./is_array":744,"./is_plain_object":745,"./keyed_container":746,"./localize":747,"./loggers":748,"./matrix":749,"./mod":750,"./nested_property":751,"./noop":752,"./notifier":753,"./push_unique":756,"./regex":758,"./relative_attr":759,"./relink_private":760,"./search":761,"./stats":764,"./throttle":767,"./to_log_range":768,d3:128,"fast-isnumeric":140}],744:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],745:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],746:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,c(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}(d)):f[e[u]]=n}}function o(t,e){var r=e;return l(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}var l=t("fast-isnumeric"),c=t("./is_array"),u=t("./is_plain_object"),f=t("../plot_api/container_array_match");e.exports=function(t,e){if(l(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),s=0;so||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,f,h,d,p,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":721,"./matrix":749}],756:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(u=p>=0?r?n:i:r?o:a,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&l.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":140}],765:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":99}],766:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t,e,r){var n="math-output-"+c.randstr([],64),i=l.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(function(t){return t.replace(p,"\\lt ").replace(m,"\\gt ")}(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=l.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function a(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function o(t,e){function r(){p++;var e=document.createElementNS(u.svg,"tspan");l.select(e).attr({class:"line",dy:p*h+"em"}),t.appendChild(e),s=e;var r=d;if(d=[{node:e}],r.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),s=d[d.length-1].node}else c.log("Ignoring unexpected end tag .",e)}e=function(t){return function(t,e){if(!t)return"";for(var r=0;r|>|>)/g,g={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},v={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},x="\u200b",b=["http:","https:","mailto:","",void 0,":"],_=new RegExp("]*)?/?>","g"),w=Object.keys(f.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:f.entityToUnicode[t]}}),M=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,A=/<(\/?)([^ >]*)(\s+(.*))?>/i,T=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,E=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,z=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(_," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=l.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){!function(){var r=l.select(i).select(".svg-container"),a=r.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12);a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(s(t,r,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=l.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;l.select(this).transition().duration(0).remove(),l.select(document).on("mouseup",null),o.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,l.select(document).on("mouseup",function(){if(l.event.target===t)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===l.event.which?(i._editing=!1,t.style({opacity:1}),l.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),l.select(this).call(s(t,r,e)))}).on("keydown",function(){13===l.event.which&&this.blur()}).call(n)}(),t.style({opacity:0});var r,a=c.attr("class");(r=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(r).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}var i=e.gd,a=e.delegate,o=l.dispatch("edit","input","cancel"),c=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():c.on("click",r),l.rebind(t,o,"on")}},{"../constants/alignment":716,"../constants/string_mappings":722,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],767:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e?a():o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],768:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":140}],769:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":818,"topojson-client":549}],770:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],771:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""]}}},{}],772:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axis_ids"),d=h.cleanId,p=h.getFromTrace,m=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(f.subplotsRegistry.cartesian||{}).attrRegex,o=(f.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),m.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s1&&o.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),d(t),!0)}var x,b,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,f).get(),C=[],z=-1,D=E.length;for(x=0;xE.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,k),-1===z&&(z=_);else for(b=0;b=0;x--)E.splice(C[x],1),L&&L.splice(C[x],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(h(g,v),p!==a){var I;if(-1===z)I=T;else{for(D=Math.max(E.length,D),I=[],x=0;x=z);x++)I.push(_);for(x=z;x=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function s(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),o(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&o(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function l(t,e,r,n,i,s){!function(t,e,r,n){var i=v.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!v.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");o(t,r,"indices");for(var a in e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l,c,u,f=function(t,e,r,n){var i,o,s,l,c,u=v.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=a(r,t.data.length-1);for(var h in e)for(var d=0;d=0&&uY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(j+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(j+".range[0]",Math.log(Z)/Math.LN10),r(j+".range[1]",Math.log(J)/Math.LN10)):(r(j+".range[0]",Math.pow(10,Z)),r(j+".range[1]",Math.pow(10,J)))}else r(j+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[E.parts[0]]&&"radialaxis"===E.parts[1]&&delete u[E.parts[0]]._subplot.viewInitial["radialaxis.range"],b.getComponentMethod("annotations","convertCoords")(t,U,L,r),b.getComponentMethod("images","convertCoords")(t,U,L,r)}else r(j+".autorange",!0),r(j+".range",null);v.nestedProperty(u,j+"._inputRange").set(null)}else if(F.match(P.AX_NAME_PATTERN)){var K=v.nestedProperty(u,S).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),b.getComponentMethod("annotations","convertCoords")(t,K,Q,r),b.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=C.containerArrayMatch(S);if($){a=$.array,o=$.index;var tt=$.property,et=(v.nestedProperty(l,a)||[])[o]||{},rt=et,nt=q||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===o?(it?M.calc=!0:I.update(M,nt),it=!1):""===tt&&(rt=L,C.isAddVal(L)?A[S]=null:C.isRemoveVal(L)?(A[S]=et,rt=et):v.warn("unrecognized full object value",e)),it&&(n(rt,"x")||n(rt,"y"))?M.calc=!0:I.update(M,nt),d[a]||(d[a]={});var at=d[a][o];at||(at=d[a][o]={}),at[tt]=L,delete e[S]}else"reverse"===F?(B.range?B.range.reverse():(r(j+".autorange",!0),B.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):((!u._has("gl2d")&&!u._has("regl")||"dragmode"!==S||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&q?I.update(M,q):M.calc=!0,E.set(L))}}for(a in d){C.applyContainerArrayChanges(t,v.nestedProperty(l,a),d[a],M)||(M.plot=!0)}var ot=u._axisConstraintGroups||[];for(x in T)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=v.getGraphDiv(t),!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=w.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(e){if(0!==e.length){for(var s=0;so._timeToNext&&function(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,w.transition(t,e.frame.data,e.frame.layout,z.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}()};e()}()}}function f(t){return Array.isArray(s)?p>=s.length?t.transitionOpts=s[p]:t.transitionOpts=s[0]:t.transitionOpts=s,p++,t}var h,d,p=0,m=[],g=void 0===e||null===e,y=Array.isArray(e);if(!g&&!y&&v.isPlainObject(e))m.push({type:"object",data:f(v.extendFlat({},e))});else if(g||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&__)&&M.push(d);m=M}}m.length>0?u(m):(t.emit("plotly_animated"),l())})},g.addFrames=function(t,e,r){t=v.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=l.length+2*e.length,f=[];for(i=e.length-1;i>=0;i--)if(v.isPlainObject(e[i])){var h=(c[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&c[h]&&(n++,v.warn('addFrames: overwriting frame "'+c[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&v.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:w.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(a=f[i].frame).name&&v.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=w.modifyFrames,l=w.modifyFrames,c=[t,o],u=[t,a];return x&&x.add(t,s,c,l,u),w.modifyFrames(t,a)},g.purge=function(t){var e=(t=v.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return w.cleanPlot([],{},r,e),w.purge(t),y.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":618,"../components/drawing":643,"../components/errorbars":649,"../constants/xmlns_namespaces":723,"../lib":743,"../lib/events":731,"../lib/queue":757,"../lib/svg_text_utils":766,"../plotly":784,"../plots/cartesian/axis_ids":792,"../plots/cartesian/constants":794,"../plots/cartesian/constraints":796,"../plots/cartesian/graph_interact":798,"../plots/plots":852,"../plots/polar/legacy":860,"../registry":873,"./edit_types":773,"./helpers":774,"./manage_arrays":775,"./plot_schema":778,"./subroutines":781,d3:128,"fast-isnumeric":140,"has-hover":276}],777:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],778:[function(t,e,r){"use strict";function n(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function a(){var t,e,r={};x(r,h);for(t in c.subplotsRegistry)if((e=c.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)s(r,e,"xaxis"),s(r,e,"yaxis");else{s(r,e,"subplot"===e.attr?e.name:e.attr)}r=function(t){return y(t,{radialaxis:g.radialaxis,angularaxis:g.angularaxis}),y(t,g.layout),t}(r);for(t in c.componentsRegistry){var n=(e=c.componentsRegistry[t]).schema;if(n&&(n.subplots||n.layout)){var i=n.subplots;if(i&&i.xaxis&&!i.yaxis)for(var a in i.xaxis)delete r.yaxis[a]}else e.layoutAttributes&&l(r,e.layoutAttributes,e.name)}return{layoutAttributes:o(r)}}function o(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):u.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[_];if(!n)return;delete t[_],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function s(t,e,r){var n=u.nestedProperty(t,r),i=x({},e.layoutAttributes);i[b]=!0,n.set(i)}function l(t,e,r){var n=u.nestedProperty(t,r);n.set(x(n.get()||{},e))}var c=t("../registry"),u=t("../lib"),f=t("../plots/attributes"),h=t("../plots/layout_attributes"),d=t("../plots/frame_attributes"),p=t("../plots/animation_attributes"),m=t("../plots/polar/legacy/area_attributes"),g=t("../plots/polar/legacy/axis_attributes"),v=t("./edit_types"),y=u.extendFlat,x=u.extendDeepAll,b="_isSubplotObj",_="_isLinkedToArray",w=[b,_,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=b,r.IS_LINKED_TO_ARRAY=_,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=w,r.get=function(){var t={};c.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:m},r={}):r=(e=c.modules[t]._module).basePlotModule;var n={};n.type=null,x(n,f),x(n,e.attributes),r.attributes&&x(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:o(n)};if(e.layoutAttributes){var a={};x(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}(e)});var e={};return Object.keys(c.transformsRegistry).forEach(function(t){e[t]=function(t){var e=c.transformsRegistry[t],r=x({},e.attributes);return Object.keys(c.componentsRegistry).forEach(function(e){var n=c.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){l(r,n.schema.transforms[t][e],e)})}),{attributes:o(r)}}(t)}),{defs:{valObjects:u.valObjectMeta,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:v.traces,layout:v.layout},impliedEdits:{}},traces:t,layout:a(),transforms:e,frames:function(){var t={frames:u.extendDeepAll({},d)};return o(t),t.frames}(),animation:o(p)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===w.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||u.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,a,o){i=i.slice(0,o).concat([r]);if(e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[o-1]&&("ticktext"===r||"tickvals"===r))){var s=function(t){return t.join(".")}(i),l=u.nestedProperty(t,s).get();Array.isArray(l)&&n.push(s)}}var n=[],i=[];if(r.crawl(f,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,o=0;o=t.transforms.length)return!1;a=(r=(c.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=m[o];else{var u=t._module;if(u||(u=(c.modules[t.type||f.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(a=r&&r[o])){var h=u.basePlotModule;h&&h.attributes&&(a=h.attributes[o])}a||(a=f[o])}return n(a,e,s)},r.getLayoutValObject=function(t,e){return n(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var a=e.plotgroup.selectAll(".bg").data(i);a.enter().append("rect").classed("bg",!0),a.exit().remove(),a.each(function(){e.bg=a;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=l._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){l._plots[t].bg=o.select(this)}),b.each(function(t){function r(t){return"M"+k+","+t+"H"+A}function o(t){return"M"+y._offset+","+t+"h"+y._length}function s(t){return"M"+t+","+z+"V"+C}function c(t){return"M"+t+","+x._offset+"v"+x._length}function p(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}var v=l._plots[t],y=v.xaxis,x=v.yaxis;v.bg&&m&&v.bg.call(h.setRect,y._offset-u,x._offset-u,y._length+2*u,x._length+2*u).call(f.fill,l.plot_bgcolor).style("stroke-width",0),v.clipId="clip"+l._uid+t+"plot";var b=l._clips.selectAll("#"+v.clipId).data([0]);b.enter().append("clipPath").attr({class:"plotclip",id:v.clipId}).append("rect"),b.selectAll("rect").attr({width:y._length,height:x._length}),h.setTranslate(v.plot,y._offset,x._offset);var _,w;for(v._hasClipOnAxisFalse?(_=null,w=v.clipId):(_=v.clipId,w=null),h.setClipUrl(v.plot,_),i=0;i1&&d.push(a("object","layout"))),l.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&i<=10||e>=15*T)t._tickround="d";else if(e>=E&&i<=16||e>=S)t._tickround="M";else if(e>=L&&i<=19||e>=E)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(m(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);m(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(c(t.exponentformat)&&!u(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function s(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=f(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}function r(t,n){return e(n,0)?t:r(n,t%n)}var n=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),i=t*n,a=Math.abs(r(i,n));return[Math.round(i/a),Math.round(n/a)]}(a);if(o[1]>=100)e.text=f(v.deg2rad(e.x),t,i,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(e.text=C+e.text)}}}}function c(t){return"SI"===t||"B"===t}function u(t){return t>14||t<-15}function f(t,e,r,n){var i=t<0,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,f=I.getTickFormat(e),h=e.separatethousands;if(n){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:m(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(d),a=(Number(d._tickround)||0)+4,l=d._tickexponent,e.hoverformat&&(f=e.hoverformat)}if(f)return e._numFormat(f)(t).replace(/-/g,C);var p=Math.pow(10,-a)/2;if("none"===s&&(l=0),(t=Math.abs(t))"+x+"":"B"===s&&9===l?t+="B":c(s)&&(t+=H[l/3+5])}return i?C+t:t}function h(t,e){for(var r=0;r2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},I.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);if(n===i){var m=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),v.simpleMap(r,t.l2r||Number)},I.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=I.getAutoRange(t),t._r=t.range.slice(),t._rl=v.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},I.saveRangeInitial=function(t,e){for(var r=I.list(t,"",!0),n=!1,i=0;i=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:b&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:b&&0===u?0:f})}}}if((t.autorange||!!v.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,g,y=e.length,x=r.padded?.05*t._length:0,b=r.tozero&&("linear"===t.type||"-"===t.type);x&&"domain"===t.constrain&&t._inputDomain&&(x*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var _=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),A=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=y-1;a>5;a--)i(a)}},I.autoBin=function(t,e,r,n,i){var a=v.aggNums(Math.min,null,t),o=v.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:a-.5,end:o+.5,size:1,_count:o-a+1};var s;if(r)s=(o-a)/r;else{var l=v.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*v.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*v.stdev(t)/Math.pow(t.length,n?.25:.4)),m(s)||(s=1)}var f;f="log"===e.type?{type:"linear",range:[a,o]}:{type:e.type,range:v.simpleMap([a,o],e.c2r,0,i),calendar:i},I.setConvert(f),I.autoTicks(f,s);var h,d,p=I.tickIncrement(I.tickFirst(f),f.dtick,"reverse",i);if("number"==typeof f.dtick)h=(p=function(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,c=0,u=0;u.3*f||a(n)||a(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=I.tickIncrement(t,"M6","reverse")+1.5*T:a.exactMonths>.8?t=I.tickIncrement(t,"M1","reverse")+15.5*T:t-=T/2;var s=I.tickIncrement(t,r);if(s<=n)return s}return t}(p,t,f.dtick,a,i)),h=p,d=0;h<=o;)h=I.tickIncrement(h,f.dtick,!1,i),d++;return{start:e.c2r(p,0,i),end:e.c2r(h,0,i),size:f.dtick,_count:d}},I.calcTicks=function(t){var e=v.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=v.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),I.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),o(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=v.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),f=Math.max(l,c),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e=l:f<=l)&&!(a.length>u||f===c);f=I.tickIncrement(f,t.dtick,i,t.calendar))c=f,a.push(f);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dk?(e/=k,n=r(10),t.dtick="M"+12*a(e,n,R)):i>A?(e/=A,t.dtick="M"+a(e,1,N)):i>T?(t.dtick=a(e,T,B),t.tick0=v.dateTick0(t.calendar,!0)):i>S?t.dtick=a(e,S,N):i>E?t.dtick=a(e,E,j):i>L?t.dtick=a(e,L,j):(n=r(10),t.dtick=a(e,n,R))}else if("log"===t.type){t.tick0=0;var o=v.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,n=r(10),t.dtick="L"+a(e,n,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=a(e,n,q)):(t.tick0=0,n=r(10),t.dtick=a(e,n,R));if(0===t.dtick&&(t.dtick=1),!m(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},I.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(m(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return v.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?V:U,l=t+.01*i,c=v.roundUp(v.mod(l,1),s,r);return Math.floor(l)+Math.log(p.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},I.tickFirst=function(t){var e=t.r2l||Number,r=v.simpleMap(t.range,e),n=r[1]"+o,t._prevDateHead=o)),e.text=s}(t,o,r,d):"log"===t.type?function(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=f(Math.pow(10,o),t,i,n);else if(m(a)||"D"===a.charAt(0)&&v.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||c(t.exponentformat)&&u(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+C+-l+"",e.fontSize*=1.25):(e.text=f(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,v.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}(t,o,0,d,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"angular"===t._id?l(t,o,r,d,i):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=f(e.x,t,i,n)}(t,o,0,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o},I.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return I.hoverLabelText(t,e)+" - "+I.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=I.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":C+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];I.getTickFormat=function(t){function e(t){return"string"!=typeof t?t:Number(t.replace("M",""))*A}function r(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function n(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function i(t,e){var n=null===e[0],i=null===e[1],a=r(t,e[0])>=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}var a,o;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(a=0;a1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":873,"./constants":794}],793:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],794:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":743}],795:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;oo*v)||_)for(r=0;rz&&IL&&(L=I);f/=(L-E)/(2*C),E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=A.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function c(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:k.background,stroke:k.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function u(t){t.selectAll(".select-outline").remove()}function f(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),h(t,e,i,a)}function h(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function d(t){y.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function p(t){j&&t.data&&t._context.showTips&&(w.notifier(w._(t,"Double-click to zoom back out"),"long"),j=!1)}function m(t){return"lasso"===t||"select"===t}function g(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,R)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function v(t,e){if(N){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}var y=t("d3"),x=t("tinycolor2"),b=t("../../plotly"),_=t("../../registry"),w=t("../../lib"),M=t("../../lib/svg_text_utils"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("../../components/fx"),S=t("../../lib/setcursor"),E=t("../../components/dragelement"),L=t("../../constants/alignment").FROM_TL,C=t("../plots"),z=t("./axes").doTicks,D=t("./axis_ids").getFromId,I=t("./select"),P=t("./scale_zoom"),O=t("./constants"),F=O.MINDRAG,R=O.MINZOOM,N=w.eventListenerOptionsSupported(),j=!0;e.exports={makeDragBox:function(t,e,r,n,h,k,S,N){function j(){X=[e.xaxis],Z=[e.yaxis];var r=X[0],n=Z[0];Q=r._length,$=n._length;var i=ot._axisConstraintGroups,o=[r._id],s=[n._id];W=[e].concat(S&&N?e.overlays:[]);for(var l=1;lR||s>R?(yt="xy",o/Q>s/$?(s=o*$/Q,dt>a?pt.t=dt-s:pt.b=dt+s):(o=s*Q/$,ht>i?pt.l=ht-o:pt.r=ht+o),bt.attr("d",g(pt))):n():!et||s10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Mt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=At.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(N||nt){for(N||(l=.5),a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(j(),"ew"===tt||"ns"===et)return tt&&s(X,e),et&&s(Z,r),Y([tt?-e:0,et?-r:0,Q,$]),void H(et,tt);if(nt&&tt&&et){var i="w"===tt==("n"===et)?1:-1,a=(e/Q+i*r/$)/2;e=a*Q,r=i*a*$}"w"===tt?e=n(X,0,e):"e"===tt?e=n(X,1,-e):tt||(e=0),"n"===et?r=n(Z,1,r):"s"===et?r=n(Z,0,-r):et||(r=0);var o="w"===tt?e:0,l="n"===et?r:0;if(nt){var c;if(!tt&&1===et.length){for(c=0;c rect").call(A.setTranslate,s,l).call(A.setScale,a,o);var T=m.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");m.plot.call(A.setTranslate,M,k).call(A.setScale,1/a,1/o),T.selectAll(".point").call(A.setPointGroupScale,a,o),T.selectAll(".textpoint").call(A.setTextPointsScale,a,o),T.call(A.hideOutsideRangePoints,m)}}}var W,X,Z,J,K,Q,$,tt,et,rt,nt,it,at,ot=t._fullLayout,st=t._fullLayout._zoomlayer,lt=S+N==="nsew",ct=1===(S+N).length;j();var ut=i(e,S+N+"drag",rt,r,n,h,k);if(!et&&!tt&&!m(ot.dragmode))return ut.onmousedown=null,ut.style.pointerEvents=lt?"all":"none",ut;var ft={element:ut,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;lt?e.shiftKey?"pan"===i?i="zoom":m(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan",ft.minDrag="lasso"===i?1:void 0,"zoom"===i?(ft.moveFn=B,ft.doneFn=U,ft.minDrag=1,function(e,r,n){var i=ut.getBoundingClientRect();ht=r-i.left,dt=n-i.top,pt={l:ht,r:ht,w:0,t:dt,b:dt,h:0},mt=t._hmpixcount?t._hmlumcount/t._hmpixcount:x(t._fullLayout.plot_bgcolor).getLuminance(),vt=!1,yt="xy",xt=l(st,mt,J,K,gt="M0,0H"+Q+"V"+$+"H0V0"),bt=c(st,J,K),u(st)}(0,r,n)):"pan"===i?(ft.moveFn=q,ft.doneFn=G,u(st)):m(i)&&(ft.xaxes=X,ft.yaxes=Z,I(e,r,n,ft,i))},clickFn:function(r,n){if(d(t),2!==r||ct||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(tt?X:[]).concat(et?Z:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;ru[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":743,"fast-isnumeric":140}],806:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":716}],807:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function b(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,s=o.nestedProperty(t,e).get();if(i="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:r.dfltRange||p.DFLTRANGEX,i=i.slice(),s&&2===s.length)for("date"===t.type&&(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(s[n],t.calendar)){t[e]=i;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!a(s[n])){if(!a(s[1-n])){t[e]=i;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-h?s[n]=-h:s[n]>h&&(s[n]=h),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else o.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:i.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:i.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":721,"../../lib":743,"./axis_ids":792,"./constants":794,d3:128,"fast-isnumeric":140}],809:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);r("tickprefix")&&r("showtickprefix",s);r("ticksuffix",o.tickSuffixDflt)&&r("showticksuffix",s);if(r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){function r(t,e){return n.coerce(s,l,i.tickformatstops,t,e)}var a=t.tickformatstops,o=e.tickformatstops=[];if(Array.isArray(a))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),h=u.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],812:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(t){var e=t.xaxis,r=t.yaxis;d._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function f(e,r){var n,i,l,c=m[e.xaxis._id],u=m[e.yaxis._id],f=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,f[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[2]=e.xaxis._length*(1-r+r*p/h)}else f[0]=0,f[2]=e.xaxis._length;if(u){i=(n=t._fullLayout[u.axisName])._r,l=u.to,f[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var g=i[1]-i[0],v=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[3]=e.yaxis._length*(1-r+r*v/g)}else f[1]=0,f[3]=e.yaxis._length;!function(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,k,A).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,E,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}function h(){b=Date.now();for(var e=Math.min(1,(b-x)/r.duration),n=w(e),a=0;ar.duration?(!function(){for(var e={},r=0;r0?".":"")+i;l.isPlainObject(a)?o(a,e,s,n+1):e(s,i,a)}})}var s=t("../plotly"),l=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(c)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(c){n(t,c,o.cache),o.check=function(){if(s){var e=n(t,c,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fn*Math.PI/180}return!1},r.getPath=function(){return i.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(m.precision),n&&r.clipAngle(n-m.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],h=e.lonaxis,d=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(h.range,d.range);u.fitExtent(f,p);var g=this.bounds=u.getBounds(p),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!c){var A=u?o.projRotate:[k,0,0];M=r("projection.rotation.lon",A[0]),r("projection.rotation.lat",A[1]),r("projection.rotation.roll",A[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}var T,S;if(c?(T=-96.6,S=38.7):(T=u?k:M,S=(b[0]+b[1])/2),r("center.lon",T),r("center.lat",S),f){r("projection.parallels",o.projParallels||[0,60])}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":865,"../constants":818,"./layout_attributes":823}],823:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,s={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({domain:i({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:s,lataxis:s},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"../constants":818}],824:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!M.hasOwnProperty(e.type))return null;var i=M[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){return t>1?S:t<-1?-S:Math.asin(t)}function a(t){return t>1?0:t<-1?T:Math.acos(t)}function o(t,e){var r=(2+S)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>k;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function s(t,e){function r(r,n){var i=D(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?D:e===1/0?l:(r.invert=function(r,n){var i=D.invert(r/t,n);return i[0]*=e,i},r)}function l(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function c(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function u(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function f(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>k&&--i>0);return e/2}}function h(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function d(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=P[i])[0],s=r[1],l=(r=P[++i])[0],c=r[1],u=(r=P[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?S:-S)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function p(t,e){return[t*Math.cos(e),e]}function m(t,e){var r=Math.cos(e),n=function(t){return t?t/Math.sin(t):1}(a(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function g(t,e){var r=m(t,e);return[(r[0]+t/S)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&v.hasOwnProperty(t.type)?v[t.type]:r)(t,n)};var v={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},y=[],x=[],b={point:function(t,e){y.push([t,e])},result:function(){var t=y.length?y.length<2?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y}:null;return y=[],t}},_={lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){y.length&&(x.push(y),y=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},w={polygonStart:n,lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){var t=y.length;if(t){do{y.push(y[0].slice())}while(++t<4);x.push(y),y=[]}},polygonEnd:n,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(h-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},M={Point:b,MultiPoint:b,LineString:_,MultiLineString:_,Polygon:w,MultiPolygon:w,Sphere:w},k=1e-6,A=k*k,T=Math.PI,S=T/2,E=(Math.sqrt(T),T/180),L=180/T,C=t.geo.projection,z=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=a[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],l}function n(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a=0;--r){var f;o=180*(f=a[1][r])[0][0]/T,s=180*f[0][1]/T,l=180*f[1][1]/T,c=180*f[2][0]/T,u=180*f[2][1]/T,e.push(n([[c-1e-6,u-1e-6],[c-1e-6,l+1e-6],[o+1e-6,l+1e-6],[o+1e-6,s-1e-6]],30))}return{type:"Polygon",coordinates:[t.merge(e)]}}(),l)},i},o.lobes=function(t){return arguments.length?(a=t.map(function(t){return t.map(function(t){return[[t[0][0]*T/180,t[0][1]*T/180],[t[1][0]*T/180,t[1][1]*T/180],[t[2][0]*T/180,t[2][1]*T/180]]})}),i=a.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),o):a.map(function(t){return t.map(function(t){return[[180*t[0][0]/T,180*t[0][1]/T],[180*t[1][0]/T,180*t[1][1]/T],[180*t[2][0]/T,180*t[2][1]/T]]})})},o},o.invert=function(t,e){var r=.5*e*Math.sqrt((4+T)/T),n=i(r),a=Math.cos(n);return[t/(2/Math.sqrt(T*(4+T))*(1+a)),i((n+r*(a+2))/(2+S))]},(t.geo.eckert4=function(){return C(o)}).raw=o;var D=t.geo.azimuthalEqualArea.raw;l.invert=function(t,e){var r=2*i(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=z(s),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=s,c.invert=function(t,e){return[2/3*T*t/Math.sqrt(T*T/3-e*e),e]},(t.geo.kavrayskiy7=function(){return C(c)}).raw=c,u.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*T]},(t.geo.miller=function(){return C(u)}).raw=u,f(T);var I=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=a(n)),e*Math.sin(n)]}var a=f(r);return n.invert=function(n,a){var o=i(a/e);return[n/(t*Math.cos(o)),i((2*o+Math.sin(2*o))/r)]},n}(Math.SQRT2/S,Math.SQRT2,T);(t.geo.mollweide=function(){return C(I)}).raw=I,h.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>k&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return C(h)}).raw=h;var P=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];P.forEach(function(t){t[1]*=1.0144}),d.invert=function(t,e){var r=e/S,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],n-=(p=(e>=0?S:-S)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*L}while(Math.abs(p)>A&&--m>0);break}}while(--a>=0);var g=P[a][0],v=P[a+1][0],y=P[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*E]},(t.geo.robinson=function(){return C(d)}).raw=d,p.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return C(p)}).raw=p,m.invert=function(t,e){if(!(t*t+4*e*e>T*T+k)){var r=t,n=e,i=25;do{var o,s=Math.sin(r),l=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,m=l*l,g=1-p*c*c,v=g?a(f*c)*Math.sqrt(o=1/g):o=0,y=2*v*f*l-t,x=v*u-e,b=o*(p*m+v*f*c*d),_=o*(.5*s*h-2*v*u*l),w=.25*o*(h*l-v*u*p*s),M=o*(d*c+v*m*f),A=_*w-M*b;if(!A)break;var S=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=S,n-=E}while((Math.abs(S)>k||Math.abs(E)>k)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return C(m)}).raw=m,g.invert=function(t,e){var r=t,n=e,i=25;do{var o,s=Math.cos(n),l=Math.sin(n),c=Math.sin(2*n),u=l*l,f=s*s,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-f*d*d,v=g?a(s*d)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*s*p+r/S)-t,x=.5*(v*l+n)-e,b=.5*o*(f*m+v*s*d*u)+.5/S,_=o*(h*c/4-v*l*p),w=.125*o*(c*p-v*l*f*h),M=.5*o*(u*d+v*m*s)+.5,A=_*w-M*b,T=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=T,n-=E}while((Math.abs(T)>k||Math.abs(E)>k)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return C(g)}).raw=g}},{}],825:[function(t,e,r){"use strict";function n(t,e){return d.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,r){function n(t,e){var r=p.nestedProperty(s,t);r.get()!==e&&(r.set(e),p.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function a(t,e){function r(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}var a=n(0,e);return a.on("zoomstart",function(){d.select(this).style(v)}).on("zoom",function(){e.scale(d.event.scale).translate(d.event.translate),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,r)}),a}function o(t,e){function r(t){return e.invert(t)}function a(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var o,s,l,c,u,f,h,p,m=n(0,e),g=2;return m.on("zoomstart",function(){d.select(this).style(v),o=d.mouse(this),s=e.rotate(),l=e.translate(),c=s,u=r(o)}).on("zoom",function(){if(f=d.mouse(this),function(t){var n=e(r(t));return Math.abs(n[0]-t[0])>g||Math.abs(n[1]-t[1])>g}(o))return m.scale(e.scale()),void m.translate(e.translate());e.scale(d.event.scale),e.translate([l[0],d.event.translate[1]]),u?r(f)&&(p=r(f),h=[c[0]+(p[0]-u[0]),s[1],s[2]],e.rotate(h),c=h):u=r(o=f),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,a)}),m}function s(t,e){function r(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var a,o={r:e.rotate(),k:e.scale()},s=n(0,e),u=function(t){var e=0,r=arguments.length,n=[];for(;++em?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/m)*g-p,i=Math.sqrt(m*m-h*h));var v=180-a-2*p,y=(Math.atan2(d,u)-Math.atan2(l,i))*g,x=(Math.atan2(d,u)-Math.atan2(l,-i))*g,b=c(r[0],r[1],a,y),_=c(r[0],r[1],v,x);return b<=_?[a,y,r[2]]:[v,x,r[2]]}(v,a,n);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=n),e.rotate(x),n=x}}else a=l(e,t=s);!function(t){t({type:"zoom"})}(u.of(this,arguments))}),function(t){p++||t({type:"zoomstart"})}(u.of(this,arguments))}).on("zoomend",function(){d.select(this).style(y),x.call(s,"zoom",null),function(t){--p||t({type:"zoomend"})}(u.of(this,arguments)),i(t,e,r)}).on("zoom.redraw",function(){t.render()}),d.rebind(s,u,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*m,r=t[1]*m,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function c(t,e,r,n){var i=u(r-t),a=u(n-e);return Math.sqrt(i*i+a*a)}function u(t){return(t%360+540)%360-180}function f(t,e,r){var n=r*m,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function h(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(s)*_*(u>=0?1:-1),c.boxEnd[1]f[3]&&(c.boxEnd[1]=f[3],c.boxEnd[0]=c.boxStart[0]+(f[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(u)/_*(s>=0?1:-1),c.boxEnd[0]f[2]&&(c.boxEnd[0]=f[2],c.boxEnd[1]=c.boxStart[1]+(f[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(s=c.boxStart[0]!==c.boxEnd[0],u=c.boxStart[1]!==c.boxEnd[1],s||u?(s&&(a(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,r?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)h[p+2]&&(h[p]=-1,h[p+2]=1),(d=this[b[p]])._length=o.viewBox[p+2]-o.viewBox[p],s.doAutoRange(d),d.setScale();y(l),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],832:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return i.validate(t[e],c[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":618,"../../../lib":743,"../../../registry":873,"../../subplot_defaults":865,"./axis_defaults":835,"./layout_attributes":838}],838:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}var i=t("./axis_attributes"),a=t("../../domain_attributes"),o=t("../../../lib/extend").extendFlat,s=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[s("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:o(n(0,0,1),{}),center:o(n(0,0,0),{}),eye:o(n(1.25,1.25,1.25),{}),editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":743,"../../../lib/extend":732,"../../domain_attributes":815,"./axis_attributes":834}],839:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=i(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new n;return e.merge(t),e}},{"../../../lib/str2rgbarray":765}],840:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var f=l[o[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||i.constrain(f._length/40,4,9);n.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=n.calcTicks(f),m=0;mh[1][s]?d[s]=1:h[1][s]===h[0][s]?d[s]=1:d[s]=1/(h[1][s]-h[0][s]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var T=m[1][a]-m[0][a];m[0][a]-=T/32,m[1][a]+=T/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){var L=y[c=(l=u[k[a]]).type];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=E;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=u.aspectratio;C=[z.x,z.y,z.z]}u.aspectratio.x=f.aspectratio.x=C[0],u.aspectratio.y=f.aspectratio.y=C[1],u.aspectratio.z=f.aspectratio.z=C[2],this.glplot.aspect=C;var D=u.domain||null,I=e._size||null;if(D&&I){var P=this.container.style;P.position="absolute",P.left=I.l+D.x[0]*I.w+"px",P.top=I.t+(1-D.y[1])*I.h+"px",P.width=I.w*(D.x[1]-D.x[0])+"px",P.height=I.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),s(this.glplot.camera)},M.setCamera=function(t){this.glplot.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(t))},M.saveCamera=function(t){function e(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}var a=t("../../lib"),o=t("./convert_text_opts"),s=n.prototype;s.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},s.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},s.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":a.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":a.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":a.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=o(n.textposition,n.iconsize);a.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),a.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},s.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":743,"./convert_text_opts":845}],848:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain_attributes"),o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:c,textposition:n.extendFlat({},s,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":618,"../../lib":743,"../../plot_api/edit_types":773,"../../traces/scatter/attributes":1066,"../domain_attributes":815,"../font_attributes":816}],849:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){function r(t,e){return i.coerce(n,a,o.layers,t,e)}var n,a,s=t.layers||[],l=e.layers=[];for(var c=0;c=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){p.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=i.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],h=t.data||[];t._transitionData||p.createTransitionData(t),n._dfltTitle={plot:f(t,"Click to enter Plot title"),x:f(t,"Click to enter X axis title"),y:f(t,"Click to enter Y axis title"),colorbar:f(t,"Click to enter Colorscale title"),annotation:f(t,"new text")},n._traceWord=f(t,"trace");var d=function(t){function e(t){for(var e=!0,r=0;r=0)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,d=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(m.width-f)),i=Math.round(d*(m.height-h))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var v=p.layoutAttributes.width.min,y=p.layoutAttributes.height.min;n1,b=!e.height&&Math.abs(r.height-i)>1;(b||x)&&(x&&(r.width=n),b&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand){u.base={l:{val:0,size:i},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}};for(var f in u){var h=u[f].l||{},d=u[f].b||{},p=h.val,m=h.size,g=d.val,v=d.size;for(var y in u){if(a(m)&&u[y].r){var x=u[y].r.val,b=u[y].r.size;if(x>p){var _=(m*x+(b-e.width)*p)/(x-p),w=(b*(1-p)+(m-e.width)*(1-x))/(x-p);_>=0&&w>=0&&_+w>i+s&&(i=_,s=w)}}if(a(v)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>g){var A=(v*M+(k-e.height)*g)/(M-g),T=(k*(1-g)+(v-e.height)*(1-M))/(M-g);A>=0&&T>=0&&A+T>c+l&&(c=A,l=T)}}}}}if(r.l=Math.round(i),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(u.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var s,l,c=0,f=0,p=t._fullLayout._basePlotModules,m=!1;if(r)for(l=0;l=0;o--)if(_[o].enabled){r._indexToPoints=_[o]._indexToPoints;break}i&&i.calc&&(b=i.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:d,y:d}]),b[0].t||(b[0].t={}),b[0].trace=r,p[a]=b}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i=0?h.angularAxis.domain:n.extent(M),E=Math.abs(M[1]-M[0]);A&&!k&&(E=0);var L=S.slice();T&&k&&(L[1]+=E);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var z=h.angularAxis.ticksStep||(L[1]-L[0])/(C*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),L[2]||(L[2]=z);var D=n.range.apply(this,L);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=T?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),P=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(P)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,F=t.select(".chart-group"),R={fill:"none",stroke:h.tickColor},N={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=O.node().getBBox();x=Math.min(h.width-B.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*x+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title){var V=t.select("g.title-group text").style(N).text(h.title),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(R),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(R);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),H.selectAll(".domain").style(R),H.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+c(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(R),Z.selectAll(".minor").style({stroke:h.minorTickColor}),X.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(N);var J=X.select("text.axis-text").attr({x:x+h.labelOffset,dy:a+"em",transform:function(t,e){var r=c(t),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(N);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[x+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(p);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),p[0]||Q){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!k){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ct.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ot.text(o.util.round(rt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(Y).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=t.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(e){return t.radialScale(l+(e[2]||0))}).outerRadius(function(e){return t.radialScale(l+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(e,r){return"rotate("+(t.orientation+s(e[0])+90)+")"}})};var p={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(p).each(c[t.geometryType]),g.exit().remove(),m.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],o.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),g=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,f]);if(u){var v=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){return function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()}(t.symbol,c)},fill:function(t,e){return m(e)}}),y.exit().remove()}var x=n.svg.axis().scale(g).orient("right"),b=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),b.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*h+l,g=d.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../../constants/alignment":716,"../../../lib":743,d3:128}],862:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(f=i),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":618,"../../../lib":743,"./micropolar":861,"./undo_manager":863,d3:128}],863:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n0?1:-1}function d(t){return h(Math.cos(t))}function p(t){return h(Math.sin(t))}var m=t("d3"),g=t("tinycolor2"),v=t("../../plotly"),y=t("../../registry"),x=t("../../lib"),b=t("../../components/color"),_=t("../../components/drawing"),w=t("../plots"),M=t("../cartesian/axes"),k=t("../../components/dragelement"),A=t("../cartesian/dragbox"),T=t("../../components/fx"),S=t("../../components/titles"),E=t("../cartesian/select"),L=t("../../lib/setcursor"),C=t("../../constants/alignment").MID_SHIFT,z=x._,D=x.deg2rad,I=x.rad2deg,P=x.wrap360,O=x.wrap180,F=t("./helpers").setConvertAngular,R=t("./constants"),N=n.prototype;e.exports=function(t,e){return new n(t,e)},N.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h),e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f),r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h),n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f),[e,r,n,i]}(g),y=v[2]-v[0],x=v[3]-v[1],w=m/p,k=Math.abs(x/y);w>k?(l=p,d=(m-(c=p*k))/i.h/2,f=[a[0],a[1]],h=[o[0]+d,o[1]-d]):(c=m,d=(p-(l=m/k))/i.w/2,f=[a[0]+d,a[1]-d],h=[o[0],o[1]]),r.xLength2=l,r.yLength2=c,r.xDomain2=f,r.yDomain2=h;var A=r.xOffset2=i.l+i.w*f[0],T=r.yOffset2=i.t+i.h*(1-h[1]),S=r.radius=l/y,E=r.cx=A-S*v[0],L=r.cy=T+S*v[3],C=r.cxx=E-A,z=r.cyy=L-T;r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.updateAngularAxis(t,e);var I=r.radialAxis.range,O=I[1]-I[0],F=r.xaxis={type:"linear",_id:"x",range:[v[0]*O,v[2]*O],domain:f};M.setConvert(F,t),F.setScale();var R=r.yaxis={type:"linear",_id:"y",range:[v[1]*O,v[3]*O],domain:h};M.setConvert(R,t),R.setScale(),F.isPtWithinRange=function(t){return r.isPtWithinSector(t)},R.isPtWithinRange=function(){return!0},n.frontplot.attr("transform",u(A,T)).call(_.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.circle),n.bgcircle.attr({d:s(S,g),transform:u(E,L)}).call(b.fill,e.bgcolor),r.clipPaths.circle.select("path").attr("d",s(S,g)).attr("transform",u(C,z)),r.framework.selectAll(".crisp").classed("crisp",0)},N.updateRadialAxis=function(t,e){var r=this.gd,n=this.layers,s=this.radius,l=this.cx,h=this.cy,d=t._size,p=e.radialaxis,m=e.sector,g=P(m[0]);this.fillViewInitialKey("radialaxis.angle",p.angle);var v=this.radialAxis=x.extendFlat({},p,{_axislayer:n["radial-axis"],_gridlayer:n["radial-grid"],_id:"x",_pos:0,side:{counterclockwise:"top",clockwise:"bottom"}[p.side],domain:[0,s/d.w],anchor:"free",position:0,_counteraxis:!0});i(v,p,t),M.doAutoRange(v),p.range=v.range.slice(),p._input.range=v.range.slice(),this.fillViewInitialKey("radialaxis.range",v.range.slice()),"auto"===v.tickangle&&g>90&&g<=270&&(v.tickangle=180),v._transfn=function(t){return"translate("+v.l2p(t.x)+",0)"},v._gridpath=function(t){return o(v.r2p(t.x),m)};var y=a(p);this.radialTickLayout!==y&&(n["radial-axis"].selectAll(".xtick").remove(),this.radialTickLayout=y),M.doTicks(r,v,!0),c(n["radial-axis"],p.showticklabels||p.ticks,{transform:u(l,h)+f(-p.angle)}),c(n["radial-grid"],p.showgrid,{transform:u(l,h)}).selectAll("path").attr("transform",null),c(n["radial-line"].select("line"),p.showline,{x1:0,y1:0,x2:s,y2:0,transform:u(l,h)+f(-p.angle)}).attr("stroke-width",p.linewidth).call(b.stroke,p.linecolor)},N.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:s.angle,u=D(c),f=Math.cos(u),h=Math.sin(u),d=0;if(s.title){var p=_.bBox(this.layers["radial-axis"].node()).height,m=s.titlefont.size;d="counterclockwise"===s.side?-p-.4*m:p+.8*m}this.layers["radial-axis-title"]=S.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:a+i/2*f+d*h,y:o-i/2*h+d*f,"text-anchor":"middle"},transform:{rotate:-c}})},N.updateAngularAxis=function(t,e){function r(t){return T.c2rad(t.x,"degrees")}function n(t){return[v*Math.cos(t),v*Math.sin(t)]}var o=this,h=o.gd,g=o.layers,v=o.radius,y=o.cx,_=o.cy,w=e.angularaxis,k=e.sector,A=k.map(D);o.fillViewInitialKey("angularaxis.rotation",w.rotation);var T=o.angularAxis=x.extendFlat({},w,{_axislayer:g["angular-axis"],_gridlayer:g["angular-grid"],_id:"angular",_pos:0,side:"right",domain:[0,Math.PI],anchor:"free",position:0,_counteraxis:!0});"linear"===T.type?(T.autorange=!1,l(k)?T.range=k.slice():T.range=A.map(T.unTransformRad).map(I),"radians"===T.thetaunit&&(T.tick0=I(T.tick0),T.dtick=I(T.dtick))):"category"===T.type&&(T._tickFilter=function(t){return o.isPtWithinSector({r:o.radialAxis.range[1],rad:T.c2rad(t.x)})}),i(T,w,t),M.doAutoRange(T),T._transfn=function(t){var e=r(t),i=n(e),a=u(y+i[0],_-i[1]),o=m.select(this);return o&&o.node()&&o.classed("ticks")&&(a+=f(-I(e))),a},T._gridpath=function(t){var e=n(r(t));return"M0,0L"+-e[0]+","+e[1]};var S="outside"!==w.ticks?.7:.5;T._labelx=function(t){var e=r(t),n=T._labelStandoff,i=T._pad;return(0===p(e)?0:Math.cos(e)*(n+i+S*t.fontSize))+d(e)*(t.dx+n+i)},T._labely=function(t){var e=r(t),n=T._labelStandoff,i=T._labelShift,a=T._pad;return t.dy+t.fontSize*C-i+-Math.sin(e)*(n+a+S*t.fontSize)},T._labelanchor=function(t,e){var n=r(e);return 0===p(n)?d(n)>0?"start":"end":"middle"};var E=a(w);o.angularTickLayout!==E&&(g["angular-axis"].selectAll(".angulartick").remove(),o.angularTickLayout=E),M.doTicks(h,T,!0),c(g["angular-line"].select("path"),w.showline,{d:s(v,k),transform:u(y,_)}).attr("stroke-width",w.linewidth).call(b.stroke,w.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t,e),this.updateRadialDrag(t,e),this.updateMainDrag(t,e))},N.updateMainDrag=function(t,e){function r(t,e){var r=t-w,n=e-M;return Math.sqrt(r*r+n*n)}function n(t,e){return Math.atan2(M-e,t-w)}function i(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function a(t,e){var r=R.cornerLen,n=R.cornerHalfWidth;if(0===t)return s(2*n,S);var a=r/t/2,o=e-a,l=e+a,c=Math.max(0,Math.min(t,x)),u=c-n,f=c+n;return"M"+i(u,o)+"A"+[u,u]+" 0,0,0 "+i(u,l)+"L"+i(f,l)+"A"+[f,f]+" 0,0,1 "+i(f,o)+"Z"}function o(t,e){var i=C+t,o=z+e,l=r(C,z),c=Math.min(r(i,o),x),u=n(C,z),f=n(i,o);lp?(l0==n>_[0]){F=p.range[1]=n,M.doTicks(s,o.radialAxis,!0),l["radial-grid"].attr("transform",u(h,d)).selectAll("path").attr("transform",null);var i=F-_[0],a=o.sectorBBox;o.xaxis.range=[a[0]*i,a[2]*i],o.yaxis.range=[a[1]*i,a[3]*i],o.xaxis.setScale(),o.yaxis.setScale();for(var f in o.traceHash){var m=o.traceHash[f],g=x.filterVisible(m),v=m[0][0].trace._module,k=s._fullLayout[o.id];if(v.plot(s,o,g,k),!y.traceIs(f,"gl"))for(var A=0;Ao&&(o+=360);var s,c,u=P(I(t.rad)),f=u+360;return n[1]>=n[0]?(s=n[0],c=n[1]):(s=n[1],c=n[0]),i>=s&&i<=c&&(l(e)||u>=a&&u<=o||f>=a&&f<=o)},N.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../constants/alignment":716,"../../lib":743,"../../lib/setcursor":762,"../../plotly":784,"../../registry":873,"../cartesian/axes":789,"../cartesian/dragbox":797,"../cartesian/select":807,"../plots":852,"./constants":853,"./helpers":854,d3:128,tinycolor2:546}],865:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r,i){function a(t,e){return n.coerce(o,s,c,t,e)}for(var o,s,l=i.type,c=i.attributes,u=i.handleDefaults,f=i.partition||"x",h=e._subplots[l],d=h.length,p=0;p=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":618,"../../subplot_defaults":865,"./axis_defaults":869,"./layout_attributes":871}],871:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("./axis_attributes"),o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"./axis_attributes":868}],872:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=l._,u=t("../../components/color"),f=t("../../components/drawing"),h=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),m=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),x=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var _=n.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*x?i=(a=x)*w:a=(i=y)/w,o=g*i/y,s=v*a/x,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[_+2*k-b,b-_-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[_,b-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=d({},t.aaxis,{visible:!0,range:[_,b-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*w],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=d({},t.baxis,{visible:!0,range:[b-_-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=d({},t.caxis,{visible:!0,range:[b-_-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*w],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var z="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),l.clipDefRelative.select("path").attr("transform",null);var D="translate("+(r-S._offset)+","+(n+a)+")";l.layers.baxis.attr("transform",D),l.layers.bgrid.attr("transform",D);var I="translate("+(r+i/2)+","+n+")rotate(30)translate(0,-"+T._offset+")";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,-"+E._offset+")";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),f.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(m.doTicks(e,n,!0),m.doTicks(e,i,!0),m.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));this.layers["a-title"]=y.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:c(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var s=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;this.layers["b-title"]=y.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:c(e,"Click to enter Component B title"),attributes:{x:this.x0-s,y:this.y0+this.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),this.layers["c-title"]=y.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:c(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+s,y:this.y0+this.h+.83*a.titlefont.size+s,"text-anchor":"middle"}})}};var M=b.MINZOOM/2+.87,k="m-0.87,.5h"+M+"v3h-"+(M+5.2)+"l"+(M/2+2.6)+",-"+(.87*M+4.5)+"l2.6,1.5l-"+M/2+","+.87*M+"Z",A="m0.87,.5h-"+M+"v3h"+(M+5.2)+"l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-2.6,1.5l"+M/2+","+.87*M+"Z",T="m0,1l"+M/2+","+.87*M+"l2.6,-1.5l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-"+(M/2+2.6)+","+(.87*M+4.5)+"l2.6,1.5l"+M/2+",-"+.87*M+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;_.initInteractions=function(){function t(t,e){return 1-e/O.h}function e(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function r(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function n(n,i){var a=m+n,o=y+i,s=Math.max(0,Math.min(1,t(0,y),t(0,o))),l=Math.max(0,Math.min(1,e(m,y),e(a,o))),c=Math.max(0,Math.min(1,r(m,y),r(a,o))),u=(s/2+c)*O.w,f=(1-s/2-l)*O.w,h=(u+f)/2,d=f-u,p=(1-s)*O.h,g=p-d/w;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),P.transition().style("opacity",1).duration(200),D=!0)}function a(){if(i(R),L!==_){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t),E&&R.data&&R._context.showTips&&(l.notifier(c(R,"Double-click to zoom back out"),"long"),E=!1)}}function h(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m,i=[(L={a:_.a-n,b:_.b+(r+n)/2,c:_.c-(r-n)/2}).a,L.b,L.c].sort(),a=i.indexOf(L.a),o=i.indexOf(L.b),s=i.indexOf(L.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),L={a:i[a],b:i[o],c:i[s]},e=(_.a-L.a)*O.yaxis._m,t=(_.c-L.c-_.b+L.b)*O.xaxis._m);var l="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",l);var c="translate("+-t+","+-e+")";O.clipDefRelative.select("path").attr("transform",c),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(f.hideOutsideRangePoints,O)}function d(){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t)}function p(){N.selectAll(".select-outline").remove()}var m,y,_,M,L,C,z,D,I,P,O=this,F=O.layers.plotbg.select("path").node(),R=O.graphDiv,N=R._fullLayout._zoomlayer,j={element:F,gd:R,plotinfo:{xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(t,e,r){j.xaxes=[O.xaxis],j.yaxes=[O.yaxis];var i=R._fullLayout.dragmode;t.shiftKey&&(i="pan"===i?"zoom":"pan"),j.minDrag="lasso"===i?1:void 0,"zoom"===i?(j.moveFn=n,j.doneFn=a,function(t,e,r){var n=F.getBoundingClientRect();m=e-n.left,y=r-n.top,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,M=O.aaxis.range[1]-_.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),z="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",D=!1,I=N.append("path").attr("class","zoombox").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),P=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}(0,e,r)):"pan"===i?(j.moveFn=h,j.doneFn=d,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,p()):"select"!==i&&"lasso"!==i||x(t,e,r,j,i)},clickFn:function(t,e){if(i(R),2===t){var r={};r[O.id+".aaxis.min"]=0,r[O.id+".baxis.min"]=0,r[O.id+".caxis.min"]=0,R.emit("plotly_doubleclick",null),s.relayout(R,r)}v.click(R,e,O.id)}};F.onmousemove=function(t){v.hover(R,t,O.id),R._fullLayout._lasthover=F,R._fullLayout._hoversubplot=O.id},F.onmouseout=function(t){R._dragging||g.unhover(R,t)},g.init(j)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../lib":743,"../../lib/extend":732,"../../plotly":784,"../cartesian/axes":789,"../cartesian/constants":794,"../cartesian/select":807,"../cartesian/set_convert":808,"../plots":852,d3:128,tinycolor2:546}],873:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=a.extendFlat,s=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,l=t.layout,c=s([],a),u=s({},l,n(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var h=Object.keys(u);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(w),w=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}(w),w=w.replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},{"../components/color":618,"../components/drawing":643,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],882:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&E>0&&(S<=F&&E<=R||S<=R&&E<=F||("h"===M?F>=S*(R/E):R>=E*(F/S)))?m="inside":(m="outside",A.remove(),A=null)}else m="inside";if(!A&&(A=d(e,k,"outside"===m?z:C),T=p.bBox(A.node()),S=T.width,E=T.height,S<=0||E<=0))A.remove();else{var N;N="outside"===m?function(t,e,r,n,a,o,s){var l,c="h"===o?Math.abs(n-r):Math.abs(e-t);c>2*w&&(l=w);var u=1;s&&(u="h"===o?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,h,d,p,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2;f=u*a.width,h=u*a.height,"h"===o?er?(d=(t+e)/2,p=n+l+h/2):(d=(t+e)/2,p=n-l-h/2);return i(m,g,d,p,u,!1)}(l,c,u,f,T,M,"both"===g.constraintext||"outside"===g.constraintext):function(t,e,r,n,a,o,s){var l,c,u,f,h,d=a.width,p=a.height,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*w&&y>2*w?(v-=2*(h=w),y-=2*h):h=0;var x,b;d<=v&&p<=y?(x=!1,b=1):d<=y&&p<=v?(x=!0,b=1):dr?(u=(t+e)/2,f=n-h-c/2):(u=(t+e)/2,f=n+h+c/2);return i(m,g,u,f,b,x)}(l,c,u,f,T,M,"both"===g.constraintext||"inside"===g.constraintext),A.attr("transform",N)}}}function i(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");return"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function a(t,e,r,n){var i=o((e=e||{}).family,r),a=o(e.size,r),l=o(e.color,r);return{family:s(t.family,i,n.family),size:function(t,e,r){if(c(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&ei;if(!a)return e}return void 0!==r?r:t.dflt}(t.size,a,n.size),color:function(t,e,r){return u(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function o(t,e){var r;return Array.isArray(t)?e=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var g,v,y,x,b=r.p+(p?h[s]:h),_=b+r.w,w=r.b,M=w+r.s;if("h"===u.orientation?(y=a.c2p(b,!0),x=a.c2p(_,!0),g=i.c2p(w,!0),v=i.c2p(M,!0),r.ct=[v,(y+x)/2]):(g=i.c2p(b,!0),v=i.c2p(_,!0),y=a.c2p(w,!0),x=a.c2p(M,!0),r.ct=[(g+v)/2,x]),c(g)&&c(v)&&c(y)&&c(x)&&g!==v&&y!==x){var k=(r.mlw+1||u.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=l.round(k/2%1,2);if(!t._context.staticPlot){var T=d.opacity(r.mc||u.marker.color)<1||k>.01?f:m;v=T(v,g=T(g,v)),x=T(x,y=T(y,x))}var S=l.select(this);S.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+g+","+y+"V"+x+"H"+v+"V"+y+"Z"),n(t,S,e,s,g,v,y,x)}else l.select(this).remove()})}),s.call(m.plot,e)}},{"../../components/color":618,"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/svg_text_utils":766,"./attributes":883,d3:128,"fast-isnumeric":140,tinycolor2:546}],891:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;ru+s||!p(l))&&(h=!0,c(f,t))}for(var i=r.traces,a=d(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,f=[l,u],h=!1,g=0;g1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){function e(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}var r,a=n.select(this);a.classed("bartext-inside")?r=s.insidetextfont:a.classed("bartext-outside")&&(r=s.outsidetextfont),r||(r=s.textfont),i.font(a,e("family"),e("size"),e("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":643,"../../components/errorbars":649,d3:128}],895:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],896:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../scatter/attributes":1066}],897:[function(t,e,r){"use strict";function n(t,e){return t.v-e.v}function i(t){return t.v}var a=t("fast-isnumeric"),o=t("../../lib"),s=o._,l=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,c,u,f,h,d=t._fullLayout,p=l.getFromId(t,e.xaxis||"x"),m=l.getFromId(t,e.yaxis||"y"),g=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=p,u="x",f=m,h="y"):(c=m,u="y",f=p,h="x");var y=c.makeCalcdata(e,u),x=function(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||a(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;var l=r.d2c(s,0,t[e+"calendar"]);return n.map(function(){return l})}(e,h,f,y,d[v]),b=o.distinctVals(x),_=b.vals,w=b.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var C=T[r].sort(n),z=C.map(i),D=z.length,I={pos:_[r],pts:C};I.min=z[0],I.max=z[D-1],I.mean=o.mean(z,D),I.sd=o.stdev(z,D,I.mean),I.q1=o.interp(z,.25),I.med=o.interp(z,.5),I.q3=o.interp(z,.75),I.lf=Math.min(I.q1,z[Math.min(o.findBin(2.5*I.q1-1.5*I.q3,z,!0)+1,D-1)]),I.uf=Math.max(I.q3,z[Math.max(o.findBin(2.5*I.q3-1.5*I.q1,z),0)]),I.lo=4*I.q1-3*I.q3,I.uo=4*I.q3-3*I.q1,g.push(I)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r0?(g[0].t={num:d[v],dPos:w,posLetter:h,valLetter:u,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete g[0].t.labels,d[v]++,g):[{t:{empty:!0}}]}},{"../../lib":743,"../../plots/cartesian/axes":789,"fast-isnumeric":140}],898:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a=r("y"),s=r("x");if(a&&a.length)i="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",r("y0")}o.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function i(t,e,r,n){var i=n.prefix,o=a.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",o||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),a.coerceSelectionMarkerOpacity(e,r)}var a=t("../../lib"),o=t("../../registry"),s=t("../../components/color"),l=t("./attributes");e.exports={supplyDefaults:function(t,e,r,o){function c(r,n){return a.coerce(t,e,l,r,n)}n(t,e,c,o),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",s.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),i(t,e,c,{prefix:"box"}))},handleSampleDefaults:n,handlePointsDefaults:i}},{"../../components/color":618,"../../lib":743,"../../registry":873,"./attributes":896}],899:[function(t,e,r){"use strict";function n(t,e,r,n){var i,c,u,f,h,d,p,m,g,v=t.cd,y=t.xa,x=t.ya,b=v[0].trace,_=v[0].t,w="violin"===b.type,M=[],k="closest"!==n||w?_.bdPos:2.5*_.bdPos,A=function(t){return t.pos+_.bPos-d};w&&"both"!==b.side?("positive"===b.side&&(g=function(t){var e=A(t);return s.inbox(e,e+k)}),"negative"===b.side&&(g=function(t){var e=A(t);return s.inbox(e-k,e)})):g=function(t){var e=A(t);return s.inbox(e-k,e+k)};var T;T=w?function(t){return s.inbox(t.span[0]-h,t.span[1]-h)}:function(t){return s.inbox(t.min-h,t.max-h)},"h"===b.orientation?(h=e,d=r,p=T,m=g,i="y",u=x,c="x",f=y):(h=r,d=e,p=g,m=T,i="x",u=y,c="y",f=x);var S=s.getDistanceFunction(n,p,m);if(s.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],L=b.line.color,C=(b.marker||{}).color;l.opacity(L)&&b.line.width?t.color=L:l.opacity(C)&&b.boxpoints?t.color=C:t.color=b.fillcolor,t[i+"0"]=u.c2p(E.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(E.pos+_.bPos+_.bdPos,!0),a.tickText(u,u.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var z={},D=["med","min","q1","q3","max"];(b.boxmean||(b.meanline||{}).visible)&&D.push("mean"),(b.boxpoints||b.points)&&D.push("lf","uf");for(var I=0;It.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*o,u=o*h,m=[],g=0;if(r.jitter){if(0===o)for(g=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(c.translatePoints,a,o)}function o(t,e,r,n){var i,a,o=e.pos,c=e.val,u=n.bPos,f=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(l.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+u,!0)+f,n=o.c2p(t.pos+u-i,!0)+f,l=o.c2p(t.pos+u+a,!0)+f,h=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?s.select(this).attr("d","M"+h+","+n+"V"+l+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+h+","+n+"L"+p+","+e+"Z":"")):s.select(this).attr("d","M"+n+","+h+"H"+l+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+h+"L"+e+","+p+"Z":""))})}var s=t("d3"),l=t("../../lib"),c=t("../../components/drawing"),u=2e9,f=5,h=.01;e.exports={plot:function(t,e,r){var n=t._fullLayout,l=e.xaxis,c=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e=t[0],r=e.t,u=e.trace,f=e.node3=s.select(this),h=n._numBoxes,d="group"===n.boxmode&&h>1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?h:1),m=d?2*r.dPos*((r.num+.5)/h-.5)*(1-n.boxgap):0,g=p*u.whiskerwidth;if(!0!==u.visible||r.empty)s.select(this).remove();else{var v,y;"h"===u.orientation?(v=c,y=l):(v=l,y=c),r.bPos=m,r.bdPos=p,r.wdPos=g,i(f,{pos:v,val:y},u,r),u.boxpoints&&a(f,{x:l,y:c},u,r),u.boxmean&&o(f,{pos:v,val:y},u,r)}})},plotBoxAndWhiskers:i,plotPoints:a,plotBoxMean:o}},{"../../components/drawing":643,"../../lib":743,d3:128}],904:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,z=E>0?Math.ceil:Math.floor,D=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,P=C(T+L),O=z(S-L),F=[[u=A(T)]];for(i=P;i*E=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],919:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,f,h,d,p,g,v=[],y=[],x={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,x.length=P,x.crossLength=I,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(h=t.dxydi([],n-1,o,0,s),v.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=P,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],c,i-1,u,1),v.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=r,x.axis=M,x.crossAxis=E,x.value=e,x.constvar=a,x.index=m,x.x=v,x.y=y,x.smoothing=E.smoothing,x}function s(e){var n,i,o,s,l,c=[],u=[],f={};if(f.length=w.length,f.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),f.xy=function(r){return t.evalxy([],r,e)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(x=w[u],b=w[y],l=0;lw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(f=5e-15,d=(h=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+f)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+f))].sort(function(t,e){return t-e}))[0],p=h[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":732,"../../plots/cartesian/axes":789}],920:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],936:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],l=r[0].trace,c=e.xaxis,h=e.yaxis,d=l.aaxis,p=l.baxis,m=t._fullLayout,g=e.plot.selectAll(".carpetlayer"),v=m._clips,y=n(g,"g","carpet"+l.uid).classed("trace",!0),x=n(y,"g","minorlayer"),b=n(y,"g","majorlayer"),_=n(y,"g","boundarylayer"),w=n(y,"g","labellayer");y.style("opacity",l.opacity),a(c,h,b,d,"a",d._gridlines),a(c,h,b,p,"b",p._gridlines),a(c,h,x,d,"a",d._minorgridlines),a(c,h,x,p,"b",p._minorgridlines),a(c,h,_,d,"a-boundary",d._boundarylines),a(c,h,_,p,"b-boundary",p._boundarylines);!function(t,e,r,n,i,a,o,l){var c,u,f,h;c=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],f=r.ab2xy(c,u,!0),h=r.dxyda_rough(c,u),s(t,e,r,n,f,h,r.aaxis,i,a,o,"a-title"),c=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),f=r.ab2xy(c,u,!0),h=r.dxydb_rough(c,u),s(t,e,r,n,f,h,r.baxis,i,a,l,"b-title")}(t,w,l,i,c,h,o(t,c,h,l,i,w,d._labels,"a-label"),o(t,c,h,l,i,w,p._labels,"b-label")),function(t,e,r,i,a){var o,s,l,c,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var d=n(h,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(c.font,i.font).text(i.text).call(d.convertToTspans,t),p=c.bBox(this);u.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*p.height+")"),f=Math.max(f,p.width+i.axis.labelpadding)}),u.exit().remove(),f}function s(t,e,r,n,i,a,o,s,u,f,p){var m=[];o.title&&m.push(o.title);var g=e.selectAll("text."+p).data(m);g.enter().append("text").classed(p,!0),g.each(function(){var e=h(r,s,u,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(f=0),f+=o.titlefont.size+o.titleoffset;l.select(this).text(o.title||"").call(d.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+f+")").classed("user-select-none",!0).attr("text-anchor","middle").call(c.font,o.titlefont)}),g.exit().remove()}var l=t("d3"),c=t("../../components/drawing"),u=t("./map_1d_array"),f=t("./makepath"),h=t("./orient_text"),d=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},f.c2p=function(t){return t},h.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,f.smoothing,h.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t.xctrl,t.yctrl],f.smoothing,h.smoothing),t.dxydj=l([t.xctrl,t.yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,d,p,m=0,g=0,v=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(d=u-2,p=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,d,h,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,d,h,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":761,"./compute_control_points":923,"./constants":924,"./create_i_derivative_evaluator":925,"./create_j_derivative_evaluator":926,"./create_spline_evaluator":927}],938:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){function i(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&o0&&a1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":743}],939:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":981,"./has_columns":929}],940:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plots/attributes":787,"../scattergeo/attributes":1104}],941:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;cl&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":628,"../../lib":743,"./attributes":940}],943:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],944:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,f=u[0].trace,h=t.subplot;for(s=0;s")}(t,f,o,h.mockAxis),[t]}},{"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"./attributes":940}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":820,"../heatmap/colorbar":980,"./attributes":940,"./calc":941,"./defaults":942,"./event_data":943,"./hover":944,"./plot":946,"./select":947,"./style":948}],946:[function(t,e,r){"use strict";function n(t,e){for(var r=t[0].trace,n=t.length,i=s(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,s=t.geometry,l=s.coordinates,c=t.id,u=[];r="RUS"===c||"FJI"===c?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var s=o.tester(n);s.pts.pop(),u.push(s)}:function(t){u.push(o.tester(t))};switch(s.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,f=e._input.contours;if(c>u&&(s.start=f.start=u,u=s.end=f.end=c,c=s.start),!(s.size>0)){var h;h=c===u?1:n(c,u,e.ncontours).dtick,f.size=s.size=h}}return r}},{"../../lib":743,"../../plots/cartesian/axes":789,"../heatmap/calc":978}],951:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,f=c.size||1,h=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":622,"../../plots/plots":852,"./end_plus":955,"./make_color_map":959}],952:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],953:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,"contours.start"),o=n.coerce2(t,e,i,"contours.end"),s=!1===a||!1===o,l=r("contours.size");!(s?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{"../../lib":743,"./attributes":949}],954:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)):e.visible=!1}},{"../../lib":743,"../heatmap/has_columns":984,"../heatmap/xyz_defaults":993,"./attributes":949,"./contours_defaults":953,"./style_defaults":963}],955:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],956:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==l.BOTTOMSTART.indexOf(t)?i=1:-1!==l.LEFTSTART.indexOf(t)?n=1:-1!==l.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),g=[o(t,e,[-m[0],-m[1]])],v=m.join(","),y=t.z.length,x=t.z[0].length;for(f=0;f<1e4;f++){if(p>20?(p=l.CHOOSESADDLE[p][(m[0]||m[1])<0?0:1],t.crossings[d]=l.SADDLEREMAINDER[p]):delete t.crossings[d],!(m=l.NEWDELTA[p])){s.log("Found bad marching index:",p,e,t.level);break}g.push(o(t,e,m)),e[0]+=m[0],e[1]+=m[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),d=e.join(",");var b=m[0]&&(e[0]<0||e[0]>x-2)||m[1]&&(e[1]<0||e[1]>y-2);if(d===h&&m.join(",")===v||r&&b)break;p=t.crossings[d]}1e4===f&&s.log("Infinite loop in contour?");var _,w,M,k,A,T,S,E,L,C,z,D=n(g[0],g[g.length-1],a,c),I=0,P=.2*t.smoothing,O=[],F=0;for(f=1;f=F;f--)if((_=O[f])=F&&_+O[w]E&&L--,t.edgepaths[L]=z.concat(g,C));break}j||(t.edgepaths[E]=g.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r)return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208;return 15===r?0:r}((c=t[u]).level,s))&&(c.crossings[o]=l,-1!==i.indexOf(l)&&(c.starts.push([e,r]),p&&-1!==i.indexOf(l,i.indexOf(l)+1)&&c.starts.push([e,r])))}},{"./constants":952}],961:[function(t,e,r){"use strict";function n(t,e,n){var l=n[0].trace,c=n[0].x,u=n[0].y,g=l.contours,v=l.uid,y=e.xaxis,x=e.yaxis,b=t._fullLayout,_="contour"+v,w=function(t,e,r){for(var n=t.size,i=[],a=p(t),s=t.start;s1e3){o.warn("Too many contours, clipping at 1000",t);break}return i}(g,e,n[0]);if(!0!==l.visible)return b._paper.selectAll("."+_+",.hm"+v).remove(),void b._infolayer.selectAll(".cb"+v).remove();"heatmap"===g.coloring?(l.zauto&&!1===l.autocontour&&(l._input.zmin=l.zmin=g.start-g.size/2,l._input.zmax=l.zmax=l.zmin+w.length*g.size),f(t,e,[n])):(b._paper.selectAll(".hm"+v).remove(),b._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+v).remove()),h(w),d(w);var M=y.c2p(c[0],!0),k=y.c2p(c[c.length-1],!0),A=x.c2p(u[0],!0),T=x.c2p(u[u.length-1],!0),S=[[M,T],[k,T],[k,A],[M,A]],E=r.makeContourGroup(e,n,_);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(E,S,g),function(t,e,r,n){var o=t.selectAll("g.contourfill").data([0]);o.enter().append("g").classed("contourfill",!0);var s=o.selectAll("path").data("fill"===n.coloring?e:[]);s.enter().append("path"),s.exit().remove(),s.each(function(t){var e=i(t,r);e?a.select(this).attr("d",e).style("stroke","none"):a.select(this).remove()})}(E,w,S,g),function(t,e,n,i,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var f=!1!==l.showlines,h=l.showlabels,d=f&&h,p=r.createLines(u,f||h,e),g=r.createLineClip(u,d,n._fullLayout._clips,i.trace.uid),v=t.selectAll("g.contourlabels").data(h?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),h){var y=[c],x=[];o.clearLocationCache();var b=r.labelFormatter(l,i.t.cb,n._fullLayout),_=s.tester.append("text").attr("data-notex",1).call(s.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var A=Math.sqrt(w*w+M*M),T=m.LABELDISTANCE*A/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,b,_,n);a.select(this).selectAll("path").each(function(){var t=o.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/T),m.LABELMAX),i=0;i=0&&(c=x,f=h):Math.abs(l[1]-c[1])<.01?Math.abs(l[1]-x[1])<.01&&(x[0]-l[0])*(c[0]-x[0])>=0&&(c=x,f=h):o.log("endpt to newendpt is not vert. or horz.",l,c,x)}if(l=c,f>=0)break;m+="L"+c}if(f===t.edgepaths.length){o.log("unclosed perimeter path");break}g=f,(y=-1===v.indexOf(g))&&(g=v[0],m+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*a)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*a);if(h<1||d<1)return 1/0;var p=g.EDGECOST*(1/(h-1)+1/(d-1));p+=g.ANGLECOST*c*c;for(var m=s-u,v=l-f,y=s+u,x=l+f,b=0;b2*g.MAXCOST)break;d&&(s/=2),l=(a=c-s/2)+1.5*s}if(h<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=i*u,h=a*c,d=i*c,p=-a*u,m=[[o-f-h,s-d-p],[o+f-h,s+d-p],[o+f+h,s+d+p],[o-f+h,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;a.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(l.convertToTspans,r)}),i){for(var s="",c=0;cx.end&&(x.start=x.end=(x.start+x.end)/2),e._input.contours=a({},x)}else{var _=x.start,w=x.end,M=e._input.contours;if(_>w&&(x.start=M.start=w,w=x.end=M.end=_,_=x.start),!(x.size>0)){var k;k=_===w?1:n(_,w,e.ncontours).dtick,M.size=x.size=k}}return y}}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../carpet/lookup_carpetid":931,"../heatmap/clean_2d_array":979,"../heatmap/convert_column_xyz":981,"../heatmap/find_empties":983,"../heatmap/has_columns":984,"../heatmap/interp2d":987,"../heatmap/make_bound_array":988,"../heatmap/max_row_length":989,"./defaults":971}],966:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-1/0,f=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],967:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],968:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":967,"fast-isnumeric":140}],969:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":968,"fast-isnumeric":140}],970:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":743}],973:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../contour/colorbar":951,"../contour/style":962,"./attributes":964,"./calc":965,"./defaults":971,"./plot":976}],974:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function f(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,b=_):Math.abs(v[1]-y[1])=0&&(y=L,b=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(b>=0)break;M+=m(v,y),v=y}if(b===e.edgepaths.length){a.log("unclosed perimeter path");break}g=b,(A=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;U--)N=k.clipsegments[U],j=l([],N.x,L.c2p),B=l([],N.y,C.c2p),j.reverse(),B.reverse(),q.push(c(j,B,N.bicubic));var H="M"+q.join("L")+"Z";!function(t,e,r,n,i,a){var o,s,u,f,h=t.selectAll("g.contourbg").data([0]);h.enter().append("g").classed("contourbg",!0);var d=h.selectAll("path").data("fill"!==a||i?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(f=0;fx&&(n.max=x);n.len=n.max-n.min}(this,r,t,n,h,e.height),!(n.len<(e.width+e.height)*m.LABELMIN)))for(var s=Math.min(Math.ceil(n.len/D),m.LABELMAX),l=0;lz){r("x scale is not linear");break}}if(y.length&&"fast"===L){var D=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(D/100);for(w=0;wI){r("y scale is not linear");break}}}var P=u(_),O="scaled"===e.xtype?"":m,F=p(e,O,g,v,P,k),R="scaled"===e.ytype?"":y,N=p(e,R,x,b,_.length,A);E||(a.expand(k,F),a.expand(A,N));var j={x:F,y:N,z:_,text:e.text};if(S&&(j.xRanges=M.xRanges,j.yRanges=M.yRanges,j.pts=M.pts),s(e,_,"","z"),T&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=p(B,O,g,v,P,k),j.yfill=p(B,R,x,b,_.length,A)}return[j]}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../../registry":873,"../histogram2d/calc":1010,"./clean_2d_array":979,"./convert_column_xyz":981,"./find_empties":983,"./has_columns":984,"./interp2d":987,"./make_bound_array":988,"./max_row_length":989}],979:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,c;if(e){for(i=0,l=0;l=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":989}],984:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],985:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=b[0].length||d<0||d>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-x[0],r-x[x.length-1])>o)return;if(c){var T;for(k=[2*y[0]-y[1]],T=1;Tm&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":743}],988:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)b=m.c2p(T[k]),k--;for(b0;)M=g.c2p(S[k]),k--;if(M0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c){var l=a(e,i,o),u=a(r,i,o),f=t===s?0:1;return l[f]!==u[f]}return Math.floor(r/t)-Math.floor(e/t)>.1}(h,t,e,l,r,n))break;u=h}return u}function i(t,e){return e&&t>h?t>c?t>1.1*s?s:t>1.1*l?l:c:t>u?u:t>f?f:h:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r){var n=e.c2d(t,s,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var o=t("../../constants/numerical"),s=o.ONEAVGYEAR,l=o.ONEAVGMONTH,c=o.ONEDAY,u=o.ONEHOUR,f=o.ONEMIN,h=o.ONESEC,d=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,l,u=-1.1*e,f=-.1*e,h=t-f,p=r[0],m=r[1],g=Math.min(n(p+f,p+h,i,a),n(m+f,m+h,i,a)),v=Math.min(n(p+u,p+f,i,a),n(m+u,m+f,i,a));if(g>v&&vc){var y=o===s?1:6,x=o===s?"M12":"M1";return function(e,r){var n=i.c2d(e,s,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cp.size/1.9?p.size:p.size/Math.ceil(p.size/b);var T=p.start+(p.size-b)/2;_=T-b*Math.ceil((T-_)/b)}for(f=0;f=0&&w=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}(a,x.direction,x.currentbin);var Z=Math.min(i.length,a.length),J=[],K=0,Q=Z-1;for(r=0;r=K;r--)if(a[r]){Q=r;break}for(r=K;r<=Q;r++)if(o(i[r])&&o(a[r])){var $={p:i[r],s:a[r],b:0};x.enabled||($.pts=z[r],q?$.p0=$.p1=z[r].length?A[z[r][0]]:i[r]:($.p0=X(S[r]),$.p1=X(S[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=l.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),c(J,e),Array.isArray(e.selectedpoints)&&s.tagSelected(J,e,Y),J}}},{"../../constants/numerical":721,"../../lib":743,"../../plots/cartesian/axes":789,"../bar/arrays_to_calcdata":882,"./average":998,"./bin_functions":1e3,"./bin_label_vals":1001,"./clean_bins":1003,"./norm_functions":1008,"fast-isnumeric":140}],1003:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===a?o:1,h=c.size;if(n(h))c.size=h>0?Number(h):f;else if("string"!=typeof h)c.size=f;else{var d=h.charAt(0),p=h.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=f)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],1004:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return i.coerce(t,e,c,r,n)}var h=f("x"),d=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var p=f("orientation",d&&!h?"h":"v"),m=e["v"===p?"x":"y"];if(m&&m.length){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u);e["h"===p?"x":"y"]&&f("histfunc");o(t,e,f,"h"===p?["y"]:["x"]),s(t,e,f,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../components/color":618,"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../bar/style_defaults":895,"./attributes":997,"./bin_defaults":999}],1005:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;t.pointNumbers=a,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex;var o;if(r._indexToPoints){o=[];for(var s=0;sA&&g.splice(A,g.length-A),y.length>A&&y.splice(A,y.length-A),n(e,"x",g,m,_,M,x),n(e,"y",y,v,w,k,b);var T=[],S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,z=[],D=[],I=L?z:e.xbins,P=C?D:e.ybins,O=0,F=[],R=[],N=e.histnorm,j=e.histfunc,B=-1!==N.indexOf("density"),U="max"===j||"min"===j?null:0,V=c.count,q=u[N],H=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(H="avg"===j,V=c[j]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-l.tickIncrement(Z,X.size,!1,x))/1e6;for(r=Z;r=0&&d=0&&p0)o=c(t.alphahull,h);else{var d=["x","y","z"].indexOf(t.delaunayaxis);o=l(h.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:h,cells:o,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:f(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=function(t){return t.map(function(t){var e=t[0],r=s(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=i(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=i(t.facecolor)):(this.color=t.color,p.meshColor=f(t.color)),this.mesh.update(p)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=o({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":765,"alpha-shape":47,"convex-hull":109,"delaunay-triangulate":130,"gl-mesh3d":210,tinycolor2:546}],1022:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),f=c(["i","j","k"]);if(u){f&&f.forEach(function(t){for(var e=0;ei?r=!0:e1)){var f=a.simpleMap(u.x,e.d2c,0,r.xcalendar),h=a.distinctVals(f).minDiff;o=Math.min(o,h)}}for(o===1/0&&(o=1),c=0;c");S.push(o,o,o,o,o,o,null)},R=0;Rs&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),c.splice(s)),l=0;l0)&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),f=Math.min(f,o.values.length)),o._index=l,u.push(o));if(isFinite(f))for(l=0;lf&&(o.values=o.values.slice(0,f));return u}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var f={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",f),n.coerceFont(c,"tickfont",f),n.coerceFont(c,"rangefont",f)}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"../../lib":743,"./attributes":1031,"./constants":1035}],1037:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1031,"./base_plot":1032,"./calc":1033,"./colorbar":1034,"./defaults":1036,"./plot":1040}],1038:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function i(t,e,r,i,a,o){function s(c){var u;u=Math.min(i,a-c*i),o.offset=h*c*i,o.count=h*u,0===c&&(window.cancelAnimationFrame(r.currentRafs[l]),delete r.currentRafs[l],n(t,o.scissorX,o.scissorY,o.scissorWidth,o.viewBoxSize[1])),r.clearOnly||(e(o),c*i+u>>8*e)%256/255}function s(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i=f-4?o(s,f-2-l):.5);return i}(E,S,T,C),O=s(E,P),F=e.regl,R=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?p:a).concat(r))}return n}(w,M,Math.round(255*(M?z:1)))}),N=F({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:k?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:R,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),j=[0,1],B=[];return{setColorDomain:function(t){j[0]=t[0],j[1]=t[1]},render:function(t,e,a){var o,s,l,c=1/0,f=-1/0;for(o=0;of&&(f=t[o].dim2.canvasX,l=o),t[o].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t){return d.scale.linear().domain(i(t))}function s(t,e,r){var i=v(e),a=i.trace,s=i.lineColor,l=i.cscale,c=a.line,u=a.domain,p=a.dimensions,m=t.width,g=a.labelfont,y=a.tickfont,x=a.rangefont,b=h.extendDeep({},c,{color:s.map(o({values:s,range:[c.cmin,c.cmax]})),blockLineCount:f.blockLineCount,canvasOverdrag:f.overdrag*f.canvasPixelRatio}),_=Math.floor(m*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w;return{key:r,colCount:p.filter(n).length,dimensions:p,tickDistance:f.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return d.rgb(t)}),n="rgb".split("").map(function(t){return d.scale.linear().clamp(!0).domain(e).range(r.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return n.map(function(e){return e(t)})}}(l),lines:b,labelFont:g,tickFont:y,rangeFont:x,layoutWidth:m,layoutHeight:t.height,domain:u,translateX:u.x[0]*m,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*f.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:A*f.canvasPixelRatio,width:k,height:A,canvasPixelRatio:f.canvasPixelRatio}}function l(t){var e=t.width,r=t.height,a=t.dimensions,s=t.canvasPixelRatio,l=function(r){return e*r/Math.max(1,t.colCount-1)},c=f.verticalPadding/(r*s),u=1-2*c,h=function(t){return c+u*t},p={key:t.key,xScale:l,model:t},m={};return p.dimensions=a.filter(n).map(function(e,n){var a=o(e),c=m[e.label];m[e.label]=(c||0)+1;return{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:f.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(h),xScale:l,x:l(n),canvasX:l(n)*s,unitScale:function(t,e){return d.scale.linear().range([t-e,e])}(r,f.verticalPadding),domainScale:function(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?d.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(d.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):d.scale.linear().domain(n).range([t-e,e])}(r,f.verticalPadding,e),ordinalScale:function(t){var e=i(t);return t.tickvals&&d.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function c(t){t.classed(f.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var u=t("./lines"),f=t("./constants"),h=t("../../lib"),d=t("d3"),p=t("../../components/drawing"),m=t("../../lib/gup").keyFun,g=t("../../lib/gup").repeat,v=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i,o){function y(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function x(t,e){return(f.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,f={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==L&&(c?o.hover(f):o.unhover&&o.unhover(f),L=u)}}),S.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var C=e.selectAll("."+f.cn.parcoords).data(T,m);C.exit().remove(),C.enter().append("g").classed(f.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(g,m);e.enter().append("defs");var r=e.selectAll("#"+f.id.filterBarPattern).data(g,m);r.enter().append("pattern").attr("id",f.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-f.bar.width).attr("width",f.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(g,m);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",f.bar.width).attr("x",f.bar.width/2).attr("fill",f.bar.fillcolor).attr("fill-opacity",f.bar.fillopacity).attr("stroke",f.bar.strokecolor).attr("stroke-opacity",f.bar.strokeopacity).attr("stroke-width",f.bar.strokewidth)}),C.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var z=C.selectAll("."+f.cn.parcoordsControlView).data(g,m);z.enter().append("g").classed(f.cn.parcoordsControlView,!0).style("box-sizing","content-box"),z.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var D=z.selectAll("."+f.cn.yAxis).data(function(t){return t.dimensions},m);D.enter().append("g").classed(f.cn.yAxis,!0).each(function(t){E.dimensions.push(t)}),z.each(function(t){x(D,t)}),S.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=u(this,t,f.scatter),t.viewModel[t.key]=t.lineLayer,E.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),D.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),D.call(d.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;A=!1,k||(t.x=Math.max(-f.overdrag,Math.min(t.model.width+f.overdrag,d.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,D.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),x(D,e),D.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),d.select(this).attr("transform","translate("+t.x+", 0)"),D.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;k?"ending"===k&&(k=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,x(D,e),d.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),D.exit().remove();var I=D.selectAll("."+f.cn.axisOverlays).data(g,m);I.enter().append("g").classed(f.cn.axisOverlays,!0),I.selectAll("."+f.cn.axis).remove();var P=I.selectAll("."+f.cn.axis).data(g,m);P.enter().append("g").classed(f.cn.axis,!0),P.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),p.font(P.selectAll("text"),t.model.tickFont)}),P.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),P.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var O=I.selectAll("."+f.cn.axisHeading).data(g,m);O.enter().append("g").classed(f.cn.axisHeading,!0);var F=O.selectAll("."+f.cn.axisTitle).data(g,m);F.enter().append("text").classed(f.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-f.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){p.font(F,t.model.labelFont)});var R=I.selectAll("."+f.cn.axisExtent).data(g,m);R.enter().append("g").classed(f.cn.axisExtent,!0);var N=R.selectAll("."+f.cn.axisExtentTop).data(g,m);N.enter().append("g").classed(f.cn.axisExtentTop,!0),N.attr("transform","translate(0,"+-f.axisExtentOffset+")");var j=N.selectAll("."+f.cn.axisExtentTopText).data(g,m);j.enter().append("text").classed(f.cn.axisExtentTopText,!0).call(c),j.text(function(t){return b(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){p.font(j,t.model.rangeFont)});var B=R.selectAll("."+f.cn.axisExtentBottom).data(g,m);B.enter().append("g").classed(f.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+f.axisExtentOffset)+")"});var U=B.selectAll("."+f.cn.axisExtentBottomText).data(g,m);U.enter().append("text").classed(f.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(c),U.text(function(t){return b(t)(t.domainScale.domain()[0])}).each(function(t){p.font(U,t.model.rangeFont)});var V=I.selectAll("."+f.cn.axisBrush).data(g,m),q=V.enter().append("g").classed(f.cn.axisBrush,!0);V.each(function(t){t.brush||(t.brush=d.svg.brush().y(t.unitScale).on("brushstart",_).on("brush",w).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),d.select(this).call(t.brush))}),q.selectAll("rect").attr("x",-f.bar.capturewidth/2).attr("width",f.bar.capturewidth),q.selectAll("rect.extent").attr("fill","url(#"+f.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),q.selectAll(".resize rect").attr("height",f.bar.handleheight).attr("opacity",0).style("visibility","visible"),q.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",f.bar.handleoverlap-f.bar.handleheight),q.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",f.bar.handleoverlap);var H=!1,G=!1;return E}},{"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1035,"./lines":1038,d3:128}],1040:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},f=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1039,regl:506}],1041:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../plots/domain_attributes"),s=t("../../lib/extend").extendFlat,l=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},l,{}),insidetextfont:s({},l,{}),outsidetextfont:s({},l,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1042:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n")}}return y};var l},{"../../components/color":618,"./helpers":1046,"fast-isnumeric":140,tinycolor2:546}],1044:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),h=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),h&&"none"!==h){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":743,"./attributes":1041}],1045:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":657}],1046:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}var a=t("d3"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./helpers"),f=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,f=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===f.indexOf(s.scalegroup)&&f.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}(e),h.each(function(){var h=a.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove();var m=[[[],[]],[[],[]]],g=!1;h.each(function(e){function s(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)a.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var h=d.cx,v=d.cy,y=a.select(this),x=y.selectAll("path.surface").data([e]),b=!1,_=!1;if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==i.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=o.castHoverinfo({hoverinfo:[u.castOption(l,e.pts)],_module:p._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var c=n(e,d),m=h+e.pxmid[0]*(1-c),g=v+e.pxmid[1]*(1-c),y=r.separators,x=[];if(-1!==l.indexOf("label")&&x.push(e.label),-1!==l.indexOf("text")){var w=u.castOption(s.hovertext||s.text,e.pts);w&&x.push(w)}-1!==l.indexOf("value")&&x.push(u.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&x.push(u.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;o.loneHover({x0:m-c*d.r,x1:m+c*d.r,y:g,text:x.join("
    "),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:u.castOption(M.bgcolor,e.pts)||e.color,borderColor:u.castOption(M.bordercolor,e.pts),fontFamily:u.castOption(k.family,e.pts),fontSize:u.castOption(k.size,e.pts),fontColor:u.castOption(k.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[f(e,s)],event:a.event}),_=!0}}).on("mouseout",function(r){var n=t._fullLayout,i=t._fullData[p.index];_&&(r.originalEvent=a.event,t.emit("plotly_unhover",{points:[f(e,i)],event:a.event}),_=!1),b&&(o.loneUnhover(n._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,n=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[f(e,n)],o.click(t,a.event))}),p.pull){var w=+u.castOption(p.pull,e.pts)||0;w>0&&(h+=w*e.pxmid[0],v+=w*e.pxmid[1])}e.cxFinal=h,e.cyFinal=v;var M=p.hole;if(e.v===d.vTotal){var k="M"+(h+e.px0[0])+","+(v+e.px0[1])+s(e.px0,e.pxmid,!0,1)+s(e.pxmid,e.px0,!0,1)+"Z";M?x.attr("d","M"+(h+M*e.px0[0])+","+(v+M*e.px0[1])+s(e.px0,e.pxmid,!1,M)+s(e.pxmid,e.px0,!1,M)+"Z"+k):x.attr("d",k)}else{var A=s(e.px0,e.px1,!0,1);if(M){var T=1-M;x.attr("d","M"+(h+M*e.px1[0])+","+(v+M*e.px1[1])+s(e.px1,e.px0,!1,M)+"l"+T*e.px0[0]+","+T*e.px0[1]+A+"Z")}else x.attr("d","M"+h+","+v+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var S=u.castOption(p.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=a.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,"outside"===S?p.outsidetextfont:p.insidetextfont).call(c.convertToTspans,t);var o,s=l.bBox(r.node());"outside"===S?o=i(s,e):(o=function(t,e,r){var i=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=n(e,r),c={scale:l*r.r*2/i,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>h.scale?g:h;return c.scale<1&&v.scale>c.scale?v:c}(s,e,d),"auto"===S&&o.scale<1&&(r.call(l.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(s=l.bBox(r.node())),o=i(s,e)));var u=h+e.pxmid[0]*o.rCenter+(o.x||0),f=v+e.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(e.yLabelMin=f-s.height/2,e.yLabelMid=f,e.yLabelMax=f+s.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+u+","+f+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}}),g&&function(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,d=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),p=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,v=t.cyFinal+c(t.px0[1],t.px1[1]),y=d-p;if(y*h>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(i=0;i=(u.castOption(e.pull,a.pts)||0)||((t.pxmid[1]-a.pxmid[1])*h>0?(y=a.cyFinal+c(a.px0[1],a.px1[1])-p-t.labelExtraY)*h>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*h>0&&(n=3*f*Math.abs(i-m.indexOf(t)),(s=a.cxFinal+l(a.px0[0],a.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*f>0&&(t.labelExtraX+=s)))}var a,o,s,l,c,f,h,d,p,m,g,v,y;for(o=0;o<2;o++)for(s=o?r:n,c=o?Math.max:Math.min,h=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,f=a?1:-1,(d=t[o][a]).sort(s),p=t[1-o][a],m=p.concat(d),v=[],g=0;gMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(s.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){h.selectAll("tspan").each(function(){var t=a.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":618,"../../components/drawing":643,"../../components/fx":660,"../../lib/svg_text_utils":766,"./event_data":1045,"./helpers":1046,d3:128}],1051:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1052,d3:128}],1052:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":618,"./helpers":1046}],1053:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scatter/attributes":1066}],1054:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),o=t("../scatter/get_trace_color"),s=["xaxis","yaxis"],l=n.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,i,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);if(h)r=h;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=a(t.marker.color),m=a(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,x/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[s[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new n(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":765,"../scatter/get_trace_color":1076,"gl-pointcloud2d":235}],1055:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":743,"./attributes":1053}],1056:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":829,"../scatter3d/calc":1092,"./attributes":1053,"./convert":1054,"./defaults":1055}],1057:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain_attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;e.exports=c({hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":617,"../../components/fx/attributes":652,"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1058:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":661,"../../plot_api/edit_types":773,"../../plots/get_data":826,"./plot":1063}],1059:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":743,"../../lib/gup":740,"strongly-connected-components":537}],1060:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1061:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}c("node.label"),c("node.pad"),c("node.thickness"),c("node.line.color"),c("node.line.width");c("node.color",e.node.label.map(function(t,e){return o.addOpacity(function(t){return a[t%a.length]}(e),.8)})),c("link.label"),c("link.source"),c("link.target"),c("link.value"),c("link.line.color"),c("link.line.width"),c("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),c("domain.x"),c("domain.y"),c("orientation"),c("valueformat"),c("valuesuffix"),c("arrangement"),n.coerceFont(c,"textfont",n.extendFlat({},l.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":618,"../../components/color/attributes":617,"../../lib":743,"./attributes":1057,tinycolor2:546}],1062:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1057,"./base_plot":1058,"./calc":1059,"./defaults":1061,"./plot":1063}],1063:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+x.sankeyNode).filter(l(t)).call(c)}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(x.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),x=t("./constants").cn,b=y._;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=b(t,"source:")+" ",y=b(t,"target:")+" ",_=b(t,"incoming flow count:")+" ",w=b(t,"outgoing flow count:")+" ";m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,r,n){p.select(e).call(f.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,c=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left+u.width/2,h=u.top+u.height/2,m=g.loneHover({x:f-c.left,y:h-c.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",l+i.link.source.label,y+i.link.target.label].filter(n).join("
    "),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},unhover:function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())},select:function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(u,r,n),g.click(t,{target:!0})}}})}},{"../../components/color":618,"../../components/fx":660,"../../lib":743,"./constants":1060,"./render":1064,d3:128}],1064:[function(t,e,r){"use strict";function n(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function i(t){return function(e){return e.node.originalX===t.node.originalX}}function a(t){for(var e=0;e1||t.linkLineWidth>0}function h(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function d(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function p(t){return w.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+_.nodeTextOffsetHorizontal:_.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-_.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-_.nodeTextOffsetHorizontal,0]])}function m(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function g(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function v(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function y(t){return t.horizontal&&t.left?"100%":"0%"}function x(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function b(t,e,r){var a=w.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(E.raiseToTop(this),a.interactionState.dragInProgress=a.node,n(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+Math.floor(a.node.originalX);a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=S.forceSimulation(n).alphaDecay(0).force("collide",S.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(_.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}(0,e,n,r)).stop()}(0,o,a),function(t,e,r,n){window.requestAnimationFrame(function a(){for(var o=0;o<_.forceTicksPerFrame;o++)r.forceLayouts[n].tick();r.sankey.relayout(),c(t.filter(i(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,a,o)}}).on("drag",function(r){if("fixed"!==r.arrangement){var a=w.event.x,o=w.event.y;"snap"===r.arrangement?(r.node.x=a,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=a),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),n(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),c(t.filter(i(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}var _=t("./constants"),w=t("d3"),M=t("tinycolor2"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("@plotly/d3-sankey").sankey,S=t("d3-force"),E=t("../../lib"),L=t("../../lib/gup").keyFun,C=t("../../lib/gup").repeat,z=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n){var i=t.selectAll("."+_.cn.sankey).data(e.filter(function(t){return z(t).trace.visible}).map(function(t,e,r){for(var n,i=z(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,u="h"===i.orientation,f=i.node.pad,h=i.node.thickness,d=i.node.line.color,p=i.node.line.width,m=i.link.line.color,g=i.link.line.width,v=i.valueformat,y=i.valuesuffix,x=i.textfont,b=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{pointNumber:e,label:t,color:E.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{pointNumber:e,label:l.label[e],color:E.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),A=T().size(u?[b,w]:[w,b]).nodeWidth(h).nodePadding(f).nodes(M).links(k).layout(_.sankeyIterations),S=A.nodes(),L=0;L5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),R.transition().ease(_.ease).duration(_.duration).attr("startOffset",y).style("fill",v)}},{"../../components/color":618,"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1060,"@plotly/d3-sankey":41,d3:128,"d3-force":124,tinycolor2:546}],1065:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;re&&l.splice(e,l.length-e),l.map(r)}return r(n.size)}}var i=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("./subtypes"),l=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),h=r.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=Math.min(h.length,d.length);r._minDtick=0,f._minDtick=0,h.length>p&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0},v=n(e,p);v&&(m.ppad=g.ppad=v),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(s.hasMarkers(e)||s.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,a.expand(r,h,m),a.expand(f,d,g);for(var y=new Array(p),x=0;x=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1070:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1071:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":625,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1072:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1073:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=(F=z[L][1])>=H&&(I=z[L-1][0],P=z[L][0],F-O&&(D=I+(P-I)*(H-O)/(F-O),B=Math.min(B,D),U=Math.max(U,D)));B=Math.max(B,0),U=Math.min(U,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),n.extendFlat(t,{distance:c+10,x0:B,x1:U,y0:H,y1:H,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":618,"../../components/errorbars":649,"../../components/fx":660,"../../lib":743,"./fill_hover_text":1074,"./get_trace_color":1076}],1078:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"./arrays_to_calcdata":1065,"./attributes":1066,"./calc":1067,"./clean_data":1069,"./colorbar":1070,"./defaults":1073,"./hover":1077,"./plot":1085,"./select":1086,"./style":1087,"./subtypes":1088}],1079:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],1080:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=t[e],i=P.c2p(r.x),a=O.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function l(t){var e=t[0]/P._length,r=t[1]/O._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=nt[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)tt||t[1]rt)return[o(t[0],$,tt),o(t[1],et,rt)]}function h(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function d(t,e){var r=[],n=f(t),i=f(e);return n&&i&&h(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=f(n),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){(o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c}return l}}function m(t){var e=t[0],r=t[1],n=e===q[H-1][0],i=r===q[H-1][1];if(!n||!i)if(H>1){var a=e===q[H-2][0],o=r===q[H-2][1];n&&(e===$||e===tt)&&a?o?H--:q[H-1]=t:i&&(r===et||r===rt)&&o?a?H--:q[H-1]=t:q[H++]=t}else q[H++]=t}function g(t){q[H-1][0]!==t[0]&&q[H-1][1]!==t[1]&&m([W,X]),m(t),Z=null,W=X=0}function v(t){if(G=t[0]<$?$:t[0]>tt?tt:0,Y=t[1]rt?rt:0,G||Y){if(H)if(Z){var e=K(Z,t);e.length>1&&(g(e[0]),q[H++]=e[1])}else J=K(q[H-1],t)[0],q[H++]=J;else q[H++]=[G||t[0],Y||t[1]];var r=q[H-1];G&&Y&&(r[0]!==G||r[1]!==Y)?(Z&&(W!==G&&X!==Y?m(W&&X?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?$:tt,rt]:[n>0?tt:$,et]}(Z,t):[W||G,X||Y]):W&&X&&m([W,X])),m([G,Y])):W-G&&X-Y&&m([G||W,Y||X]),Z=t,W=G,X=Y}else Z&&g(K(Z,t)[0]),q[H++]=t}var y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P=e.xaxis,O=e.yaxis,F=e.simplify,R=e.connectGaps,N=e.baseTolerance,j=e.shape,B="linear"===j,U=[],V=s.minTolerance,q=new Array(t.length),H=0;F||(N=V=-1);var G,Y,W,X,Z,J,K,Q=s.maxScreensAway,$=-P._length*Q,tt=P._length*(1+Q),et=-O._length*Q,rt=O._length*(1+Q),nt=[[$,et,tt,et],[tt,et,tt,rt],[tt,rt,$,rt],[$,rt,$,et]];for("linear"===j||"spline"===j?K=u:"hv"===j||"vh"===j?K=d:"hvh"===j?K=p(0,$,tt):"vhv"===j&&(K=p(1,et,rt)),y=0;yl(M))break;b=M,(C=T[0]*A[0]+T[1]*A[1])>E?(E=C,_=M,k=!1):C=t.length||!M)break;v(M),x=M}}else v(_)}Z&&m([W||Z[0],X||Z[1]]),U.push(q.slice(0,H))}return U}},{"../../constants/numerical":721,"../../lib":743,"./constants":1072}],1081:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1082:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i=null,a=0;a0?Math.max(e,i):0}}},{"fast-isnumeric":140}],1084:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;if(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1085:[function(t,e,r){"use strict";function n(t,e,r,n,u,h,d){function p(t){return _?t.transition():t}function m(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function v(){return!1}function y(e){var n,s=e[0].trace,c=i.select(this),u=l.hasMarkers(s),f=l.hasText(s),h=function(t){if(t.ids)return g}(s),d=v,y=v;u&&(d=s.marker.maxdisplayed||s._needsCull?m:a.identity),f&&(y=s.marker.maxdisplayed||s._needsCull?m:a.identity);var x=(n=c.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);_&&x.call(o.pointStyle,s,t).call(o.translatePoints,w,M).style("opacity",0).transition().style("opacity",1);var b=u&&o.tryColorscale(s.marker,""),k=u&&o.tryColorscale(s.marker,"line");n.order(),n.each(function(e){var n=i.select(this),a=p(n);o.translatePoint(e,a,w,M)?(o.singlePointStyle(e,a,s,b,k,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,w,M,s.xcalendar,s.ycalendar),s.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),_?n.exit().transition().style("opacity",0).remove():n.exit().remove(),(n=c.selectAll("g").data(y,h)).enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=i.select(this),n=p(e.select("text"));o.translatePoint(t,n,w,M)?r.layerClipId&&o.hideOutsideRangePoint(t,e,w,M,s.xcalendar,s.ycalendar):e.remove()}),n.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=w.c2p(t.x),r=M.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){p(i.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var x,b;!function(t,e,r,n,o){var s=r.xaxis,c=r.yaxis,u=i.extent(a.simpleMap(s.range,s.r2c)),f=i.extent(a.simpleMap(c.range,c.r2c)),h=n[0].trace;if(!l.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0,w=r.xaxis,M=r.yaxis,k=n[0].trace,A=k.line,T=i.select(h);if(T.call(s.plot,r,d),!0===k.visible){p(T).style("opacity",k.opacity);var S,E,L=k.fill.charAt(k.fill.length-1);"x"!==L&&"y"!==L&&(L=""),n[0].node3=T;var C="",z=[],D=k._prevtrace;D&&(C=D._prevRevpath||"",E=D._nextFill,z=D._polygons);var I,P,O,F,R,N,j,B,U,V="",q="",H=[],G=a.noop;if(S=k._ownFill,l.hasLines(k)||"none"!==k.fill){for(E&&E.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(A.shape)?(O=o.steps(A.shape),F=o.steps(A.shape.split("").reverse().join(""))):O=F="spline"===A.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),A.smoothing):o.smoothopen(t,A.smoothing)}:function(t){return"M"+t.join("L")},R=function(t){return F(t.reverse())},H=c(n,{xaxis:w,yaxis:M,connectGaps:k.connectgaps,baseTolerance:Math.max(A.width||1,3)/4,shape:A.shape,simplify:A.simplify}),U=k._polygons=new Array(H.length),b=0;b1){var r=i.select(this);if(r.datum(n),t)p(r.style("opacity",0).attr("d",I).call(o.lineGroupStyle)).style("opacity",1);else{var a=p(r);a.attr("d",I),o.singleLineStyle(n,a)}}}}}var Y=T.selectAll(".js-line").data(H);p(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(G(!0)),o.setClipUrl(Y,r.layerClipId),H.length&&(S?N&&B&&(L?("y"===L?N[1]=B[1]=M.c2p(0,!0):"x"===L&&(N[0]=B[0]=w.c2p(0,!0)),p(S).attr("d","M"+B+"L"+N+"L"+V.substr(1)).call(o.singleFillStyle)):p(S).attr("d",V+"Z").call(o.singleFillStyle)):"tonext"===k.fill.substr(0,6)&&V&&C&&("tonext"===k.fill?p(E).attr("d",V+"Z"+C+"Z").call(o.singleFillStyle):p(E).attr("d",V+"L"+C.substr(1)+"Z").call(o.singleFillStyle),k._polygons=k._polygons.concat(z)),k._prevRevpath=q,k._prevPolygons=U);var W=T.selectAll(".points");x=W.data([n]),W.each(y),x.enter().append("g").classed("points",!0).each(y),x.exit().remove(),x.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(i.select(this),e?null:r.layerClipId)})}}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./line_points"),u=t("./link_traces"),f=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,c,f,h,d=e.plot.select("g.scatterlayer"),p=!a,m=!!a&&a.duration>0;for((f=d.selectAll("g.trace").data(r,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),u(t,e,r),function(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=i.select(this);if((n=t[0].trace)._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,d,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),m){s&&(h=s());i.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)})})}else d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)});p&&f.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/polygon":755,"./line_points":1080,"./link_traces":1082,"./subtypes":1088,d3:128}],1086:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}(e.textposition),r.textColor=g(e.textfont,1,S),r.textSize=o(e.textfont.size,S,p.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var D=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var I=e.projection[D[n]];(r.project[n]=I.show)&&(r.projectOpacity[n]=I.opacity,r.projectScale[n]=I.scale)}r.errorBounds=b(e,d);var P=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=m(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=P.color,r.errorLineWidth=P.lineWidth,r.errorCapSize=P.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=m(e.surfacecolor),r}function l(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}var c=t("gl-line3d"),u=t("gl-scatter3d"),f=t("gl-error3d"),h=t("gl-mesh3d"),d=t("delaunay-triangulate"),p=t("../../lib"),m=t("../../lib/str2rgbarray"),g=t("../../lib/gl_format_color"),v=t("../scatter/make_bubble_size_func"),y=t("../../constants/gl3d_dashes"),x=t("../../constants/gl3d_markers"),b=t("./calc_errors"),_=n.prototype;_.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},_.update=function(t){var e,r,n,i,a=this.scene.glplot.gl,o=y.solid;this.data=t;var p=s(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in y&&(o=y[p.lineDashes]),this.color=l(p.scatterColor)||l(p.lineColor),this.dataPoints=p.position,e={gl:a,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:o[0],dashScale:o[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=c(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var m=t.opacity;if(t.marker&&t.marker.opacity&&(m*=t.marker.opacity),r={gl:a,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:m,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=u(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),i={gl:a,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(i):(this.textMarkers=u(i),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=f(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n=0&&h("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];h(v+".show")&&(h(v+".opacity"),h(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../scatter/line_defaults":1079,"../scatter/marker_defaults":1084,"../scatter/subtypes":1088,"../scatter/text_defaults":1089,"./attributes":1091}],1096:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":719,"../../plots/gl3d":832,"../scatter/colorbar":1070,"./attributes":1091,"./calc":1092,"./convert":1094,"./defaults":1095}],1097:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1098:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e.a.length,d=new Array(h),p=!1;for(c=0;c0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(h.hi||d.hoverinfo).split("+"),g=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,h.a),-1!==m.indexOf("b")&&a(p.baxis,h.b);var v=p.ab2ij([h.a,h.b]),y=Math.floor(v[0]),x=v[0]-y,b=Math.floor(v[1]),_=v[1]-b,w=p.evalxy([],y,b,x,_);return g.push("y: "+w[1].toFixed(3)),s.extraText=g.join("
    "),o}}},{"../scatter/hover":1077}],1102:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1097,"./calc":1098,"./defaults":1099,"./event_data":1100,"./hover":1101,"./plot":1103}],1103:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}(u,g,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076,"./attributes":1104}],1109:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":820,"../scatter/colorbar":1070,"./attributes":1104,"./calc":1105,"./defaults":1106,"./event_data":1107,"./hover":1108,"./plot":1110,"./select":1111,"./style":1112}],1110:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");e.exports=function(t,e,r){function f(t,e){t.lonlat[0]===a&&n.select(e).remove()}for(var h=0;h1,f=r.error_x&&!0===r.error_x.visible,h=r.error_y&&!0===r.error_y.visible,p=f||h,m=d.hasMarkers(r),x=!!r.fill&&"none"!==r.fill);var E,L,C,z,D,I,O,F,R=p?l.calcFromTrace(r,b):null;if(f){(C={}).positions=n;var N=new Float64Array(4*_);if("log"===T.type)for(o=0;o<_;++o)N[k++]=n[2*o]-T.d2l(R[o].xs)||0,N[k++]=T.d2l(R[o].xh)-n[2*o]||0,N[k++]=0,N[k++]=0;else for(o=0;o<_;++o)N[k++]=n[2*o]-R[o].xs||0,N[k++]=R[o].xh-n[2*o]||0,N[k++]=0,N[k++]=0;r.error_x.copy_ystyle&&(r.error_x=r.error_y),C.errors=N,C.capSize=2*r.error_x.width,C.lineWidth=r.error_x.thickness,C.color=r.error_x.color}if(h){(z={}).positions=n;var j=new Float64Array(4*_);if("log"===S.type)for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-S.d2l(R[o].ys)||0,j[A++]=S.d2l(R[o].yh)-n[2*o+1]||0;else for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-R[o].ys||0,j[A++]=R[o].yh-n[2*o+1]||0;z.errors=j,z.capSize=2*r.error_y.width,z.lineWidth=r.error_y.thickness,z.color=r.error_y.color}if(s){(E={}).thickness=r.line.width,E.color=r.line.color,E.opacity=r.opacity,E.overlay=!0;var B=(v[r.line.dash]||[1]).slice();for(o=0;oP?"rect":m?"rect":"round",U&&r.connectgaps){var V=F[0],q=F[1];for(o=0;os&&(A[0]=s),A[1]l&&(T[0]=l),T[1]=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),h=e-f;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([h,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+f,p[1]],g=c.c2p(m),v=u.c2p(m),y=d.mrc||1;return t.x0=g-y,t.x1=g+y,t.y0=v-y,t.y1=v+y,t.color=i(l,d),t.extraText=function(t,e,r){function n(t){return t+"\xb0"}var i=(e.hi||t.hoverinfo).split("+"),o=-1!==i.indexOf("all"),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),c=e.lonlat,u=[];return o||s&&l?u.push("("+n(c[0])+", "+n(c[1])+")"):s?u.push(r.lon+n(c[0])):l&&u.push(r.lat+n(c[1])),(o||-1!==i.indexOf("text"))&&a(e,t,u),u.join("
    ")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076}],1121:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){if(e){e[0].trace._glTrace.update(e)}},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":846,"../scatter/colorbar":1070,"../scattergeo/calc":1105,"./attributes":1116,"./defaults":1118,"./event_data":1119,"./hover":1120,"./plot":1122,"./select":1123}],1122:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1117}],1123:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(!n.hasMarkers(h))return[];if(!1===e)for(s=0;s")}var i=t("../scatter/hover"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports={hoverPoints:function(t,e,r,a){var o=i(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtWithinSector(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,s.extraText=n(c,u,l),o}},makeHoverPointText:n}},{"../../lib":743,"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1128:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":855,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1124,"./calc":1125,"./defaults":1126,"./hover":1127,"./plot":1129}],1129:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var a,o,s,l={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.circle:null},c=e.radialAxis,u=c.range;for(s=u[0]>u[1]?function(t){return t<=0}:function(t){return t>=0},a=0;a=0?(g=o.c2r(m)-l[0],y=d(v),E[p]=S[2*p]=g*Math.cos(y),L[p]=S[2*p+1]=g*Math.sin(y)):E[p]=L[p]=S[2*p]=S[2*p+1]=NaN;var C=a.sceneOptions(t,e,b,S);C.fill&&!u.fill2d&&(u.fill2d=!0),C.marker&&!u.scatter2d&&(u.scatter2d=!0),C.line&&!u.line2d&&(u.line2d=!0),!C.errorX&&!C.errorY||u.error2d||(u.error2d=!0),c.hasMarkers(b)&&(C.selected.positions=C.unselected.positions=C.marker.positions),u.lineOptions.push(C.line),u.errorXOptions.push(C.errorX),u.errorYOptions.push(C.errorY),u.fillOptions.push(C.fill),u.markerOptions.push(C.marker),u.selectedOptions.push(C.selected),u.unselectedOptions.push(C.unselected),u.count=r.length,_.scene=u,_.index=h,_.x=E,_.y=L,_.rawx=E,_.rawy=L,_.r=w,_.theta=M,_.positions=S,_.count=T,_.tree=n(S,512)}}),a.plot(t,e,r)},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,c=a.hoverPoints(t,e,r,n);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var f=t.subplot,h=f.angularAxis,d=u.cd[u.index],p=u.trace;if(d.r=o[u.index],d.theta=s[u.index],d.rad=h.c2rad(d.theta,p.thetaunit),f.isPtWithinSector(d))return u.xLabelVal=void 0,u.yLabelVal=void 0,u.extraText=l(d,p,f),c}},style:a.style,selectPoints:a.selectPoints,meta:{}}},{"../../plots/cartesian/axes":789,"../../plots/polar":855,"../scatter/colorscale_calc":1071,"../scatter/subtypes":1088,"../scattergl":1115,"../scatterpolar/hover":1127,"./attributes":1130,"./defaults":1131,"fast-isnumeric":140,kdgrass:292}],1133:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:s,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker"),{showscale:c.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../components/drawing/attributes":642,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1134:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,d,p,m=t._fullLayout[e.subplot].sum,g=e.sum||m;for(r=0;r"),s}}},{"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1138:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":866,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1133,"./calc":1134,"./defaults":1135,"./event_data":1136,"./hover":1137,"./plot":1139}],1139:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null};n(t,a,r)}},{"../scatter/plot":1085}],1140:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:i.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:i.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var i=t("../../components/color"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=e.exports=l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:a.zauto,cmin:a.zmin,cmax:a.zmax,colorscale:a.colorscale,autocolorscale:s({},a.autocolorscale,{dflt:!1}),reversescale:a.reversescale,showscale:a.showscale,colorbar:o,contours:{x:n(),y:n(),z:n()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":618,"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plot_api/edit_types":773}],1141:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":625}],1142:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,c=r.cmin,u=r.cmax,f=r.surfacecolor||r.z;if(n(c)||(c=i.aggNums(Math.min,null,f)),n(u)||(u=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1143:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=o(new Float32Array(r[0]*r[1]),r);return c.assign(n.lo(1,1).hi(e[0],e[1]),t),c.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),c.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),c.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),c.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}var a=t("gl-surface3d"),o=t("ndarray"),s=t("ndarray-homography"),l=t("ndarray-fill"),c=t("ndarray-ops"),u=t("tinycolor2"),f=t("../../lib/str2rgbarray"),h=128,d=n.prototype;d.handlePick=function(t){if(t.object===this.surface){var e=t.index=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},d.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},d.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,c=t.opacity,d=function(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=u(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}})}(t.colorscale,c),p=t.z,m=t.x,g=t.y,v=n.xaxis,y=n.yaxis,x=n.zaxis,b=r.dataScale,_=p[0].length,w=p.length,M=[o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w])],k=M[0],A=M[1],T=r.contourLevels;this.data=t;var S=t.xcalendar,E=t.ycalendar,L=t.zcalendar;l(M[2],function(t,e){return x.d2l(p[e][t],0,L)*b[2]}),Array.isArray(m[0])?l(k,function(t,e){return v.d2l(m[e][t],0,S)*b[0]}):l(k,function(t){return v.d2l(m[t],0,S)*b[0]}),Array.isArray(g[0])?l(A,function(t,e){return y.d2l(g[e][t],0,E)*b[1]}):l(A,function(t,e){return y.d2l(g[e],0,E)*b[1]});var C={colormap:d,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(C.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var z=o(new Float32Array(_*w),[_,w]);l(z,function(e,r){return t.surfacecolor[r][e]}),M.push(z)}else C.intensityBounds[0]*=b[2],C.intensityBounds[1]*=b[2];this.dataScale=function(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1150:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}var o=t("./constants"),s=t("../../lib/extend").extendFlat,l=t("fast-isnumeric");e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),c=e.cells.values,u=e.domain,f=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),h=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),d=r.length?r[0].map(function(){return e.header.height}):[],p=c.length?c[0].map(function(){return e.cells.height}):[],m=d.reduce(function(t,e){return t+e},0),g=a(p,h-m+o.uplift),v=i(a(d,m),[]),y=i(g,v),x={},b=e._fullInput.columnorder,_=r.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return l(n)?Number(n):1}),w=_.reduce(function(t,e){return t+e},0);_=_.map(function(t){return t/w*f});var M={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:f,height:h,columnOrder:b,groupHeight:h,rowBlocks:y,headerRowBlocks:v,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=x[t];x[t]=(r||0)+1;return{key:t+"__"+x[t],label:t,specIndex:e,xIndex:b[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:_[e]}})};return M.columns.forEach(function(t){t.calcdata=M,t.x=n(t)}),M}},{"../../lib/extend":732,"./constants":1149,"fast-isnumeric":140}],1151:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":732}],1152:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=function(t){return"string"==typeof t&&t.match(A.latexCheck)}(n);t.latex=s;var l,f=s?"":u(t.calcdata.cells.prefix,e,r)||"",h=s?"":u(t.calcdata.cells.suffix,e,r)||"",d=s?null:u(t.calcdata.cells.format,e,r)||null,p=f+(d?T.format(d)(t.value):t.value)+h;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=c(p)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?c(p):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var m;if(t.wrappingNeeded){var g=(" "===A.wrapSplitCharacter?p.replace(/i&&n.push(a),i+=l}return n}(i,u,c);1===f.length&&(f[0]===i.length-1?f.unshift(f[0]-1):f.push(f[0]+1)),f[0]%2&&f.reverse(),e.each(function(t,e){t.page=f[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(w(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(v(t,r,e,f,n.prevPages,n,0),v(t,r,e,f,n.prevPages,n,1),o(r,t))}}function g(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*T.event.dy:n;var l=o.selectAll("."+A.cn.yColumn).selectAll("."+A.cn.columnBlock).filter(h);m(t,l,o)}}function v(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function y(t,e,r){return function(){var n=T.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,c=t.column.columnWidth-2*A.cellPad;for(t.value="";o.length;)l+(i=(r=o.shift()).width+a)>c&&(t.value+=s.join(A.wrapSpacer)+A.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(A.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),l(n.select("."+A.cn.cellText),r,t),T.select(e.parentNode.parentNode).call(_)}}function x(t,e,r,n,i){return function(){if(!i.settledY){var a=T.select(e.parentNode),s=k(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*A.cellPad:c,f=Math.max(u,c);f-s.rows[l].rowHeight&&(s.rows[l].rowHeight=f,t.selectAll("."+A.cn.columnCell).call(_),m(null,t.filter(h),0),o(r,n,!0)),a.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),e=T.select(this.parentNode).select("."+A.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),n=e.top-t.top+(r?r.matrix.f:A.cellPad);return"translate("+b(i,T.select(this.parentNode).select("."+A.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+n+")"}),i.settledY=!0}}}function b(t,e){switch(t.align){case"left":return A.cellPad;case"right":return t.column.columnWidth-(e||0)-A.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return A.cellPad}}function _(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+M(e,1/0)},0);return"translate(0 "+(M(k(t),t.key)+e)+")"}).selectAll("."+A.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(k(t),t.key).rowHeight})}function w(t,e){for(var r=0,n=e-1;n>=0;n--)r+=function(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n0){var y,x,b,_,w,M=t.xa,k=t.ya;"h"===h.orientation?(w=e,y="y",b=k,x="x",_=M):(w=r,y="x",b=M,x="y",_=k);var A=f[t.index];if(w>=A.span[0]&&w<=A.span[1]){var T=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,h,w),L=o.getPositionOnKdePath(A,h,S),C=b._offset,z=b._length;T[y+"0"]=L[0],T[y+"1"]=L[1],T[x+"0"]=T[x+"1"]=S,T[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+E.toFixed(3),g.push(T),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+z),u[y+"2"]=n.constrain(C+L[1],C,C+z),u[x+"1"]=u[x+"2"]=_._offset+S}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var D=l.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":743,"../../plots/cartesian/axes":789,"../box/hover":899,"./helpers":1158}],1160:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":800,"../box/select":904,"./attributes":1155,"./calc":1156,"./defaults":1157,"./hover":1159,"./layout_attributes":1161,"./layout_defaults":1162,"./plot":1163,"./set_positions":1164,"./style":1165}],1161:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":743,"../box/layout_attributes":901}],1162:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":743,"../box/layout_defaults":902,"./layout_attributes":1161}],1163:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,f=e.xaxis,h=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,g=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),v=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-u.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],x=e[a.posLetter+"axis"],b="both"===s.side,_=b||"positive"===s.side,w=b||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,A=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+v,u=x.c2p(l);switch(s.scalemode){case"width":e=A.maxWidth/g;break;case"count":e=A.maxWidth/g*(A.maxCount/t.pts.length)}var f,h,d,p,m,M,k;if(_){for(M=new Array(o),p=0;pi&&(i=c,a=l)}}return i?s(a):f};case"rms":return function(t,e){for(var r=0,i=0,a=0;a=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,i){return n.coerce(t,a,r.attributes,e,i)}var a={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,a,"valuecalendar",null),o(t,a,"targetcalendar",null)}return a},r.calcTransform=function(t,e,r){function i(t,r){for(var i=0;i":return function(t){return h(t)>i};case">=":return function(t){return h(t)>=i};case"[]":return function(t){var e=h(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=h(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=h(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=h(t);return ei[1]};case"](":return function(t){var e=h(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=h(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(h(t))};case"}{":return function(t){return-1===i.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,f,u),d),x={},b={},_=0;r.preservegaps?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),i(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;o np.ndarray: - """ - Performs a svds operation on the two dimensional s_mat - - Parameters - ---------- - s_mat: ndarray - 2D array on which the svds operation shall be performed - k: int, 10, optional. - The size of the POD - - Returns - ------- - v: ndarray - Array containing the right reduced order basis - """ - small_mat = csc_matrix(s_mat.astype(np.float64)) - - _, _, v = svds(small_mat, k=k) - - v = v[::-1, :] - - return v - - -def calculate_v_and_betas( - stacked_sub_displ: np.ndarray, - progress_bar: Union[None, Progress, PlaceHolderBar] = None, - task_id: Union[None, TaskID] = None, -) -> Union[str, tuple[np.ndarray, np.ndarray]]: - """ - Calculates the right reduced order Basis V and up to 10 eigenvalues of the subsamples - - Parameters - ---------- - stacked_sub_displ: np.ndarray - np.ndarray containing all subsampled displacements - shape must be (samples, timesteps, nodes, dims) - - Returns - ------- - v_big: np.ndarray - Reduced order basis to transform betas bag into subsamples - betas: np.ndarray - Projected simulation runs - err_msg: str - Error message if not enough samples where provided - """ - - big_mat = stacked_sub_displ.reshape(( - stacked_sub_displ.shape[0], - stacked_sub_displ.shape[1], - stacked_sub_displ.shape[2] * stacked_sub_displ.shape[3], - )) - - diff_mat = np.stack([big_mat[:, 0, :] for _ in range(big_mat.shape[1])]).reshape(( - big_mat.shape[0], - big_mat.shape[1], - big_mat.shape[2], - )) - - # We only want the difference in displacement - big_mat = big_mat - diff_mat - - k = min(10, big_mat.shape[0] - 1) - if k < 1: - return "Must provide more than 1 sample" - - if task_id is None and progress_bar: - return "Progress requires a task ID" - - v_big = np.zeros((k, big_mat.shape[1], big_mat.shape[2])) - if progress_bar: - progress_bar.advance(task_id) # type: ignore - for step in range(big_mat.shape[1] - 1): - v_big[:, step + 1] = svd_step_and_dim(big_mat[:, step + 1], k) - progress_bar.advance(task_id) # type: ignore - else: - for step in range(big_mat.shape[1] - 1): - v_big[:, step + 1] = svd_step_and_dim(big_mat[:, step + 1], k) - - betas_big = np.einsum("stn, ktn -> stk", big_mat, v_big) - - return v_big, betas_big diff --git a/src/lasso/dimred/svd/subsampling_methods.py b/src/lasso/dimred/svd/subsampling_methods.py deleted file mode 100644 index 73468ac..0000000 --- a/src/lasso/dimred/svd/subsampling_methods.py +++ /dev/null @@ -1,291 +0,0 @@ -import os -import random -import time -from collections.abc import Sequence -from typing import Union - -import numpy as np -from sklearn.neighbors import NearestNeighbors - -from lasso.dyna import ArrayType, D3plot - - -def _mark_dead_eles(node_indexes: np.ndarray, alive_shells: np.ndarray) -> np.ndarray: - """ - Returns a mask to filter out elements mark as 'no alive' - - Parameters - ---------- - node_indexes: ndarray - Array containing node indexes - alive_nodes: ndarray - Array containing float value representing if element is alive. - Expected for D3plot.arrays[ArrayType.element_shell_is_alive] or equivalent for beams etc - - Returns - ------- - node_coordinate_mask: np.ndarray - Array containing indizes of alive shells. - Use node_coordinates[node_coordinate_mask] to get all nodes alive. - - See Also - -------- - bury_the_dead(), also removes dead beam nodes - """ - - dead_eles_shell = np.unique(np.where(alive_shells == 0)[1]) - - ele_filter = np.zeros(node_indexes.shape[0]) - ele_filter[dead_eles_shell] = 1 - ele_filter_bool = ele_filter == 1 - - dead_nodes = np.unique(node_indexes[ele_filter_bool]) - - return dead_nodes - - -def _extract_shell_parts( - part_list: Sequence[int], d3plot: D3plot -) -> Union[tuple[np.ndarray, np.ndarray], str]: - """ - Extracts a shell part defined by its part ID out of the given d3plot. - Returns a new node index, relevant coordinates and displacement - - Parameters - ---------- - part_list: list - List of part IDs of the parts that shall be extracted - d3plot: D3plot - D3plot the part shall be extracted from - - Returns - ------- - node_coordinates: ndarray - Numpy array containing the node coordinates of the extracted part - node_displacement: ndarray - Numpy array containing the node displacement of the extracted part - err_msg: str - If an error occurs, a string containing the error msg is returned instead - """ - - # pylint: disable = too-many-locals, too-many-statements - - # convert into list - part_list = list(part_list) - - shell_node_indexes = d3plot.arrays[ArrayType.element_shell_node_indexes] - shell_part_indexes = d3plot.arrays[ArrayType.element_shell_part_indexes] - beam_node_indexes = d3plot.arrays[ArrayType.element_beam_node_indexes] - beam_part_indexes = d3plot.arrays[ArrayType.element_beam_part_indexes] - solid_node_indexes = d3plot.arrays[ArrayType.element_solid_node_indexes] - solid_part_indexes = d3plot.arrays[ArrayType.element_solid_part_indexes] - tshell_node_indexes = d3plot.arrays[ArrayType.element_tshell_node_indexes] - tshell_part_indexes = d3plot.arrays[ArrayType.element_tshell_part_indexes] - - node_coordinates = d3plot.arrays[ArrayType.node_coordinates] - node_displacement = d3plot.arrays[ArrayType.node_displacement] - - alive_mask = np.full((node_coordinates.shape[0]), True) - - if ArrayType.element_shell_is_alive in d3plot.arrays: - dead_shell_mask = _mark_dead_eles( - shell_node_indexes, d3plot.arrays[ArrayType.element_shell_is_alive] - ) - alive_mask[dead_shell_mask] = False - if ArrayType.element_beam_is_alive in d3plot.arrays: - dead_beam_mask = _mark_dead_eles( - beam_node_indexes, d3plot.arrays[ArrayType.element_beam_is_alive] - ) - alive_mask[dead_beam_mask] = False - if ArrayType.element_solid_is_alive in d3plot.arrays: - dead_solid_mask = _mark_dead_eles( - solid_node_indexes, d3plot.arrays[ArrayType.element_solid_is_alive] - ) - alive_mask[dead_solid_mask] = False - if ArrayType.element_tshell_is_alive in d3plot.arrays: - dead_tshell_mask = _mark_dead_eles( - tshell_node_indexes, d3plot.arrays[ArrayType.element_tshell_is_alive] - ) - alive_mask[dead_tshell_mask] = False - - if len(part_list) > 0: - try: - part_ids = d3plot.arrays[ArrayType.part_ids] - except KeyError: - err_msg = "KeyError: Loaded plot has no parts" - return err_msg - part_ids_as_list = part_ids.tolist() - # check if parts exist - for part in part_list: - try: - part_ids_as_list.index(int(part)) - except ValueError: - err_msg = "ValueError: Could not find part: {0}" - return err_msg.format(part) - - def mask_parts( - part_list2: list[int], element_part_index: np.ndarray, element_node_index: np.ndarray - ) -> np.ndarray: - element_part_filter = np.full(element_part_index.shape, False) - proc_parts = [] - - for pid in part_list2: - part_index = part_ids_as_list.index(int(pid)) - locs = np.where(element_part_index == part_index)[0] - if not locs.shape == (0,): - proc_parts.append(pid) - element_part_filter[locs] = True - - for part in proc_parts: - part_list2.pop(part_list2.index(part)) - - unique_element_node_indexes = np.unique(element_node_index[element_part_filter]) - - return unique_element_node_indexes - - # shells: - unique_shell_node_indexes = mask_parts(part_list, shell_part_indexes, shell_node_indexes) - - # beams - unique_beam_node_indexes = mask_parts(part_list, beam_part_indexes, beam_node_indexes) - - # solids: - unique_solide_node_indexes = mask_parts(part_list, solid_part_indexes, solid_node_indexes) - - # tshells - unique_tshell_node_indexes = mask_parts(part_list, tshell_part_indexes, tshell_node_indexes) - - # this check may seem redundant, but also verifies that our masking of parts works - if not len(part_list) == 0: - err_msg = "Value Error: Could not find parts: " + str(part_list) - return err_msg - - # New coordinate mask - coord_mask = np.full((node_coordinates.shape[0]), False) - coord_mask[unique_shell_node_indexes] = True - coord_mask[unique_solide_node_indexes] = True - coord_mask[unique_beam_node_indexes] = True - coord_mask[unique_tshell_node_indexes] = True - - inv_alive_mask = np.logical_not(alive_mask) - coord_mask[inv_alive_mask] = False - - node_coordinates = node_coordinates[coord_mask] - node_displacement = node_displacement[:, coord_mask] - else: - node_coordinates = node_coordinates[alive_mask] - node_displacement = node_displacement[:, alive_mask] - - return node_coordinates, node_displacement - - -def create_reference_subsample( - load_path: str, parts: Sequence[int], nr_samples=2000 -) -> Union[tuple[np.ndarray, float, float], str]: - """ - Loads the D3plot at load_path, extracts the node coordinates of part 13, returns - a random subsample of these nodes - - Parameters - ---------- - load_path: str - Filepath of the D3plot - parts: Sequence[int] - List of parts to be extracted - nr_samples: int - How many nodes are subsampled - - Returns - ------- - reference_sample: np.array - Numpy array containing the reference sample - t_total: float - Total time required for subsampling - t_load: float - Time required to load plot - err_msg: str - If an error occurs, a string containing the error is returned instead - """ - t_null = time.time() - try: - plot = D3plot( - load_path, - state_array_filter=[ArrayType.node_displacement, ArrayType.element_shell_is_alive], - ) - except Exception: - err_msg = ( - f"Failed to load {load_path}! Please make sure it is a D3plot file. " - f"This might be due to {os.path.split(load_path)[1]} being a timestep of a plot" - ) - return err_msg - - t_load = time.time() - t_null - result = _extract_shell_parts(parts, plot) - if isinstance(result, str): - return result - - coordinates = result[0] - if coordinates.shape[0] < nr_samples: - err_msg = "Number of nodes is lower than desired samplesize" - return err_msg - - random.seed("seed") - samples = random.sample(range(len(coordinates)), nr_samples) - - reference_sample = coordinates[samples] - t_total = time.time() - t_null - return reference_sample, t_total, t_load - - -def remap_random_subsample( - load_path: str, parts: list, reference_subsample: np.ndarray -) -> Union[tuple[np.ndarray, float, float], str]: - """ - Remaps the specified sample onto a new mesh provided by reference subsampl, using knn matching - - Parameters - ---------- - load_path: str - Filepath of the desired D3plot - parts: list of int - Which parts shall be extracted from the D3plot - reference_subsample: np.array - Numpy array containing the reference nodes - - Returns - ------- - subsampled_displacement: np.ndarray - Subsampled displacement of provided sample - t_total: float - Total time required to perform subsampling - t_load: float - Time required to load D3plot - err_msg: str - If an error occurred, a string is returned instead containing the error - """ - t_null = time.time() - try: - plot = D3plot( - load_path, - state_array_filter=[ArrayType.node_displacement, ArrayType.element_shell_is_alive], - ) - except Exception: - err_msg = ( - f"Failed to load {load_path}! Please make sure it is a D3plot file. " - f"This might be due to {os.path.split(load_path)[1]} being a timestep of a plot" - ) - return err_msg - - t_load = time.time() - t_null - result = _extract_shell_parts(parts, plot) - if isinstance(result, str): - return result - - coordinates, displacement = result[0], result[1] - - quarantine_zone = NearestNeighbors(n_neighbors=1, n_jobs=4).fit(coordinates) - _, quarantined_index = quarantine_zone.kneighbors(reference_subsample) - - subsampled_displacement = displacement[:, quarantined_index[:, 0]] - - return subsampled_displacement, time.time() - t_null, t_load diff --git a/src/lasso/dyna/__init__.py b/src/lasso/dyna/__init__.py deleted file mode 100644 index 519167d..0000000 --- a/src/lasso/dyna/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from .array_type import ArrayType -from .binout import Binout -from .d3plot import D3plot -from .d3plot_header import D3plotFiletype, D3plotHeader -from .filter_type import FilterType - - -__all__ = ["Binout", "D3plot", "ArrayType", "FilterType", "D3plotHeader", "D3plotFiletype"] diff --git a/src/lasso/dyna/array_type.py b/src/lasso/dyna/array_type.py deleted file mode 100644 index 7c5c535..0000000 --- a/src/lasso/dyna/array_type.py +++ /dev/null @@ -1,602 +0,0 @@ -class ArrayType: - """Specifies the names for specific arrays - - Enums from this class shall be used as a preferred practice - instead of the string array names to ensure compatibility. - - Attributes - ---------- - global_timesteps: str - array shape: (n_timesteps) - global_kinetic_energy: str - array shape: (n_timesteps) - global_internal_energy: str - array shape: (n_timesteps) - global_total_energy: str - array shape: (n_timesteps) - global_velocity: str - array shape: (n_timesteps) - node_ids: str - array shape: (n_nodes) - node_coordinates: str - array shape: (n_nodes, x_y_z) - node_displacement: str - array shape: (n_states, n_nodes, x_y_z) - node_velocity: str - array shape: (n_states, n_nodes, x_y_z) - node_acceleration: str - array shape: (n_states, n_nodes, x_y_z) - node_is_alive: str - array shape: (n_states, n_nodes) - node_temperature: str - array shape: (n_states, n_nodes) or (n_states, n_nodes, 3) - node_heat_flux: str - array shape: (n_states, n_nodes, 3) - node_mass_scaling: str - array shape: (n_states, n_nodes) - node_temperature_gradient: str - array shape: (n_states, n_nodes) - node_residual_forces: str - array shape: (n_states, n_nodes, fx_fy_fz) - node_residual_moments: str - array shape: (n_states, n_nodes, mx_my_mz) - element_solid_node_indexes: str - array shape: (n_solids, 8) - element_solid_part_indexes: str - array shape: (n_solids) - element_solid_ids: str - array shape: (n_solids) - element_solid_thermal_data: str - array shape: (n_states, n_solids, n_solids_thermal_vars) - element_solid_stress: str - array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) - element_solid_effective_plastic_strain: str - array shape: (n_states, n_solid_layers, n_solids) - element_solid_history_variables: str - array shape: (n_states, n_solids, n_solid_layers, n_solids_history_vars) - element_solid_strain: str - array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) - element_solid_plastic_strain_tensor: str - array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) - element_solid_thermal_strain_tensor: str - array shape: (n_states, n_solids, n_solid_layers, xx_yy_zz_xy_yz_xz) - element_solid_is_alive: str - array shape: (n_states, n_solids) - element_solid_extra_nodes: str - array shape: (n_solids, 2) - element_solid_node10_extra_node_indexes: str - array shape: (n_solids, 2) - element_solid_node20_element_index: str - array shape: (n_node20_solids) - element_solid_node20_extra_node_indexes: str - array shape: (n_node20_solids, 12) - element_solid_node27_element_index: str - array shape: (n_node27_solids) - element_solid_node27_extra_node_indexes: str - array shape: (n_node27_solids, 27) - element_solid_node21_penta_element_index: str - array shape: (n_node21p_solids) - element_solid_node21_penta_extra_node_indexes: str - array shape: (n_node21p_solids, 21) - element_solid_node15_tetras_element_index: str - array shape: (n_node15t_solids) - element_solid_node15_tetras_extra_node_indexes: str - array shape: (n_node15t_solids, 7) - element_solid_node20_tetras_element_index: str - array shape: (n_node20t_solids) - element_solid_node20_tetras_extra_node_indexes: str - array shape: (n_node20t_solids, 20) - element_solid_node40_pentas_element_index: str - array shape: (n_node40h_solids) - element_solid_node40_pentas_extra_node_indexes: str - array shape: (n_node40h_solids, 40) - element_solid_node64_hexas_element_index: str - array shape: (n_node64h_solids) - element_solid_node64_hexas_extra_node_indexes: str - array shape: (n_node64h_solids, 64) - element_tshell_part_indexes: str - array shape: (n_tshells) - element_tshell_node_indexes: str - array shape: (n_tshells, 8) - element_tshell_ids: str - array shape: (n_tshells) - element_tshell_stress: str - array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) - element_tshell_effective_plastic_strain: str - array shape: (n_states, n_tshells, n_tshells_layers) - element_tshell_history_variables: str - array shape: (n_states, n_tshells, n_tshells_layers, xx_yy_zz_xy_yz_xz) - element_tshell_is_alive: str - array shape: (n_states, n_tshells) - element_tshell_strain: str - array shape: (n_states, n_tshells, upper_lower, xx_yy_zz_xy_yz_xz) - element_beam_part_indexes: str - array shape: (n_beams) - element_beam_node_indexes: str - array shape: (n_beams, 5) - element_beam_ids: str - array shape: (n_beams) - element_beam_axial_force: str - array shape: (n_states, n_beams) - element_beam_shear_force: str - array shape: (n_states, n_beams, s_t) - element_beam_bending_moment: str - array shape: (n_states, n_beams, s_t) - element_beam_torsion_moment: str - array shape: (n_states, n_beams) - element_beam_shear_stress: str - array shape: (n_states, n_beams, n_beams_layers, rs_rt) - element_beam_axial_stress: str - array shape: (n_states, n_beams, n_beams_layers) - element_beam_plastic_strain: str - array shape: (n_states, n_beams, n_beams_layers) - element_beam_axial_strain: str - array shape: (n_states, n_beams, n_beams_layers) - element_beam_history_vars: str - array shape: (n_states, n_beams, n_beams_layers+3, n_beams_history_vars) - element_beam_is_alive: str - array shape: (n_states, n_beams) - element_shell_part_indexes: str - array shape (n_shells, 4) - element_shell_node_indexes: str - array shape (n_shells) - element_shell_ids: str - array shape (n_shells) - element_shell_stress: str - array shape (n_states, n_shells_non_rigid, n_shell_layers, xx_yy_zz_xy_yz_xz) - element_shell_effective_plastic_strain: str - array shape (n_states, n_shells_non_rigid, n_shell_layers) - element_shell_history_vars: str - array shape (n_states, n_shells_non_rigid, n_shell_layers, n_shell_history_vars) - element_shell_bending_moment: str - array shape (n_states, n_shells_non_rigid, mx_my_mxy) - element_shell_shear_force: str - array shape (n_states, n_shells_non_rigid, qx_qy) - element_shell_normal_force: str - array shape (n_states, n_shells_non_rigid, nx_ny_nxy) - element_shell_thickness: str - array shape (n_states, n_shells_non_rigid) - element_shell_unknown_variables: str - array shape (n_states, n_shells_non_rigid, 2) - element_shell_internal_energy: str - array shape (n_states, n_shells_non_rigid) - element_shell_strain: str - array shape (n_states, n_shells_non_rigid, upper_lower, xx_yy_zz_xy_yz_xz) - element_shell_is_alive: str - array shape (n_states, n_shells_non_rigid) - element_shell_node8_extra_node_indexes: str - array shape (n_shells, 4) - element_shell_node8_element_index: str - array shape: (n_shells) - element_shell_plastic_strain_tensor: str - array shape(n_states, n_shells_non_rigid, n_layers, 6) - element_shell_thermal_strain_tensor: str - array shape(n_states, n_shells_non_rigid, 6) - part_material_type: str - array shape: (n_parts) - part_ids: str - array shape: (n_parts) - part_ids_unordered: str - array shape: (n_parts) - part_ids_cross_references: str - array shape: (n_parts) - part_titles: str - array shape: (n_parts) - part_titles_ids: str - array shape: (n_parts) - part_internal_energy: str - array shape: (n_states, n_parts) - part_kinetic_energy: str - array shape: (n_states, n_parts) - part_velocity: str - array shape: (n_states, n_parts, x_y_z) - part_mass: str - array shape: (n_states, n_parts) - part_hourglass_energy: str - array shape: (n_states, n_parts) - sph_node_indexes: str - array shape: (n_sph_nodes) - sph_node_material_index: str - array shape: (n_sph_nodes) - sph_is_alive: str - array shape: (n_states, n_sph_particles) - sph_radius: str - array shape: (n_states, n_sph_particles) - sph_pressure: str - array shape: (n_states, n_sph_particles) - sph_stress: str - array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) - sph_effective_plastic_strain: str - array shape: (n_states, n_sph_particles) - sph_density: str - array shape: (n_states, n_sph_particles) - sph_internal_energy: str - array shape: (n_states, n_sph_particles) - sph_n_neighbors: str - array shape: (n_states, n_sph_particles) - sph_strain: str - array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) - sph_strainrate: str - array shape: (n_states, n_sph_particles, xx_yy_zz_xy_yz_xz) - sph_mass: str - array shape: (n_states, n_sph_particles) - sph_deletion: str - array shape: (n_states, n_sph_particles) - sph_history_vars: str - array shape: (n_states, n_sph_particles, n_sph_history_vars) - airbag_variable_names: str - array shape: (n_variables) - airbag_variable_types: str - array shape: (n_variables) - airbags_first_particle_id: str - array shape: (n_airbags) - airbags_n_particles: str - array shape: (n_airbags) - airbags_ids: str - array shape: (n_airbags) - airbags_n_gas_mixtures: str - array shape: (n_airbags) - airbags_n_chambers: str - array shape: (n_airbags) - airbag_n_active_particles: str - array shape: (n_states, n_airbags) - airbag_bag_volume: str - array shape: (n_states, n_airbags) - airbag_particle_gas_id: str - array shape: (n_states, n_airbag_particles) - airbag_particle_chamber_id: str - array shape: (n_states, n_airbag_particles) - airbag_particle_leakage: str - array shape: (n_states, n_airbag_particles) - airbag_particle_mass: str - array shape: (n_states, n_airbag_particles) - airbag_particle_radius: str - array shape: (n_states, n_airbag_particles) - airbag_particle_spin_energy: str - array shape: (n_states, n_airbag_particles) - airbag_particle_translation_energy: str - array shape: (n_states, n_airbag_particles) - airbag_particle_nearest_segment_distance: str - array shape: (n_states, n_airbag_particles) - airbag_particle_position: str - array shape: (n_states, n_airbag_particles, x_y_z) - airbag_particle_velocity: str - array shape: (n_states, n_airbag_particles, x_y_z) - rigid_road_node_ids: str - array shape: (rigid_road_n_nodes) - rigid_road_node_coordinates: str - array shape: (rigid_road_n_nodes, x_y_z) - rigid_road_ids: str - array shape: (n_roads) - rigid_road_n_segments: str - array shape: (n_roads) - rigid_road_segment_node_ids: str - list!: (n_roads, 4*n_road_segments) - rigid_road_segment_road_id: str - list!: (n_roads, n_road_segments) - rigid_road_displacement: str - array shape: (n_states, n_roads, x_y_z) - rigid_road_velocity: str - array shape: (n_states, n_roads, x_y_z) - rigid_body_part_indexes: str - array shape: (n_rigid_bodies) - rigid_body_n_nodes: str - array shape: (n_rigid_bodies) - rigid_body_node_indexes_list: str - list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) - rigid_body_n_active_nodes: str - array shape: (n_rigid_bodies) - rigid_body_active_node_indexes_list: str - list!: (n_rigid_bodies, n_rigid_body_nodes (differs)) - rigid_body_coordinates: str - array shape: (n_states, n_rigid_bodies, x_y_z) - rigid_body_rotation_matrix: str - array shape: (n_states, n_rigid_bodies, 9) - rigid_body_velocity: str - array shape: (n_states, n_rigid_bodies, x_y_z) - rigid_body_rot_velocity: str - array shape: (n_states, n_rigid_bodies, x_y_z) - rigid_body_acceleration: str - array shape: (n_states, n_rigid_bodies, x_y_z) - rigid_body_rot_acceleration: str - array shape: (n_states, n_rigid_bodies, x_y_z) - contact_title_ids: str - array shape: (n_contacts) - contact_titles: str - array shape: (n_contacts) - ale_material_ids: str - array shape: (n_ale_material) - rigid_wall_force: str - array shape: (n_states, n_rigid_walls) - rigid_wall_position: str - array shape: (n_states, n_rigid_walls, x_y_z) - """ - - # global - global_timesteps = "timesteps" - global_kinetic_energy = "global_kinetic_energy" - global_internal_energy = "global_internal_energy" - global_total_energy = "global_total_energy" - global_velocity = "global_velocity" - # nodes - node_ids = "node_ids" - node_coordinates = "node_coordinates" - node_displacement = "node_displacement" - node_velocity = "node_velocity" - node_acceleration = "node_acceleration" - node_is_alive = "node_is_alive" - node_temperature = "node_temperature" - node_heat_flux = "node_heat_flux" - node_mass_scaling = "node_mass_scaling" - node_temperature_gradient = "node_temperature_gradient" - node_residual_forces = "node_residual_forces" - node_residual_moments = "node_residual_moments" - # solids - element_solid_node_indexes = "element_solid_node_indexes" - element_solid_part_indexes = "element_solid_part_indexes" - element_solid_ids = "element_solid_ids" - element_solid_thermal_data = "element_solid_thermal_data" - element_solid_stress = "element_solid_stress" - element_solid_effective_plastic_strain = "element_solid_effective_plastic_strain" - element_solid_history_variables = "element_solid_history_variables" - element_solid_strain = "element_solid_strain" - element_solid_plastic_strain_tensor = "element_solid_plastic_strain_tensor" - element_solid_thermal_strain_tensor = "element_solid_thermal_strain_tensor" - element_solid_is_alive = "element_solid_is_alive" - element_solid_extra_nodes = "element_solid_extra_nodes" - element_solid_node10_extra_node_indexes = "element_solid_node10_extra_node_indexes" - element_solid_node20_element_index = "element_solid_node20_element_index" - element_solid_node20_extra_node_indexes = "element_solid_node20_extra_node_indexes" - element_solid_node27_element_index = "element_solid_node27_element_index" - element_solid_node27_extra_node_indexes = "element_solid_node27_extra_node_indexes" - element_solid_node21_penta_element_index = "element_solid_node21_penta_element_index" - element_solid_node21_penta_extra_node_indexes = "element_solid_node21_penta_extra_node_indexes" - element_solid_node15_tetras_element_index = "element_solid_node15_tetras_element_index" - element_solid_node15_tetras_extra_node_indexes = ( - "element_solid_node15_tetras_extra_node_indexes" - ) - element_solid_node20_tetras_element_index = "element_solid_node20_tetras_element_index" - element_solid_node20_tetras_extra_node_indexes = ( - "element_solid_node20_tetras_extra_node_indexes" - ) - element_solid_node40_pentas_element_index = "element_solid_node40_pentas_element_index" - element_solid_node40_pentas_extra_node_indexes = ( - "element_solid_node40_pentas_extra_node_indexes" - ) - element_solid_node64_hexas_element_index = "element_solid_node64_hexas_element_index" - element_solid_node64_hexas_extra_node_indexes = "element_solid_node64_hexas_extra_node_indexes" - - # tshells - element_tshell_part_indexes = "element_tshell_part_indexes" - element_tshell_node_indexes = "element_tshell_node_indexes" - element_tshell_ids = "element_tshell_ids" - element_tshell_stress = "element_tshell_stress" - element_tshell_effective_plastic_strain = "element_tshell_effective_plastic_strain" - element_tshell_history_variables = "element_tshell_history_variables" - element_tshell_is_alive = "element_tshell_is_alive" - element_tshell_strain = "element_tshell_strain" - # beams - element_beam_part_indexes = "element_beam_part_indexes" - element_beam_node_indexes = "element_beam_node_indexes" - element_beam_ids = "element_beam_ids" - - element_beam_axial_force = "element_beam_axial_force" - element_beam_shear_force = "element_beam_shear_force" - element_beam_bending_moment = "element_beam_bending_moment" - element_beam_torsion_moment = "element_beam_torsion_moment" - element_beam_shear_stress = "element_beam_shear_stress" - element_beam_axial_stress = "element_beam_axial_stress" - element_beam_plastic_strain = "element_beam_plastic_strain" - element_beam_axial_strain = "element_beam_axial_strain" - element_beam_history_vars = "element_beam_history_vars" - element_beam_is_alive = "element_beam_is_alive" - # shells - element_shell_part_indexes = "element_shell_part_indexes" - element_shell_node_indexes = "element_shell_node_indexes" - element_shell_ids = "element_shell_ids" - element_shell_stress = "element_shell_stress" - element_shell_effective_plastic_strain = "element_shell_effective_plastic_strain" - element_shell_history_vars = "element_shell_history_vars" - element_shell_bending_moment = "element_shell_bending_moment" - element_shell_shear_force = "element_shell_shear_force" - element_shell_normal_force = "element_shell_normal_force" - element_shell_thickness = "element_shell_thickness" - element_shell_unknown_variables = "element_shell_unknown_variables" - element_shell_internal_energy = "element_shell_internal_energy" - element_shell_strain = "element_shell_strain" - element_shell_is_alive = "element_shell_is_alive" - element_shell_node8_extra_node_indexes = "element_shell_node8_extra_node_indexes" - element_shell_node8_element_index = "element_shell_node8_element_index" - element_shell_plastic_strain_tensor = "element_shell_plastic_strain_tensor" - element_shell_thermal_strain_tensor = "element_shell_thermal_strain_tensor" - # parts - part_material_type = "part_material_type" - part_ids = "part_ids" - part_ids_unordered = "part_ids_unordered" - part_ids_cross_references = "part_ids_cross_references" - part_titles = "part_titles" - part_titles_ids = "part_titles_ids" - part_internal_energy = "part_internal_energy" - part_kinetic_energy = "part_kinetic_energy" - part_velocity = "part_velocity" - part_mass = "part_mass" - part_hourglass_energy = "part_hourglass_energy" - # sph - sph_node_indexes = "sph_node_indexes" - sph_node_material_index = "sph_node_material_index" - sph_is_alive = "sph_is_alive" - sph_radius = "sph_radius" - sph_pressure = "sph_pressure" - sph_stress = "sph_stress" - sph_effective_plastic_strain = "sph_effective_plastic_strain" - sph_density = "sph_density" - sph_internal_energy = "sph_internal_energy" - sph_n_neighbors = "sph_n_neighbors" - sph_strain = "sph_strain" - sph_strainrate = "sph_strainrate" - sph_mass = "sph_mass" - sph_deletion = "sph_deletion" - sph_history_vars = "sph_history_vars" - # airbag - airbag_variable_names = "airbag_variable_names" - airbag_variable_types = "airbag_variable_types" - - airbags_first_particle_id = "airbags_first_particle_id" - airbags_n_particles = "airbags_n_particles" - airbags_ids = "airbags_ids" - airbags_n_gas_mixtures = "airbags_n_gas_mixtures" - airbags_n_chambers = "airbags_n_chambers" - - airbag_n_active_particles = "airbag_n_active_particles" - airbag_bag_volume = "airbag_bag_volume" - - airbag_particle_gas_id = "airbag_particle_gas_id" - airbag_particle_chamber_id = "airbag_particle_chamber_id" - airbag_particle_leakage = "airbag_particle_leakage" - airbag_particle_mass = "airbag_particle_mass" - airbag_particle_radius = "airbag_particle_radius" - airbag_particle_spin_energy = "airbag_particle_spin_energy" - airbag_particle_translation_energy = "airbag_particle_translation_energy" - airbag_particle_nearest_segment_distance = "airbag_particle_nearest_segment_distance" - airbag_particle_position = "airbag_particle_position" - airbag_particle_velocity = "airbag_particle_velocity" - # rigid roads - rigid_road_node_ids = "rigid_road_node_ids" - rigid_road_node_coordinates = "rigid_road_node_coordinates" - rigid_road_ids = "rigid_road_ids" - rigid_road_n_segments = "rigid_road_n_segments" - rigid_road_segment_node_ids = "rigid_road_segment_node_ids" - rigid_road_segment_road_id = "rigid_road_segment_road_id" - rigid_road_displacement = "rigid_road_displacement" - rigid_road_velocity = "rigid_road_velocity" - # rigid body - rigid_body_part_indexes = "rigid_body_part_index" - rigid_body_n_nodes = "rigid_body_n_nodes" - rigid_body_node_indexes_list = "rigid_body_node_indexes_list" - rigid_body_n_active_nodes = "rigid_body_n_active_nodes" - rigid_body_active_node_indexes_list = "rigid_body_active_node_indexes_list" - rigid_body_coordinates = "rigid_body_coordinates" - rigid_body_rotation_matrix = "rigid_body_rotation_matrix" - rigid_body_velocity = "rigid_body_velocity" - rigid_body_rot_velocity = "rigid_body_rotational_velocity" - rigid_body_acceleration = "rigid_body_acceleration" - rigid_body_rot_acceleration = "rigid_body_rotational_acceleration" - # contact info - contact_title_ids = "contact_title_ids" - contact_titles = "contact_titles" - # ALE - ale_material_ids = "ale_material_ids" - # rigid wall - rigid_wall_force = "rigid_wall_force" - rigid_wall_position = "rigid_wall_position" - - @staticmethod - def get_state_array_names() -> list[str]: - """Get the names of all state arrays - - Returns: - -------- - state_array_names: List[str] - list of state array names - """ - return [ - # global - ArrayType.global_timesteps, - ArrayType.global_kinetic_energy, - ArrayType.global_internal_energy, - ArrayType.global_total_energy, - ArrayType.global_velocity, - # parts - ArrayType.part_internal_energy, - ArrayType.part_kinetic_energy, - ArrayType.part_velocity, - ArrayType.part_mass, - ArrayType.part_hourglass_energy, - # rigid wall - ArrayType.rigid_wall_force, - ArrayType.rigid_wall_position, - # nodes - ArrayType.node_temperature, - ArrayType.node_heat_flux, - ArrayType.node_mass_scaling, - ArrayType.node_displacement, - ArrayType.node_velocity, - ArrayType.node_acceleration, - ArrayType.node_temperature_gradient, - ArrayType.node_residual_forces, - ArrayType.node_residual_moments, - # solids - ArrayType.element_solid_thermal_data, - ArrayType.element_solid_stress, - ArrayType.element_solid_effective_plastic_strain, - ArrayType.element_solid_history_variables, - ArrayType.element_solid_strain, - ArrayType.element_solid_is_alive, - ArrayType.element_solid_plastic_strain_tensor, - ArrayType.element_solid_thermal_strain_tensor, - # thick shells - ArrayType.element_tshell_stress, - ArrayType.element_tshell_effective_plastic_strain, - ArrayType.element_tshell_history_variables, - ArrayType.element_tshell_strain, - ArrayType.element_tshell_is_alive, - # beams - ArrayType.element_beam_axial_force, - ArrayType.element_beam_shear_force, - ArrayType.element_beam_bending_moment, - ArrayType.element_beam_torsion_moment, - ArrayType.element_beam_shear_stress, - ArrayType.element_beam_axial_stress, - ArrayType.element_beam_plastic_strain, - ArrayType.element_beam_axial_strain, - ArrayType.element_beam_history_vars, - ArrayType.element_beam_is_alive, - # shells - ArrayType.element_shell_stress, - ArrayType.element_shell_effective_plastic_strain, - ArrayType.element_shell_history_vars, - ArrayType.element_shell_bending_moment, - ArrayType.element_shell_shear_force, - ArrayType.element_shell_normal_force, - ArrayType.element_shell_thickness, - ArrayType.element_shell_unknown_variables, - ArrayType.element_shell_internal_energy, - ArrayType.element_shell_strain, - ArrayType.element_shell_is_alive, - ArrayType.element_shell_plastic_strain_tensor, - ArrayType.element_shell_thermal_strain_tensor, - # sph - ArrayType.sph_deletion, - ArrayType.sph_radius, - ArrayType.sph_pressure, - ArrayType.sph_stress, - ArrayType.sph_effective_plastic_strain, - ArrayType.sph_density, - ArrayType.sph_internal_energy, - ArrayType.sph_n_neighbors, - ArrayType.sph_strain, - ArrayType.sph_mass, - # airbag - ArrayType.airbag_n_active_particles, - ArrayType.airbag_bag_volume, - ArrayType.airbag_particle_gas_id, - ArrayType.airbag_particle_chamber_id, - ArrayType.airbag_particle_leakage, - ArrayType.airbag_particle_mass, - ArrayType.airbag_particle_radius, - ArrayType.airbag_particle_spin_energy, - ArrayType.airbag_particle_translation_energy, - ArrayType.airbag_particle_nearest_segment_distance, - ArrayType.airbag_particle_position, - ArrayType.airbag_particle_velocity, - # rigid road - ArrayType.rigid_road_displacement, - ArrayType.rigid_road_velocity, - # rigid body - ArrayType.rigid_body_coordinates, - ArrayType.rigid_body_rotation_matrix, - ArrayType.rigid_body_velocity, - ArrayType.rigid_body_rot_velocity, - ArrayType.rigid_body_acceleration, - ArrayType.rigid_body_rot_acceleration, - ] diff --git a/src/lasso/dyna/binout.py b/src/lasso/dyna/binout.py deleted file mode 100644 index 02a6300..0000000 --- a/src/lasso/dyna/binout.py +++ /dev/null @@ -1,480 +0,0 @@ -import glob -from typing import Union - -import h5py -import numpy as np -import pandas as pd - -from .lsda_py3 import Lsda - - -class Binout: - """This class is meant to read binouts from LS-Dyna - - Parameters - ---------- - filepath: str - Path to the binout to read. May contain * (glob) for selecting multiple - files. - - Attributes - ---------- - filelist: List[str] - List of files which are opened. - lsda: Lsda - The underlying LS-Dyna binout reader instance from code from LSTC. - lsda_root: Symbol - Root lsda symbol which is like a root directory to traverse the - content of the binout file. - - Notes - ----- - This class is only a utility wrapper for Lsda from LSTC. - - Examples - -------- - >>> binout = Binout("path/to/binout") - """ - - def __init__(self, filepath: str): - """Constructor for a binout - - Parameters - ---------- - filepath: str - path to the binout or pattern - - Notes - ----- - The class loads the file given in the filepath. By giving a - search pattern such as: "binout*", all files with that - pattern will be loaded. - - Examples - -------- - >>> # reads a single binout - >>> binout = Binout("path/to/binout0000") - >>> binout.filelist - ['path/to/binout0000'] - - >>> # reads multiple files - >>> binout = Binout("path/to/binout*") - >>> binout.filelist - ['path/to/binout0000','path/to/binout0001'] - """ - - self.filelist = glob.glob(filepath) - - # check file existence - if not self.filelist: - raise OSError("No file was found.") - - # open lsda buffer - self.lsda = Lsda(self.filelist, "r") - self.lsda_root = self.lsda.root - - def read(self, *path) -> Union[list[str], str, np.ndarray]: - """Read all data from Binout (top to low level) - - Parameters - ---------- - path: Union[Tuple[str, ...], List[str], str] - internal path in the folder structure of the binout - - Returns - ------- - ret: Union[List[str], str, np.ndarray] - list of subdata within the folder or data itself (array or string) - - Notes - ----- - This function is used to read any data from the binout. It has been used - to make the access to the data more comfortable. The return type depends - on the given path: - - - `binout.read()`: `List[str] names of directories (in binout) - - `binout.read(dir)`: `List[str]` names of variables or subdirs - - `binout.read(dir1, ..., variable)`: np.array data - - If you have multiple outputs with different ids (e.g. in nodout for - multiple nodes) then don't forget to read the id array for - identification or id-labels. - - Examples - -------- - >>> from lasso.dyna import Binout - >>> binout = Binout("test/binout") - >>> # get top dirs - >>> binout.read() - ['swforc'] - >>> binout.read("swforc") - ['title', 'failure', 'ids', 'failure_time', ...] - >>> binout.read("swforc", "shear").shape - (321L, 26L) - >>> binout.read("swforc", "ids").shape - (26L,) - >>> binout.read("swforc", "ids") - array([52890, 52891, 52892, ...]) - >>> # read a string value - >>> binout.read("swforc", "date") - '11/05/2013' - """ - - return self._decode_path(path) - - def as_df(self, *args) -> pd.DataFrame: - """read data and convert to pandas dataframe if possible - - Parameters - ---------- - *args: Union[Tuple[str, ...], List[str], str] - internal path in the folder structure of the binout - - Returns - ------- - df: pandas.DataFrame - data converted to pandas dataframe - - Raises - ------ - ValueError - if the data cannot be converted to a pandas dataframe - - Examples - -------- - >>> from lasso.dyna import Binout - >>> binout = Binout("path/to/binout") - - Read a time-dependent array. - - >>> binout.as_df("glstat", "eroded_kinetic_energy") - time - 0.00000 0.000000 - 0.19971 0.000000 - 0.39942 0.000000 - 0.59976 0.000000 - 0.79947 0.000000 - ... - 119.19978 105.220786 - 119.39949 105.220786 - 119.59983 105.220786 - 119.79954 105.220786 - 119.99988 105.220786 - Name: eroded_kinetic_energy, Length: 601, dtype: float64 - - Read a time and id-dependent array. - - >>> binout.as_df("secforc", "x_force") - 1 2 3 ... 33 34 - time . - 0.00063 2.168547e-16 2.275245e-15 -3.118639e-14 ... -5.126108e-13 4.592941e-16 - 0.20034 3.514243e-04 3.797908e-04 -1.701294e-03 ... 2.530416e-11 2.755493e-07 - 0.40005 3.052490e-03 3.242951e-02 -2.699926e-02 ... 6.755315e-06 -2.608923e-03 - 0.60039 -1.299816e-02 4.930999e-02 -1.632376e-02 ... 8.941705e-05 -2.203455e-02 - 0.80010 1.178485e-02 4.904512e-02 -9.740204e-03 ... 5.648263e-05 -6.999854e-02 - ... ... ... ... ... ... ... - 119.00007 9.737679e-01 -8.833702e+00 1.298964e+01 ... -9.977377e-02 7.883521e+00 - 119.20041 7.421170e-01 -8.849411e+00 1.253505e+01 ... -1.845916e-01 7.791409e+00 - 119.40012 9.946615e-01 -8.541475e+00 1.188757e+01 ... -3.662228e-02 7.675800e+00 - 119.60046 9.677638e-01 -8.566695e+00 1.130774e+01 ... 5.144208e-02 7.273052e+00 - 119.80017 1.035165e+00 -8.040828e+00 1.124044e+01 ... -1.213450e-02 7.188395e+00 - """ - - data = self.read(*args) - - # validate time-based data - if not isinstance(data, np.ndarray): - err_msg = "data is not a numpy array but has type '{0}'" - raise ValueError(err_msg.format(type(data))) - - time_array = self.read(*args[:-1], "time") - if data.shape[0] != time_array.shape[0]: - raise ValueError("data series length does not match time array length") - - time_pdi = pd.Index(time_array, name="time") - - # create dataframe - if data.ndim > 1: - df = pd.DataFrame(index=time_pdi) - - if args[0] == "rcforc": - ids = [ - (str(i) + "m") if j else (str(i) + "s") - for i, j in zip( - self.read("rcforc", "ids"), self.read("rcforc", "side"), strict=False - ) - ] - else: - ids = self.read(*args[:-1], "ids") - - for i, j in enumerate(ids): - df[str(j)] = data.T[i] - - else: - df = pd.Series(data, index=time_pdi, name=args[-1]) - - return df - - def _decode_path(self, path): - """Decode a path and get whatever is inside. - - Parameters - ---------- - path: List[str] - path within the binout - - Notes - ----- - Usually returns the folder children. If there are variables in the folder - (usually also if a subfolder metadata exists), then the variables will - be printed from these directories. - - Returns - ------- - ret: Union[List[str], np.ndarray] - either sub folder list or data array - """ - - i_level = len(path) - - if i_level == 0: # root subfolders - return self._bstr_to_str(list(self.lsda_root.children.keys())) - - # some subdir - # try if path can be resolved (then it's a dir) - # in this case print the subfolders or subvars - try: - dir_symbol = self._get_symbol(self.lsda_root, path) - - if "metadata" in dir_symbol.children: - return self._collect_variables(dir_symbol) - return self._bstr_to_str(list(dir_symbol.children.keys())) - - # an error is risen, if the path is not resolvable - # this could be, because we want to read a var - except ValueError: - return self._get_variable(path) - - def _get_symbol(self, symbol, path): - """Get a symbol from a path via lsda - - Parameters - ---------- - symbol: Symbol - current directory which is a Lsda.Symbol - - Returns - ------- - symbol: Symbol - final symbol after recursive search of path - """ - - # check - if symbol is None: - raise ValueError("Symbol may not be none.") - - # no further path, return current symbol - if len(path) == 0: - return symbol - - # more subsymbols to search for - sub_path = list(path) # copy - next_symbol_name = sub_path.pop(0) - - next_symbol = symbol.get(next_symbol_name) - if next_symbol is None: - raise ValueError(f"Cannot find: {next_symbol_name}") - - return self._get_symbol(next_symbol, sub_path) - - def _get_variable(self, path): - """Read a variable from a given path - - Parameters - ---------- - path: List[str] - path to the variable - - Returns - ------- - data: np.ndarray - """ - - dir_symbol = self._get_symbol(self.lsda_root, path[:-1]) - # variables are somehow binary strings ... dirs not - variable_name = self._str_to_bstr(path[-1]) - - # var in metadata - if ("metadata" in dir_symbol.children) and ( - variable_name in dir_symbol.get("metadata").children - ): - var_symbol = dir_symbol.get("metadata").get(variable_name) - var_type = var_symbol.type - - # symbol is a string - if var_type == 1: - return self._to_string(var_symbol.read()) - - # symbol is numeric data - return np.asarray(var_symbol.read()) - - # var in state data ... hopefully - time = [] - data = [] - for subdir_name, subdir_symbol in dir_symbol.children.items(): - # skip metadata - if subdir_name == "metadata": - continue - - # read data - if variable_name in subdir_symbol.children: - state_data = subdir_symbol.get(variable_name).read() - if len(state_data) == 1: - data.append(state_data[0]) - else: # more than one data entry - data.append(state_data) - - time_symbol = subdir_symbol.get(b"time") - if time_symbol: - time += time_symbol.read() - - # return sorted by time - if len(time) == len(data): - return np.array(data)[np.argsort(time)] - - return np.array(data) - - def _collect_variables(self, symbol): - """Collect all variables from a symbol - - Parameters - ---------- - symbol: Symbol - - Returns - ------- - variable_names: List[str] - - Notes - ----- - This function collect all variables from the state dirs and metadata. - """ - - var_names = set() - for _, subdir_symbol in symbol.children.items(): - var_names = var_names.union(subdir_symbol.children.keys()) - - return self._bstr_to_str(list(var_names)) - - def _to_string(self, data_array): - """Convert a data series of numbers (usually ints) to a string - - Parameters - ---------- - data_array: Union[int, np.ndarray] - some data array - - Returns - ------- - string: str - data array converted to characters - - Notes - ----- - This is needed for the reason that sometimes the binary data - within the files are strings. - """ - - return "".join([chr(entry) for entry in data_array]) - - def _bstr_to_str(self, arg): - """Encodes or decodes a string correctly regarding python version - - Parameters - ---------- - arg: Union[str, bytes] - - Returns - ------- - string: str - converted to python version - """ - - # in case of a list call this function with its atomic strings - if isinstance(arg, (list, tuple)): - return [self._bstr_to_str(entry) for entry in arg] - - # convert a string (dependent on python version) - if not isinstance(arg, str): - return arg.decode("utf-8") - - return arg - - def _str_to_bstr(self, string): - """Convert a string to a binary string python version independent - - Parameters - ---------- - string: str - - Returns - ------- - string: bytes - """ - - if not isinstance(string, bytes): - return string.encode("utf-8") - - return string - - def save_hdf5(self, filepath, compression="gzip"): - """Save a binout as HDF5 - - Parameters - ---------- - filepath: str - path where the HDF5 shall be saved - compression: str - compression technique (see h5py docs) - - Examples - -------- - >>> binout = Binout("path/to/binout") - >>> binout.save_hdf5("path/to/binout.h5") - """ - - with h5py.File(filepath, "w") as fh: - self._save_all_variables(fh, compression) - - def _save_all_variables(self, hdf5_grp, compression, *path): - """Iterates through all variables in the Binout - - Parameters - ---------- - hdf5_grp: Group - group object in the HDF5, where all the data - shall be saved into (of course in a tree like - manner) - compression: str - compression technique (see h5py docs) - path: Tuple[str, ...] - entry path in the binout - """ - - ret = self.read(*path) - path_str = "/".join(path) - - # iterate through subdirs - if isinstance(ret, list): - if path_str: - hdf5_grp = hdf5_grp.create_group(path_str) - - for entry in ret: - path_child = path + (entry,) - self._save_all_variables(hdf5_grp, compression, *path_child) - # children are variables - else: - # can not save strings, only list of strings ... - if isinstance(ret, str): - ret = np.array([ret], dtype=np.dtype("S")) - hdf5_grp.create_dataset(path[-1], data=ret, compression=compression) diff --git a/src/lasso/dyna/d3plot.py b/src/lasso/dyna/d3plot.py deleted file mode 100644 index 5a6fa26..0000000 --- a/src/lasso/dyna/d3plot.py +++ /dev/null @@ -1,9724 +0,0 @@ -import ctypes -import logging -import mmap -import os -import pprint -import re -import struct -import tempfile -import traceback -import typing -import webbrowser -from collections.abc import Iterable -from dataclasses import dataclass -from typing import Any, BinaryIO, Union - -import numpy as np - -from lasso.dyna.array_type import ArrayType -from lasso.dyna.d3plot_header import D3plotFiletype, D3plotHeader -from lasso.dyna.femzip_mapper import FemzipMapper, filter_femzip_variables -from lasso.dyna.filter_type import FilterType -from lasso.femzip.femzip_api import FemzipAPI, FemzipBufferInfo, FemzipVariableCategory -from lasso.io.binary_buffer import BinaryBuffer -from lasso.io.files import open_file_or_filepath -from lasso.logging import get_logger -from lasso.plotting import plot_shell_mesh - - -# pylint: disable = too-many-lines - -FORTRAN_OFFSET = 1 -LOGGER = get_logger(__name__) - - -def _check_ndim(d3plot, array_dim_names: dict[str, list[str]]): - """Checks if the specified array is fine in terms of ndim - - Parameters - ---------- - d3plot: D3plot - d3plot holding arrays - array_dim_names: Dict[str, List[str]] - """ - - for type_name, dim_names in array_dim_names.items(): - if type_name in d3plot.arrays: - array = d3plot.arrays[type_name] - if array.ndim != len(dim_names): - msg = "Array {0} must have {1} instead of {2} dimensions: ({3})" - dim_names_text = ", ".join(dim_names) - raise ValueError(msg.format(type_name, len(dim_names), array.ndim, dim_names_text)) - - -def _check_array_occurrence( - d3plot, array_names: list[str], required_array_names: list[str] -) -> bool: - """Check if an array exists, if all depending on it exist too - - Parameters - ---------- - array_names: List[str] - list of base arrays - required_array_names: List[str] - list of array names which would be required - - Returns - ------- - exists: bool - if the arrays exist or not - - Raises - ------ - ValueError - If a required array is not present - """ - - if any(name in d3plot.arrays for name in array_names): - if not all(name in d3plot.arrays for name in required_array_names): - msg = "The arrays '{0}' require setting also the arrays '{1}'" - raise ValueError(msg.format(", ".join(array_names), ", ".join(required_array_names))) - return True - return False - - -def _negative_to_positive_state_indexes(indexes: set[int], n_entries) -> set[int]: - """Convert negative indexes of an iterable to positive ones - - Parameters - ---------- - indexes: Set[int] - indexes to check and convert - n_entries: int - total number of entries - - Returns - ------- - new_entries: Set[int] - the positive indexes - """ - - new_entries: set[int] = set() - for _, index in enumerate(indexes): - new_index = index + n_entries if index < 0 else index - if new_index >= n_entries: - err_msg = "State '{0}' exceeds the maximum number of states of '{1}'" - raise ValueError(err_msg.format(index, n_entries)) - new_entries.add(new_index) - return new_entries - - -# pylint: disable = too-many-instance-attributes -class D3plotWriterSettings: - """Settings class for d3plot writing""" - - def __init__(self, d3plot: Any, block_size_bytes: int, single_file: bool): - # check the writing types - if d3plot.header.itype == np.int32: - self.itype = " 100 and new_header["istrn"]: - new_header["idtdt"] += 10000 - - # info of element deletion is encoded into maxint ... - element_deletion_arrays = [ - ArrayType.element_beam_is_alive, - ArrayType.element_shell_is_alive, - ArrayType.element_tshell_is_alive, - ArrayType.element_solid_is_alive, - ] - mdlopt = 0 - if any(name in self.d3plot.arrays for name in element_deletion_arrays): - mdlopt = 2 - elif ArrayType.node_is_alive in self.d3plot.arrays: - mdlopt = 1 - self.mdlopt = mdlopt - - # MAXINT - shell integration layer count - array_dims = { - ArrayType.element_shell_stress: 2, - ArrayType.element_shell_effective_plastic_strain: 2, - ArrayType.element_shell_history_vars: 2, - ArrayType.element_tshell_stress: 2, - ArrayType.element_tshell_effective_plastic_strain: 2, - } - n_shell_layers = self.d3plot.check_array_dims(array_dims, "n_layers") - - # beauty fix: take old shell layers if none exist - if n_shell_layers == 0: - n_shell_layers = self.d3plot.header.n_shell_tshell_layers - - if mdlopt == 0: - new_header["maxint"] = n_shell_layers - elif mdlopt == 1: - new_header["maxint"] = -n_shell_layers - elif mdlopt == 2: - new_header["maxint"] = -(n_shell_layers + 10000) - - # NV2D - shell variable count - has_shell_stress = new_header["ioshl1"] == 1000 - has_shell_pstrain = new_header["ioshl2"] == 1000 - has_shell_forces = new_header["ioshl3"] == 1000 - has_shell_other = new_header["ioshl4"] == 1000 - new_header["nv2d"] = ( - n_shell_layers * (6 * has_shell_stress + has_shell_pstrain + new_header["neips"]) - + 8 * has_shell_forces - + 4 * has_shell_other - + 12 * istrn - + n_shell_layers * self.has_plastic_strain_tensor * 6 - + self.has_thermal_strain_tensor * 6 - ) - - # NMSPH - number of sph nodes - new_header["nmsph"] = ( - len(self.d3plot.arrays[ArrayType.sph_node_indexes]) - if ArrayType.sph_node_indexes in self.d3plot.arrays - else 0 - ) - - # NGPSPH - number of sph materials - new_header["ngpsph"] = ( - len(np.unique(self.d3plot.arrays[ArrayType.sph_node_material_index])) - if ArrayType.sph_node_material_index in self.d3plot.arrays - else 0 - ) - - # NUMMATT - thick shell material count - required_arrays = [ - ArrayType.element_tshell_node_indexes, - ArrayType.element_tshell_part_indexes, - ] - _check_array_occurrence( - self.d3plot, array_names=required_arrays, required_array_names=required_arrays - ) - if ArrayType.element_tshell_part_indexes in self.d3plot.arrays: - part_indexes = self.d3plot.arrays[ArrayType.element_tshell_part_indexes] - unique_part_indexes = np.unique(part_indexes) - new_header["nummatt"] = len(unique_part_indexes) - - self.unique_tshell_part_indexes = unique_part_indexes - - # max_index = unique_part_indexes.max() + 1 \ - # if len(part_indexes) else 0 - # new_header["nmmat"] = max(new_header["nmmat"], - # max_index) - else: - new_header["nummatt"] = 0 - - # NV3DT - new_header["nv3dt"] = ( - n_shell_layers * (6 * has_shell_stress + has_shell_pstrain + new_header["neips"]) - + 12 * istrn - ) - - # IALEMAT - number of ALE materials - new_header["ialemat"] = ( - len(self.d3plot.arrays[ArrayType.ale_material_ids]) - if ArrayType.ale_material_ids in self.d3plot.arrays - else 0 - ) - # NCFDV1 - new_header["ncfdv1"] = 0 - - # NCFDV2 - new_header["ncfdv2"] = 0 - - # NADAPT - number of adapted element to parent pairs ?!? - new_header["ncfdv2"] = 0 - - # NUMRBS (written to numbering header) - if ArrayType.rigid_body_coordinates in self.d3plot.arrays: - array = self.d3plot.arrays[ArrayType.rigid_body_coordinates] - if array.ndim != 3: - msg = "Array '{0}' was expected to have {1} dimensions ({2})." - raise ValueError( - msg.format(ArrayType.rigid_wall_force, 3, "n_timesteps,n_rigid_bodies,x_y_z") - ) - new_header["numrbs"] = array.shape[1] - else: - new_header["numrbs"] = 0 - - # NMMAT - material count (very complicated stuff ...) - tmp_nmmat = ( - new_header["nummat2"] - + new_header["nummat4"] - + new_header["nummat8"] - + new_header["nummatt"] - + new_header["numrbs"] - ) - if ( - ArrayType.part_ids in self.d3plot.arrays - or ArrayType.part_internal_energy in self.d3plot.arrays - or ArrayType.part_kinetic_energy in self.d3plot.arrays - or ArrayType.part_mass in self.d3plot.arrays - or ArrayType.part_velocity in self.d3plot.arrays - ): - tmp_nmmat2 = self.d3plot.check_array_dims( - { - ArrayType.part_ids: 0, - ArrayType.part_internal_energy: 1, - ArrayType.part_kinetic_energy: 1, - ArrayType.part_mass: 1, - ArrayType.part_velocity: 1, - }, - "n_parts", - ) - - new_header["nmmat"] = tmp_nmmat2 - - # FIX - # ... - if new_header["nmmat"] > tmp_nmmat: - new_header["numrbs"] = ( - new_header["nmmat"] - - new_header["nummat2"] - - new_header["nummat4"] - - new_header["nummat8"] - - new_header["nummatt"] - ) - else: - new_header["nmmat"] = tmp_nmmat - - # NARBS - words for arbitrary numbering of everything - # requires nmmat thus it was placed here - new_header["narbs"] = ( - new_header["numnp"] - + new_header["nel8"] - + new_header["nel2"] - + new_header["nel4"] - + new_header["nelth"] - + 3 * new_header["nmmat"] - ) - # narbs header data - if ArrayType.part_ids in self.d3plot.arrays: - new_header["narbs"] += 16 - else: - new_header["narbs"] += 10 - - # NGLBV - number of global variables - n_rigid_wall_vars = 0 - n_rigid_walls = 0 - if ArrayType.rigid_wall_force in self.d3plot.arrays: - n_rigid_wall_vars = 1 - array = self.d3plot.arrays[ArrayType.rigid_wall_force] - if array.ndim != 2: - msg = "Array '{0}' was expected to have {1} dimensions ({2})." - raise ValueError( - msg.format(ArrayType.rigid_wall_force, 2, "n_timesteps,n_rigid_walls") - ) - n_rigid_walls = array.shape[1] - if ArrayType.rigid_wall_position in self.d3plot.arrays: - n_rigid_wall_vars = 4 - array = self.d3plot.arrays[ArrayType.rigid_wall_position] - if array.ndim != 3: - msg = "Array '{0}' was expected to have {1} dimensions ({2})." - raise ValueError( - msg.format(ArrayType.rigid_wall_position, 3, "n_timesteps,n_rigid_walls,x_y_z") - ) - n_rigid_walls = array.shape[1] - - new_header["n_rigid_walls"] = n_rigid_walls - new_header["n_rigid_wall_vars"] = n_rigid_wall_vars - n_global_variables = 0 - if ArrayType.global_kinetic_energy in self.d3plot.arrays: - n_global_variables = 1 - if ArrayType.global_internal_energy in self.d3plot.arrays: - n_global_variables = 2 - if ArrayType.global_total_energy in self.d3plot.arrays: - n_global_variables = 3 - if ArrayType.global_velocity in self.d3plot.arrays: - n_global_variables = 6 - if ArrayType.part_internal_energy in self.d3plot.arrays: - n_global_variables = 6 + 1 * new_header["nmmat"] - if ArrayType.part_kinetic_energy in self.d3plot.arrays: - n_global_variables = 6 + 2 * new_header["nmmat"] - if ArrayType.part_velocity in self.d3plot.arrays: - n_global_variables = 6 + 5 * new_header["nmmat"] - if ArrayType.part_mass in self.d3plot.arrays: - n_global_variables = 6 + 6 * new_header["nmmat"] - if ArrayType.part_hourglass_energy in self.d3plot.arrays: - n_global_variables = 6 + 7 * new_header["nmmat"] - if n_rigid_wall_vars * n_rigid_walls != 0: - n_global_variables = 6 + 7 * new_header["nmmat"] + n_rigid_wall_vars * n_rigid_walls - new_header["nglbv"] = n_global_variables - - # NUMFLUID - total number of ALE fluid groups - new_header["numfluid"] = 0 - - # INN - Invariant node numbering fore shell and solid elements - if self.d3plot.header.has_invariant_numbering: - if "inn" in self.d3plot.header.raw_header and self.d3plot.header.raw_header["inn"] != 0: - new_header["inn"] = self.d3plot.header.raw_header["inn"] - else: - new_header["inn"] = int(self.d3plot.header.has_invariant_numbering) - else: - new_header["inn"] = 0 - - # NPEFG - airbag_arrays = [ - ArrayType.airbags_first_particle_id, - ArrayType.airbags_n_particles, - ArrayType.airbags_ids, - ArrayType.airbags_n_gas_mixtures, - ArrayType.airbags_n_chambers, - ArrayType.airbag_n_active_particles, - ArrayType.airbag_bag_volume, - ArrayType.airbag_particle_gas_id, - ArrayType.airbag_particle_chamber_id, - ArrayType.airbag_particle_leakage, - ArrayType.airbag_particle_mass, - ArrayType.airbag_particle_radius, - ArrayType.airbag_particle_spin_energy, - ArrayType.airbag_particle_translation_energy, - ArrayType.airbag_particle_nearest_segment_distance, - ArrayType.airbag_particle_position, - ArrayType.airbag_particle_velocity, - ] - subver = 3 if any(name in self.d3plot.arrays for name in airbag_arrays) else 0 - - # subver overwrite - if self.d3plot.header.n_airbags: - # pylint: disable = protected-access - subver = self.d3plot._airbag_info.subver - - n_partgas = ( - len(self.d3plot.arrays[ArrayType.airbags_ids]) - if ArrayType.airbags_ids in self.d3plot.arrays - else 0 - ) - - new_header["npefg"] = 1000 * subver + n_partgas - - # NEL48 - extra nodes for 8 node shell elements - required_arrays = [ - ArrayType.element_shell_node8_element_index, - ArrayType.element_shell_node8_extra_node_indexes, - ] - _check_array_occurrence( - self.d3plot, array_names=required_arrays, required_array_names=required_arrays - ) - new_header["nel48"] = ( - len(self.d3plot.arrays[ArrayType.element_shell_node8_element_index]) - if ArrayType.element_shell_node8_element_index in self.d3plot.arrays - else 0 - ) - - # NEL20 - 20 nodes solid elements - required_arrays = [ - ArrayType.element_solid_node20_element_index, - ArrayType.element_solid_node20_extra_node_indexes, - ] - _check_array_occurrence( - self.d3plot, array_names=required_arrays, required_array_names=required_arrays - ) - if ArrayType.element_solid_node20_element_index in self.d3plot.arrays: - new_header["nel20"] = len( - self.d3plot.arrays[ArrayType.element_solid_node20_element_index] - ) - else: - new_header["nel20"] = 0 - - # NT3D - thermal solid data - if ArrayType.element_solid_thermal_data in self.d3plot.arrays: - new_header["nt3d"] = len(self.d3plot.arrays[ArrayType.element_solid_thermal_data]) - else: - new_header["nt3d"] = 0 - - # NEL27 - 27 node solid elements - required_arrays = [ - ArrayType.element_solid_node27_element_index, - ArrayType.element_solid_node27_extra_node_indexes, - ] - _check_array_occurrence( - self.d3plot, array_names=required_arrays, required_array_names=required_arrays - ) - if ArrayType.element_solid_node27_element_index in self.d3plot.arrays: - new_header["nel27"] = len( - self.d3plot.arrays[ArrayType.element_solid_node27_element_index] - ) - else: - new_header["nel27"] = 0 - - # EXTRA - extra header variables - # set only if any value is non-zero - extra_hdr_variables = ["nel20", "nt3d", "nel27", "neipb"] - if any(new_header[name] for name in extra_hdr_variables): - new_header["extra"] = 64 - else: - new_header["extra"] = 0 - - # CHECKS - - # unique part indexes all ok - for part_index in self.unique_beam_part_indexes: - if part_index >= new_header["nmmat"]: - msg = "{0} part index {1} is larger than number of materials {2}" - raise ValueError(msg.format("beam", part_index, new_header["nmmat"])) - for part_index in self.unique_shell_part_indexes: - if part_index >= new_header["nmmat"]: - msg = "{0} part index {1} is larger than number of materials {2}" - raise ValueError(msg.format("shell", part_index, new_header["nmmat"])) - for part_index in self.unique_solid_part_indexes: - if part_index >= new_header["nmmat"]: - msg = "{0} part index {1} is larger than number of materials {2}" - raise ValueError(msg.format("solid", part_index, new_header["nmmat"])) - for part_index in self.unique_tshell_part_indexes: - if part_index >= new_header["nmmat"]: - msg = "{0} part index {1} is larger than number of materials {2}" - raise ValueError(msg.format("tshell", part_index, new_header["nmmat"])) - - # new header - self._header = new_header - - # pylint: disable = too-many-return-statements - def pack(self, value: Any, size=None, dtype_hint=None) -> bytes: - """Pack a python value according to its settings - - Parameters - ---------- - value: Any - integer, float or string type value - size: int - size in bytes - dtype_hint: `np.integer` or `np.floating` (default: None) - dtype hint for numpy arrays (prevens wrong casting) - - Returns - ------- - bytes: bytes - value packed in bytes - - Raises - ------ - RuntimeError - If the type cannot be deserialized for being unknown. - """ - - if dtype_hint not in (None, np.integer, np.floating): - raise TypeError( - f"dtype_hint must be None, np.integer, or np.floating, got {dtype_hint}" - ) - - # INT - if isinstance(value, self._allowed_int_types): - return struct.pack(self.itype, value) - # FLOAT - if isinstance(value, self._allowed_float_types): - return struct.pack(self.ftype, value) - # BYTES - if isinstance(value, bytes): - if size and len(value) > size: - return value[:size] - return value - # BYTEARRAY - if isinstance(value, bytearray): - if size and len(value) > size: - return bytes(value[:size]) - return bytes(value) - # STRING - if isinstance(value, str): - if size: - fmt = "{0:" + str(size) + "}" - return fmt.format(value).encode(self._str_codec) - - return value.encode(self._str_codec) - # ARRAY - if isinstance(value, np.ndarray): - if (value.dtype != self.ftype and dtype_hint == np.floating) or ( - value.dtype != self.itype and dtype_hint == np.integer - ): - # we need typehint - if dtype_hint is None: - msg = "Please specify a dtype_hint (np.floating, np.integer)." - raise ValueError(msg) - - # determine new dtype - new_dtype = self.itype if dtype_hint == np.integer else self.ftype - - # log conversion - msg = "Converting array from %s to %s" - LOGGER.info(msg, value.dtype, new_dtype) - - # warn if convert between int and float (possible bugs) - if not np.issubdtype(value.dtype, dtype_hint): - LOGGER.warning(msg, value.dtype, new_dtype) - - value = value.astype(new_dtype) - - return value.tobytes() - - msg = "Cannot deserialize type '%s' of value '%s' for writing." - raise RuntimeError(msg, type(value), value) - - def count_array_state_var( - self, array_type: str, dimension_names: list[str], has_layers: bool, n_layers: int = 0 - ) -> tuple[int, int]: - """This functions checks and updates the variable count for certain types of arrays - - Parameters - ---------- - array_type: str - name of the shell layer array - dimension_names: List[str] - names of the array dimensions - has_layers: bool - if the array has integration layers - n_layers: int - number of (previous) shell layers, if unknown set to 0 - - Returns - ------- - n_vars: int - variable count - n_layers: int - number of layers - - Raises - ------ - ValueError - If the dimensions of the array were invalid or an inconsistent - number of integration layers was detected. - """ - - n_vars = 0 - - if array_type in self.d3plot.arrays: - array = self.d3plot.arrays[array_type] - - if array.ndim != len(dimension_names): - msg = "Array '{0}' was expected to have {1} dimensions ({2})." - raise ValueError( - msg.format(array_type, len(dimension_names), ", ".join(dimension_names)) - ) - - if has_layers: - if n_layers == 0: - n_layers = array.shape[2] - elif n_layers != array.shape[2]: - msg = "Array '{0}' has '{1}' integration layers but another array used '{2}'." - raise ValueError(msg.format(array_type, array.shape[2], n_layers)) - - # last dimension is collapsed - if array.ndim == 3: - n_vars = 1 * n_layers - else: - n_vars = array.shape[3] * n_layers - - # no layers - # last dimension is collapsed - elif array.ndim == 2: - n_vars = 1 - else: - n_vars = array.shape[2] - - return n_vars, n_layers - - -@dataclass -class MemoryInfo: - """MemoryInfo contains info about memory regions in files""" - - start: int = 0 - length: int = 0 - filepath: str = "" - n_states: int = 0 - filesize: int = 0 - use_mmap: bool = False - - -class FemzipInfo: - """FemzipInfo contains information and wrappers for the femzip api""" - - api: FemzipAPI - n_states: int = 0 - buffer_info: FemzipBufferInfo - use_femzip: bool = False - - def __init__(self, filepath: str = ""): - self.api = FemzipAPI() - self.buffer_info = FemzipBufferInfo() - - if filepath: - tmp_header = D3plotHeader().load_file(filepath) - self.use_femzip = tmp_header.has_femzip_indicator - - if self.use_femzip: - # there is a lot to go wrong - try: - self.buffer_info = self.api.get_buffer_info(filepath) - # loading femzip api failed - except Exception as err: - raise RuntimeError(f"Failed to use Femzip: {err}") from err - - -class MaterialSectionInfo: - """MaterialSectionInfo contains vars from the material section""" - - n_rigid_shells: int = 0 - - -class SphSectionInfo: - """SphSectionInfo contains vars from the sph geometry section""" - - n_sph_array_length: int = 11 - n_sph_vars: int = 0 - has_influence_radius: bool = False - has_particle_pressure: bool = False - has_stresses: bool = False - has_plastic_strain: bool = False - has_material_density: bool = False - has_internal_energy: bool = False - has_n_affecting_neighbors: bool = False - has_strain: bool = False - has_strainrate: bool = False - has_true_strains: bool = False - has_mass: bool = False - n_sph_history_vars: int = 0 - - -class AirbagInfo: - """AirbagInfo contains vars used to describe the sph geometry section""" - - n_geometric_variables: int = 0 - n_airbag_state_variables: int = 0 - n_particle_state_variables: int = 0 - n_particles: int = 0 - n_airbags: int = 0 - # ? - subver: int = 0 - n_chambers: int = 0 - - def get_n_variables(self) -> int: - """Get the number of airbag variables - - Returns - ------- - n_airbag_vars: int - number of airbag vars - """ - return ( - self.n_geometric_variables - + self.n_particle_state_variables - + self.n_airbag_state_variables - ) - - -class NumberingInfo: - """NumberingInfo contains vars from the part numbering section (ids)""" - - # the value(s) of ptr is initialized - # as 1 since we need to make it - # negative if part_ids are written - # to file and 0 cannot do that ... - # This is ok for self-made D3plots - # since these fields are unused anyway - ptr_node_ids: int = 1 - has_material_ids: bool = False - ptr_solid_ids: int = 1 - ptr_beam_ids: int = 1 - ptr_shell_ids: int = 1 - ptr_thick_shell_ids: int = 1 - n_nodes: int = 0 - n_solids: int = 0 - n_beams: int = 0 - n_shells: int = 0 - n_thick_shells: int = 0 - ptr_material_ids: int = 1 - ptr_material_ids_defined_order: int = 1 - ptr_material_ids_crossref: int = 1 - n_parts: int = 0 - n_parts2: int = 0 - n_rigid_bodies: int = 0 - - -@dataclass -class RigidBodyMetadata: - """RigidBodyMetadata contains vars from the rigid body metadata section. - This section comes before the individual rigid body data. - """ - - internal_number: int - n_nodes: int - node_indexes: np.ndarray - n_active_nodes: int - active_node_indexes: np.ndarray - - -# NOTE: class-as-data-structure (B903) -# Class could be dataclass or namedtuple -# See: https://docs.astral.sh/ruff/rules/class-as-data-structure/ -class RigidBodyInfo: # noqa B903 - """RigidBodyMetadata contains vars for the individual rigid bodies""" - - rigid_body_metadata_list: Iterable[RigidBodyMetadata] - n_rigid_bodies: int = 0 - - def __init__( - self, rigid_body_metadata_list: Iterable[RigidBodyMetadata], n_rigid_bodies: int = 0 - ): - self.rigid_body_metadata_list = rigid_body_metadata_list - self.n_rigid_bodies = n_rigid_bodies - - -# NOTE: class-as-data-structure (B903) -# Class could be dataclass or namedtuple -# See: https://docs.astral.sh/ruff/rules/class-as-data-structure/ -class RigidRoadInfo: # noqa B903 - """RigidRoadInfo contains metadata for the description of rigid roads""" - - n_nodes: int = 0 - n_road_segments: int = 0 - n_roads: int = 0 - # ? - motion: int = 0 - - def __init__( - self, n_nodes: int = 0, n_road_segments: int = 0, n_roads: int = 0, motion: int = 0 - ): - self.n_nodes = n_nodes - self.n_road_segments = n_road_segments - self.n_roads = n_roads - self.motion = motion - - -# NOTE: class-as-data-structure (B903) -# Class could be dataclass or namedtuple -# See: https://docs.astral.sh/ruff/rules/class-as-data-structure/ -class StateInfo: # noqa B903 - """StateInfo holds metadata for states which is currently solely the timestep. - We all had bigger plans in life ... - """ - - n_timesteps: int = 0 - - def __init__(self, n_timesteps: int = 0): - self.n_timesteps = n_timesteps - - -class D3plot: - """Class used to read LS-Dyna d3plots""" - - _header: D3plotHeader - _femzip_info: FemzipInfo - _material_section_info: MaterialSectionInfo - _sph_info: SphSectionInfo - _airbag_info: AirbagInfo - _numbering_info: NumberingInfo - _rigid_body_info: RigidBodyInfo - _rigid_road_info: RigidRoadInfo - _buffer: Union[BinaryBuffer, None] = None - - # we all love secret settings - use_advanced_femzip_api: bool = False - - # This amount of args is needed - # pylint: disable = too-many-arguments, too-many-statements, unused-argument - def __init__( - self, - filepath: str = None, - use_femzip: Union[bool, None] = None, - n_files_to_load_at_once: Union[int, None] = None, - state_array_filter: Union[list[str], None] = None, - state_filter: Union[None, set[int]] = None, - buffered_reading: bool = False, - ): - """Constructor for a D3plot - - Parameters - ---------- - filepath: str - path to a d3plot file - use_femzip: bool - Not used anymore. - n_files_to_load_at_once: int - *DEPRECATED* not used anymore, use `buffered_reading` - state_array_filter: Union[List[str], None] - names of arrays which will be the only ones loaded from state data - state_filter: Union[None, Set[int]] - which states to load. Negative indexes count backwards. - buffered_reading: bool - whether to pull only a single state into memory during reading - - Examples - -------- - >>> from lasso.dyna import D3plot, ArrayType - >>> # open and read everything - >>> d3plot = D3plot("path/to/d3plot") - - >>> # only read node displacement - >>> d3plot = D3plot("path/to/d3plot", state_array_filter=["node_displacement"]) - >>> # or with nicer syntax - >>> d3plot = D3plot("path/to/d3plot", state_array_filter=[ArrayType.node_displacement]) - - >>> # only load first and last state - >>> d3plot = D3plot("path/to/d3plot", state_filter={0, -1}) - - >>> # our computer lacks RAM so lets extract a specific array - >>> # but only keep one state at a time in memory - >>> d3plot = D3plot("path/to/d3plot", - >>> state_array_filter=[ArrayType.node_displacement], - >>> buffered_reading=True) - - Notes - ----- - If dyna wrote multiple files for several states, - only give the path to the first file. - """ - super().__init__() - - LOGGER.debug("-------- D 3 P L O T --------") - - self._arrays = {} - self._header = D3plotHeader() - self._femzip_info = FemzipInfo(filepath=filepath if filepath is not None else "") - self._material_section_info = MaterialSectionInfo() - self._sph_info = SphSectionInfo() - self._airbag_info = AirbagInfo() - self._numbering_info = NumberingInfo() - self._rigid_body_info = RigidBodyInfo(rigid_body_metadata_list=()) - self._rigid_road_info = RigidRoadInfo() - self._state_info = StateInfo() - - # which states to load - self.state_filter = state_filter - - # how many files to load into memory at once - if n_files_to_load_at_once is not None: - warn_msg = "D3plot argument '{0}' is deprecated. Please use '{1}=True'." - raise DeprecationWarning(warn_msg.format("n_files_to_load_at_once", "buffered_reading")) - self.buffered_reading = buffered_reading or (state_filter is not None and any(state_filter)) - - # arrays to filter out - self.state_array_filter = state_array_filter - - # load memory accordingly - # no femzip - if filepath and not self._femzip_info.use_femzip: - self._buffer = BinaryBuffer(filepath) - self.bb_states = None - # femzip - elif filepath and self._femzip_info.use_femzip: - self._buffer = self._read_femzip_geometry(filepath) - # we need to reload the header - self._header = D3plotHeader().load_file(self._buffer) - self.bb_states = None - # no data to load basically - else: - self._buffer = None - self.bb_states = None - - self.geometry_section_size = 0 - - # read header - self._read_header() - - # read geometry - self._parse_geometry() - - # read state data - - # try advanced femzip api - if ( - filepath - and self._femzip_info.use_femzip - and self.use_advanced_femzip_api - and self._femzip_info.api.has_femunziplib_license() - ): - LOGGER.debug("Advanced FEMZIP-API used") - try: - self._read_states_femzip_advanced(filepath) - except Exception: - trace = traceback.format_exc() - warn_msg = ( - "Error when using advanced Femzip API, " - "falling back to normal but slower Femzip API.\n%s" - ) - LOGGER.warning(warn_msg, trace) - - # since we had a crash, we need to reload the file - # to be sure we don't crash again - self._femzip_info.api.close_current_file() - self._femzip_info.api.read_geometry(filepath, self._femzip_info.buffer_info, False) - # try normal femzip api - self._read_states(filepath) - finally: - self._femzip_info.api.close_current_file() - - # normal state reading (femzip and non-femzip) - elif filepath: - self._read_states(filepath) - if self._femzip_info.use_femzip: - self._femzip_info.api.close_current_file() - else: - # no filepath = nothing to do - pass - - def _read_femzip_geometry(self, filepath: str) -> BinaryBuffer: - """Read the geometry from femzip - - Parameters - ---------- - filepath: str - path to the femzpi file - - Returns - ------- - bb: BinaryBuffer - memory of the geometry section - """ - - buffer_geo = self._femzip_info.api.read_geometry( - filepath, buffer_info=self._femzip_info.buffer_info, close_file=False - ) - - # save - buffer = BinaryBuffer() - buffer.filepath_ = filepath - buffer.memoryview = buffer_geo.cast("B") - - return buffer - - @property - def n_timesteps(self) -> int: - """Number of timesteps loaded""" - return self._state_info.n_timesteps - - @property - def arrays(self) -> dict: - """Dictionary holding all d3plot arrays - - Notes - ----- - The corresponding keys of the dictionary can - also be found in `lasso.dyna.ArrayTypes`, which - helps with IDE integration and code safety. - - Examples - -------- - >>> d3plot = D3plot("some/path/to/d3plot") - >>> d3plot.arrays.keys() - dict_keys(['irbtyp', 'node_coordinates', ...]) - >>> # The following is good coding practice - >>> import lasso.dyna.ArrayTypes.ArrayTypes as atypes - >>> d3plot.arrays[atypes.node_displacmeent].shape - """ - return self._arrays - - @arrays.setter - def arrays(self, array_dict: dict): - if not isinstance(array_dict, dict): - raise TypeError(f"array_dict must be a dict, got {type(array_dict)}") - - self._arrays = array_dict - - @property - def header(self) -> D3plotHeader: - """Instance holding all d3plot header information - - Returns - ------- - header: D3plotHeader - header of the d3plot - - Notes - ----- - The header contains a lot of information such as number - of elements, etc. - - Examples - -------- - >>> d3plot = D3plot("some/path/to/d3plot") - >>> # number of shells - >>> d3plot.header.n_shells - 85624 - """ - return self._header - - @staticmethod - def _is_end_of_file_marker( - buffer: BinaryBuffer, position: int, ftype: Union[np.float32, np.float64] - ) -> bool: - """Check for the dyna eof marker at a certain position - - Parameters - ---------- - bb: BinaryBuffer - buffer holding memory - position: int - position in the buffer - ftype: Union[np.float32, np.float64] - floating point type - - Returns - ------- - is_end_marker: bool - if at the position is an end marker - - Notes - ----- - The end of file marker is represented by a floating point - number with the value -999999 (single precision hex: F02374C9, - double precision hex: 000000007E842EC1). - """ - - if ftype not in (np.float32, np.float64): - err_msg = "Floating point type '{0}' is not a floating point type." - raise ValueError(err_msg.format(ftype)) - - return buffer.read_number(position, ftype) == ftype(-999999) - - def _correct_file_offset(self): - """Correct the position in the bytes - - Notes - ----- - LS-Dyna writes its files zero padded at a size of - 512 words in block size. There might be a lot of - unused trailing data in the rear we need to skip - in order to get to the next useful data block. - """ - - if not self._buffer: - return - - block_count = len(self._buffer) // (512 * self.header.wordsize) - - # Warning! - # Resets the block count! - self.geometry_section_size = (block_count + 1) * 512 * self.header.wordsize - - @property - def _n_parts(self) -> int: - """Get the number of parts contained in the d3plot - - Returns - ------- - n_parts: int - number of total parts - """ - - n_parts = ( - self.header.n_solid_materials - + self.header.n_beam_materials - + self.header.n_shell_materials - + self.header.n_thick_shell_materials - + self._numbering_info.n_rigid_bodies - ) - - return n_parts - - @property - def _n_rigid_walls(self) -> int: - """Get the number of rigid walls in the d3plot - - Returns - ------- - n_rigid_walls: int - number of rigid walls - """ - - # there have been cases that there are less than in the specs - # indicated global vars. That breaks this computation, thus we - # use max at the end. - previous_global_vars = 6 + 7 * self._n_parts - n_rigid_wall_vars = self.header.n_rigid_wall_vars - n_rigid_walls = (self.header.n_global_vars - previous_global_vars) // n_rigid_wall_vars - - # if n_rigid_walls < 0: - # err_msg = "The computed number of rigid walls is negative ('{0}')." - # raise RuntimeError(err_msg.format(n_rigid_walls)) - - return max(n_rigid_walls, 0) - - # pylint: disable = unused-argument, too-many-locals - def _read_d3plot_file_generator( - self, buffered_reading: bool, state_filter: Union[None, set[int]] - ) -> typing.Any: - """Generator function for reading bare d3plot files - - Parameters - ---------- - buffered_reading: bool - whether to read one state at a time - state_filter: Union[None, Set[int]] - which states to filter out - - Yields - ------ - buffer: BinaryBuffer - buffer for each file - n_states: int - number of states from second yield on - """ - - # (1) STATES - # This is dangerous. The following routine requires data from - # several sections in the geometry part calling this too early crashes - bytes_per_state = self._compute_n_bytes_per_state() - file_infos = self._collect_file_infos(bytes_per_state) - - # some status - n_files = len(file_infos) - n_states = sum(file_info.n_states for file_info in file_infos) - LOGGER.debug("n_files found: %d", n_files) - LOGGER.debug("n_states estimated: %d", n_states) - - # convert negative state indexes into positive ones - if state_filter is not None: - state_filter = _negative_to_positive_state_indexes(state_filter, n_states) - - # if using buffered reading, we load one state at a time - # into memory - if buffered_reading: - file_infos_tmp: list[MemoryInfo] = [] - n_previous_states = 0 - for minfo in file_infos: - for i_file_state in range(minfo.n_states): - i_global_state = n_previous_states + i_file_state - - # do we need to skip this one - if state_filter and i_global_state not in state_filter: - continue - - file_infos_tmp.append( - MemoryInfo( - start=minfo.start + i_file_state * bytes_per_state, - length=bytes_per_state, - filepath=minfo.filepath, - n_states=1, - filesize=minfo.filesize, - use_mmap=minfo.n_states != 1, - ) - ) - - n_previous_states += minfo.n_states - file_infos = file_infos_tmp - - LOGGER.debug("buffers: %s", pprint.pformat([info.__dict__ for info in file_infos])) - - # number of states and if buffered reading is used - n_states_selected = sum(file_info.n_states for file_info in file_infos) - yield n_states_selected - - sub_file_infos = [file_infos] if not buffered_reading else [[info] for info in file_infos] - for sub_file_info_list in sub_file_infos: - buffer, n_states = D3plot._read_file_from_memory_info(sub_file_info_list) - yield buffer, n_states - - def _read_femzip_file_generator( - self, buffered_reading: bool, state_filter: Union[None, set[int]] - ) -> typing.Any: - """Generator function for reading femzipped d3plot files - - Parameters - ---------- - buffered_reading: bool - load state by state - state_filter: Union[None, Set[int]] - which states to filter out - - Yields - ------ - buffer: BinaryBuffer - binary buffer of a file - n_states: int - from second yield on, number of states for buffers - """ - - femzip_api = self._femzip_info.api - - # (1) STATES - # number of states and if buffered reading is used - buffer_info = self._femzip_info.buffer_info - n_timesteps: int = buffer_info.n_timesteps - - # convert negative filter indexes - state_filter_parsed: set[int] = set() - if state_filter is not None: - state_filter_parsed = _negative_to_positive_state_indexes(state_filter, n_timesteps) - n_states_to_load = len(state_filter) - else: - n_states_to_load = n_timesteps - state_filter_parsed = set(range(n_timesteps)) - - yield n_states_to_load - - n_files_to_load_at_once = n_timesteps if not buffered_reading else 1 - # pylint: disable = invalid-name - BufferStateType = ctypes.c_float * (buffer_info.size_state * n_files_to_load_at_once) - buffer_state = BufferStateType() - - buffer = BinaryBuffer() - buffer.memoryview = memoryview(buffer_state) - - # do the thing - i_timesteps_read = 0 - max_timestep = max(state_filter_parsed) if state_filter_parsed else 0 - for i_timestep in range(n_timesteps): - # buffer offset - buffer_current_state = buffer.memoryview[i_timesteps_read * buffer_info.size_state :] - - # read state - femzip_api.read_single_state(i_timestep, buffer_info, state_buffer=buffer_current_state) - - if i_timestep in state_filter_parsed: - i_timesteps_read += 1 - - # Note: - # the buffer is re-used here! This saves memory BUT - # if memory is not copied we overwrite the same again and again - # This is ok for buffered reading thus indirectly safe - # since elsewhere the arrays get copied but keep it in mind! - if i_timesteps_read != 0 and i_timesteps_read % n_files_to_load_at_once == 0: - yield buffer, i_timesteps_read - i_timesteps_read = 0 - - # stop in case we have everything we needed - if i_timestep >= max_timestep: - if i_timesteps_read != 0: - yield buffer, i_timesteps_read - break - - # do the thing - femzip_api.close_current_file() - - def _read_states_femzip_advanced(self, filepath: str) -> None: - """Read d3plot variables with advanced femzip API - - Parameters - ---------- - filepath: str - path to the femzipped d3plot - """ - - # convert filter - d3plot_array_filter = set(self.state_array_filter) if self.state_array_filter else None - - # what vars are inside? - api = self._femzip_info.api - file_metadata = api.get_file_metadata(filepath) - - if file_metadata.number_of_timesteps <= 0: - return - - # filter femzip vars according to requested d3plot vars - file_metadata_filtered = filter_femzip_variables(file_metadata, d3plot_array_filter) - - # read femzip arrays - result_arrays = api.read_variables( - file_metadata=file_metadata_filtered, - n_parts=self.header.n_parts, - n_rigid_walls=self._n_rigid_walls, - n_rigid_wall_vars=self.header.n_rigid_wall_vars, - n_airbag_particles=self._airbag_info.n_particles, - n_airbags=self._airbag_info.n_airbags, - state_filter=self.state_filter, - ) - - # special case arrays which need extra parsing - keys_to_remove = [] - for (fz_index, fz_name, fz_cat), array in result_arrays.items(): - # global vars - if fz_cat == FemzipVariableCategory.GLOBAL: - keys_to_remove.append((fz_index, fz_name, fz_cat)) - self._read_states_globals(state_data=array, var_index=0, array_dict=self.arrays) - - # parts and rigid walls - elif fz_cat == FemzipVariableCategory.PART: - keys_to_remove.append((fz_index, fz_name, fz_cat)) - - var_index = self._read_states_parts( - state_data=array, var_index=0, array_dict=self.arrays - ) - - self._read_states_rigid_walls( - state_data=array, var_index=var_index, array_dict=self.arrays - ) - - for key in keys_to_remove: - del result_arrays[key] - - # transfer arrays - mapper = FemzipMapper() - mapper.map(result_arrays) - - # save arrays - for plt_name, arr in mapper.d3plot_arrays.items(): - # femzip sometimes stores strain in solid history vars - # but also sometimes separately - if ( - plt_name == ArrayType.element_solid_history_variables - and self.header.has_element_strain - and ArrayType.element_solid_strain not in mapper.d3plot_arrays - ): - self.arrays[ArrayType.element_solid_strain] = arr[:, :, :, :6] - tmp_array = arr[:, :, :, 6:] - if all(tmp_array.shape): - self.arrays[plt_name] = tmp_array - else: - self.arrays[plt_name] = arr - - # ELEMENT DELETION - # - # somehow element deletion info is extra ... - # buffer_info - buffer_info = self._femzip_info.buffer_info - deletion_array = api.read_state_deletion_info( - buffer_info=buffer_info, state_filter=self.state_filter - ) - self._read_states_is_alive(state_data=deletion_array, var_index=0, array_dict=self.arrays) - - # TIMESTEPS - timestep_array = np.array( - [buffer_info.timesteps[i_timestep] for i_timestep in range(buffer_info.n_timesteps)], - dtype=self.header.ftype, - ) - self.arrays[ArrayType.global_timesteps] = timestep_array - - def _read_header(self): - """Read the d3plot header""" - - LOGGER.debug("-------- H E A D E R --------") - - if self._buffer: - self._header.load_file(self._buffer) - - self.geometry_section_size = self._header.n_header_bytes - - def _parse_geometry(self): - """Read the d3plot geometry""" - - LOGGER.debug("------ G E O M E T R Y ------") - - # read material section - self._read_material_section() - - # read fluid material data - self._read_fluid_material_data() - - # SPH element data flags - self._read_sph_element_data_flags() - - # Particle Data - self._read_particle_data() - - # Geometry Data - self._read_geometry_data() - - # User Material, Node, Blabla IDs - self._read_user_ids() - - # Rigid Body Description - self._read_rigid_body_description() - - # Adapted Element Parent List - # manual says not implemented - - # Smooth Particle Hydrodynamcis Node and Material list - self._read_sph_node_and_material_list() - - # Particle Geometry Data - self._read_particle_geometry_data() - - # Rigid Road Surface Data - self._read_rigid_road_surface() - - # Connectivity for weirdo elements - # 10 Node Tetra - # 8 Node Shell - # 20 Node Solid - # 27 Node Solid - self._read_extra_node_connectivity() - - # Header Part & Contact Interface Titles - # this is a class method since it is also needed elsewhere - self.geometry_section_size = self._read_header_part_contact_interface_titles( - self.header, - self._buffer, - self.geometry_section_size, # type: ignore - self.arrays, - ) - - # Extra Data Types (for multi solver output) - # ... not supported - - def _read_material_section(self): - """This function reads the material type section""" - - if not self._buffer: - return - - if not self.header.has_material_type_section: - return - - LOGGER.debug("_read_material_section start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - # failsafe - original_position = self.geometry_section_size - blocksize = (2 + self.header.n_parts) * self.header.wordsize - - try: - # Material Type Data - # - # "This data is required because those shell elements - # that are in a rigid body have no element data output - # in the state data section." - # - # "The normal length of the shell element state data is: - # NEL4 * NV2D, when the MATTYP flag is set the length is: - # (NEL4 โ€“ NUMRBE) * NV2D. When reading the shell element data, - # the material number must be checked against IRBRTYP list to - # find the elementโ€™s material type. If the type = 20, then - # all the values for the element to zero." (Manual 03.2016) - - self._material_section_info.n_rigid_shells = int( - self._buffer.read_number(position, self._header.itype) - ) # type: ignore - position += self.header.wordsize - - test_nummat = self._buffer.read_number(position, self._header.itype) - position += self.header.wordsize - - if test_nummat != self.header.n_parts: - raise RuntimeError( - "nmmat (header) != nmmat (material type data): " - f"{self.header.n_parts} != {test_nummat}" - ) - - self.arrays[ArrayType.part_material_type] = self._buffer.read_ndarray( - position, self.header.n_parts * self.header.wordsize, 1, self.header.itype - ) - position += self.header.n_parts * self.header.wordsize - - except Exception: - # print info - trb_msg = traceback.format_exc() - LOGGER.warning("A failure in %s was caught:\n%s", "_read_material_section", trb_msg) - - # fix position - position = original_position + blocksize - - self.geometry_section_size = position - LOGGER.debug("_read_material_section end at byte %d", self.geometry_section_size) - - def _read_fluid_material_data(self): - """Read the fluid material data""" - - if not self._buffer: - return - - if self.header.n_ale_materials == 0: - return - - LOGGER.debug("_read_fluid_material_data start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - # safety - original_position = position - blocksize = self.header.n_ale_materials * self.header.wordsize - - try: - # Fluid Material Data - array_length = self.header.n_ale_materials * self.header.wordsize - self.arrays[ArrayType.ale_material_ids] = self._buffer.read_ndarray( - position, array_length, 1, self.header.itype - ) # type: ignore - position += array_length - - except Exception: - # print info - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_fluid_material_data", trb_msg) - - # fix position - position = original_position + blocksize - - # remember position - self.geometry_section_size = position - LOGGER.debug("_read_fluid_material_data end at byte %d", self.geometry_section_size) - - def _read_sph_element_data_flags(self): - """Read the sph element data flags - - The LS-DYNA database has some undocumented behaviour between older and newer - versions that impact how SPH header data is handled. The manual idnicates that - isphfg(1) should always be 11. However, in versions of LS-DYNA newer than R9, - isphfg(1) can be either 10 or 11 as history variables are handled differently. - Special handling was needed to ensure that old behaviour broken while handling - this undocumented change. - """ - - if not self._buffer: - return - - if not self.header.n_sph_nodes: - return - - LOGGER.debug("_read_sph_element_data_flags start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - sph_element_data_words = { - "isphfg1": (position, self._header.itype), - "isphfg2": (position + 1 * self.header.wordsize, self._header.itype), - "isphfg3": (position + 2 * self.header.wordsize, self._header.itype), - "isphfg4": (position + 3 * self.header.wordsize, self._header.itype), - "isphfg5": (position + 4 * self.header.wordsize, self._header.itype), - "isphfg6": (position + 5 * self.header.wordsize, self._header.itype), - "isphfg7": (position + 6 * self.header.wordsize, self._header.itype), - "isphfg8": (position + 7 * self.header.wordsize, self._header.itype), - "isphfg9": (position + 8 * self.header.wordsize, self._header.itype), - "isphfg10": (position + 9 * self.header.wordsize, self._header.itype), - "isphfg11": (position + 10 * self.header.wordsize, self._header.itype), - } - - sph_header_data = self.header.read_words(self._buffer, sph_element_data_words) - - self._sph_info.n_sph_array_length = sph_header_data["isphfg1"] - self._sph_info.has_influence_radius = sph_header_data["isphfg2"] != 0 - self._sph_info.has_particle_pressure = sph_header_data["isphfg3"] != 0 - self._sph_info.has_stresses = sph_header_data["isphfg4"] != 0 - self._sph_info.has_plastic_strain = sph_header_data["isphfg5"] != 0 - self._sph_info.has_material_density = sph_header_data["isphfg6"] != 0 - self._sph_info.has_internal_energy = sph_header_data["isphfg7"] != 0 - self._sph_info.has_n_affecting_neighbors = sph_header_data["isphfg8"] != 0 - self._sph_info.has_strain = sph_header_data["isphfg9"] != 0 - self._sph_info.has_strainrate = sph_header_data["isphfg9"] > 6 - self._sph_info.has_true_strains = sph_header_data["isphfg9"] < 0 - self._sph_info.has_mass = sph_header_data["isphfg10"] != 0 - # If isphfg1 = 10, then there are no history variables by default and isphfg11 - # is filled with junk data that causes issues calculating n_sph_vars below - if sph_header_data["isphfg1"] == 10: - self._sph_info.n_sph_history_vars = 0 - else: - self._sph_info.n_sph_history_vars = sph_header_data["isphfg11"] - - self._sph_info.n_sph_vars = ( - sph_header_data["isphfg2"] - + sph_header_data["isphfg3"] - + sph_header_data["isphfg4"] - + sph_header_data["isphfg5"] - + sph_header_data["isphfg6"] - + sph_header_data["isphfg7"] - + sph_header_data["isphfg8"] - + abs(sph_header_data["isphfg9"]) - + sph_header_data["isphfg10"] - + self._sph_info.n_sph_history_vars - + 1 - ) # material number - - self.geometry_section_size += sph_header_data["isphfg1"] * self.header.wordsize - LOGGER.debug("_read_sph_element_data_flags end at byte %d", self.geometry_section_size) - - def _read_particle_data(self): - """Read the geometry section for particle data (airbags)""" - - if not self._buffer: - return - - if "npefg" not in self.header.raw_header: - return - npefg = self.header.raw_header["npefg"] - - # let's stick to the manual, too lazy to decypther this test - if npefg <= 0 or npefg > 10000000: - return - - LOGGER.debug("_read_particle_data start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - airbag_header = { - # number of airbags - "npartgas": npefg % 1000, - # ? - "subver": npefg // 1000, - } - - particle_geometry_data_words = { - # number of geometry variables - "ngeom": (position, self._header.itype), - # number of state variables - "nvar": (position + 1 * self.header.wordsize, self._header.itype), - # number of particles - "npart": (position + 2 * self.header.wordsize, self._header.itype), - # number of state geometry variables - "nstgeom": (position + 3 * self.header.wordsize, self._header.itype), - } - - self.header.read_words(self._buffer, particle_geometry_data_words, airbag_header) - position += 4 * self.header.wordsize - - # transfer to info object - self._airbag_info.n_airbags = npefg % 1000 - self._airbag_info.subver = npefg // 1000 - self._airbag_info.n_geometric_variables = airbag_header["ngeom"] - self._airbag_info.n_particle_state_variables = airbag_header["nvar"] - self._airbag_info.n_particles = airbag_header["npart"] - self._airbag_info.n_airbag_state_variables = airbag_header["nstgeom"] - - if self._airbag_info.subver == 4: - # number of chambers - self._airbag_info.n_chambers = self._buffer.read_number(position, self._header.itype) - position += self.header.wordsize - - n_airbag_variables = self._airbag_info.get_n_variables() - - # safety - # from here on the code may fail - original_position = position - blocksize = 9 * n_airbag_variables * self.header.wordsize - - try: - # variable typecodes - self.arrays[ArrayType.airbag_variable_types] = self._buffer.read_ndarray( - position, n_airbag_variables * self.header.wordsize, 1, self._header.itype - ) - position += n_airbag_variables * self.header.wordsize - - # airbag variable names - # every word is an ascii char - airbag_variable_names = [] - var_width = 8 - - for i_variable in range(n_airbag_variables): - name = self._buffer.read_text( - position + (i_variable * var_width) * self.header.wordsize, - var_width * self.header.wordsize, - ) - airbag_variable_names.append(name[:: self.header.wordsize]) - - self.arrays[ArrayType.airbag_variable_names] = airbag_variable_names - position += n_airbag_variables * var_width * self.header.wordsize - - except Exception: - # print info - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_particle_data", trb_msg) - - # fix position - position = original_position + blocksize - - # update position marker - self.geometry_section_size = position - LOGGER.debug("_read_particle_data start at byte %d", self.geometry_section_size) - - # pylint: disable = too-many-branches - def _read_geometry_data(self): - """Read the data from the geometry section""" - - if not self._buffer: - return - - LOGGER.debug("_read_geometry_data start at byte %d", self.geometry_section_size) - - # not sure but I think never used by LS-Dyna - # anyway needs to be detected in the header and not here, - # though it is mentioned in this section of the database manual - # - # is_packed = True if self.header['ndim'] == 3 else False - # if is_packed: - # raise RuntimeError("Can not deal with packed "\ - # "geometry data (ndim == {}).".format(self.header['ndim'])) - - position = self.geometry_section_size - - # node coords - n_nodes = self.header.n_nodes - n_dimensions = self.header.n_dimensions - section_word_length = n_dimensions * n_nodes - try: - node_coordinates = self._buffer.read_ndarray( - position, section_word_length * self.header.wordsize, 1, self.header.ftype - ).reshape((n_nodes, n_dimensions)) - self.arrays[ArrayType.node_coordinates] = node_coordinates - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %d was caught:\n%s" - LOGGER.warning(msg, "_read_geometry_data, node_coordinates", trb_msg) - finally: - position += section_word_length * self.header.wordsize - - # solid data - n_solids = self.header.n_solids - section_word_length = 9 * n_solids - try: - elem_solid_data = self._buffer.read_ndarray( - position, section_word_length * self.header.wordsize, 1, self._header.itype - ).reshape((n_solids, 9)) - solid_connectivity = elem_solid_data[:, :8] - solid_part_indexes = elem_solid_data[:, 8] - self.arrays[ArrayType.element_solid_node_indexes] = solid_connectivity - FORTRAN_OFFSET - self.arrays[ArrayType.element_solid_part_indexes] = solid_part_indexes - FORTRAN_OFFSET - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_geometry_data, solids_geometry", trb_msg) - finally: - position += section_word_length * self.header.wordsize - - # ten node solids extra nodes - if self.header.has_solid_2_extra_nodes: - section_word_length = 2 * n_solids - try: - self.arrays[ArrayType.element_solid_extra_nodes] = elem_solid_data = ( - self._buffer.read_ndarray( - position, section_word_length * self.header.wordsize, 1, self._header.itype - ).reshape((n_solids, 2)) - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_geometry_data, ten_node_solids", trb_msg) - finally: - position += section_word_length * self.header.wordsize - - # 8 node thick shells - n_thick_shells = self.header.n_thick_shells - section_word_length = 9 * n_thick_shells - try: - elem_tshell_data = self._buffer.read_ndarray( - position, section_word_length * self.header.wordsize, 1, self._header.itype - ).reshape((self.header.n_thick_shells, 9)) - self.arrays[ArrayType.element_tshell_node_indexes] = ( - elem_tshell_data[:, :8] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_tshell_part_indexes] = ( - elem_tshell_data[:, 8] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_geometry_data, tshells_geometry", trb_msg) - finally: - position += section_word_length * self.header.wordsize - - # beams - n_beams = self.header.n_beams - section_word_length = 6 * n_beams - try: - elem_beam_data = self._buffer.read_ndarray( - position, section_word_length * self.header.wordsize, 1, self._header.itype - ).reshape((n_beams, 6)) - self.arrays[ArrayType.element_beam_part_indexes] = elem_beam_data[:, 5] - FORTRAN_OFFSET - self.arrays[ArrayType.element_beam_node_indexes] = ( - elem_beam_data[:, :5] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_geometry_data, beams_geometry", trb_msg) - finally: - position += section_word_length * self.header.wordsize - - # shells - n_shells = self.header.n_shells - section_word_length = 5 * n_shells - try: - elem_shell_data = self._buffer.read_ndarray( - position, section_word_length * self.header.wordsize, 1, self._header.itype - ).reshape((self.header.n_shells, 5)) - self.arrays[ArrayType.element_shell_node_indexes] = ( - elem_shell_data[:, :4] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_shell_part_indexes] = ( - elem_shell_data[:, 4] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_geometry_data, shells_geometry", trb_msg) - finally: - position += section_word_length * self.header.wordsize - - # update word position - self.geometry_section_size = position - - LOGGER.debug("_read_geometry_data end at byte %d", self.geometry_section_size) - - def _read_user_ids(self): - if not self._buffer: - return - - if not self.header.has_numbering_section: - self.arrays[ArrayType.node_ids] = np.arange( - FORTRAN_OFFSET, self.header.n_nodes + FORTRAN_OFFSET, dtype=self.header.itype - ) - self.arrays[ArrayType.element_solid_ids] = np.arange( - FORTRAN_OFFSET, self.header.n_solids + FORTRAN_OFFSET, dtype=self.header.itype - ) - self.arrays[ArrayType.element_beam_ids] = np.arange( - FORTRAN_OFFSET, self.header.n_beams + FORTRAN_OFFSET, dtype=self.header.itype - ) - self.arrays[ArrayType.element_shell_ids] = np.arange( - FORTRAN_OFFSET, self.header.n_shells + FORTRAN_OFFSET, dtype=self.header.itype - ) - self.arrays[ArrayType.element_tshell_ids] = np.arange( - FORTRAN_OFFSET, self.header.n_thick_shells + FORTRAN_OFFSET, dtype=self.header.itype - ) - self.arrays[ArrayType.part_ids] = np.arange( - FORTRAN_OFFSET, self.header.n_parts + FORTRAN_OFFSET, dtype=self.header.itype - ) - return - - LOGGER.debug("_read_user_ids start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - # safety - original_position = position - blocksize = self.header.raw_header["narbs"] * self.header.wordsize - - try: - numbering_words = { - "nsort": (position, self._header.itype), - "nsrh": (position + 1 * self.header.wordsize, self._header.itype), - "nsrb": (position + 2 * self.header.wordsize, self._header.itype), - "nsrs": (position + 3 * self.header.wordsize, self._header.itype), - "nsrt": (position + 4 * self.header.wordsize, self._header.itype), - "nsortd": (position + 5 * self.header.wordsize, self._header.itype), - "nsrhd": (position + 6 * self.header.wordsize, self._header.itype), - "nsrbd": (position + 7 * self.header.wordsize, self._header.itype), - "nsrsd": (position + 8 * self.header.wordsize, self._header.itype), - "nsrtd": (position + 9 * self.header.wordsize, self._header.itype), - } - - extra_numbering_words = { - "nsrma": (position + 10 * self.header.wordsize, self._header.itype), - "nsrmu": (position + 11 * self.header.wordsize, self._header.itype), - "nsrmp": (position + 12 * self.header.wordsize, self._header.itype), - "nsrtm": (position + 13 * self.header.wordsize, self._header.itype), - "numrbs": (position + 14 * self.header.wordsize, self._header.itype), - "nmmat": (position + 15 * self.header.wordsize, self._header.itype), - } - - numbering_header = self.header.read_words(self._buffer, numbering_words) - position += len(numbering_words) * self.header.wordsize - - # let's make life easier - info = self._numbering_info - - # transfer first bunch - info.ptr_node_ids = abs(numbering_header["nsort"]) - info.has_material_ids = numbering_header["nsort"] < 0 - info.ptr_solid_ids = numbering_header["nsrh"] - info.ptr_beam_ids = numbering_header["nsrb"] - info.ptr_shell_ids = numbering_header["nsrs"] - info.ptr_thick_shell_ids = numbering_header["nsrt"] - info.n_nodes = numbering_header["nsortd"] - info.n_solids = numbering_header["nsrhd"] - info.n_beams = numbering_header["nsrbd"] - info.n_shells = numbering_header["nsrsd"] - info.n_thick_shells = numbering_header["nsrtd"] - - if info.has_material_ids: - # read extra header - self.header.read_words(self._buffer, extra_numbering_words, numbering_header) - position += len(extra_numbering_words) * self.header.wordsize - - # transfer more - info.ptr_material_ids = numbering_header["nsrma"] - info.ptr_material_ids_defined_order = numbering_header["nsrmu"] - info.ptr_material_ids_crossref = numbering_header["nsrmp"] - info.n_parts = numbering_header["nsrtm"] - info.n_rigid_bodies = numbering_header["numrbs"] - info.n_parts2 = numbering_header["nmmat"] - else: - info.n_parts = self.header.n_parts - - # let's do a quick check - n_words_computed = ( - len(numbering_header) - + info.n_nodes - + info.n_shells - + info.n_beams - + info.n_solids - + info.n_thick_shells - + info.n_parts * 3 - ) - if n_words_computed != self.header.n_numbering_section_words: - warn_msg = ( - "ID section: The computed word count does " - "not match the header word count: %d != %d." - " The ID arrays might contain errors." - ) - LOGGER.warning(warn_msg, n_words_computed, self.header.n_numbering_section_words) - # node ids - array_length = info.n_nodes * self.header.wordsize - self.arrays[ArrayType.node_ids] = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - position += array_length - # solid ids - array_length = info.n_solids * self.header.wordsize - self.arrays[ArrayType.element_solid_ids] = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - position += array_length - # beam ids - array_length = info.n_beams * self.header.wordsize - self.arrays[ArrayType.element_beam_ids] = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - position += array_length - # shell ids - array_length = info.n_shells * self.header.wordsize - self.arrays[ArrayType.element_shell_ids] = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - position += array_length - # tshell ids - array_length = info.n_thick_shells * self.header.wordsize - self.arrays[ArrayType.element_tshell_ids] = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - position += array_length - - # part ids - # - # this makes no sense but materials are output three times at this section - # but the length of the array (nmmat) is only output if nsort < 0. In - # the other case the length is unknown ... - # - # Bugfix: - # The material arrays (three times) are always output, even if nsort < 0 - # which means they are not used. Quite confusing, especially since nmmat - # is output in the main header and numbering header. - # - if "nmmat" in numbering_header: - if info.n_parts != self.header.n_parts: - err_msg = ( - "nmmat in the file header (%d) and in the " - "numbering header (%d) are inconsistent." - ) - raise RuntimeError(err_msg, self.header.n_parts, info.n_parts) - - array_length = info.n_parts * self.header.wordsize - - self.arrays[ArrayType.part_ids] = self._buffer.read_ndarray( - position, info.n_parts * self.header.wordsize, 1, self._header.itype - ) - position += info.n_parts * self.header.wordsize - - self.arrays[ArrayType.part_ids_unordered] = self._buffer.read_ndarray( - position, info.n_parts * self.header.wordsize, 1, self._header.itype - ) - position += info.n_parts * self.header.wordsize - - self.arrays[ArrayType.part_ids_cross_references] = self._buffer.read_ndarray( - position, info.n_parts * self.header.wordsize, 1, self._header.itype - ) - position += info.n_parts * self.header.wordsize - - else: - position += 3 * self.header.n_parts * self.header.wordsize - - except Exception: - # print info - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_user_ids", trb_msg) - - # fix position - position = original_position + blocksize - - # update position - self.geometry_section_size = position - LOGGER.debug("_read_user_ids end at byte %d", self.geometry_section_size) - - def _read_rigid_body_description(self): - """Read the rigid body description section""" - - if not self._buffer: - return - - if not self.header.has_rigid_body_data: - return - - LOGGER.debug("_read_rigid_body_description start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - rigid_body_description_header = { - "nrigid": self._buffer.read_number(position, self._header.itype) - } - position += self.header.wordsize - - info = self._rigid_body_info - info.n_rigid_bodies = rigid_body_description_header["nrigid"] - - rigid_bodies: list[RigidBodyMetadata] = [] - for _ in range(info.n_rigid_bodies): - rigid_body_info = { - # rigid body part internal number - "mrigid": self._buffer.read_number(position, self._header.itype), - # number of nodes in rigid body - "numnodr": self._buffer.read_number( - position + self.header.wordsize, self._header.itype - ), - } - position += 2 * self.header.wordsize - - # internal node number of rigid body - array_length = rigid_body_info["numnodr"] * self.header.wordsize - rigid_body_info["noder"] = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - position += array_length - - # number of active (non-rigid) nodes - rigid_body_info["numnoda"] = self._buffer.read_number(position, self._header.itype) - position += self.header.wordsize - - # internal node numbers of active nodes - array_length = rigid_body_info["numnoda"] * self.header.wordsize - rigid_body_info["nodea"] = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - position += array_length - - # transfer props - body_metadata = RigidBodyMetadata( - internal_number=rigid_body_info["mrigid"], - n_nodes=rigid_body_info["numnodr"], - node_indexes=rigid_body_info["noder"], - n_active_nodes=rigid_body_info["numnoda"], - active_node_indexes=rigid_body_info["nodea"], - ) - - # append to list - rigid_bodies.append(body_metadata) - - # save rigid body info to header - info.rigid_body_metadata_list = rigid_bodies - - # save arrays - rigid_body_n_nodes = [] - rigid_body_part_indexes = [] - rigid_body_n_active_nodes = [] - rigid_body_node_indexes_list = [] - rigid_body_active_node_indexes_list = [] - for rigid_body_info in rigid_bodies: - rigid_body_part_indexes.append(rigid_body_info.internal_number) - rigid_body_n_nodes.append(rigid_body_info.n_nodes) - rigid_body_node_indexes_list.append(rigid_body_info.node_indexes - FORTRAN_OFFSET) - rigid_body_n_active_nodes.append(rigid_body_info.n_active_nodes) - rigid_body_active_node_indexes_list.append( - rigid_body_info.active_node_indexes - FORTRAN_OFFSET - ) - - self.arrays[ArrayType.rigid_body_part_indexes] = ( - np.array(rigid_body_part_indexes, dtype=self._header.itype) - FORTRAN_OFFSET - ) - self.arrays[ArrayType.rigid_body_n_nodes] = np.array( - rigid_body_n_nodes, dtype=self._header.itype - ) - self.arrays[ArrayType.rigid_body_n_active_nodes] = np.array( - rigid_body_n_active_nodes, dtype=self._header.itype - ) - self.arrays[ArrayType.rigid_body_node_indexes_list] = rigid_body_node_indexes_list - self.arrays[ArrayType.rigid_body_active_node_indexes_list] = ( - rigid_body_active_node_indexes_list - ) - - # update position - self.geometry_section_size = position - LOGGER.debug("_read_rigid_body_description end at byte %d", self.geometry_section_size) - - def _read_sph_node_and_material_list(self): - """Read SPH node and material list""" - - if not self._buffer: - return - - if self.header.n_sph_nodes <= 0: - return - - LOGGER.debug( - "_read_sph_node_and_material_list start at byte %d", self.geometry_section_size - ) - - position = self.geometry_section_size - - array_length = self.header.n_sph_nodes * self.header.wordsize * 2 - try: - # read info array - sph_node_matlist = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_sph_nodes, 2)) - - # save array - self.arrays[ArrayType.sph_node_indexes] = sph_node_matlist[:, 0] - FORTRAN_OFFSET - self.arrays[ArrayType.sph_node_material_index] = sph_node_matlist[:, 1] - FORTRAN_OFFSET - - except Exception: - # print info - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_sph_node_and_material_list", trb_msg) - - finally: - # update position - self.geometry_section_size += array_length - - LOGGER.debug("_read_sph_node_and_material_list end at byte %d", self.geometry_section_size) - - def _read_particle_geometry_data(self): - """Read the particle geometry data""" - - if not self._buffer: - return - - if "npefg" not in self.header.raw_header: - return - - if self.header.raw_header["npefg"] <= 0: - return - - LOGGER.debug("_read_particle_geometry_data start at byte %d", self.geometry_section_size) - - info = self._airbag_info - - position = self.geometry_section_size - - # size of geometry section checking - ngeom = info.n_geometric_variables - if ngeom not in [4, 5]: - raise RuntimeError("variable ngeom in the airbag header must be 4 or 5.") - - original_position = position - blocksize = info.n_airbags * ngeom * self.header.wordsize - try: - # extract geometry as a single array - array_length = blocksize - particle_geom_data = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((info.n_airbags, ngeom)) - position += array_length - - # store arrays - self.arrays[ArrayType.airbags_first_particle_id] = particle_geom_data[:, 0] - self.arrays[ArrayType.airbags_n_particles] = particle_geom_data[:, 1] - self.arrays[ArrayType.airbags_ids] = particle_geom_data[:, 2] - self.arrays[ArrayType.airbags_n_gas_mixtures] = particle_geom_data[:, 3] - if ngeom == 5: - self.arrays[ArrayType.airbags_n_chambers] = particle_geom_data[:, 4] - - except Exception: - # print info - trb_msg = traceback.format_exc() - msg = "A failure in %d was caught:\n%s" - LOGGER.warning(msg, "_read_particle_geometry_data", trb_msg) - - # fix position - position = original_position + blocksize - - # update position - self.geometry_section_size = position - - LOGGER.debug("_read_particle_geometry_data end at byte %d", self.geometry_section_size) - - def _read_rigid_road_surface(self): - """Read rigid road surface data""" - - if not self._buffer: - return - - if not self.header.has_rigid_road_surface: - return - - LOGGER.debug("_read_rigid_road_surface start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - # read header - rigid_road_surface_words = { - "nnode": (position, self._header.itype), - "nseg": (position + 1 * self.header.wordsize, self._header.itype), - "nsurf": (position + 2 * self.header.wordsize, self._header.itype), - "motion": (position + 3 * self.header.wordsize, self._header.itype), - } - - rigid_road_header = self.header.read_words(self._buffer, rigid_road_surface_words) - position += 4 * self.header.wordsize - - self._rigid_road_info = RigidRoadInfo( - n_nodes=rigid_road_header["nnode"], - n_roads=rigid_road_header["nsurf"], - n_road_segments=rigid_road_header["nseg"], - motion=rigid_road_header["motion"], - ) - info = self._rigid_road_info - - # node ids - array_length = info.n_nodes * self.header.wordsize - rigid_road_node_ids = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ) - self.arrays[ArrayType.rigid_road_node_ids] = rigid_road_node_ids - position += array_length - - # node xyz - array_length = info.n_nodes * 3 * self.header.wordsize - rigid_road_node_coords = self._buffer.read_ndarray( - position, array_length, 1, self.header.ftype - ).reshape((info.n_nodes, 3)) - self.arrays[ArrayType.rigid_road_node_coordinates] = rigid_road_node_coords - position += array_length - - # read road segments - # Warning: must be copied - rigid_road_ids = np.empty(info.n_roads, dtype=self._header.itype) - rigid_road_nsegments = np.empty(info.n_roads, dtype=self._header.itype) - rigid_road_segment_node_ids = [] - - # this array is created since the array database requires - # constant sized arrays, and we dump all segments into one - # array. In order to distinguish which segment - # belongs to which road, this new array keeps track of it - rigid_road_segment_road_id = [] - - # n_total_segments = 0 - for i_surf in range(info.n_roads): - # surface id - surf_id = self._buffer.read_number(position, self._header.itype) # type: ignore - position += self.header.wordsize - rigid_road_ids[i_surf] = surf_id - - # number of segments of surface - surf_nseg = self._buffer.read_number( - position + 1 * self.header.wordsize, self._header.itype - ) # type: ignore - position += self.header.wordsize - rigid_road_nsegments[i_surf] = surf_nseg - - # count total segments - # n_total_segments += surf_nseg - - # node ids of surface segments - array_length = 4 * surf_nseg * self.header.wordsize - surf_segm_node_ids = self._buffer.read_ndarray( - position, # type: ignore - array_length, # type: ignore - 1, - self._header.itype, - ).reshape((surf_nseg, 4)) - position += array_length - rigid_road_segment_node_ids.append(surf_segm_node_ids) - - # remember road id for segments - rigid_road_segment_road_id += [surf_id] * surf_nseg - - # save arrays - self.arrays[ArrayType.rigid_road_ids] = rigid_road_ids - self.arrays[ArrayType.rigid_road_n_segments] = rigid_road_nsegments - self.arrays[ArrayType.rigid_road_segment_node_ids] = np.concatenate( - rigid_road_segment_node_ids - ) - self.arrays[ArrayType.rigid_road_segment_road_id] = np.asarray(rigid_road_segment_road_id) - - # update position - self.geometry_section_size = position - LOGGER.debug("_read_rigid_road_surface end at byte %d", self.geometry_section_size) - - # pylint: disable = too-many-branches - def _read_extra_node_connectivity(self): - """Read the extra node data for creepy elements""" - - if not self._buffer: - return - - LOGGER.debug("_read_extra_node_connectivity start at byte %d", self.geometry_section_size) - - position = self.geometry_section_size - - # extra 2 node connectivity for 10 node tetrahedron elements - if self.header.has_solid_2_extra_nodes: - array_length = 2 * self.header.n_solids * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids, 2)) - self.arrays[ArrayType.element_solid_node10_extra_node_indexes] = ( - array - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid10", trb_msg) - finally: - position += array_length - - # 8 node shell elements - if self.header.n_shells_8_nodes > 0: - array_length = 5 * self.header.n_shells_8_nodes * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_shells_8_nodes, 5)) - self.arrays[ArrayType.element_shell_node8_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_shell_node8_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, shell8", trb_msg) - finally: - position += array_length - - # 20 node solid elements - if self.header.n_solids_20_node_hexas > 0: - array_length = 13 * self.header.n_solids_20_node_hexas * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids_20_node_hexas, 13)) - self.arrays[ArrayType.element_solid_node20_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_solid_node20_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid20", trb_msg) - finally: - position += array_length - - # 27 node solid hexas - if ( - self.header.n_solids_27_node_hexas > 0 - and self.header.quadratic_elems_has_full_connectivity - ): - array_length = 28 * self.header.n_solids_27_node_hexas * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids_27_node_hexas, 28)) - self.arrays[ArrayType.element_solid_node27_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_solid_node27_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid27", trb_msg) - finally: - position += array_length - - # 21 node solid pentas - if ( - self.header.n_solids_21_node_pentas > 0 - and self.header.quadratic_elems_has_full_connectivity - ): - array_length = 22 * self.header.n_solids_21_node_pentas * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids_21_node_pentas, 22)) - self.arrays[ArrayType.element_solid_node21_penta_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_solid_node21_penta_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid21p", trb_msg) - finally: - position += array_length - - # 15 node solid tetras - if ( - self.header.n_solids_15_node_tetras > 0 - and self.header.quadratic_elems_has_full_connectivity - ): - # manual says 8 but this seems odd - array_length = 8 * self.header.n_solids_15_node_tetras * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids_15_node_tetras, 8)) - self.arrays[ArrayType.element_solid_node15_tetras_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_solid_node15_tetras_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid15t", trb_msg) - finally: - position += array_length - - # 20 node solid tetras - if self.header.n_solids_20_node_tetras > 0 and self.header.has_cubic_solids: - array_length = 21 * self.header.n_solids_20_node_tetras * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids_20_node_tetras, 21)) - self.arrays[ArrayType.element_solid_node20_tetras_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_solid_node20_tetras_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid20t", trb_msg) - finally: - position += array_length - - # 40 node solid tetras - if self.header.n_solids_40_node_pentas > 0 and self.header.has_cubic_solids: - array_length = 41 * self.header.n_solids_40_node_pentas * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids_40_node_pentas, 41)) - self.arrays[ArrayType.element_solid_node40_pentas_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_solid_node40_pentas_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid40t", trb_msg) - finally: - position += array_length - - # 64 node solid tetras - if self.header.n_solids_64_node_hexas > 0 and self.header.has_cubic_solids: - array_length = 65 * self.header.n_solids_64_node_hexas * self.header.wordsize - try: - array = self._buffer.read_ndarray( - position, array_length, 1, self._header.itype - ).reshape((self.header.n_solids_64_node_hexas, 65)) - self.arrays[ArrayType.element_solid_node64_hexas_element_index] = ( - array[:, 0] - FORTRAN_OFFSET - ) - self.arrays[ArrayType.element_solid_node64_hexas_extra_node_indexes] = ( - array[:, 1:] - FORTRAN_OFFSET - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_extra_node_connectivity, solid64t", trb_msg) - finally: - position += array_length - - # update position - self.geometry_section_size = position - - LOGGER.debug("_read_extra_node_connectivity end at byte %d", self.geometry_section_size) - - # pylint: disable = too-many-branches - @classmethod - def _read_header_part_contact_interface_titles( - cls, - header: D3plotHeader, - buffer: Union[BinaryBuffer, None], - geometry_section_size: int, - arrays: dict, - ) -> int: - """Read the header for the parts, contacts and interfaces - - Parameters - ---------- - header: D3plotHeader - d3plot header - bb: BinaryBuffer - buffer holding geometry - geometry_section_size: int - size of the geometry section until now - arrays: dict - dictionary holding arrays and where arrays will be saved into - - Returns - ------- - geometry_section_size: int - new size of the geometry section - """ - - if not buffer: - return geometry_section_size - - if header.filetype not in ( - D3plotFiletype.D3PLOT, - D3plotFiletype.D3PART, - D3plotFiletype.INTFOR, - ): - return geometry_section_size - - LOGGER.debug( - "_read_header_part_contact_interface_titles start at byte %d", geometry_section_size - ) - - position = geometry_section_size - - # Security - # - # we try to read the titles ahead. If dyna writes multiple files - # then the first file is geometry only thus failing here has no - # impact on further state reading. - # If though states are compressed into the first file then we are - # in trouble here even when catching here. - try: - # there is only output if there is an eof marker - # at least I think I fixed such a bug in the past - if not cls._is_end_of_file_marker(buffer, position, header.ftype): - return geometry_section_size - - position += header.wordsize - - # section have types here according to what is inside - ntypes = [] - - # read first ntype - current_ntype = buffer.read_number(position, header.itype) - - while current_ntype in [90000, 90001, 90002, 90020]: - # title output - if current_ntype == 90000: - ntypes.append(current_ntype) - position += header.wordsize - - # Bugfix: - # the titles are always 18*4 bytes, even if the wordsize - # is 8 bytes for the entire file. - titles_wordsize = 4 - - array_length = 18 * titles_wordsize - header.title2 = buffer.read_text(position, array_length) - position += array_length - - # some title output - elif current_ntype in [90001, 90002, 90020]: - ntypes.append(current_ntype) - position += header.wordsize - - # number of parts - entry_count = buffer.read_number(position, header.itype) - position += header.wordsize - - # Bugfix: - # the titles are always 18*4 bytes, even if the wordsize - # is 8 bytes for the entire file. - titles_wordsize = 4 - - # part ids and corresponding titles - array_type = np.dtype([ - ("ids", header.itype), - ("titles", "S" + str(18 * titles_wordsize)), - ]) - array_length = (header.wordsize + 18 * titles_wordsize) * int(entry_count) - tmp_arrays = buffer.read_ndarray(position, array_length, 1, array_type) - position += array_length - - # save stuff - if current_ntype == 90001: - arrays[ArrayType.part_titles_ids] = tmp_arrays["ids"] - arrays[ArrayType.part_titles] = tmp_arrays["titles"] - elif current_ntype == 90002: - arrays[ArrayType.contact_title_ids] = tmp_arrays["ids"] - arrays[ArrayType.contact_titles] = tmp_arrays["titles"] - elif current_ntype == 90020: - arrays["icfd_part_title_ids"] = tmp_arrays["ids"] - arrays["icfd_part_titles"] = tmp_arrays["titles"] - - # d3prop - elif current_ntype == 90100: - ntypes.append(current_ntype) - position += header.wordsize - - # number of keywords - nline = buffer.read_number(position, header.itype) - position += header.wordsize - - # Bugfix: - # the titles are always 18*4 bytes, even if the wordsize - # is 8 bytes for the entire file. - titles_wordsize = 4 - - # keywords - array_length = 20 * titles_wordsize * int(nline) - d3prop_keywords = buffer.read_ndarray( - position, array_length, 1, np.dtype("S" + str(titles_wordsize * 20)) - ) - position += array_length - - # save - arrays["d3prop_keywords"] = d3prop_keywords - - # not sure whether there is an eof file here - # do not have a test file to check ... - if cls._is_end_of_file_marker(buffer, position, header.ftype): - position += header.wordsize - - # next one - if buffer.size <= position: - break - current_ntype = buffer.read_number(position, header.itype) - - header.n_types = tuple(ntypes) - - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_header_part_contact_interface_titles", trb_msg) - - # remember position - geometry_section_size = position - LOGGER.debug( - "_read_header_part_contact_interface_titles end at byte %d", geometry_section_size - ) - - return geometry_section_size - - @staticmethod - def _read_states_allocate_arrays( - header: D3plotHeader, - material_section_info: MaterialSectionInfo, - airbag_info: AirbagInfo, - rigid_road_info: RigidRoadInfo, - rigid_body_info: RigidBodyInfo, - n_states: int, - n_rigid_walls: int, - n_parts: int, - array_names: Union[Iterable[str], None], - array_dict: dict, - ) -> None: - """Allocate the state arrays - - Parameters - ---------- - header: D3plotHeader - header of the d3plot - material_section_info: MaterialSectionInfo - info about the material section data - airbag_info: AirbagInfo - info for airbags - rigid_road_info: RigidRoadInfo - info for rigid roads - rigid_body_info: RigidBodyInfo - info for rigid bodies - n_states: int - number of states to allocate memory for - n_rigid_walls: int - number of rigid walls - n_parts: int - number of parts - array_names: Union[Iterable[str], None] - names of state arrays to allocate (all if None) - array_dict: dict - dictionary to allocate arrays into - """ - - # (1) ARRAY SHAPES - # general - n_dim = header.n_dimensions - # nodes - n_nodes = header.n_nodes - # solids - n_solids = header.n_solids - n_solids_thermal_vars = header.n_solid_thermal_vars - n_solids_strain_vars = 6 * header.has_element_strain * (header.n_solid_history_vars >= 6) - n_solid_thermal_strain_vars = 6 * header.has_solid_shell_thermal_strain_tensor - n_solid_plastic_strain_vars = 6 * header.has_solid_shell_plastic_strain_tensor - n_solid_layers = header.n_solid_layers - n_solids_history_vars = ( - header.n_solid_history_vars - - n_solids_strain_vars - - n_solid_thermal_strain_vars - - n_solid_plastic_strain_vars - ) - # thick shells - n_tshells = header.n_thick_shells - n_tshells_history_vars = header.n_shell_tshell_history_vars - n_tshells_layers = header.n_shell_tshell_layers - # beams - n_beams = header.n_beams - n_beams_history_vars = header.n_beam_history_vars - n_beam_vars = header.n_beam_vars - n_beams_layers = max( - int((-3 * n_beams_history_vars + n_beam_vars - 6) / (n_beams_history_vars + 5)), 0 - ) - # shells - n_shells = header.n_shells - n_shells_reduced = header.n_shells - material_section_info.n_rigid_shells - n_shell_layers = header.n_shell_tshell_layers - n_shell_history_vars = header.n_shell_tshell_history_vars - # sph - allocate_sph = header.n_sph_nodes != 0 - n_sph_particles = header.n_sph_nodes if allocate_sph else 0 - # airbags - allocate_airbags = header.n_airbags != 0 - n_airbags = header.n_airbags if allocate_airbags else 0 - n_airbag_particles = airbag_info.n_particles if allocate_airbags else 0 - # rigid roads - allocate_rigid_roads = rigid_road_info.n_roads != 0 - n_roads = rigid_road_info.n_roads if allocate_rigid_roads else 0 - # rigid bodies - n_rigid_bodies = rigid_body_info.n_rigid_bodies - - # dictionary to lookup array types - state_array_shapes = { - # global - ArrayType.global_timesteps: [n_states], - ArrayType.global_kinetic_energy: [n_states], - ArrayType.global_internal_energy: [n_states], - ArrayType.global_total_energy: [n_states], - ArrayType.global_velocity: [n_states, 3], - # parts - ArrayType.part_internal_energy: [n_states, n_parts], - ArrayType.part_kinetic_energy: [n_states, n_parts], - ArrayType.part_velocity: [n_states, n_parts, 3], - ArrayType.part_mass: [n_states, n_parts], - ArrayType.part_hourglass_energy: [n_states, n_parts], - # rigid wall - ArrayType.rigid_wall_force: [n_states, n_rigid_walls], - ArrayType.rigid_wall_position: [n_states, n_rigid_walls, 3], - # nodes - ArrayType.node_temperature: ( - [n_states, n_nodes, 3] - if header.has_node_temperature_layers - else [n_states, n_nodes] - ), - ArrayType.node_heat_flux: [n_states, n_nodes, 3], - ArrayType.node_mass_scaling: [n_states, n_nodes], - ArrayType.node_displacement: [n_states, n_nodes, n_dim], - ArrayType.node_velocity: [n_states, n_nodes, n_dim], - ArrayType.node_acceleration: [n_states, n_nodes, n_dim], - ArrayType.node_temperature_gradient: [n_states, n_nodes], - ArrayType.node_residual_forces: [n_states, n_nodes, 3], - ArrayType.node_residual_moments: [n_states, n_nodes, 3], - # solids - ArrayType.element_solid_thermal_data: [n_states, n_solids, n_solids_thermal_vars], - ArrayType.element_solid_stress: [n_states, n_solids, n_solid_layers, 6], - ArrayType.element_solid_effective_plastic_strain: [n_states, n_solids, n_solid_layers], - ArrayType.element_solid_history_variables: [ - n_states, - n_solids, - n_solid_layers, - n_solids_history_vars, - ], - ArrayType.element_solid_strain: [n_states, n_solids, n_solid_layers, 6], - ArrayType.element_solid_is_alive: [n_states, n_solids], - ArrayType.element_solid_plastic_strain_tensor: [n_states, n_solids, n_solid_layers, 6], - ArrayType.element_solid_thermal_strain_tensor: [n_states, n_solids, n_solid_layers, 6], - # thick shells - ArrayType.element_tshell_stress: [n_states, n_tshells, n_tshells_layers, 6], - ArrayType.element_tshell_effective_plastic_strain: [ - n_states, - n_tshells, - n_tshells_layers, - ], - ArrayType.element_tshell_history_variables: [ - n_states, - n_tshells, - n_tshells_layers, - n_tshells_history_vars, - ], - ArrayType.element_tshell_strain: [n_states, n_tshells, 2, 6], - ArrayType.element_tshell_is_alive: [n_states, n_tshells], - # beams - ArrayType.element_beam_axial_force: [n_states, n_beams], - ArrayType.element_beam_shear_force: [n_states, n_beams, 2], - ArrayType.element_beam_bending_moment: [n_states, n_beams, 2], - ArrayType.element_beam_torsion_moment: [n_states, n_beams], - ArrayType.element_beam_shear_stress: [n_states, n_beams, n_beams_layers, 2], - ArrayType.element_beam_axial_stress: [n_states, n_beams, n_beams_layers], - ArrayType.element_beam_plastic_strain: [n_states, n_beams, n_beams_layers], - ArrayType.element_beam_axial_strain: [n_states, n_beams, n_beams_layers], - ArrayType.element_beam_history_vars: [ - n_states, - n_beams, - n_beams_layers + 3, - n_beams_history_vars, - ], - ArrayType.element_beam_is_alive: [n_states, n_beams], - # shells - ArrayType.element_shell_stress: [n_states, n_shells_reduced, n_shell_layers, 6], - ArrayType.element_shell_effective_plastic_strain: [ - n_states, - n_shells_reduced, - n_shell_layers, - ], - ArrayType.element_shell_history_vars: [ - n_states, - n_shells_reduced, - n_shell_layers, - n_shell_history_vars, - ], - ArrayType.element_shell_bending_moment: [n_states, n_shells_reduced, 3], - ArrayType.element_shell_shear_force: [n_states, n_shells_reduced, 2], - ArrayType.element_shell_normal_force: [n_states, n_shells_reduced, 3], - ArrayType.element_shell_thickness: [n_states, n_shells_reduced], - ArrayType.element_shell_unknown_variables: [n_states, n_shells_reduced, 2], - ArrayType.element_shell_internal_energy: [n_states, n_shells_reduced], - ArrayType.element_shell_strain: [n_states, n_shells_reduced, 2, 6], - ArrayType.element_shell_thermal_strain_tensor: [n_states, n_shells_reduced, 6], - ArrayType.element_shell_plastic_strain_tensor: [ - n_states, - n_shells_reduced, - n_shell_layers, - 6, - ], - ArrayType.element_shell_is_alive: [n_states, n_shells], - # sph - ArrayType.sph_deletion: [n_states, n_sph_particles], - ArrayType.sph_radius: [n_states, n_sph_particles], - ArrayType.sph_pressure: [n_states, n_sph_particles], - ArrayType.sph_stress: [n_states, n_sph_particles, 6], - ArrayType.sph_effective_plastic_strain: [n_states, n_sph_particles], - ArrayType.sph_density: [n_states, n_sph_particles], - ArrayType.sph_internal_energy: [n_states, n_sph_particles], - ArrayType.sph_n_neighbors: [n_states, n_sph_particles], - ArrayType.sph_strain: [n_states, n_sph_particles, 6], - ArrayType.sph_mass: [n_states, n_sph_particles], - # airbag - ArrayType.airbag_n_active_particles: [n_states, n_airbags], - ArrayType.airbag_bag_volume: [n_states, n_airbags], - ArrayType.airbag_particle_gas_id: [n_states, n_airbag_particles], - ArrayType.airbag_particle_chamber_id: [n_states, n_airbag_particles], - ArrayType.airbag_particle_leakage: [n_states, n_airbag_particles], - ArrayType.airbag_particle_mass: [n_states, n_airbag_particles], - ArrayType.airbag_particle_radius: [n_states, n_airbag_particles], - ArrayType.airbag_particle_spin_energy: [n_states, n_airbag_particles], - ArrayType.airbag_particle_translation_energy: [n_states, n_airbag_particles], - ArrayType.airbag_particle_nearest_segment_distance: [n_states, n_airbag_particles], - ArrayType.airbag_particle_position: [n_states, n_airbag_particles, 3], - ArrayType.airbag_particle_velocity: [n_states, n_airbag_particles, 3], - # rigid road - ArrayType.rigid_road_displacement: [n_states, n_roads, 3], - ArrayType.rigid_road_velocity: [n_states, n_roads, 3], - # rigid body - ArrayType.rigid_body_coordinates: [n_states, n_rigid_bodies, 3], - ArrayType.rigid_body_rotation_matrix: [n_states, n_rigid_bodies, 9], - ArrayType.rigid_body_velocity: [n_states, n_rigid_bodies, 3], - ArrayType.rigid_body_rot_velocity: [n_states, n_rigid_bodies, 3], - ArrayType.rigid_body_acceleration: [n_states, n_rigid_bodies, 3], - ArrayType.rigid_body_rot_acceleration: [n_states, n_rigid_bodies, 3], - } - - # only allocate available arrays - if array_names is None: - array_names = ArrayType.get_state_array_names() - - # BUGFIX - # These arrays are actually integer types, all other state arrays - # are floats - int_state_arrays = [ - ArrayType.airbag_n_active_particles, - ArrayType.airbag_particle_gas_id, - ArrayType.airbag_particle_chamber_id, - ArrayType.airbag_particle_leakage, - ] - - # (2) ALLOCATE ARRAYS - # this looper allocates the arrays specified by the user. - for array_name in array_names: - array_dtype = header.ftype if array_name not in int_state_arrays else header.itype - - if array_name in state_array_shapes: - array_dict[array_name] = np.empty(state_array_shapes[array_name], dtype=array_dtype) - else: - raise ValueError( - f"Array '{array_name}' is not a state array. " - f"Please try one of: {list(state_array_shapes.keys())}" - ) - - @staticmethod - def _read_states_transfer_memory( - i_state: int, buffer_array_dict: dict, master_array_dict: dict - ): - """Transfers the memory from smaller buffer arrays with only a few - timesteps into the major one - - Parameters - ---------- - i_state: int - current state index - buffer_array_dict: dict - dict with arrays of only a few timesteps - master_array_dict: dict - dict with the parent master arrays - - Notes - ----- - If an array in the master dict is not found in the buffer dict - then this array is set to `None`. - """ - - state_array_names = ArrayType.get_state_array_names() - - arrays_to_delete = [] - for array_name, array in master_array_dict.items(): - # copy memory to big array - if array_name in buffer_array_dict: - buffer_array = buffer_array_dict[array_name] - n_states_buffer_array = buffer_array.shape[0] - array[i_state : i_state + n_states_buffer_array] = buffer_array - # remove unnecessary state arrays (not geometry arrays!) - # we "could" deal with this in the allocate function - # by not allocating them but this would replicate code - # in the reading functions - elif array_name in state_array_names: - arrays_to_delete.append(array_name) - - for array_name in arrays_to_delete: - del master_array_dict[array_name] - - def _compute_n_bytes_per_state(self) -> int: - """Computes the number of bytes for every state - - Returns - ------- - n_bytes_per_state: int - number of bytes of every state - """ - - if not self.header: - return 0 - - # timestep - timestep_offset = 1 * self.header.wordsize - # global vars - global_vars_offset = self.header.n_global_vars * self.header.wordsize - # node vars - n_node_vars = ( - self.header.has_node_displacement - + self.header.has_node_velocity - + self.header.has_node_acceleration - ) * self.header.n_dimensions - - if self.header.has_node_temperatures: - n_node_vars += 1 - if self.header.has_node_temperature_layers: - n_node_vars += 2 - if self.header.has_node_heat_flux: - n_node_vars += 3 - if self.header.has_node_mass_scaling: - n_node_vars += 1 - if self.header.has_node_temperature_gradient: - n_node_vars += 1 - if self.header.has_node_residual_forces: - n_node_vars += 3 - if self.header.has_node_residual_moments: - n_node_vars += 3 - - node_data_offset = n_node_vars * self.header.n_nodes * self.header.wordsize - # thermal shit - therm_data_offset = ( - self.header.n_solid_thermal_vars * self.header.n_solids * self.header.wordsize - ) - # solids - solid_offset = self.header.n_solids * self.header.n_solid_vars * self.header.wordsize - # tshells - tshell_offset = ( - self.header.n_thick_shells * self.header.n_thick_shell_vars * self.header.wordsize - ) - # beams - beam_offset = self.header.n_beams * self.header.n_beam_vars * self.header.wordsize - # shells - shell_offset = ( - (self.header.n_shells - self._material_section_info.n_rigid_shells) - * self.header.n_shell_vars - * self.header.wordsize - ) - # Manual - # "NOTE: This CFDDATA is no longer output by ls-dyna." - cfd_data_offset = 0 - # sph - sph_offset = self.header.n_sph_nodes * self._sph_info.n_sph_vars * self.header.wordsize - # deleted nodes and elems ... or nothing - elem_deletion_offset = 0 - if self.header.has_node_deletion_data: - elem_deletion_offset = self.header.n_nodes * self.header.wordsize - elif self.header.has_element_deletion_data: - elem_deletion_offset = ( - self.header.n_beams - + self.header.n_shells - + self.header.n_solids - + self.header.n_thick_shells - ) * self.header.wordsize - # airbag particle offset - if self._airbag_info.n_airbags: - particle_state_offset = ( - self._airbag_info.n_airbags * self._airbag_info.n_airbag_state_variables - + self._airbag_info.n_particles * self._airbag_info.n_particle_state_variables - ) * self.header.wordsize - else: - particle_state_offset = 0 - # rigid road stuff whoever uses this - road_surface_offset = self._rigid_road_info.n_roads * 6 * self.header.wordsize - # rigid body motion data - if self.header.has_rigid_body_data: - n_rigids = self._rigid_body_info.n_rigid_bodies - n_rigid_vars = 12 if self.header.has_reduced_rigid_body_data else 24 - rigid_body_motion_offset = n_rigids * n_rigid_vars * self.header.wordsize - else: - rigid_body_motion_offset = 0 - # ... not supported - extra_data_offset = 0 - - n_bytes_per_state = ( - timestep_offset - + global_vars_offset - + node_data_offset - + therm_data_offset - + solid_offset - + tshell_offset - + beam_offset - + shell_offset - + cfd_data_offset - + sph_offset - + elem_deletion_offset - + particle_state_offset - + road_surface_offset - + rigid_body_motion_offset - + extra_data_offset - ) - return n_bytes_per_state - - def _read_states(self, filepath: str): - """Read the states from the d3plot - - Parameters - ---------- - filepath: str - path to the d3plot - """ - - if not self._buffer or not filepath: - self._state_info.n_timesteps = 0 - return - - LOGGER.debug("-------- S T A T E S --------") - LOGGER.debug("_read_states with geom offset %d", self.geometry_section_size) - - # (0) OFFSETS - bytes_per_state = self._compute_n_bytes_per_state() - LOGGER.debug("bytes_per_state: %d", bytes_per_state) - - # load the memory from the files - if self._femzip_info.use_femzip: - bytes_per_state += 1 * self.header.wordsize - self.bb_generator = self._read_femzip_file_generator( - self.buffered_reading, self.state_filter - ) - else: - self.bb_generator = self._read_d3plot_file_generator( - self.buffered_reading, self.state_filter - ) - - # (1) READ STATE DATA - n_states = next(self.bb_generator) - - # determine whether to transfer arrays - if not self.buffered_reading: - transfer_arrays = False - else: - transfer_arrays = True - if self.state_filter is not None and any(self.state_filter): - transfer_arrays = True - if self.state_array_filter: - transfer_arrays = True - - # arrays need to be preallocated if we transfer them - if transfer_arrays: - self._read_states_allocate_arrays( - self.header, - self._material_section_info, - self._airbag_info, - self._rigid_road_info, - self._rigid_body_info, - n_states, - self._n_rigid_walls, - self._n_parts, - self.state_array_filter, - self.arrays, - ) - - i_state = 0 - for bb_states, n_states in self.bb_generator: - # dictionary to store the temporary, partial arrays - # if we do not transfer any arrays we store them directly - # in the classes main dict - array_dict = {} if transfer_arrays else self.arrays - - # sometimes there is just a geometry in the file - if n_states == 0: - continue - - # state data as array - array_length = int(n_states) * int(bytes_per_state) - state_data = bb_states.read_ndarray(0, array_length, 1, self.header.ftype) - state_data = state_data.reshape((n_states, -1)) - - var_index = 0 - - # global state header - var_index = self._read_states_global_section(state_data, var_index, array_dict) - - # node data - var_index = self._read_states_nodes(state_data, var_index, array_dict) - - # thermal solid data - var_index = self._read_states_solids_thermal(state_data, var_index, array_dict) - - # cfddata was originally here - - # solids - var_index = self._read_states_solids(state_data, var_index, array_dict) - - # tshells - var_index = self._read_states_tshell(state_data, var_index, array_dict) - - # beams - var_index = self._read_states_beams(state_data, var_index, array_dict) - - # shells - var_index = self._read_states_shell(state_data, var_index, array_dict) - - # element and node deletion info - var_index = self._read_states_is_alive(state_data, var_index, array_dict) - - # sph - var_index = self._read_states_sph(state_data, var_index, array_dict) - - # airbag particle data - var_index = self._read_states_airbags(state_data, var_index, array_dict) - - # road surface data - var_index = self._read_states_road_surfaces(state_data, var_index, array_dict) - - # rigid body motion - var_index = self._read_states_rigid_body_motion(state_data, var_index, array_dict) - - # transfer memory - if transfer_arrays: - self._read_states_transfer_memory(i_state, array_dict, self.arrays) - - # increment state counter - i_state += n_states - self._state_info.n_timesteps = i_state - - if transfer_arrays: - self._buffer = None - self.bb_states = None - - def _read_states_global_section( - self, state_data: np.ndarray, var_index: int, array_dict: dict - ) -> int: - """Read the global vars for the state - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - LOGGER.debug("_read_states_global_section start at var_index %d", var_index) - - # we wrap globals, parts and rigid walls into a single try - # catch block since in the header the global section is - # defined by those three. If we fail in any of those we can - # only heal by skipping all together and jumping forward - original_var_index = var_index - try: - # timestep - array_dict[ArrayType.global_timesteps] = state_data[:, var_index] - var_index += 1 - - # global stuff - var_index = self._read_states_globals(state_data, var_index, array_dict) - - # parts - var_index = self._read_states_parts(state_data, var_index, array_dict) - - # rigid walls - var_index = self._read_states_rigid_walls(state_data, var_index, array_dict) - - except Exception: - # print - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_global_section", trb_msg) - finally: - timestep_var_size = 1 - var_index = original_var_index + self.header.n_global_vars + timestep_var_size - - LOGGER.debug("_read_states_global_section end at var_index %d", var_index) - - return var_index - - def _read_states_globals(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the part data in the state section - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - n_global_vars = self.header.n_global_vars - - # global stuff - i_global_var = 0 - if i_global_var < n_global_vars: - array_dict[ArrayType.global_kinetic_energy] = state_data[:, var_index + i_global_var] - i_global_var += 1 - if i_global_var < n_global_vars: - array_dict[ArrayType.global_internal_energy] = state_data[:, var_index + i_global_var] - i_global_var += 1 - if i_global_var < n_global_vars: - array_dict[ArrayType.global_total_energy] = state_data[:, var_index + i_global_var] - i_global_var += 1 - if i_global_var + 3 <= n_global_vars: - array_dict[ArrayType.global_velocity] = state_data[ - :, var_index + i_global_var : var_index + i_global_var + 3 - ] - i_global_var += 3 - - return var_index + i_global_var - - def _read_states_parts(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the part data in the state section - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - n_states = state_data.shape[0] - timestep_word = 1 - n_global_vars = self.header.n_global_vars + timestep_word - - # part infos - # n_parts = self._n_parts - n_parts = self.header.n_parts - - # part internal energy - if var_index + n_parts <= n_global_vars: - array_dict[ArrayType.part_internal_energy] = state_data[ - :, var_index : var_index + n_parts - ] - var_index += n_parts - - # part kinetic energy - if var_index + n_parts <= n_global_vars: - array_dict[ArrayType.part_kinetic_energy] = state_data[ - :, var_index : var_index + n_parts - ] - var_index += n_parts - - # part velocity - if var_index + 3 * n_parts <= n_global_vars: - array_dict[ArrayType.part_velocity] = state_data[ - :, var_index : var_index + 3 * n_parts - ].reshape((n_states, n_parts, 3)) - var_index += 3 * n_parts - - # part mass - if var_index + n_parts <= n_global_vars: - array_dict[ArrayType.part_mass] = state_data[:, var_index : var_index + n_parts] - var_index += n_parts - - # part hourglass energy - if var_index + n_parts <= n_global_vars: - array_dict[ArrayType.part_hourglass_energy] = state_data[ - :, var_index : var_index + n_parts - ] - var_index += n_parts - - return var_index - - def _read_states_rigid_walls( - self, state_data: np.ndarray, var_index: int, array_dict: dict - ) -> int: - """Read the rigid wall data in the state section - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - n_states = state_data.shape[0] - - i_global_var = 6 + 7 * self.header.n_parts - n_global_vars = self.header.n_global_vars - - # rigid walls - previous_global_vars = i_global_var - n_rigid_wall_vars = 4 if self.header.version >= 971 else 1 - # +1 is timestep which is not considered a global var ... seriously - n_rigid_walls = self._n_rigid_walls - if n_global_vars >= previous_global_vars + n_rigid_walls * n_rigid_wall_vars: - if ( - previous_global_vars + n_rigid_walls * n_rigid_wall_vars - != self.header.n_global_vars - ): - LOGGER.warning("Bug while reading global data for rigid walls. Skipping this data.") - var_index += self.header.n_global_vars - previous_global_vars - # rigid wall force - elif n_rigid_walls * n_rigid_wall_vars != 0: - array_dict[ArrayType.rigid_wall_force] = state_data[ - :, var_index : var_index + n_rigid_walls - ] - var_index += n_rigid_walls - - # rigid wall position - if n_rigid_wall_vars > 1: - array_dict[ArrayType.rigid_wall_position] = state_data[ - :, var_index : var_index + 3 * n_rigid_walls - ].reshape(n_states, n_rigid_walls, 3) - var_index += 3 * n_rigid_walls - - return var_index - - def _read_states_nodes(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the node data in the state section - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if self.header.n_nodes <= 0: - return var_index - - LOGGER.debug("_read_states_nodes start at var_index %d", var_index) - - n_dim = self.header.n_dimensions - n_states = state_data.shape[0] - n_nodes = self.header.n_nodes - - # displacement - if self.header.has_node_displacement: - try: - tmp_array = state_data[:, var_index : var_index + n_dim * n_nodes].reshape(( - n_states, - n_nodes, - n_dim, - )) - array_dict[ArrayType.node_displacement] = tmp_array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_displacement", trb_msg) - finally: - var_index += n_dim * n_nodes - - # temperatures - if self.header.has_node_temperatures: - # only node temperatures - if not self.header.has_node_temperature_layers: - try: - array_dict[ArrayType.node_temperature] = state_data[ - :, var_index : var_index + n_nodes - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_temperatures", trb_msg) - finally: - var_index += n_nodes - # node temperature layers - else: - try: - tmp_array = state_data[:, var_index : var_index + 3 * n_nodes].reshape(( - n_states, - n_nodes, - 3, - )) - array_dict[ArrayType.node_temperature] = tmp_array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_temperatures_layers", trb_msg) - finally: - var_index += 3 * n_nodes - - # node heat flux - if self.header.has_node_heat_flux: - try: - tmp_array = state_data[:, var_index : var_index + 3 * n_nodes].reshape(( - n_states, - n_nodes, - 3, - )) - array_dict[ArrayType.node_heat_flux] = tmp_array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_heat_flux", trb_msg) - finally: - var_index += 3 * n_nodes - - # mass scaling - if self.header.has_node_mass_scaling: - try: - array_dict[ArrayType.node_mass_scaling] = state_data[ - :, var_index : var_index + n_nodes - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_mass_scaling", trb_msg) - finally: - var_index += n_nodes - - # node temperature gradient - # Unclear: verify (could also be between temperature and node heat flux) - if self.header.has_node_temperature_gradient: - try: - array_dict[ArrayType.node_temperature_gradient] = state_data[ - :, var_index : var_index + n_nodes - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_temperature_gradient", trb_msg) - finally: - var_index += n_nodes - - # node residual forces and moments - # Unclear: verify (see before, according to docs this is after previous) - if self.header.has_node_residual_forces: - try: - array_dict[ArrayType.node_residual_forces] = state_data[ - :, var_index : var_index + 3 * n_nodes - ].reshape((n_states, n_nodes, 3)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_residual_forces", trb_msg) - finally: - var_index += n_nodes * 3 - - if self.header.has_node_residual_moments: - try: - array_dict[ArrayType.node_residual_moments] = state_data[ - :, var_index : var_index + 3 * n_nodes - ].reshape((n_states, n_nodes, 3)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_residual_moments", trb_msg) - finally: - var_index += n_nodes * 3 - - # velocity - if self.header.has_node_velocity: - try: - tmp_array = state_data[:, var_index : var_index + n_dim * n_nodes].reshape(( - n_states, - n_nodes, - n_dim, - )) - array_dict[ArrayType.node_velocity] = tmp_array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_velocity", trb_msg) - finally: - var_index += n_dim * n_nodes - - # acceleration - if self.header.has_node_acceleration: - try: - tmp_array = state_data[:, var_index : var_index + n_dim * n_nodes].reshape(( - n_states, - n_nodes, - n_dim, - )) - array_dict[ArrayType.node_acceleration] = tmp_array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_nodes, node_acceleration", trb_msg) - finally: - var_index += n_dim * n_nodes - - LOGGER.debug("_read_states_nodes end at var_index %d", var_index) - - return var_index - - def _read_states_solids_thermal( - self, state_data: np.ndarray, var_index: int, array_dict: dict - ) -> int: - """Read the thermal data for solids - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if self.header.n_solid_thermal_vars <= 0: - return var_index - - LOGGER.debug("_read_states_solids_thermal start at var_index %d", var_index) - - n_states = state_data.shape[0] - n_solids = self.header.n_solids - n_thermal_vars = self.header.n_solid_thermal_vars - - try: - tmp_array = state_data[:, var_index : var_index + n_solids * n_thermal_vars] - array_dict[ArrayType.element_solid_thermal_data] = tmp_array.reshape(( - n_states, - n_solids, - n_thermal_vars, - )) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_solids_thermal", trb_msg) - finally: - var_index += n_thermal_vars * n_solids - - LOGGER.debug("_read_states_solids_thermal end at var_index %d", var_index) - - return var_index - - def _read_states_solids(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the state data of the solid elements - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if self.header.n_solids <= 0 or self.header.n_solid_vars <= 0: - return var_index - - LOGGER.debug("_read_states_solids start at var_index %d", var_index) - - n_solid_vars = self.header.n_solid_vars - n_solids = self.header.n_solids - n_states = state_data.shape[0] - n_strain_vars = 6 * self.header.has_element_strain - n_history_vars = self.header.n_solid_history_vars - n_solid_layers = self.header.n_solid_layers - - # double safety here, if either the formatting of the solid state data - # or individual arrays fails then we catch it - try: - # this is a sanity check if the manual was understood correctly - # - # NOTE due to plotcompress we disable this check, it can delete - # variables so that stress or pstrain might be missing despite - # being always present in the file spec - # - # n_solid_vars2 = (7 + - # n_history_vars) - - # if n_solid_vars2 != n_solid_vars: - # msg = "n_solid_vars != n_solid_vars_computed: {} != {}."\ - # + " Solid variables might be wrong." - # LOGGER.warning(msg.format(n_solid_vars, n_solid_vars2)) - - solid_state_data = state_data[ - :, var_index : var_index + n_solid_vars * n_solids - ].reshape((n_states, n_solids, n_solid_layers, n_solid_vars // n_solid_layers)) - - i_solid_var = 0 - - # stress - try: - if self.header.has_solid_stress: - array_dict[ArrayType.element_solid_stress] = solid_state_data[:, :, :, :6] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_solids, stress", trb_msg) - finally: - i_solid_var += 6 * self.header.has_solid_stress - - # effective plastic strain - try: - # in case plotcompress deleted stresses but pstrain exists - if self.header.has_solid_pstrain: - array_dict[ArrayType.element_solid_effective_plastic_strain] = solid_state_data[ - :, :, :, i_solid_var - ].reshape((n_states, n_solids, n_solid_layers)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_solids, eff_plastic_strain", trb_msg) - finally: - i_solid_var += 1 * self.header.has_solid_pstrain - - # history vars - if n_history_vars: - try: - array_dict[ArrayType.element_solid_history_variables] = solid_state_data[ - :, :, :, i_solid_var : i_solid_var + n_history_vars - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_solids, history_variables", trb_msg) - finally: - i_solid_var += n_history_vars - - # strain - # they are the last 6 entries of the history vars (if ISTRN = 1) - if n_strain_vars: - try: - array_dict[ArrayType.element_solid_strain] = array_dict[ - ArrayType.element_solid_history_variables - ][:, :, :, -n_strain_vars:] - - array_dict[ArrayType.element_solid_history_variables] = array_dict[ - ArrayType.element_solid_history_variables - ][:, :, :, :-n_strain_vars] - - if not all(array_dict[ArrayType.element_solid_history_variables].shape): - del array_dict[ArrayType.element_solid_history_variables] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_solids, strain", trb_msg) - - # plastic strain tensor - # if present, beginning of element_solid_history_variables (if ISTRN = 11) - if self.header.has_solid_shell_plastic_strain_tensor: - try: - array_dict[ArrayType.element_solid_plastic_strain_tensor] = array_dict[ - ArrayType.element_solid_history_variables - ][:, :, :, :n_strain_vars] - - array_dict[ArrayType.element_solid_history_variables] = array_dict[ - ArrayType.element_solid_history_variables - ][:, :, :, n_strain_vars:] - - if not all(array_dict[ArrayType.element_solid_history_variables].shape): - del array_dict[ArrayType.element_solid_history_variables] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_solids, element_solid_plastic_strain_tensor", trb_msg - ) - - # thermal strain tensor - # if present, beginning of element_solid_history_variables - if self.header.has_solid_shell_thermal_strain_tensor: - try: - array_dict[ArrayType.element_solid_thermal_strain_tensor] = array_dict[ - ArrayType.element_solid_history_variables - ][:, :, :, :n_strain_vars] - - array_dict[ArrayType.element_solid_history_variables] = array_dict[ - ArrayType.element_solid_history_variables - ][:, :, :, n_strain_vars:] - - if not all(array_dict[ArrayType.element_solid_history_variables].shape): - del array_dict[ArrayType.element_solid_history_variables] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_solids, element_solid_thermal_strain_tensor", trb_msg - ) - - # catch formatting in solid_state_datra - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_solids, solid_state_data", trb_msg) - # always increment variable count - finally: - var_index += n_solids * n_solid_vars - - LOGGER.debug("_read_states_solids end at var_index %d", var_index) - - return var_index - - def _read_states_tshell(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the state data for thick shell elements - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if self.header.n_thick_shells <= 0 or self.header.n_thick_shell_vars <= 0: - return var_index - - LOGGER.debug("_read_states_tshell start at var_index %d", var_index) - - n_states = state_data.shape[0] - n_tshells = self.header.n_thick_shells - n_history_vars = self.header.n_shell_tshell_history_vars - n_layers = self.header.n_shell_tshell_layers - n_layer_vars = n_layers * ( - 6 * self.header.has_shell_tshell_stress - + self.header.has_shell_tshell_pstrain - + n_history_vars - ) - n_strain_vars = 12 * self.header.has_element_strain - n_thsell_vars = self.header.n_thick_shell_vars - has_stress = self.header.has_shell_tshell_stress - has_pstrain = self.header.has_shell_tshell_pstrain - - try: - # this is a sanity check if the manual was understood correctly - n_tshell_vars2 = n_layer_vars + n_strain_vars - - if n_tshell_vars2 != n_thsell_vars: - msg = ( - "n_tshell_vars != n_tshell_vars_computed: %d != %d." - " Thick shell variables might be wrong." - ) - LOGGER.warning(msg, n_thsell_vars, n_tshell_vars2) - - # thick shell element data - tshell_data = state_data[:, var_index : var_index + n_thsell_vars * n_tshells] - tshell_data = tshell_data.reshape((n_states, n_tshells, n_thsell_vars)) - - # extract layer data - tshell_layer_data = tshell_data[:, :, slice(0, n_layer_vars)] - tshell_layer_data = tshell_layer_data.reshape((n_states, n_tshells, n_layers, -1)) - tshell_nonlayer_data = tshell_data[:, :, n_layer_vars:] - - # STRESS - i_tshell_layer_var = 0 - if has_stress: - try: - array_dict[ArrayType.element_tshell_stress] = tshell_layer_data[ - :, :, :, i_tshell_layer_var : i_tshell_layer_var + 6 - ].reshape((n_states, n_tshells, n_layers, 6)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %d was caught:\n%s" - LOGGER.warning(msg, "_read_states_tshell, stress", trb_msg) - finally: - i_tshell_layer_var += 6 - - # PSTRAIN - if has_pstrain: - try: - array_dict[ArrayType.element_tshell_effective_plastic_strain] = ( - tshell_layer_data[:, :, :, i_tshell_layer_var].reshape(( - n_states, - n_tshells, - n_layers, - )) - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_tshell, eff_plastic_strain", trb_msg) - finally: - i_tshell_layer_var += 1 - - # HISTORY VARS - if n_history_vars: - try: - array_dict[ArrayType.element_tshell_history_variables] = tshell_layer_data[ - :, :, :, i_tshell_layer_var : i_tshell_layer_var + n_history_vars - ].reshape((n_states, n_tshells, n_layers, n_history_vars)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_tshell, history_variables", trb_msg) - - # STRAIN (only non layer data for tshells) - if n_strain_vars: - try: - tshell_nonlayer_data = tshell_nonlayer_data[:, :, :n_strain_vars] - array_dict[ArrayType.element_tshell_strain] = tshell_nonlayer_data.reshape(( - n_states, - n_tshells, - 2, - 6, - )) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_tshell, strain", trb_msg) - - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_tshell, tshell_data", trb_msg) - finally: - var_index += n_thsell_vars * n_tshells - - LOGGER.debug("_read_states_tshell end at var_index %d", var_index) - - return var_index - - def _read_states_beams(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the state data for beams - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if self.header.n_beams <= 0 or self.header.n_beam_vars <= 0: - return var_index - - LOGGER.debug("_read_states_beams start at var_index %d", var_index) - - # usual beam vars - # pylint: disable = invalid-name - N_BEAM_BASIC_VARS = 6 - # beam integration point vars - # pylint: disable = invalid-name - N_BEAM_IP_VARS = 5 - - n_states = state_data.shape[0] - n_beams = self.header.n_beams - n_history_vars = self.header.n_beam_history_vars - n_beam_vars = self.header.n_beam_vars - n_layers = int( - (-3 * n_history_vars + n_beam_vars - N_BEAM_BASIC_VARS) - / (n_history_vars + N_BEAM_IP_VARS) - ) - # n_layer_vars = 6 + N_BEAM_IP_VARS * n_layers - n_layer_vars = N_BEAM_IP_VARS * n_layers - - try: - # beam element data - beam_data = state_data[:, var_index : var_index + n_beam_vars * n_beams] - beam_data = beam_data.reshape((n_states, n_beams, n_beam_vars)) - - # extract layer data - beam_nonlayer_data = beam_data[:, :, :N_BEAM_BASIC_VARS] - beam_layer_data = beam_data[:, :, N_BEAM_BASIC_VARS : N_BEAM_BASIC_VARS + n_layer_vars] - beam_layer_data = beam_layer_data.reshape((n_states, n_beams, n_layers, N_BEAM_IP_VARS)) - - # axial force - try: - array_dict[ArrayType.element_beam_axial_force] = beam_nonlayer_data[ - :, :, 0 - ].reshape((n_states, n_beams)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, axial_force", trb_msg) - - # shear force - try: - array_dict[ArrayType.element_beam_shear_force] = beam_nonlayer_data[ - :, :, 1:3 - ].reshape((n_states, n_beams, 2)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, shear_force", trb_msg) - - # bending moment - try: - array_dict[ArrayType.element_beam_bending_moment] = beam_nonlayer_data[ - :, :, 3:5 - ].reshape((n_states, n_beams, 2)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, bending_moment", trb_msg) - - # torsion moment - try: - array_dict[ArrayType.element_beam_torsion_moment] = beam_nonlayer_data[ - :, :, 5 - ].reshape((n_states, n_beams)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, torsion_moment", trb_msg) - - if n_layers: - # BUGFIX? - # According to the database manual the first - # two layer vars are the shear stress and then - # axial stress. Tests with FEMZIP and META though - # suggests that axial stress comes first. - - # axial stress - try: - array_dict[ArrayType.element_beam_axial_stress] = beam_layer_data[:, :, :, 0] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, axial_stress", trb_msg) - - # shear stress - try: - array_dict[ArrayType.element_beam_shear_stress] = beam_layer_data[:, :, :, 1:3] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, shear_stress", trb_msg) - - # eff. plastic strain - try: - array_dict[ArrayType.element_beam_plastic_strain] = beam_layer_data[:, :, :, 3] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, eff_plastic_strain", trb_msg) - - # axial strain - try: - array_dict[ArrayType.element_beam_axial_strain] = beam_layer_data[:, :, :, 4] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, axial_strain", trb_msg) - - # history vars - if n_history_vars: - try: - array_dict[ArrayType.element_beam_history_vars] = beam_data[ - :, :, 6 + n_layer_vars : - ].reshape((n_states, n_beams, 3 + n_layers, n_history_vars)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, history_variables", trb_msg) - - # failure of formatting beam state data - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_beams, beam_state_data", trb_msg) - # always increment variable index - finally: - var_index += n_beams * n_beam_vars - - LOGGER.debug("_read_states_beams end at var_index %d", var_index) - - return var_index - - def _read_states_shell(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the state data for shell elements - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - # bugfix - # - # Interestingly, dyna seems to write result values for rigid shells in - # the d3part file, but not in the d3plot. Of course this is not - # documented ... - n_reduced_shells = ( - self.header.n_shells - if self.header.filetype == D3plotFiletype.D3PART - else self.header.n_shells - self._material_section_info.n_rigid_shells - ) - - if self.header.n_shell_vars <= 0 or n_reduced_shells <= 0: - return var_index - - LOGGER.debug("_read_states_shell start at var_index %d", var_index) - - n_states = state_data.shape[0] - n_shells = n_reduced_shells - n_shell_vars = self.header.n_shell_vars - - # what is in the file? - n_layers = self.header.n_shell_tshell_layers - n_history_vars = self.header.n_shell_tshell_history_vars - n_stress_vars = 6 * self.header.has_shell_tshell_stress - n_pstrain_vars = 1 * self.header.has_shell_tshell_pstrain - n_force_variables = 8 * self.header.has_shell_forces - n_extra_variables = 4 * self.header.has_shell_extra_variables - n_strain_vars = 12 * self.header.has_element_strain - n_plastic_strain_tensor = 6 * n_layers * self.header.has_solid_shell_plastic_strain_tensor - n_thermal_strain_tensor = 6 * self.header.has_solid_shell_thermal_strain_tensor - - try: - # this is a sanity check if the manual was understood correctly - n_shell_vars2 = ( - n_layers * (n_stress_vars + n_pstrain_vars + n_history_vars) - + n_force_variables - + n_extra_variables - + n_strain_vars - + n_plastic_strain_tensor - + n_thermal_strain_tensor - ) - - if n_shell_vars != n_shell_vars2: - msg = ( - "n_shell_vars != n_shell_vars_computed: %d != %d." - " Shell variables might be wrong." - ) - LOGGER.warning(msg, n_shell_vars, n_shell_vars2) - - n_layer_vars = n_layers * (n_stress_vars + n_pstrain_vars + n_history_vars) - - # shell element data - shell_data = state_data[:, var_index : var_index + n_shell_vars * n_shells] - shell_data = shell_data.reshape((n_states, n_shells, n_shell_vars)) - - # extract layer data - shell_layer_data = shell_data[:, :, :n_layer_vars] - shell_layer_data = shell_layer_data.reshape((n_states, n_shells, n_layers, -1)) - shell_nonlayer_data = shell_data[:, :, n_layer_vars:] - - # save layer stuff - # STRESS - layer_var_index = 0 - if n_stress_vars: - try: - array_dict[ArrayType.element_shell_stress] = shell_layer_data[ - :, :, :, :n_stress_vars - ].reshape((n_states, n_shells, n_layers, n_stress_vars)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shells, stress", trb_msg) - finally: - layer_var_index += n_stress_vars - - # PSTRAIN - if n_pstrain_vars: - try: - array_dict[ArrayType.element_shell_effective_plastic_strain] = shell_layer_data[ - :, :, :, layer_var_index - ].reshape((n_states, n_shells, n_layers)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shells, stress", trb_msg) - finally: - layer_var_index += 1 - - # HISTORY VARIABLES - if n_history_vars: - try: - array_dict[ArrayType.element_shell_history_vars] = shell_layer_data[ - :, :, :, layer_var_index : layer_var_index + n_history_vars - ].reshape((n_states, n_shells, n_layers, n_history_vars)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shells, history_variables", trb_msg) - finally: - layer_var_index += n_history_vars - - # save nonlayer stuff - # forces - nonlayer_var_index = 0 - if n_force_variables: - try: - array_dict[ArrayType.element_shell_bending_moment] = shell_nonlayer_data[ - :, :, 0:3 - ].reshape((n_states, n_shells, 3)) - array_dict[ArrayType.element_shell_shear_force] = shell_nonlayer_data[ - :, :, 3:5 - ].reshape((n_states, n_shells, 2)) - array_dict[ArrayType.element_shell_normal_force] = shell_nonlayer_data[ - :, :, 5:8 - ].reshape((n_states, n_shells, 3)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shells, forces", trb_msg) - finally: - nonlayer_var_index += n_force_variables - - # weird stuff - if n_extra_variables: - try: - array_dict[ArrayType.element_shell_thickness] = shell_nonlayer_data[ - :, :, nonlayer_var_index - ].reshape((n_states, n_shells)) - array_dict[ArrayType.element_shell_unknown_variables] = shell_nonlayer_data[ - :, :, nonlayer_var_index + 1 : nonlayer_var_index + 3 - ].reshape((n_states, n_shells, 2)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shells, history_variables", trb_msg) - finally: - nonlayer_var_index += 3 - - # strain present - if n_strain_vars: - try: - shell_strain = shell_nonlayer_data[ - :, :, nonlayer_var_index : nonlayer_var_index + n_strain_vars - ] - array_dict[ArrayType.element_shell_strain] = shell_strain.reshape(( - n_states, - n_shells, - 2, - 6, - )) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shells, strain", trb_msg) - finally: - nonlayer_var_index += n_strain_vars - - # internal energy is behind strain if strain is written - if self.header.has_shell_extra_variables: - try: - array_dict[ArrayType.element_shell_internal_energy] = shell_nonlayer_data[ - :, :, nonlayer_var_index - ].reshape((n_states, n_shells)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shells, internal_energy", trb_msg) - - # PLASTIC STRAIN TENSOR - if n_plastic_strain_tensor: - try: - pstrain_tensor = shell_nonlayer_data[ - :, :, nonlayer_var_index : nonlayer_var_index + n_plastic_strain_tensor - ] - array_dict[ArrayType.element_shell_plastic_strain_tensor] = ( - pstrain_tensor.reshape((n_states, n_shells, n_layers, 6)) - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_shells, element_shell_plastic_strain_tensor", trb_msg - ) - finally: - nonlayer_var_index += n_plastic_strain_tensor - - # THERMAL STRAIN TENSOR - if n_thermal_strain_tensor: - try: - thermal_tensor = shell_nonlayer_data[ - :, :, nonlayer_var_index : nonlayer_var_index + n_thermal_strain_tensor - ] - array_dict[ArrayType.element_shell_thermal_strain_tensor] = ( - thermal_tensor.reshape((n_states, n_shells, 6)) - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_shells, element_shell_thermal_strain_tensor", trb_msg - ) - finally: - nonlayer_var_index += n_thermal_strain_tensor - - # error in formatting shell state data - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_shell, shell_state_data", trb_msg) - - # always increment variable index - finally: - var_index += n_shell_vars * n_shells - - LOGGER.debug("_read_states_shell end at var_index %d", var_index) - - return var_index - - def _read_states_is_alive( - self, state_data: np.ndarray, var_index: int, array_dict: dict - ) -> int: - """Read deletion info for nodes, elements, etc - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if not self.header.has_node_deletion_data and not self.header.has_element_deletion_data: - return var_index - - LOGGER.debug("_read_states_is_alive start at var_index %s", var_index) - - n_states = state_data.shape[0] - - # NODES - if self.header.has_node_deletion_data: - n_nodes = self.header.n_nodes - - if n_nodes > 0: - try: - array_dict[ArrayType.node_is_alive] = state_data[ - :, var_index : var_index + n_nodes - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_is_alive, nodes", trb_msg) - finally: - var_index += n_nodes - - # element deletion info - elif self.header.has_element_deletion_data: - n_solids = self.header.n_solids - n_tshells = self.header.n_thick_shells - n_shells = self.header.n_shells - n_beams = self.header.n_beams - # n_elems = n_solids + n_tshells + n_shells + n_beams - - # SOLIDS - if n_solids > 0: - try: - array_dict[ArrayType.element_solid_is_alive] = state_data[ - :, var_index : var_index + n_solids - ].reshape((n_states, n_solids)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_is_alive, solids", trb_msg) - finally: - var_index += n_solids - - # TSHELLS - if n_tshells > 0: - try: - array_dict[ArrayType.element_tshell_is_alive] = state_data[ - :, var_index : var_index + n_tshells - ].reshape((n_states, n_tshells)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_is_alive, solids", trb_msg) - finally: - var_index += n_tshells - - # SHELLS - if n_shells > 0: - try: - array_dict[ArrayType.element_shell_is_alive] = state_data[ - :, var_index : var_index + n_shells - ].reshape((n_states, n_shells)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_is_alive, shells", trb_msg) - finally: - var_index += n_shells - - # BEAMS - if n_beams > 0: - try: - array_dict[ArrayType.element_beam_is_alive] = state_data[ - :, var_index : var_index + n_beams - ].reshape((n_states, n_beams)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_is_alive, beams", trb_msg) - finally: - var_index += n_beams - - LOGGER.debug("_read_states_is_alive end at var_index %d", var_index) - - return var_index - - def _read_states_sph(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the sph state data - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if self.header.n_sph_nodes <= 0: - return var_index - - LOGGER.debug("_read_states_sph start at var_index %d", var_index) - - info = self._sph_info - n_states = state_data.shape[0] - n_particles = self.header.n_sph_nodes - n_variables = info.n_sph_vars - - # extract data - try: - sph_data = state_data[:, var_index : var_index + n_particles * n_variables].reshape(( - n_states, - n_particles, - n_variables, - )) - - i_var = 1 - - # deletion - try: - array_dict[ArrayType.sph_deletion] = sph_data[:, :, 0] < 0 - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, deletion", trb_msg) - - # particle radius - if info.has_influence_radius: - try: - array_dict[ArrayType.sph_radius] = sph_data[:, :, i_var] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, radius", trb_msg) - finally: - i_var += 1 - - # pressure - if info.has_particle_pressure: - try: - array_dict[ArrayType.sph_pressure] = sph_data[:, :, i_var] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, pressure", trb_msg) - finally: - i_var += 1 - - # stress - if info.has_stresses: - try: - array_dict[ArrayType.sph_stress] = sph_data[:, :, i_var : i_var + 6] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, pressure", trb_msg) - finally: - i_var += 6 - - # eff. plastic strain - if info.has_plastic_strain: - try: - array_dict[ArrayType.sph_effective_plastic_strain] = sph_data[:, :, i_var] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, eff_plastic_strain", trb_msg) - finally: - i_var += 1 - - # density - if info.has_material_density: - try: - array_dict[ArrayType.sph_density] = sph_data[:, :, i_var] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, density", trb_msg) - finally: - i_var += 1 - - # internal energy - if info.has_internal_energy: - try: - array_dict[ArrayType.sph_internal_energy] = sph_data[:, :, i_var] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, internal_energy", trb_msg) - finally: - i_var += 1 - - # number of neighbors - if info.has_n_affecting_neighbors: - try: - array_dict[ArrayType.sph_n_neighbors] = sph_data[:, :, i_var] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, n_neighbors", trb_msg) - finally: - i_var += 1 - - # strain - if info.has_strain: - try: - array_dict[ArrayType.sph_strain] = sph_data[:, :, i_var : i_var + 6] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, strain", trb_msg) - finally: - i_var += 6 - - if info.has_strainrate: - try: - array_dict[ArrayType.sph_strainrate] = sph_data[:, :, i_var : i_var + 6] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, strainrate", trb_msg) - finally: - i_var += 6 - - # mass - if info.has_mass: - try: - array_dict[ArrayType.sph_mass] = sph_data[:, :, i_var] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, pressure", trb_msg) - finally: - i_var += 1 - - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_sph, sph_data", trb_msg) - finally: - var_index += n_particles * n_variables - - LOGGER.debug("_read_states_sph end at var_index %d", var_index) - - return var_index - - def _read_states_airbags(self, state_data: np.ndarray, var_index: int, array_dict: dict) -> int: - """Read the airbag state data - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if self.header.n_airbags <= 0: - return var_index - - LOGGER.debug("_read_states_airbags start at var_index %d", var_index) - - n_states = state_data.shape[0] - info = self._airbag_info - n_airbag_geom_vars = info.n_geometric_variables - n_airbags = info.n_airbags - n_state_airbag_vars = info.n_airbag_state_variables - n_particles = info.n_particles - n_particle_vars = info.n_particle_state_variables - - # Warning - # I am not sure if this is right ... - n_total_vars = n_airbags * n_state_airbag_vars + n_particles * n_particle_vars - - try: - # types - # nlist = ngeom + nvar + nstgeom - airbag_var_types = self.arrays[ArrayType.airbag_variable_types] - airbag_var_names = self.arrays[ArrayType.airbag_variable_names] - # geom_var_types = airbag_var_types[:n_airbag_geom_vars] - particle_var_types = airbag_var_types[ - n_airbag_geom_vars : n_airbag_geom_vars + n_particle_vars - ] - particle_var_names = airbag_var_names[ - n_airbag_geom_vars : n_airbag_geom_vars + n_particle_vars - ] - - airbag_state_var_types = airbag_var_types[n_airbag_geom_vars + n_particle_vars :] - airbag_state_var_names = airbag_var_names[n_airbag_geom_vars + n_particle_vars :] - - # required for dynamic reading - def get_dtype(type_flag): - return self._header.itype if type_flag == 1 else self.header.ftype - - # extract airbag data - airbag_state_data = state_data[:, var_index : var_index + n_total_vars] - - # airbag data - airbag_data = airbag_state_data[:, : n_airbags * n_state_airbag_vars].reshape(( - n_states, - n_airbags, - n_state_airbag_vars, - )) - airbag_state_offset = n_airbags * n_state_airbag_vars - - # particle data - particle_data = airbag_state_data[ - :, airbag_state_offset : airbag_state_offset + n_particles * n_particle_vars - ].reshape((n_states, n_particles, n_particle_vars)) - - # save sh... - - # airbag state vars - for i_airbag_state_var in range(n_state_airbag_vars): - var_name = airbag_state_var_names[i_airbag_state_var].strip() - var_type = airbag_state_var_types[i_airbag_state_var] - - if var_name.startswith("Act Gas"): - try: - array_dict[ArrayType.airbag_n_active_particles] = airbag_data[ - :, :, i_airbag_state_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, airbag_n_active_particles", trb_msg - ) - elif var_name.startswith("Bag Vol"): - try: - array_dict[ArrayType.airbag_bag_volume] = airbag_data[ - :, :, i_airbag_state_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_airbags, airbag_volume", trb_msg) - else: - warn_msg = "Unknown airbag state var: '%s'. Skipping it." - LOGGER.warning(warn_msg, var_name) - - # particles yay - for i_particle_var in range(n_particle_vars): - var_type = particle_var_types[i_particle_var] - var_name = particle_var_names[i_particle_var].strip() - - # particle gas id - if var_name.startswith("GasC ID"): - try: - array_dict[ArrayType.airbag_particle_gas_id] = particle_data[ - :, :, i_particle_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle chamber id - elif var_name.startswith("Cham ID"): - try: - array_dict[ArrayType.airbag_particle_chamber_id] = particle_data[ - :, :, i_particle_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle leakage - elif var_name.startswith("Leakage"): - try: - array_dict[ArrayType.airbag_particle_leakage] = particle_data[ - :, :, i_particle_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle mass - elif var_name.startswith("Mass"): - try: - array_dict[ArrayType.airbag_particle_mass] = particle_data[ - :, :, i_particle_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle radius - try: - array_dict[ArrayType.airbag_particle_radius] = particle_data[ - :, :, i_particle_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle spin energy - elif var_name.startswith("Spin En"): - try: - array_dict[ArrayType.airbag_particle_spin_energy] = particle_data[ - :, :, i_particle_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle translational energy - elif var_name.startswith("Tran En"): - try: - array_dict[ArrayType.airbag_particle_translation_energy] = particle_data[ - :, :, i_particle_var - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle segment distance - elif var_name.startswith("NS dist"): - try: - array_dict[ArrayType.airbag_particle_nearest_segment_distance] = ( - particle_data[:, :, i_particle_var].view(get_dtype(var_type)) - ) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - # particle position - elif var_name.startswith("Pos x"): - try: - particle_var_names_stripped = [ - entry.strip() for entry in particle_var_names - ] - i_particle_var_x = i_particle_var - i_particle_var_y = particle_var_names_stripped.index("Pos y") - i_particle_var_z = particle_var_names_stripped.index("Pos z") - - array_dict[ArrayType.airbag_particle_position] = particle_data[ - :, :, (i_particle_var_x, i_particle_var_y, i_particle_var_z) - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - elif var_name.startswith("Pos y"): - # handled in Pos x - pass - elif var_name.startswith("Pos z"): - # handled in Pos x - pass - # particle velocity - elif var_name.startswith("Vel x"): - try: - particle_var_names_stripped = [ - entry.strip() for entry in particle_var_names - ] - i_particle_var_x = i_particle_var - i_particle_var_y = particle_var_names_stripped.index("Vel y") - i_particle_var_z = particle_var_names_stripped.index("Vel z") - - array_dict[ArrayType.airbag_particle_velocity] = particle_data[ - :, :, (i_particle_var_x, i_particle_var_y, i_particle_var_z) - ].view(get_dtype(var_type)) - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s %s was caught:\n%s" - LOGGER.warning( - msg, "_read_states_airbags, particle_gas_id", var_name, trb_msg - ) - - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_airbags, particle_data", trb_msg) - finally: - var_index += n_total_vars - - LOGGER.debug("_read_states_airbags end at var_index %d", var_index) - - return var_index - - def _read_states_road_surfaces( - self, state_data: np.ndarray, var_index: int, array_dict: dict - ) -> int: - """Read the road surfaces state data for whoever wants this ... - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if not self.header.has_rigid_road_surface: - return var_index - - LOGGER.debug("_read_states_road_surfaces start at var_index %s", var_index) - - n_states = state_data.shape[0] - info = self._rigid_road_info - n_roads = info.n_roads - - try: - # read road data - road_data = state_data[:, var_index : var_index + 6 * n_roads].reshape(( - n_states, - n_roads, - 2, - 3, - )) - - # DISPLACEMENT - try: - array_dict[ArrayType.rigid_road_displacement] = road_data[:, :, 0, :] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_road_surfaces, road_displacement", trb_msg) - - # VELOCITY - try: - array_dict[ArrayType.rigid_road_velocity] = road_data[:, :, 1, :] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_road_surfaces, road_velocity", trb_msg) - - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_road_surfaces, road_data", trb_msg) - finally: - var_index += 6 * n_roads - - LOGGER.debug("_read_states_road_surfaces end at var_index %d", var_index) - - return var_index - - def _read_states_rigid_body_motion( - self, state_data: np.ndarray, var_index: int, array_dict: dict - ) -> int: - """Read the road surfaces state data for whoever want this ... - - Parameters - ---------- - state_data: np.ndarray - array with entire state data - var_index: int - variable index in the state data array - array_dict: dict - dictionary to store the loaded arrays in - - Returns - ------- - var_index: int - updated variable index after reading the section - """ - - if not self.header.has_rigid_body_data: - return var_index - - LOGGER.debug("_read_states_rigid_body_motion start at var_index %d", var_index) - - info = self._rigid_body_info - n_states = state_data.shape[0] - n_rigids = info.n_rigid_bodies - n_rigid_vars = 12 if self.header.has_reduced_rigid_body_data else 24 - - try: - # do the thing - rigid_body_data = state_data[ - :, var_index : var_index + n_rigids * n_rigid_vars - ].reshape((n_states, n_rigids, n_rigid_vars)) - - # let the party begin - # rigid coordinates - try: - array_dict[ArrayType.rigid_body_coordinates] = rigid_body_data[:, :, :3] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_rigid_body_motion, coordinates", trb_msg) - finally: - i_var = 3 - - # rotation matrix - try: - array_dict[ArrayType.rigid_body_rotation_matrix] = rigid_body_data[ - :, :, i_var : i_var + 9 - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_rigid_body_motion, rot_matrix", trb_msg) - finally: - i_var += 9 - - if self.header.has_reduced_rigid_body_data: - return var_index - - # velocity pewpew - try: - array_dict[ArrayType.rigid_body_velocity] = rigid_body_data[:, :, i_var : i_var + 3] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_rigid_body_motion, velocity", trb_msg) - finally: - i_var += 3 - - # rotational velocity - try: - array_dict[ArrayType.rigid_body_rot_velocity] = rigid_body_data[ - :, :, i_var : i_var + 3 - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_rigid_body_motion, rot_velocity", trb_msg) - finally: - i_var += 3 - - # acceleration - try: - array_dict[ArrayType.rigid_body_acceleration] = rigid_body_data[ - :, :, i_var : i_var + 3 - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_rigid_body_motion, acceleration", trb_msg) - finally: - i_var += 3 - - # rotational acceleration - try: - array_dict[ArrayType.rigid_body_rot_acceleration] = rigid_body_data[ - :, :, i_var : i_var + 3 - ] - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_rigid_body_motion, rot_acceleration", trb_msg) - finally: - i_var += 3 - - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_read_states_rigid_body_motion, rigid_body_data", trb_msg) - - finally: - var_index += n_rigids * n_rigid_vars - - LOGGER.debug("_read_states_rigid_body_motion end at var_index %d", var_index) - - return var_index - - def _collect_file_infos(self, size_per_state: int) -> list[MemoryInfo]: - """This routine collects the memory and file info for the d3plot files - - Parameters - ---------- - size_per_state: int - size of every state to be read - - Returns - ------- - memory_infos: List[MemoryInfo] - memory infos about the states - - Notes - ----- - State data is expected directly behind geometry data - Unfortunately data is spread across multiple files. - One file could contain geometry and state data but states - may also be littered across several files. This would - not be an issue, if dyna would not always write in blocks - of 512 words of memory, leaving zero byte padding blocks - at the end of files. These need to be removed and/or taken - care of. - """ - - if not self._buffer: - return [] - - base_filepath = self.header.filepath - - # bugfix - # If you encounter these int casts more often here this is why: - # Some ints around here are numpy.int32 which can overflow - # (sometimes there is a warning ... sometimes not ...) - # we cast to python ints in order to prevent overflow. - size_per_state = int(size_per_state) - - # Info: - # - # We need to determine here how many states are in every file - # without really loading the file itself. For big files this is - # simply filesize // state_size. - # For files though with a smaller filesize this may cause issues - # e.g. - # filesize 2048 bytes (minimum filesize from dyna) - # geom_size 200 bytes - # state_size 200 bytes - # File contains: - # -> 1 state * state_size + geom_size = 400 bytes - # Wrong State Estimation: - # -> (filesize - geom_size) // state_size = 9 states != 1 state - # - # To avoid this wrong number of states when reading small files - # we need to search the end mark (here nonzero byte) from the rear - # of the file. - # This though needs the file to be loaded into memory. To make this - # very light, we simply memorymap a small fraction of the file starting - # from the rear until we have our nonzero byte. Since the end mark - # is usually in the first block loaded, there should not be any performance - # concerns, even with bigger files. - - # query for state files - filepaths = D3plot._find_dyna_result_files(base_filepath) - - # compute state data in first file - # search therefore the first non-zero byte from the rear - last_nonzero_byte_index = self._buffer.size - mview_inv_arr = np.asarray(self._buffer.memoryview[::-1]) - # pylint: disable = invalid-name - BLOCK_SIZE = 2048 - for start in range(0, self._buffer.size, BLOCK_SIZE): - (nz_indexes,) = np.nonzero(mview_inv_arr[start : start + BLOCK_SIZE]) - if len(nz_indexes): - last_nonzero_byte_index = self._buffer.size - (start + nz_indexes[0]) - break - n_states_beyond_geom = ( - last_nonzero_byte_index - self.geometry_section_size - ) // size_per_state - - # bugfix: if states are too big we can get a negative estimation - n_states_beyond_geom = max(0, n_states_beyond_geom) - - # memory required later - memory_infos = [ - MemoryInfo( - start=self.geometry_section_size, # type: ignore - length=n_states_beyond_geom * size_per_state, # type: ignore - filepath=base_filepath, - n_states=n_states_beyond_geom, # type: ignore - filesize=self._buffer.size, - use_mmap=True, - ) - ] - - # compute amount of state data in every further file - for filepath in filepaths: - filesize = os.path.getsize(filepath) - last_nonzero_byte_index = -1 - - n_blocks = filesize // mmap.ALLOCATIONGRANULARITY - rest_size = filesize % mmap.ALLOCATIONGRANULARITY - block_length = mmap.ALLOCATIONGRANULARITY - with open(filepath, "rb") as fp: - # search last rest block (page-aligned) - # page-aligned means the start must be - # a multiple of mmap.ALLOCATIONGRANULARITY - # otherwise we get an error on linux - if rest_size: - start = n_blocks * block_length - mview = memoryview( - mmap.mmap( - fp.fileno(), offset=start, length=rest_size, access=mmap.ACCESS_READ - ).read() - ) - (nz_indexes,) = np.nonzero(mview[::-1]) - if len(nz_indexes): - last_nonzero_byte_index = start + rest_size - nz_indexes[0] - - # search in blocks from the reair - if last_nonzero_byte_index == -1: - for i_block in range(n_blocks - 1, -1, -1): - start = block_length * i_block - mview = memoryview( - mmap.mmap( - fp.fileno(), - offset=start, - length=block_length, - access=mmap.ACCESS_READ, - ).read() - ) - (nz_indexes,) = np.nonzero(mview[::-1]) - if len(nz_indexes): - index = block_length - nz_indexes[0] - last_nonzero_byte_index = start + index - break - - if last_nonzero_byte_index == -1: - msg = "The file {0} seems to be missing it's endmark." - raise RuntimeError(msg.format(filepath)) - - # BUGFIX - # In d3eigv it could be observed that there is not necessarily an end mark. - # As a consequence the last byte can indeed be zero. We control this by - # checking if the last nonzero byte was smaller than the state size which - # makes no sense. - if ( - self.header.filetype == D3plotFiletype.D3EIGV - and last_nonzero_byte_index < size_per_state <= filesize - ): - last_nonzero_byte_index = size_per_state - - n_states_in_file = last_nonzero_byte_index // size_per_state - memory_infos.append( - MemoryInfo( - start=0, - length=size_per_state * (n_states_in_file), - filepath=filepath, - n_states=n_states_in_file, - filesize=filesize, - use_mmap=False, - ) - ) - - return memory_infos - - @staticmethod - def _read_file_from_memory_info( - memory_infos: Union[MemoryInfo, list[MemoryInfo]], - ) -> tuple[BinaryBuffer, int]: - """Read files from a single or multiple memory infos - - Parameters - ---------- - memory_infos: MemoryInfo or List[MemoryInfo] - memory infos for loading a file (see `D3plot._collect_file_infos`) - - Returns - ------- - bb_states: BinaryBuffer - New binary buffer with all states perfectly linear in memory - n_states: int - Number of states to be expected - - Notes - ----- - This routine in contrast to `D3plot._read_state_bytebuffer` is used - to load only a fraction of files into memory. - """ - - # single file case - if isinstance(memory_infos, MemoryInfo): - memory_infos = [memory_infos] - - # allocate memory - # bugfix: casting to int prevents int32 overflow for large files - memory_required = 0 - for mem in memory_infos: - memory_required += int(mem.length) - mview = memoryview(bytearray(memory_required)) - - # transfer memory for other files - n_states = 0 - total_offset = 0 - for minfo in memory_infos: - LOGGER.debug("opening: %s", minfo.filepath) - - with open(minfo.filepath, "br") as fp: - # NOTE - # mmap is too slow but maybe there are faster - # ways to use mmap correctly - # if minfo.use_mmap: - - # # memory mapping can only be done page aligned - # mmap_start = (minfo.start // mmap.ALLOCATIONGRANULARITY) * \ - # mmap.ALLOCATIONGRANULARITY - # mview_start = minfo.start - mmap_start - - # end = minfo.start + minfo.length - # n_end_pages = (end // mmap.ALLOCATIONGRANULARITY + - # (end % mmap.ALLOCATIONGRANULARITY != 0)) - # mmap_length = n_end_pages * mmap.ALLOCATIONGRANULARITY - mmap_start - # if mmap_start + mmap_length > minfo.filesize: - # mmap_length = minfo.filesize - mmap_start - - # with mmap.mmap(fp.fileno(), - # length=mmap_length, - # offset=mmap_start, - # access=mmap.ACCESS_READ) as mp: - # # mp.seek(mview_start) - # # mview[total_offset:total_offset + - # # minfo.length] = mp.read(minfo.length) - - # mview[total_offset:total_offset + - # minfo.length] = mp[mview_start:mview_start + minfo.length] - - # else: - fp.seek(minfo.start) - fp.readinto(mview[total_offset : total_offset + minfo.length]) # type: ignore - - total_offset += minfo.length - n_states += minfo.n_states - - # save - bb_states = BinaryBuffer() - bb_states.memoryview = mview - - return bb_states, n_states - - def _read_state_bytebuffer(self, size_per_state: int): - """This routine reads the data for state information - - Parameters - ---------- - size_per_state: int - size of every state to be read - - Returns - ------- - bb_states: BinaryBuffer - New binary buffer with all states perfectly linear in memory - n_states: int - Number of states to be expected - - Notes - ----- - State data is expected directly behind geometry data - Unfortunately data is spread across multiple files. - One file could contain geometry and state data but states - may also be littered across several files. This would - not be an issue, if dyna would not always write in blocks - of 512 words of memory, leaving zero byte padding blocks - at the end of files. These need to be removed and/or taken - care of. - """ - - if not self._buffer: - return BinaryBuffer(), 0 - - memory_infos = self._collect_file_infos(size_per_state) - - # allocate memory - # bugfix: casting to int prevents int32 overflow for large files - memory_required = 0 - for mem in memory_infos: - memory_required += int(mem.length) - mview = memoryview(bytearray(memory_required)) - - # transfer memory from first file - n_states = memory_infos[0].n_states - start = memory_infos[0].start - length = memory_infos[0].length - end = start + length - mview[:length] = self._buffer.memoryview[start:end] - - # transfer memory for other files - total_offset = length - for minfo in memory_infos[1:]: - with open(minfo.filepath, "br") as fp: - fp.seek(minfo.start) - fp.readinto(mview[total_offset : total_offset + length]) # type: ignore - - total_offset += length - n_states += minfo.n_states - - # save - bb_states = BinaryBuffer() - bb_states.memoryview = mview - return bb_states, n_states - - @staticmethod - def _find_dyna_result_files(filepath: str): - """Searches all dyna result files - - Parameters - ---------- - filepath: str - path to the first basic d3plot file - - Returns - ------- - filepaths: list of str - path to all dyna files - - Notes - ----- - The dyna files usually follow a scheme to - simply have the base name and numbers appended - e.g. (d3plot, d3plot0001, d3plot0002, etc.) - """ - - file_dir = os.path.dirname(filepath) - file_dir = file_dir if len(file_dir) != 0 else "." - file_basename = os.path.basename(filepath) - - pattern = f"({file_basename})[0-9]+$" - reg = re.compile(pattern) - - filepaths = [ - os.path.join(file_dir, path) - for path in os.listdir(file_dir) - if os.path.isfile(os.path.join(file_dir, path)) and reg.match(path) - ] - - # alphasort files to handle d3plots with more than 100 files - # e.g. d3plot01, d3plot02, ..., d3plot100 - def convert(text): - return int(text) if text.isdigit() else text.lower() - - number_pattern = "([0-9]+)" - - def alphanum_key(key): - return [convert(c) for c in re.split(number_pattern, key)] - - return sorted(filepaths, key=alphanum_key) - - def _determine_wordsize(self): - """Determine the precision of the file - - Returns - ------- - wordsize: int - size of each word in bytes - """ - - if not self._buffer: - return 4, np.int32, np.float32 - - # test file type flag (1=d3plot, 5=d3part, 11=d3eigv) - - # single precision - value = self._buffer.read_number(44, np.int32) - if value > 1000: - value -= 1000 - if value in (1, 5, 11): - return 4, np.int32, np.float32 - - # double precision - value = self._buffer.read_number(88, np.int64) - if value > 1000: - value -= 1000 - if value in (1, 5, 11): - return 8, np.int64, np.float64 - - raise RuntimeError(f"Unknown file type '{value}'.") - - def plot( - self, - i_timestep: int = 0, - field: Union[np.ndarray, None] = None, - is_element_field: bool = True, - fringe_limits: Union[tuple[float, float], None] = None, - export_filepath: str = "", - ): - """Plot the d3plot geometry - - Parameters - ---------- - i_timestep: int - timestep index to plot - field: Union[np.ndarray, None] - Array containing a field value for every element or node - is_element_field: bool - if the specified field is for elements or nodes - fringe_limits: Union[Tuple[float, float], None] - limits for the fringe bar. Set by default to min and max. - export_filepath: str - filepath to export the html to - - Notes - ----- - Currently only shell elements can be plotted, since for - solids the surface needs extraction. - - Examples - -------- - Plot deformation of last timestep. - - >>> d3plot = D3plot("path/to/d3plot") - >>> d3plot.plot(-1) - >>> # get eff. plastic strain - >>> pstrain = d3plot.arrays[ArrayType.element_shell_effective_plastic_strain] - >>> pstrain.shape - (1, 4696, 3) - >>> # mean across all 3 integration points - >>> pstrain = pstrain.mean(axis=2) - >>> pstrain.shape - (1, 4696) - >>> # we only have 1 timestep here but let's take last one in general - >>> last_timestep = -1 - >>> d3plot.plot(0, field=pstrain[last_timestep]) - >>> # we don't like the fringe, let's adjust - >>> d3plot.plot(0, field=pstrain[last_timestep], fringe_limits=(0, 0.3)) - """ - - if i_timestep >= self._state_info.n_timesteps: - raise ValueError( - f"i_timestep must be less than {self._state_info.n_timesteps}, got {i_timestep}" - ) - - if ArrayType.node_displacement not in self.arrays: - raise KeyError("ArrayType.node_displacement is missing from self.arrays") - - if fringe_limits is not None and len(fringe_limits) != 2: - raise ValueError("fringe_limits must be a sequence of length 2") - - # shell nodes - shell_node_indexes = self.arrays[ArrayType.element_shell_node_indexes] - - # get node displacement - node_xyz = self.arrays[ArrayType.node_displacement][i_timestep, :, :] - - # check for correct field size - if isinstance(field, np.ndarray): - if getattr(field, "ndim", None) != 1: - raise ValueError( - "field must be a 1-dimensional array, " - f"got ndim={getattr(field, 'ndim', 'unknown')}" - ) - - if is_element_field and len(shell_node_indexes) != len(field): # type: ignore - msg = "Element indexes and field have different len: {} != {}" - raise ValueError(msg.format(shell_node_indexes.shape, field.shape)) - if not is_element_field and len(node_xyz) != len(field): # type: ignore - msg = "Node field and coords have different len: {} != {}" - raise ValueError(msg.format(node_xyz.shape, field.shape)) - - # create plot - _html = plot_shell_mesh( - node_coordinates=node_xyz, - shell_node_indexes=shell_node_indexes, - field=field, - is_element_field=is_element_field, - fringe_limits=fringe_limits, - ) - - # store in a temporary file - tempdir = tempfile.gettempdir() - tempdir = os.path.join(tempdir, "lasso") - if not os.path.isdir(tempdir): - os.mkdir(tempdir) - - for tmpfile in os.listdir(tempdir): - tmpfile = os.path.join(tempdir, tmpfile) - if os.path.isfile(tmpfile): - os.remove(tmpfile) - - if export_filepath: - with open(export_filepath, "w", encoding="utf-8") as fp: - fp.write(_html) - else: - # create new temp file - with tempfile.NamedTemporaryFile( - dir=tempdir, suffix=".html", mode="w", delete=False - ) as fp: - fp.write(_html) - webbrowser.open(fp.name) - - def write_d3plot( - self, filepath: Union[str, BinaryIO], block_size_bytes: int = 2048, single_file: bool = True - ): - """Write a d3plot file again - - Parameters - ---------- - filepath: Union[str, BinaryIO] - filepath of the new d3plot file or an opened file handle - block_size_bytes: int - D3plots are originally written in byte-blocks causing zero-padding at the end of - files. This can be controlled by this parameter. Set to 0 for no padding. - single_file: bool - whether to write all states into a single file - - Examples - -------- - Modify an existing d3plot: - - >>> d3plot = D3plot("path/to/d3plot") - >>> hvars = d3plot.array[ArrayType.element_shell_history_vars] - >>> hvars.shape - (1, 4696, 3, 19) - >>> new_history_var = np.random.random((1, 4696, 3, 1)) - >>> new_hvars = np.concatenate([hvars, new_history_var], axis=3) - >>> d3plot.array[ArrayType.element_shell_history_vars] = new_hvars - >>> d3plot.write_d3plot("path/to/new/d3plot") - - Write a new d3plot from scratch: - - >>> d3plot = D3plot() - >>> d3plot.arrays[ArrayType.node_coordinates] = np.array([ - ... [0, 0, 0], - ... [1, 0, 0], - ... [0, 1, 0], - ... ]) - >>> d3plot.arrays[ArrayType.element_shell_node_indexes] = np.array([[0, 2, 1, 1]]) - >>> d3plot.arrays[ArrayType.element_shell_part_indexes] = np.array([0]) - >>> d3plot.arrays[ArrayType.node_displacement] = np.array([ - ... [[0, 0, 0], [1, 0, 0], [0, 1, 0]] - ... ]) - >>> d3plot.write_d3plot("yay.d3plot") - """ - - # if there is a single buffer, write all in - if not isinstance(filepath, str): - single_file = True - - # determine write settings - write_settings = D3plotWriterSettings(self, block_size_bytes, single_file) - write_settings.build_header() - - # remove old files - if isinstance(filepath, str): - filepaths = D3plot._find_dyna_result_files(filepath) - for path in filepaths: - if os.path.isfile(path): - os.remove(path) - - # write geometry file - with open_file_or_filepath(filepath, "wb") as fp: - n_bytes_written = 0 - msg = "wrote %s after %s." - - # header - n_bytes_written += self._write_header(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_header") - - # material section - n_bytes_written += self._write_geom_material_section(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_material_section") - - # fluid material data - n_bytes_written += self._write_geom_fluid_material_header(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_fluid_material_header") - - # SPH element data flags - n_bytes_written += self._write_geom_sph_element_data_flags(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_sph_element_data_flags") - - # Particle Data - n_bytes_written += self._write_geom_particle_flags(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_particle_flags") - - # Geometry Data - n_bytes_written += self._write_geometry(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geometry") - - # User Material, Node, Blabla IDs - n_bytes_written += self._write_geom_user_ids(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_user_ids") - - # Rigid Body Description - n_bytes_written += self._write_geom_rigid_body_description(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_rigid_body_description") - - # Adapted Element Parent List - # not supported - - # Smooth Particle Hydrodynamcis Node and Material list - n_bytes_written += self._write_geom_sph_node_and_materials(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_sph_node_and_materials") - - # Particle Geometry Data - n_bytes_written += self._write_geom_particle_geometry_data(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_particle_geometry_data") - - # Rigid Road Surface Data - n_bytes_written += self._write_geom_rigid_road_surface(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_rigid_road_surface") - - # Connectivity for weirdo elements - # 10 Node Tetra - # 8 Node Shell - # 20 Node Solid - # 27 Node Solid - n_bytes_written += self._write_geom_extra_node_data(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_geom_extra_node_data") - - # end mark - n_bytes_written += fp.write(write_settings.pack(-999999.0)) - LOGGER.debug(msg, n_bytes_written, "_end_mark") - - # Header Part & Contact Interface Titles - n_bytes_written_before_titles = n_bytes_written - n_bytes_written += self._write_header_part_contact_interface_titles(fp, write_settings) - LOGGER.debug(msg, n_bytes_written, "_write_header_part_contact_interface_titles") - - if n_bytes_written_before_titles != n_bytes_written: - # we seal the file here with an endmark - n_bytes_written += fp.write(write_settings.pack(-999999.0)) - LOGGER.debug(msg, n_bytes_written, "_end_mark") - else: - pass - # we already set an end-mark before - # that is perfectly fine - - # correct zero padding at the end - if block_size_bytes > 0: - zero_bytes = self._get_zero_byte_padding(n_bytes_written, block_size_bytes) - n_bytes_written += fp.write(zero_bytes) - LOGGER.debug(msg, n_bytes_written, "_zero_byte_padding") - - msg = "Wrote %s bytes to geometry file." - LOGGER.debug(msg, n_bytes_written) - - # Extra Data Types (for multi solver output) - # not supported - - # write states - self._write_states(filepath, write_settings) - - def _write_header(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: - wordsize = settings.wordsize - - header_words = { - "title": (0 * wordsize, 10 * wordsize), - "runtime": (10 * wordsize, wordsize), - "filetype": (11 * wordsize, wordsize), - "source_version": (12 * wordsize, wordsize), - "release_version": (13 * wordsize, wordsize), - "version": (14 * wordsize, wordsize), - "ndim": (15 * wordsize, wordsize), - "numnp": (16 * wordsize, wordsize), - "icode": (17 * wordsize, wordsize), - "nglbv": (18 * wordsize, wordsize), - "it": (19 * wordsize, wordsize), - "iu": (20 * wordsize, wordsize), - "iv": (21 * wordsize, wordsize), - "ia": (22 * wordsize, wordsize), - "nel8": (23 * wordsize, wordsize), - "nummat8": (24 * wordsize, wordsize), - "numds": (25 * wordsize, wordsize), - "numst": (26 * wordsize, wordsize), - "nv3d": (27 * wordsize, wordsize), - "nel2": (28 * wordsize, wordsize), - "nummat2": (29 * wordsize, wordsize), - "nv1d": (30 * wordsize, wordsize), - "nel4": (31 * wordsize, wordsize), - "nummat4": (32 * wordsize, wordsize), - "nv2d": (33 * wordsize, wordsize), - "neiph": (34 * wordsize, wordsize), - "neips": (35 * wordsize, wordsize), - "maxint": (36 * wordsize, wordsize), - "nmsph": (37 * wordsize, wordsize), - "ngpsph": (38 * wordsize, wordsize), - "narbs": (39 * wordsize, wordsize), - "nelth": (40 * wordsize, wordsize), - "nummatt": (41 * wordsize, wordsize), - "nv3dt": (42 * wordsize, wordsize), - "ioshl1": (43 * wordsize, wordsize), - "ioshl2": (44 * wordsize, wordsize), - "ioshl3": (45 * wordsize, wordsize), - "ioshl4": (46 * wordsize, wordsize), - "ialemat": (47 * wordsize, wordsize), - "ncfdv1": (48 * wordsize, wordsize), - "ncfdv2": (49 * wordsize, wordsize), - # "nadapt": (50*wordsize, wordsize), - "nmmat": (51 * wordsize, wordsize), - "numfluid": (52 * wordsize, wordsize), - "inn": (53 * wordsize, wordsize), - "npefg": (54 * wordsize, wordsize), - "nel48": (55 * wordsize, wordsize), - "idtdt": (56 * wordsize, wordsize), - "extra": (57 * wordsize, wordsize), - } - - header_extra_words = { - "nel20": (64 * wordsize, wordsize), - "nt3d": (65 * wordsize, wordsize), - "nel27": (66 * wordsize, wordsize), - "neipb": (67 * wordsize, wordsize), - } - - new_header = settings.header - - barray = bytearray((64 + new_header["extra"]) * wordsize) - - for name, (position, size) in header_words.items(): - barray[position : position + size] = settings.pack(new_header[name], size) - - if new_header["extra"] > 0: - for name, (position, size) in header_extra_words.items(): - barray[position : position + size] = settings.pack(new_header[name], size) - - n_bytes_written = fp.write(barray) - - # check - n_bytes_expected = (64 + new_header["extra"]) * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_material_section( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - if settings.mattyp <= 0: - return 0 - - _check_ndim(self, {ArrayType.part_material_type: ["n_parts"]}) - - part_material_type_original = self.arrays[ArrayType.part_material_type] - # part_material_type = np.full(settings.header["nmmat"], -1, - # dtype=settings.itype) - - # if ArrayType.element_solid_part_indexes in self.arrays: - # unique_part_indexes = settings.unique_solid_part_indexes - # part_material_type[unique_part_indexes] = \ - # part_material_type_original[unique_part_indexes] - # if ArrayType.element_beam_part_indexes in self.arrays: - # unique_part_indexes = settings.unique_beam_part_indexes - # part_material_type[unique_part_indexes] = \ - # part_material_type_original[unique_part_indexes] - # if ArrayType.element_shell_part_indexes in self.arrays: - # unique_part_indexes = settings.unique_shell_part_indexes - # part_material_type[unique_part_indexes] = \ - # part_material_type_original[unique_part_indexes] - # if ArrayType.element_tshell_part_indexes in self.arrays: - # unique_part_indexes = settings.unique_tshell_part_indexes - # part_material_type[unique_part_indexes] = \ - # part_material_type_original[unique_part_indexes] - - numrbe = settings.n_rigid_shells - - n_bytes_written = 0 - n_bytes_written += fp.write(settings.pack(numrbe)) - n_bytes_written += fp.write(settings.pack(len(part_material_type_original))) - n_bytes_written += fp.write(settings.pack(part_material_type_original)) - - # check - n_bytes_expected = (len(part_material_type_original) + 2) * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_fluid_material_header( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - if settings.header["ialemat"] == 0: - return 0 - - _check_ndim(self, {ArrayType.ale_material_ids: ["n_ale_parts"]}) - - array = self.arrays[ArrayType.ale_material_ids] - n_bytes_written = fp.write(settings.pack(array, dtype_hint=np.integer)) - - # check - n_bytes_expected = settings.header["ialemat"] * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_sph_element_data_flags( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - if settings.header["nmsph"] <= 0: - return 0 - - n_sph_var_count = 0 - - # radius - n_sph_radius_vars = 1 if ArrayType.sph_radius in self.arrays else 0 - n_sph_var_count += n_sph_radius_vars - - # pressure - n_sph_pressure_vars = 1 if ArrayType.sph_pressure in self.arrays else 0 - n_sph_var_count += n_sph_pressure_vars - - # stress - n_sph_stress_vars = 6 if ArrayType.sph_stress in self.arrays else 0 - n_sph_var_count += n_sph_stress_vars - - # eff pstrain - n_sph_eff_pstrain_vars = 1 if ArrayType.sph_effective_plastic_strain in self.arrays else 0 - n_sph_var_count += n_sph_eff_pstrain_vars - - # density - n_sph_density_vars = 1 if ArrayType.sph_density in self.arrays else 0 - n_sph_var_count += n_sph_density_vars - - # internal energy - n_sph_internal_energy_vars = 1 if ArrayType.sph_internal_energy in self.arrays else 0 - n_sph_var_count += n_sph_internal_energy_vars - - # n neighbors - n_sph_n_neighbors_vars = 1 if ArrayType.sph_n_neighbors in self.arrays else 0 - n_sph_var_count += n_sph_n_neighbors_vars - - # strains - n_sph_strain_vars = 6 if ArrayType.sph_strain in self.arrays else 0 - n_sph_var_count += n_sph_strain_vars - - # mass - n_sph_mass_vars = 1 if ArrayType.sph_mass in self.arrays else 0 - n_sph_var_count += n_sph_mass_vars - - # history vars - n_sph_history_vars = 0 - if ArrayType.sph_history_vars in self.arrays: - n_sph_history_vars, _ = settings.count_array_state_var( - ArrayType.sph_history_vars, - ["n_timesteps", "n_sph_particles", "n_sph_history_vars"], - False, - ) - n_sph_var_count += n_sph_history_vars - - # write - n_bytes_written = 0 - n_bytes_written += fp.write(settings.pack(n_sph_var_count)) - n_bytes_written += fp.write(settings.pack(n_sph_radius_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_pressure_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_stress_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_eff_pstrain_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_density_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_internal_energy_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_n_neighbors_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_strain_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_mass_vars)) - n_bytes_written += fp.write(settings.pack(n_sph_history_vars)) - - # check - n_bytes_expected = 11 * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_particle_flags(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: - npefg = settings.header["npefg"] - - if npefg <= 0 or npefg > 10000000: - return 0 - - _check_ndim( - self, - { - ArrayType.airbags_n_particles: ["n_airbags"], - ArrayType.airbags_n_chambers: ["n_airbags"], - }, - ) - - # n_airbags = npefg % 1000 - subver = npefg // 1000 - - # airbag geometry var count - ngeom = 5 if ArrayType.airbags_n_chambers in self.arrays else 4 - - # state variable count - # see later - nvar = 14 - - # n particles - n_particles = 0 - if ArrayType.airbags_n_particles in self.arrays: - n_particles = np.sum(self.arrays[ArrayType.airbags_n_particles]) - - # airbag state var count - nstgeom = 2 - - # write - n_bytes_written = 0 - n_bytes_written += fp.write(settings.pack(ngeom)) - n_bytes_written += fp.write(settings.pack(nvar)) - n_bytes_written += fp.write(settings.pack(n_particles)) - n_bytes_written += fp.write(settings.pack(nstgeom)) - if subver == 4: - # This was never validated - n_bytes_written += fp.write( - settings.pack(self.arrays[ArrayType.airbags_n_chambers].sum()) - ) - - # check - n_bytes_expected = (5 if subver == 4 else 4) * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - # typecode for variables - # pylint: disable = invalid-name - INT_TC = 1 - # pylint: disable = invalid-name - FLOAT_TC = 2 - nlist_names_typecodes = [ - # airbag geometry data (ngeom) - ["Start N ", INT_TC], - ["Npart ", INT_TC], - ["Bag ID ", INT_TC], - ["NGasC ", INT_TC], - ["NCham ", INT_TC], - # state particle data (nvar) - ["GasC ID ", INT_TC], - ["Cham ID ", INT_TC], - ["Leakage ", INT_TC], - ["Pos x ", FLOAT_TC], - ["Pos y ", FLOAT_TC], - ["Pos z ", FLOAT_TC], - ["Vel x ", FLOAT_TC], - ["Vel y ", FLOAT_TC], - ["Vel z ", FLOAT_TC], - ["Mass ", FLOAT_TC], - ["Radius ", FLOAT_TC], - ["Spin En ", FLOAT_TC], - ["Tran En ", FLOAT_TC], - ["NS dist ", FLOAT_TC], - # airbag state vars (nstgeom) - ["Act Gas ", INT_TC], - ["Bag Vol ", FLOAT_TC], - ] - - # airbag var typecodes - for _, typecode in nlist_names_typecodes: - n_bytes_written += fp.write(settings.pack(typecode)) - - # airbag var names - # every word is an ascii char. So, we need to set - # only the first byte to the ascii char code - fmt_string = "{0:" + str(settings.wordsize) + "}" - for name, _ in nlist_names_typecodes: - name_formatted = fmt_string.format(name).encode("utf-8") - for ch in name_formatted: - barray = bytearray(settings.wordsize) - barray[0] = ch - - n_bytes_written += fp.write(settings.pack(barray, settings.wordsize)) - - # check - n_bytes_expected += len(nlist_names_typecodes) * 9 * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geometry(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: - n_bytes_written = 0 - - # pre-checks - _check_ndim( - self, - { - ArrayType.node_coordinates: ["n_nodes", "x_y_z"], - ArrayType.element_solid_node_indexes: ["n_solids", "n_element_nodes"], - ArrayType.element_solid_part_indexes: ["n_solids"], - ArrayType.element_solid_extra_nodes: ["n_solids", "n_extra_nodes"], - ArrayType.element_tshell_node_indexes: ["n_tshells", "n_element_nodes"], - ArrayType.element_tshell_part_indexes: ["n_tshells"], - ArrayType.element_beam_node_indexes: ["n_beams", "n_element_nodes"], - ArrayType.element_beam_part_indexes: ["n_beams"], - ArrayType.element_shell_node_indexes: ["n_shells", "n_element_nodes"], - ArrayType.element_shell_part_indexes: ["n_shells"], - }, - ) - self.check_array_dims({ArrayType.node_coordinates: 1}, "x_y_z", 3) - - array_dims = { - ArrayType.element_solid_node_indexes: 0, - ArrayType.element_solid_part_indexes: 0, - ArrayType.element_solid_extra_nodes: 0, - } - n_solids = self.check_array_dims(array_dims, "n_solids") - self.check_array_dims({ArrayType.element_solid_node_indexes: 1}, "n_element_nodes", 8) - self.check_array_dims({ArrayType.element_solid_extra_nodes: 1}, "n_extra_nodes", 2) - array_dims = { - ArrayType.element_tshell_node_indexes: 0, - ArrayType.element_tshell_part_indexes: 0, - } - self.check_array_dims(array_dims, "n_tshells") - self.check_array_dims({ArrayType.element_tshell_node_indexes: 1}, "n_element_nodes", 8) - array_dims = { - ArrayType.element_beam_node_indexes: 0, - ArrayType.element_beam_part_indexes: 0, - } - self.check_array_dims(array_dims, "n_beams") - self.check_array_dims({ArrayType.element_beam_node_indexes: 1}, "n_element_nodes", 5) - array_dims = { - ArrayType.element_shell_node_indexes: 0, - ArrayType.element_shell_part_indexes: 0, - } - self.check_array_dims(array_dims, "n_shells") - self.check_array_dims({ArrayType.element_shell_node_indexes: 1}, "n_element_nodes", 4) - - # NODES - node_coordinates = ( - self.arrays[ArrayType.node_coordinates] - if ArrayType.node_coordinates in self.arrays - else np.zeros((0, settings.header["ndim"]), dtype=self.header.ftype) - ) - n_bytes_written += fp.write(settings.pack(node_coordinates, dtype_hint=np.floating)) - - # SOLIDS - solid_node_indexes = ( - self.arrays[ArrayType.element_solid_node_indexes] + FORTRAN_OFFSET - if ArrayType.element_solid_node_indexes in self.arrays - else np.zeros((0, 8), dtype=self._header.itype) - ) - solid_part_indexes = ( - self.arrays[ArrayType.element_solid_part_indexes] + FORTRAN_OFFSET - if ArrayType.element_solid_part_indexes in self.arrays - else np.zeros(0, dtype=self._header.itype) - ) - solid_geom_array = np.concatenate( - (solid_node_indexes, solid_part_indexes.reshape(n_solids, 1)), axis=1 - ) - n_bytes_written += fp.write(settings.pack(solid_geom_array, dtype_hint=np.integer)) - - # SOLID 10 - # the two extra nodes - if ArrayType.element_solid_extra_nodes in self.arrays: - array = self.arrays[ArrayType.element_solid_extra_nodes] + FORTRAN_OFFSET - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.integer)) - - # THICK SHELLS - tshell_node_indexes = ( - self.arrays[ArrayType.element_tshell_node_indexes] + FORTRAN_OFFSET - if ArrayType.element_tshell_node_indexes in self.arrays - else np.zeros((0, 8), dtype=self._header.itype) - ) - tshell_part_indexes = ( - self.arrays[ArrayType.element_tshell_part_indexes] + FORTRAN_OFFSET - if ArrayType.element_tshell_part_indexes in self.arrays - else np.zeros(0, dtype=self._header.itype) - ) - tshell_geom_array = np.concatenate( - (tshell_node_indexes, tshell_part_indexes.reshape(-1, 1)), axis=1 - ) - n_bytes_written += fp.write(settings.pack(tshell_geom_array, dtype_hint=np.integer)) - - # BEAMS - beam_node_indexes = ( - self.arrays[ArrayType.element_beam_node_indexes] + FORTRAN_OFFSET - if ArrayType.element_beam_node_indexes in self.arrays - else np.zeros((0, 5), dtype=self._header.itype) - ) - beam_part_indexes = ( - self.arrays[ArrayType.element_beam_part_indexes] + FORTRAN_OFFSET - if ArrayType.element_beam_part_indexes in self.arrays - else np.zeros(0, dtype=self._header.itype) - ) - beam_geom_array = np.concatenate( - (beam_node_indexes, beam_part_indexes.reshape(-1, 1)), axis=1 - ) - n_bytes_written += fp.write(settings.pack(beam_geom_array, dtype_hint=np.integer)) - - # SHELLS - shell_node_indexes = ( - self.arrays[ArrayType.element_shell_node_indexes] + FORTRAN_OFFSET - if ArrayType.element_shell_node_indexes in self.arrays - else np.zeros((0, 4), dtype=self._header.itype) - ) - shell_part_indexes = ( - self.arrays[ArrayType.element_shell_part_indexes] + FORTRAN_OFFSET - if ArrayType.element_shell_part_indexes in self.arrays - else np.zeros(0, dtype=self._header.itype) - ) - shell_geom_array = np.concatenate( - (shell_node_indexes, shell_part_indexes.reshape(-1, 1)), axis=1 - ) - n_bytes_written += fp.write(settings.pack(shell_geom_array, dtype_hint=np.integer)) - - # check - n_bytes_expected = ( - settings.header["numnp"] * 3 - + abs(settings.header["nel8"]) * 9 - + settings.header["nelth"] * 9 - + settings.header["nel2"] * 6 - + settings.header["nel4"] * 5 - ) * settings.wordsize - if ArrayType.element_solid_extra_nodes in self.arrays: - n_bytes_expected += 2 * abs(settings.header["nel8"]) - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - # return the chunks - return n_bytes_written - - def _write_geom_user_ids(self, fp: typing.IO[Any], settings: D3plotWriterSettings) -> int: - narbs = settings.header["narbs"] - if narbs == 0: - return 0 - - info = self._numbering_info - - _check_ndim( - self, - { - ArrayType.node_ids: ["n_nodes"], - ArrayType.element_solid_ids: ["n_solids"], - ArrayType.element_beam_ids: ["n_beams"], - ArrayType.element_shell_ids: ["n_shells"], - ArrayType.element_tshell_ids: ["n_tshells"], - ArrayType.part_ids: ["n_parts"], - ArrayType.part_ids_unordered: ["n_parts"], - ArrayType.part_ids_cross_references: ["n_parts"], - }, - ) - - n_bytes_written = 0 - - # NUMBERING HEADER - - # nsort seems to be solver internal pointer - # ... hopefully - nsort = info.ptr_node_ids - nsort *= -1 if ArrayType.part_ids in self.arrays else 1 - - n_bytes_written += fp.write(settings.pack(nsort)) - - nsrh = abs(nsort) + settings.header["numnp"] - n_bytes_written += fp.write(settings.pack(nsrh)) - - nsrb = nsrh + abs(settings.header["nel8"]) - n_bytes_written += fp.write(settings.pack(nsrb)) - - nsrs = nsrb + settings.header["nel2"] - n_bytes_written += fp.write(settings.pack(nsrs)) - - nsrt = nsrs + settings.header["nel4"] - n_bytes_written += fp.write(settings.pack(nsrt)) - - nsortd = settings.header["numnp"] - n_bytes_written += fp.write(settings.pack(nsortd)) - - nsrhd = abs(settings.header["nel8"]) - n_bytes_written += fp.write(settings.pack(nsrhd)) - - nsrbd = settings.header["nel2"] - n_bytes_written += fp.write(settings.pack(nsrbd)) - - nsrsd = settings.header["nel4"] - n_bytes_written += fp.write(settings.pack(nsrsd)) - - nsrtd = settings.header["nelth"] - n_bytes_written += fp.write(settings.pack(nsrtd)) - - if ArrayType.part_ids in self.arrays: - # some lsdyna material pointer - Used by LS-Prepost in labelling materials - - # Unsorted material ID pointer - nsrmu = nsrt + settings.header["nelth"] - # Sorted material ID pointer - nsrma = nsrmu + settings.header["nmmat"] - # Mapping array between sorted and unsorted - nsrmp = nsrma + settings.header["nmmat"] - - n_bytes_written += fp.write(settings.pack(nsrma)) - n_bytes_written += fp.write(settings.pack(nsrmu)) - n_bytes_written += fp.write(settings.pack(nsrmp)) - - # "Total number of materials (parts)" - nsrtm = settings.header["nmmat"] - n_bytes_written += fp.write(settings.pack(nsrtm)) - - # Total number of nodal rigid body constraint sets - numrbs = settings.header["numrbs"] - n_bytes_written += fp.write(settings.pack(numrbs)) - - # Total number of materials - # ... coz it's fun doing nice things twice - nmmat = settings.header["nmmat"] - n_bytes_written += fp.write(settings.pack(nmmat)) - - # NODE IDS - node_ids = ( - self.arrays[ArrayType.node_ids] - if ArrayType.node_ids in self.arrays - else np.arange( - FORTRAN_OFFSET, settings.header["numnp"] + FORTRAN_OFFSET, dtype=settings.itype - ) - ) - n_bytes_written += fp.write(settings.pack(node_ids, dtype_hint=np.integer)) - - # SOLID IDS - solid_ids = ( - self.arrays[ArrayType.element_solid_ids] - if ArrayType.element_solid_ids in self.arrays - else np.arange( - FORTRAN_OFFSET, settings.header["nel8"] + FORTRAN_OFFSET, dtype=settings.itype - ) - ) - n_bytes_written += fp.write(settings.pack(solid_ids, dtype_hint=np.integer)) - - # BEAM IDS - beam_ids = ( - self.arrays[ArrayType.element_beam_ids] - if ArrayType.element_beam_ids in self.arrays - else np.arange( - FORTRAN_OFFSET, settings.header["nel2"] + FORTRAN_OFFSET, dtype=settings.itype - ) - ) - n_bytes_written += fp.write(settings.pack(beam_ids, dtype_hint=np.integer)) - - # SHELL IDS - shell_ids = ( - self.arrays[ArrayType.element_shell_ids] - if ArrayType.element_shell_ids in self.arrays - else np.arange( - FORTRAN_OFFSET, settings.header["nel4"] + FORTRAN_OFFSET, dtype=settings.itype - ) - ) - n_bytes_written += fp.write(settings.pack(shell_ids, dtype_hint=np.integer)) - - # TSHELL IDS - tshell_ids = ( - self.arrays[ArrayType.element_tshell_ids] - if ArrayType.element_tshell_ids in self.arrays - else np.arange( - FORTRAN_OFFSET, settings.header["nelth"] + FORTRAN_OFFSET, dtype=settings.itype - ) - ) - n_bytes_written += fp.write(settings.pack(tshell_ids, dtype_hint=np.integer)) - - # MATERIALS .... yay - # - # lsdyna generates duplicate materials originally - # thus nmmat in header is larger than the materials used - # by the elements. Some are related to rigid bodies - # but some are also generated internally by material models - # by the following procedure the material array is larger - # than the actual amount of materials (there may be unused - # material ids), but it ensures a relatively consistent writing - - material_ids = np.full(settings.header["nmmat"], -1, dtype=self._header.itype) - if ArrayType.part_ids in self.arrays: - part_ids = self.arrays[ArrayType.part_ids] - material_ids = part_ids - else: - material_ids = np.arange(start=0, stop=settings.header["nmmat"], dtype=settings.itype) - - n_bytes_written += fp.write(settings.pack(material_ids, dtype_hint=np.integer)) - - # unordered material ids can be ignored - data_array = np.zeros(settings.header["nmmat"], dtype=settings.itype) - if ArrayType.part_ids_unordered in self.arrays: - array = self.arrays[ArrayType.part_ids_unordered] - end_index = min(len(array), len(data_array)) - data_array[:end_index] = array[:end_index] - n_bytes_written += fp.write(settings.pack(data_array, dtype_hint=np.integer)) - - # also cross-reference array for ids - data_array = np.zeros(settings.header["nmmat"], dtype=settings.itype) - if ArrayType.part_ids_cross_references in self.arrays: - array = self.arrays[ArrayType.part_ids_cross_references] - end_index = min(len(array), len(data_array)) - data_array[:end_index] = array[:end_index] - n_bytes_written += fp.write(settings.pack(data_array, dtype_hint=np.integer)) - - # check - n_bytes_expected = settings.header["narbs"] * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_rigid_body_description( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - # this type of rigid body descriptions are very rare - # and thus badly tested - - if settings.header["ndim"] not in (8, 9): - return 0 - - _check_ndim(self, {ArrayType.rigid_body_part_indexes: ["n_rigid_bodies"]}) - array_dims = { - ArrayType.rigid_body_part_indexes: 0, - ArrayType.rigid_body_node_indexes_list: 0, - ArrayType.rigid_body_active_node_indexes_list: 0, - } - if not _check_array_occurrence(self, list(array_dims.keys()), list(array_dims.keys())): - return 0 - - # check length - # cannot use self._check_array_dims due to some lists - dim_size = -1 - for typename in array_dims: - array = self.arrays[typename] - if dim_size < 0: - dim_size = len(array) - elif len(array) != dim_size: - dimension_size_dict = { - typename2: len(self.arrays[typename2]) for typename2 in array_dims - } - msg = "Inconsistency in array dim '{0}' detected:\n{1}" - size_list = [ - f" - name: {typename}, dim: {array_dims[typename]}, size: {size}" - for typename, size in dimension_size_dict.items() - ] - raise ValueError(msg.format("n_rigid_bodies", "\n".join(size_list))) - - rigid_body_part_indexes = self.arrays[ArrayType.rigid_body_part_indexes] + FORTRAN_OFFSET - # rigid_body_n_nodes = self.arrays[ArrayType.rigid_body_n_nodes] - rigid_body_node_indexes_list = self.arrays[ArrayType.rigid_body_node_indexes_list] - # rigid_body_n_active_nodes = self.arrays[ArrayType.rigid_body_n_active_nodes] - rigid_body_active_node_indexes_list = self.arrays[ - ArrayType.rigid_body_active_node_indexes_list - ] - - n_bytes_written = 0 - n_bytes_expected = settings.wordsize - - # NRIGID - n_rigid_bodies = len(rigid_body_part_indexes) - n_bytes_written += fp.write(settings.pack(n_rigid_bodies)) - - for i_rigid in range(n_rigid_bodies): - # part index - n_bytes_written += fp.write(settings.pack(rigid_body_part_indexes[i_rigid])) - # node indexes - array = rigid_body_node_indexes_list[i_rigid] + FORTRAN_OFFSET - n_bytes_written += fp.write(settings.pack(len(array))) - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.integer)) - # active node indexes - array = rigid_body_active_node_indexes_list[i_rigid] - n_bytes_written += fp.write(settings.pack(len(array))) - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.integer)) - - n_bytes_expected += settings.wordsize * ( - 3 - + len(rigid_body_node_indexes_list[i_rigid]) - + len(rigid_body_active_node_indexes_list[i_rigid]) - ) - - # check - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_sph_node_and_materials( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - nmsph = settings.header["nmsph"] - - if nmsph <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.sph_node_indexes: ["n_sph_nodes"], - ArrayType.sph_node_material_index: ["n_sph_nodes"], - }, - ) - array_dims = {ArrayType.sph_node_indexes: 0, ArrayType.sph_node_material_index: 0} - array_names = list(array_dims.keys()) - _check_array_occurrence(self, array_names, array_names) - self.check_array_dims(array_dims, "n_sph_nodes", nmsph) - - sph_node_indexes = self.arrays[ArrayType.sph_node_indexes] + FORTRAN_OFFSET - sph_node_material_index = self.arrays[ArrayType.sph_node_material_index] + FORTRAN_OFFSET - sph_data = np.concatenate((sph_node_indexes, sph_node_material_index), axis=1) - - # write - n_bytes_written = fp.write(settings.pack(sph_data, dtype_hint=np.integer)) - - # check - n_bytes_expected = nmsph * settings.wordsize * 2 - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_particle_geometry_data( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - npefg = settings.header["npefg"] - if npefg <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.airbags_first_particle_id: ["n_airbags"], - ArrayType.airbags_n_particles: ["n_airbags"], - ArrayType.airbags_ids: ["n_airbags"], - ArrayType.airbags_n_gas_mixtures: ["n_airbags"], - ArrayType.airbags_n_chambers: ["n_airbags"], - }, - ) - array_dims = { - ArrayType.airbags_first_particle_id: 0, - ArrayType.airbags_n_particles: 0, - ArrayType.airbags_ids: 0, - ArrayType.airbags_n_gas_mixtures: 0, - ArrayType.airbags_n_chambers: 0, - } - array_names = list(array_dims.keys()) - _check_array_occurrence(self, array_names, array_names) - self.check_array_dims(array_dims, "n_airbags") - - # get the arrays - array_list = [ - self.arrays[ArrayType.airbags_first_particle_id].reshape(-1, 1), - self.arrays[ArrayType.airbags_n_particles].reshape(-1, 1), - self.arrays[ArrayType.airbags_ids].reshape(-1, 1), - self.arrays[ArrayType.airbags_n_gas_mixtures].reshape(-1, 1), - ] - if ArrayType.airbags_n_chambers in self.arrays: - array_list.append(self.arrays[ArrayType.airbags_n_chambers].reshape(-1, 1)) - - # write - airbag_geometry_data = np.concatenate(array_list, axis=1) - n_bytes_written = fp.write(settings.pack(airbag_geometry_data, dtype_hint=np.integer)) - - # check - n_airbags = npefg % 1000 - ngeom = 5 if ArrayType.airbags_n_chambers in self.arrays else 4 - n_bytes_expected = n_airbags * ngeom * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_rigid_road_surface( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - if settings.header["ndim"] <= 5: - return 0 - - _check_ndim( - self, - { - ArrayType.rigid_road_node_ids: ["rigid_road_n_nodes"], - ArrayType.rigid_road_node_coordinates: ["rigid_road_n_nodes", "x_y_z"], - ArrayType.rigid_road_segment_node_ids: ["n_segments", "n_nodes"], - ArrayType.rigid_road_segment_road_id: ["n_segments"], - }, - ) - array_dims = {ArrayType.rigid_road_node_ids: 0, ArrayType.rigid_road_node_coordinates: 0} - n_rigid_road_nodes = self.check_array_dims(array_dims, "rigid_road_n_nodes") - self.check_array_dims({ArrayType.rigid_road_node_coordinates: 1}, "x_y_z", 3) - array_dims = { - ArrayType.rigid_road_n_segments: 0, - ArrayType.rigid_road_segment_node_ids: 0, - ArrayType.rigid_road_segment_road_id: 0, - } - n_rigid_roads = self.check_array_dims(array_dims, "n_rigid_roads") - n_bytes_written = 0 - - # NODE COUNT - n_bytes_written += fp.write(settings.pack(n_rigid_road_nodes)) - - # SEGMENT COUNT - # This was never verified - n_total_segments = np.sum( - len(segment_ids) for segment_ids in self.arrays[ArrayType.rigid_road_segment_node_ids] - ) - n_bytes_written += fp.write(settings.pack(n_total_segments)) - - # SURFACE COUNT - n_bytes_written += fp.write(settings.pack(n_rigid_roads)) - - # MOTION FLAG - if motion data is output - # by default let's just say ... yeah baby - # This was never verified - n_bytes_written += fp.write(settings.pack(1)) - - # RIGID ROAD NODE IDS - rigid_road_node_ids = self.arrays[ArrayType.rigid_road_node_ids] - n_bytes_written += fp.write(settings.pack(rigid_road_node_ids, dtype_hint=np.integer)) - - # RIGID ROAD NODE COORDS - rigid_road_node_coordinates = self.arrays[ArrayType.rigid_road_node_coordinates] - n_bytes_written += fp.write( - settings.pack(rigid_road_node_coordinates, dtype_hint=np.floating) - ) - - # SURFACE ID - # SURFACE N_SEGMENTS - # SURFACE SEGMENTS - rigid_road_segment_road_id = self.arrays[ArrayType.rigid_road_segment_road_id] - rigid_road_segment_node_ids = self.arrays[ArrayType.rigid_road_segment_node_ids] - - for segment_id, node_ids in zip( - rigid_road_segment_road_id, rigid_road_segment_node_ids, strict=False - ): - n_bytes_written += fp.write(settings.pack(segment_id)) - n_bytes_written += fp.write(settings.pack(len(node_ids))) - n_bytes_written += fp.write(settings.pack(node_ids, dtype_hint=np.integer)) - - # check - n_bytes_expected = ( - 4 + 4 * n_rigid_road_nodes + n_rigid_roads * (2 + 4 * n_total_segments) - ) * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_geom_extra_node_data( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - n_bytes_written = 0 - - # 10 NODE SOLIDS - if settings.header["nel8"] < 0: - _check_ndim( - self, - { - ArrayType.element_solid_node10_extra_node_indexes: [ - "n_solids", - "2_extra_node_ids", - ] - }, - ) - array_dims = { - ArrayType.element_solid_node_indexes: 0, - ArrayType.element_solid_node10_extra_node_indexes: 0, - } - self.check_array_dims(array_dims, "n_solids") - self.check_array_dims( - {ArrayType.element_solid_node10_extra_node_indexes: 1}, "extra_node_ids", 2 - ) - - extra_nodes = ( - self.arrays[ArrayType.element_solid_node10_extra_node_indexes] + FORTRAN_OFFSET - ) - - n_bytes_written += fp.write(settings.pack(extra_nodes, dtype_hint=np.integer)) - - # 8 NODE SHELLS - if settings.header["nel48"] > 0: - _check_ndim( - self, - { - ArrayType.element_shell_node8_element_index: ["n_node8_shells"], - ArrayType.element_shell_node8_extra_node_indexes: [ - "n_node8_shells", - "4_extra_node_ids", - ], - }, - ) - array_dims = { - ArrayType.element_shell_node8_element_index: 0, - ArrayType.element_shell_node8_extra_node_indexes: 0, - } - self.check_array_dims(array_dims, "n_node8_shells") - self.check_array_dims( - {ArrayType.element_shell_node8_extra_node_indexes: 1}, "extra_node_ids", 4 - ) - - element_indexes = ( - self.arrays[ArrayType.element_shell_node8_element_index] + FORTRAN_OFFSET - ) - extra_nodes = ( - self.arrays[ArrayType.element_shell_node8_extra_node_indexes] + FORTRAN_OFFSET - ) - - geom_data = np.concatenate((element_indexes, extra_nodes), axis=1) - - n_bytes_written += fp.write(settings.pack(geom_data, dtype_hint=np.integer)) - - # 20 NODE SOLIDS - if settings.header["extra"] > 0 and settings.header["nel20"] > 0: - _check_ndim( - self, - { - ArrayType.element_solid_node20_element_index: ["n_node20_solids"], - ArrayType.element_solid_node20_extra_node_indexes: [ - "n_node20_solids", - "12_extra_node_ids", - ], - }, - ) - array_dims = { - ArrayType.element_solid_node20_element_index: 0, - ArrayType.element_solid_node20_extra_node_indexes: 0, - } - self.check_array_dims(array_dims, "n_node20_solids") - self.check_array_dims( - {ArrayType.element_solid_node20_extra_node_indexes: 1}, "extra_node_ids", 12 - ) - - element_indexes = ( - self.arrays[ArrayType.element_solid_node20_element_index] + FORTRAN_OFFSET - ) - extra_nodes = ( - self.arrays[ArrayType.element_solid_node20_extra_node_indexes] + FORTRAN_OFFSET - ) - - geom_data = np.concatenate((element_indexes, extra_nodes), axis=1) - - n_bytes_written += fp.write(settings.pack(geom_data, dtype_hint=np.integer)) - - # 27 NODE SOLIDS - if settings.header["extra"] > 0 and settings.header["nel27"] > 0: - _check_ndim( - self, - { - ArrayType.element_solid_node20_element_index: ["n_node27_solids"], - ArrayType.element_solid_node20_extra_node_indexes: [ - "n_node27_solids", - "19_extra_node_ids", - ], - }, - ) - array_dims = { - ArrayType.element_solid_node27_element_index: 0, - ArrayType.element_solid_node27_extra_node_indexes: 0, - } - self.check_array_dims(array_dims, "n_node27_solids") - self.check_array_dims( - {ArrayType.element_solid_node27_extra_node_indexes: 1}, "extra_node_ids", 19 - ) - - element_indexes = ( - self.arrays[ArrayType.element_solid_node27_element_index] + FORTRAN_OFFSET - ) - extra_nodes = ( - self.arrays[ArrayType.element_solid_node27_extra_node_indexes] + FORTRAN_OFFSET - ) - - geom_data = np.concatenate((element_indexes, extra_nodes), axis=1) - - n_bytes_written += fp.write(settings.pack(geom_data, dtype_hint=np.integer)) - - # check - has_nel10 = settings.header["nel8"] < 0 - n_bytes_expected = ( - has_nel10 * abs(settings.header["nel8"]) - + settings.header["nel48"] * 5 - + settings.header["nel20"] * 13 - + settings.header["nel27"] * 20 - ) * settings.wordsize - D3plot._compare_n_bytes_checksum(n_bytes_written, n_bytes_expected) - - return n_bytes_written - - def _write_header_part_contact_interface_titles( - self, fp: typing.IO[Any], settings: D3plotWriterSettings - ) -> int: - n_bytes_written = 0 - - # PART TITLES - _check_ndim( - self, - { - # ArrayType.part_titles: ["n_parts", "n_chars"], - ArrayType.part_titles_ids: ["n_parts"] - }, - ) - array_dimensions = {ArrayType.part_titles: 0, ArrayType.part_titles_ids: 0} - if _check_array_occurrence( - self, list(array_dimensions.keys()), list(array_dimensions.keys()) - ): - self.check_array_dims(array_dimensions, "n_parts") - - ntype = 90001 - - n_bytes_written += fp.write(settings.pack(ntype)) - - part_titles_ids = self.arrays[ArrayType.part_titles_ids] - part_titles = self.arrays[ArrayType.part_titles] - - n_entries = len(part_titles) - n_bytes_written += fp.write(settings.pack(n_entries)) - - # title words always have 4 byte size - title_wordsize = 4 - max_len = 18 * title_wordsize - fmt_name = "{0:" + str(max_len) + "}" - for pid, title in zip(part_titles_ids, part_titles, strict=False): - title = title.decode("utf-8") - n_bytes_written += fp.write(settings.pack(pid)) - - formatted_title = fmt_name.format(title[:max_len]) - n_bytes_written += fp.write(settings.pack(formatted_title, max_len)) - - # TITLE2 - # yet another title, coz double is always more fun - if "title2" in self.header.title2: - ntype = 90000 - - # title words always have 4 bytes - title_wordsize = 4 - title_size_words = 18 - - fmt_title2 = "{0:" + str(title_wordsize * title_size_words) + "}" - title2 = fmt_title2.format(self.header.title2[: settings.wordsize * title_size_words]) - - n_bytes_written += fp.write(settings.pack(ntype)) - n_bytes_written += fp.write(settings.pack(title2, settings.wordsize * title_size_words)) - - # CONTACT TITLES - array_dimensions = {ArrayType.contact_titles: 0, ArrayType.contact_title_ids: 0} - if _check_array_occurrence( - self, list(array_dimensions.keys()), list(array_dimensions.keys()) - ): - self.check_array_dims(array_dimensions, "n_parts") - - ntype = 90002 - n_bytes_written += fp.write(settings.pack(ntype)) - - titles_ids = self.arrays[ArrayType.contact_title_ids] - titles = self.arrays[ArrayType.contact_titles] - - n_entries = len(titles) - n_bytes_written += fp.write(settings.pack(n_entries)) - - max_len = 18 * self.header.wordsize - fmt_name = "{0:" + str(max_len) + "}" - for pid, title in zip(titles_ids, titles, strict=False): - n_bytes_written += fp.write(settings.pack(pid)) - - formatted_title = fmt_name.format(title[:max_len]) - n_bytes_written += fp.write(settings.pack(formatted_title)) - - return n_bytes_written - - def _write_states( - self, filepath: Union[str, typing.BinaryIO], settings: D3plotWriterSettings - ) -> int: - # did we store any states? - n_timesteps_written = 0 - - # if timestep array is missing check for any state arrays - if ArrayType.global_timesteps not in self.arrays: - # if any state array is present simply make up a timestep array - if any(array_name in self.arrays for array_name in ArrayType.get_state_array_names()): - array_dims = dict.fromkeys(ArrayType.get_state_array_names(), 0) - n_timesteps = self.check_array_dims( - array_dimensions=array_dims, dimension_name="n_timesteps" - ) - self._state_info.n_timesteps = n_timesteps - self.arrays[ArrayType.global_timesteps] = np.arange( - 0, n_timesteps, dtype=settings.ftype - ) - # no state data so we call it a day - else: - return n_timesteps_written - - # formatter for state files - timesteps = self.arrays[ArrayType.global_timesteps] - n_timesteps = len(timesteps) - fmt_state_file_counter = "{0:02d}" - - # single file or multiple file handling - state_fp: Union[None, typing.BinaryIO] = None - file_to_close: Union[None, typing.BinaryIO] = None - if isinstance(filepath, str): - if settings.single_file: - # pylint: disable = consider-using-with - state_fp = file_to_close = open(filepath + fmt_state_file_counter.format(1), "ab") - else: - # create a new file per timestep - # see time loop - pass - else: - state_fp = filepath - - try: - # time looping ... wheeeeeeeee - for i_timestep, _ in enumerate(timesteps): - # open new state file ... or not - state_filepath_or_file = ( - filepath + fmt_state_file_counter.format(i_timestep + 1) - if isinstance(filepath, str) and state_fp is None - else state_fp - ) - - n_bytes_written = 0 - - with open_file_or_filepath(state_filepath_or_file, "ab") as fp: - # GLOBALS - n_bytes_written += self._write_states_globals(fp, i_timestep, settings) - - # NODE DATA - n_bytes_written += self._write_states_nodes(fp, i_timestep, settings) - - # SOLID THERMAL DATA - n_bytes_written += self._write_states_solid_thermal_data( - fp, i_timestep, settings - ) - - # CFDDATA - # not supported - - # SOLIDS - n_bytes_written += self._write_states_solids(fp, i_timestep, settings) - - # THICK SHELLS - n_bytes_written += self._write_states_tshells(fp, i_timestep, settings) - - # spocky ... BEAM me up - n_bytes_written += self._write_states_beams(fp, i_timestep, settings) - - # SHELLS - n_bytes_written += self._write_states_shells(fp, i_timestep, settings) - - # DELETION INFO - n_bytes_written += self._write_states_deletion_info(fp, i_timestep, settings) - - # SPH - n_bytes_written += self._write_states_sph(fp, i_timestep, settings) - - # AIRBAG - n_bytes_written += self._write_states_airbags(fp, i_timestep, settings) - - # RIGID ROAD - n_bytes_written += self._write_states_rigid_road(fp, i_timestep, settings) - - # RIGID BODY - n_bytes_written += self._write_states_rigid_bodies(fp, i_timestep, settings) - - # EXTRA DATA - # not supported - - # end mark - # at the end for single file buffer - # or behind each state file - if not settings.single_file or i_timestep == n_timesteps - 1: - n_bytes_written += fp.write(settings.pack(-999999.0)) - - if settings.block_size_bytes > 0: - zero_bytes = self._get_zero_byte_padding( - n_bytes_written, settings.block_size_bytes - ) - n_bytes_written += fp.write(zero_bytes) - - # log - msg = "_write_states wrote %d bytes" - LOGGER.debug(msg, n_bytes_written) - n_timesteps_written += 1 - - finally: - # close file if required - if file_to_close is not None: - file_to_close.close() - - return n_timesteps_written - - def _write_states_globals( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - _check_ndim( - self, - { - ArrayType.global_kinetic_energy: ["n_timesteps"], - ArrayType.global_internal_energy: ["n_timesteps"], - ArrayType.global_total_energy: ["n_timesteps"], - ArrayType.global_velocity: ["n_timesteps", "vx_vy_vz"], - }, - ) - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.global_kinetic_energy: 0, - ArrayType.global_internal_energy: 0, - ArrayType.global_total_energy: 0, - ArrayType.global_velocity: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - byte_checksum = 0 - - n_global_vars = settings.header["nglbv"] - - # TIME - timesteps = self.arrays[ArrayType.global_timesteps] - byte_checksum += fp.write(settings.pack(timesteps[i_timestep])) - - # GLOBAL KINETIC ENERGY - if n_global_vars >= 1: - array_type = ArrayType.global_kinetic_energy - value = ( - self.arrays[array_type][i_timestep] - if array_type in self.arrays - else self.header.ftype(0.0) - ) - byte_checksum += fp.write(settings.pack(value, dtype_hint=np.floating)) - - # GLOBAL INTERNAL ENERGY - if n_global_vars >= 2: - array_type = ArrayType.global_internal_energy - value = ( - self.arrays[array_type][i_timestep] - if array_type in self.arrays - else self.header.ftype(0.0) - ) - byte_checksum += fp.write(settings.pack(value, dtype_hint=np.floating)) - - # GLOBAL TOTAL ENERGY - if n_global_vars >= 3: - array_type = ArrayType.global_total_energy - value = ( - self.arrays[array_type][i_timestep] - if array_type in self.arrays - else self.header.ftype(0.0) - ) - byte_checksum += fp.write(settings.pack(value, dtype_hint=np.floating)) - - # GLOBAL VELOCITY - if n_global_vars >= 6: - self.check_array_dims({ArrayType.global_velocity: 1}, "vx_vy_vz", 3) - array_type = ArrayType.global_velocity - array = ( - self.arrays[array_type][i_timestep] - if array_type in self.arrays - else np.zeros(3, self.header.ftype) - ) - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # PARTS - # - # Parts always need special love since dyna - # writes many dummy parts - _check_ndim( - self, - { - ArrayType.part_internal_energy: ["n_timesteps", "n_parts"], - ArrayType.part_kinetic_energy: ["n_timesteps", "n_parts"], - ArrayType.part_velocity: ["n_timesteps", "n_parts", "vx_vy_vz"], - ArrayType.part_mass: ["n_timesteps", "n_parts"], - ArrayType.part_hourglass_energy: ["n_timesteps", "n_parts"], - }, - ) - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.part_internal_energy: 0, - ArrayType.part_kinetic_energy: 0, - ArrayType.part_velocity: 0, - ArrayType.part_mass: 0, - ArrayType.part_hourglass_energy: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - self.check_array_dims({ArrayType.part_velocity: 2}, "vx_vy_vz", 3) - - n_parts = settings.header["nmmat"] - - def _write_part_field(array_type: str, default_shape: Union[int, tuple], dtype: np.dtype): - array = ( - self.arrays[array_type][i_timestep] - if array_type in self.arrays - else np.zeros(default_shape, self.header.ftype) - ) - - if len(array): - dummy_array = array - return fp.write(settings.pack(dummy_array, dtype_hint=np.floating)) - - return 0 - - # PART INTERNAL ENERGY - if n_global_vars >= 6 + n_parts: - byte_checksum += _write_part_field( - ArrayType.part_internal_energy, n_parts, settings.ftype - ) - - # PART KINETIC ENERGY - if n_global_vars >= 6 + 2 * n_parts: - byte_checksum += _write_part_field( - ArrayType.part_kinetic_energy, n_parts, settings.ftype - ) - - # PART VELOCITY - if n_global_vars >= 6 + 5 * n_parts: - byte_checksum += _write_part_field( - ArrayType.part_velocity, (n_parts, 3), settings.ftype - ) - - # PART MASS - if n_global_vars >= 6 + 6 * n_parts: - byte_checksum += _write_part_field(ArrayType.part_mass, n_parts, settings.ftype) - - # PART HOURGLASS ENERGY - if n_global_vars >= 6 + 7 * n_parts: - byte_checksum += _write_part_field( - ArrayType.part_hourglass_energy, n_parts, settings.ftype - ) - - # RIGID WALL - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.rigid_wall_force: 0, - ArrayType.rigid_wall_position: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - array_dims = {ArrayType.rigid_wall_force: 1, ArrayType.rigid_wall_position: 1} - self.check_array_dims(array_dims, "n_rigid_walls") - self.check_array_dims({ArrayType.rigid_wall_position: 2}, "x_y_z", 3) - - n_rigid_wall_vars = settings.header["n_rigid_wall_vars"] - n_rigid_walls = settings.header["n_rigid_walls"] - if n_global_vars >= 6 + 7 * n_parts + n_rigid_wall_vars * n_rigid_walls: - if n_rigid_wall_vars >= 1: - array = self.arrays[ArrayType.rigid_wall_force][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - if n_rigid_wall_vars >= 4: - array = self.arrays[ArrayType.rigid_wall_position][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # check byte checksum - # pylint: disable = invalid-name - TIME_WORDSIZE = 1 - byte_checksum_target = (TIME_WORDSIZE + settings.header["nglbv"]) * settings.wordsize - if byte_checksum != byte_checksum_target: - msg = ( - "byte checksum wrong: " - f"{byte_checksum_target} (header) != {byte_checksum} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_globals", byte_checksum) - - return byte_checksum - - def _write_states_nodes( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - n_nodes = settings.header["numnp"] - if n_nodes <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.node_displacement: ["n_timesteps", "n_nodes", "x_y_z"], - ArrayType.node_velocity: ["n_timesteps", "n_nodes", "vx_vy_vz"], - ArrayType.node_acceleration: ["n_timesteps", "n_nodes", "ax_ay_az"], - ArrayType.node_heat_flux: ["n_timesteps", "n_nodes", "hx_hy_hz"], - # INFO: cannot check since it may have 1 or 3 values per node - # ArrayType.node_temperature: ["n_timesteps","n_nodes"], - ArrayType.node_mass_scaling: ["n_timesteps", "n_nodes"], - ArrayType.node_temperature_gradient: ["n_timesteps", "n_nodes"], - ArrayType.node_residual_forces: ["n_timesteps", "n_nodes", "fx_fy_fz"], - ArrayType.node_residual_moments: ["n_timesteps", "n_nodes", "mx_my_mz"], - }, - ) - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.node_displacement: 0, - ArrayType.node_velocity: 0, - ArrayType.node_acceleration: 0, - ArrayType.node_heat_flux: 0, - ArrayType.node_temperature: 0, - ArrayType.node_mass_scaling: 0, - ArrayType.node_temperature_gradient: 0, - ArrayType.node_residual_forces: 0, - ArrayType.node_residual_moments: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - array_dims = { - ArrayType.node_coordinates: 0, - ArrayType.node_displacement: 1, - ArrayType.node_velocity: 1, - ArrayType.node_acceleration: 1, - ArrayType.node_heat_flux: 1, - ArrayType.node_temperature: 1, - ArrayType.node_mass_scaling: 1, - ArrayType.node_temperature_gradient: 1, - ArrayType.node_residual_forces: 1, - ArrayType.node_residual_moments: 1, - } - self.check_array_dims(array_dims, "n_nodes") - self.check_array_dims({ArrayType.node_heat_flux: 2}, "x_y_z", 3) - self.check_array_dims({ArrayType.node_displacement: 2}, "dx_dy_dz", 3) - self.check_array_dims({ArrayType.node_velocity: 2}, "vx_vy_vz", 3) - self.check_array_dims({ArrayType.node_acceleration: 2}, "ax_ay_az", 3) - self.check_array_dims({ArrayType.node_residual_forces: 2}, "fx_fy_fz", 3) - self.check_array_dims({ArrayType.node_residual_moments: 2}, "mx_my_mz", 3) - - byte_checksum = 0 - - it = settings.header["it"] - has_mass_scaling = False - if it >= 10: - it -= 10 - has_mass_scaling = True - - n_nodes = settings.header["numnp"] - - # NODE DISPLACEMENT - if settings.header["iu"]: - array = self.arrays[ArrayType.node_displacement][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - if it != 0: - # NODE TEMPERATURES - array_type = ArrayType.node_temperature - array = ( - self.arrays[array_type][i_timestep] - if array_type in self.arrays - else np.zeros(n_nodes, dtype=settings.ftype) - ) - - # just 1 temperature per node - if it < 3: - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - # 3 temperatures per node - else: - self.check_array_dims({ArrayType.node_temperature: 2}, "node_layer", 3) - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # NODE HEAT FLUX - if it >= 2: - array = self.arrays[ArrayType.node_heat_flux][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # NODE MASS SCALING - if has_mass_scaling: - array = self.arrays[ArrayType.node_mass_scaling][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # NODE TEMPERATURE GRADIENT - if settings.has_node_temperature_gradient: - array = self.arrays[ArrayType.node_temperature_gradient][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # NODE RESIDUAL FORCES - if settings.has_node_residual_forces: - array = ( - self.arrays[ArrayType.node_residual_forces][i_timestep] - if ArrayType.node_residual_forces in self.arrays - else np.zeros((n_nodes, 3), dtype=settings.ftype) - ) - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # NODE RESIDUAL MOMENTS - if settings.has_node_residual_moments: - array = ( - self.arrays[ArrayType.node_residual_moments][i_timestep] - if ArrayType.node_residual_forces in self.arrays - else np.zeros((n_nodes, 3), dtype=settings.ftype) - ) - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # NODE VELOCITY - if settings.header["iv"]: - array = self.arrays[ArrayType.node_velocity][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # NODE ACCELERATION - if settings.header["ia"]: - array = self.arrays[ArrayType.node_acceleration][i_timestep] - byte_checksum += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # check the checksum - n_thermal_vars = 0 - if settings.header["it"] % 10 == 1: - n_thermal_vars = 1 - elif settings.header["it"] % 10 == 2: - n_thermal_vars = 4 - elif settings.header["it"] % 10 == 3: - n_thermal_vars = 6 - - if settings.header["it"] // 10 == 1: - n_thermal_vars += 1 - - n_temp_gradient_vars = settings.has_node_temperature_gradient - n_residual_forces_vars = settings.has_node_residual_forces * 3 - n_residual_moments_vars = settings.has_node_residual_moments * 3 - - # pylint: disable = invalid-name - NDIM = 3 - byte_checksum_target = ( - ( - (settings.header["iu"] + settings.header["iv"] + settings.header["ia"]) * NDIM - + n_thermal_vars - + n_temp_gradient_vars - + n_residual_forces_vars - + n_residual_moments_vars - ) - * settings.wordsize - * settings.header["numnp"] - ) - if byte_checksum != byte_checksum_target: - msg = ( - "byte checksum wrong: {byte_checksum_target} (header) != {byte_checksum} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_nodes", byte_checksum) - - return byte_checksum - - def _write_states_solid_thermal_data( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - if settings.header["nt3d"] <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.element_solid_thermal_data: [ - "n_timesteps", - "n_solids", - "n_solids_thermal_vars", - ] - }, - ) - - array_dims = {ArrayType.global_timesteps: 0, ArrayType.element_solid_thermal_data: 0} - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.element_solid_node_indexes: 0, - ArrayType.element_solid_thermal_data: 1, - } - self.check_array_dims(array_dims, "n_solids") - - array = self.arrays[ArrayType.element_solid_thermal_data][i_timestep] - n_bytes_written = fp.write(settings.pack(array, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = ( - settings.header["nt3d"] * abs(settings.header["nel8"]) * settings.wordsize - ) - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_thermal_data", n_bytes_written) - - return n_bytes_written - - def _write_states_solids( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - n_solids = abs(settings.header["nel8"]) - n_solid_vars = settings.header["nv3d"] - n_solid_layers = settings.n_solid_layers - - if n_solids == 0 or n_solid_vars <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.element_solid_stress: [ - "n_timesteps", - "n_solids", - "n_solid_layers", - "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz", - ], - ArrayType.element_solid_effective_plastic_strain: [ - "n_timesteps", - "n_solid_layers", - "n_solids", - ], - ArrayType.element_solid_history_variables: [ - "n_timesteps", - "n_solids", - "n_solid_layers", - "n_solid_history_vars", - ], - ArrayType.element_solid_strain: [ - "n_timesteps", - "n_solids", - "n_solid_layers", - "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", - ], - ArrayType.element_solid_plastic_strain_tensor: [ - "n_timesteps", - "n_solids", - "n_solid_layers", - "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", - ], - ArrayType.element_solid_thermal_strain_tensor: [ - "n_timesteps", - "n_solids", - "n_solid_layers", - "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", - ], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.element_solid_stress: 0, - ArrayType.element_solid_effective_plastic_strain: 0, - ArrayType.element_solid_history_variables: 0, - ArrayType.element_solid_strain: 0, - ArrayType.element_solid_plastic_strain_tensor: 0, - ArrayType.element_solid_thermal_strain_tensor: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.element_solid_node_indexes: 0, - ArrayType.element_solid_stress: 1, - ArrayType.element_solid_effective_plastic_strain: 1, - ArrayType.element_solid_history_variables: 1, - ArrayType.element_solid_strain: 1, - ArrayType.element_solid_plastic_strain_tensor: 1, - ArrayType.element_solid_thermal_strain_tensor: 1, - } - self.check_array_dims(array_dims, "n_solids") - - array_dims = { - ArrayType.element_solid_stress: 2, - ArrayType.element_solid_effective_plastic_strain: 2, - ArrayType.element_solid_history_variables: 2, - ArrayType.element_solid_strain: 2, - ArrayType.element_solid_plastic_strain_tensor: 2, - ArrayType.element_solid_thermal_strain_tensor: 2, - } - self.check_array_dims(array_dims, "n_solid_layers") - - self.check_array_dims({ArrayType.element_solid_stress: 3}, "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz", 6) - - self.check_array_dims({ArrayType.element_solid_strain: 3}, "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", 6) - - self.check_array_dims( - {ArrayType.element_solid_plastic_strain_tensor: 3}, "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", 6 - ) - - self.check_array_dims( - {ArrayType.element_solid_thermal_strain_tensor: 3}, "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", 6 - ) - - # allocate array - solid_data = np.zeros( - (n_solids, n_solid_layers, n_solid_vars // n_solid_layers), dtype=settings.ftype - ) - - # SOLID STRESS - if ArrayType.element_solid_stress in self.arrays: - try: - array = self.arrays[ArrayType.element_solid_stress][i_timestep] - solid_data[:, :, 0:6] = array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_write_states_solids, element_solid_stress", trb_msg) - - # SOLID EFFECTIVE PSTRAIN - if ArrayType.element_solid_effective_plastic_strain in self.arrays: - try: - array = self.arrays[ArrayType.element_solid_effective_plastic_strain][i_timestep] - solid_data[:, :, 6] = array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_write_states_solids, element_solid_effective_plastic_strain", trb_msg - ) - - # SOLID HISTORY VARIABLES - # (strains, pstrain tensor and thermal tensor are excluded here) - has_strain = settings.header["istrn"] - n_solid_history_variables = ( - settings.header["neiph"] - - 6 * has_strain - - 6 * settings.has_plastic_strain_tensor - - 6 * settings.has_thermal_strain_tensor - ) - - if n_solid_history_variables: - try: - array = self.arrays[ArrayType.element_solid_history_variables][i_timestep] - solid_data[:, :, 7 : 7 + n_solid_history_variables] = array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_write_states_solids, element_solid_history_variables", trb_msg - ) - - # SOLID STRAIN - if has_strain and ArrayType.element_solid_strain in self.arrays: - try: - array = self.arrays[ArrayType.element_solid_strain][i_timestep] - offset = 7 + n_solid_history_variables - solid_data[:, :, offset : offset + 6] = array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning(msg, "_write_states_solids, element_solid_strain", trb_msg) - - # PLASTIC STRAIN TENSOR - if ( - settings.has_plastic_strain_tensor - and ArrayType.element_solid_plastic_strain_tensor in self.arrays - ): - try: - array = self.arrays[ArrayType.element_solid_plastic_strain_tensor][i_timestep] - offset = 7 + n_solid_history_variables + 6 * has_strain - solid_data[:, :, offset : offset + 6] = array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_write_states_solids, element_solid_plastic_strain_tensor", trb_msg - ) - - # THERMAL STRAIN TENSOR - if ( - settings.has_thermal_strain_tensor - and ArrayType.element_solid_thermal_strain_tensor in self.arrays - ): - try: - array = self.arrays[ArrayType.element_solid_thermal_strain_tensor][i_timestep] - offset = ( - 7 - + n_solid_history_variables - + 6 * has_strain - + 6 * settings.has_plastic_strain_tensor - ) - solid_data[:, :, offset : offset + 6] = array - except Exception: - trb_msg = traceback.format_exc() - msg = "A failure in %s was caught:\n%s" - LOGGER.warning( - msg, "_write_states_solids, element_solid_thermal_strain_tensor", trb_msg - ) - - n_bytes_written = fp.write(settings.pack(solid_data, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = ( - settings.header["nv3d"] * abs(settings.header["nel8"]) * settings.wordsize - ) - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_solids", n_bytes_written) - - return n_bytes_written - - def _write_states_tshells( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - n_tshells = settings.header["nelth"] - n_tshell_vars = settings.header["nv3dt"] - if n_tshells <= 0 or n_tshell_vars <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.element_tshell_stress: [ - "n_timesteps", - "n_tshells", - "n_shell_layers", - "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz", - ], - ArrayType.element_tshell_strain: [ - "n_timesteps", - "n_tshells", - "upper_lower", - "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", - ], - ArrayType.element_tshell_effective_plastic_strain: [ - "n_timesteps", - "n_tshells", - "n_shell_layers", - ], - ArrayType.element_tshell_history_variables: [ - "n_timesteps", - "n_tshells", - "n_shell_layers", - "n_tshell_history_vars", - ], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.element_tshell_stress: 0, - ArrayType.element_tshell_strain: 0, - ArrayType.element_tshell_effective_plastic_strain: 0, - ArrayType.element_tshell_history_variables: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.element_tshell_node_indexes: 0, - ArrayType.element_tshell_stress: 1, - ArrayType.element_tshell_strain: 1, - ArrayType.element_tshell_effective_plastic_strain: 1, - ArrayType.element_tshell_history_variables: 1, - } - self.check_array_dims(array_dims, "n_tshells") - - self.check_array_dims({ArrayType.element_tshell_stress: 3}, "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz", 6) - - self.check_array_dims({ArrayType.element_tshell_strain: 2}, "upper_lower", 2) - - self.check_array_dims({ArrayType.element_tshell_strain: 3}, "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", 6) - - has_stress = settings.header["ioshl1"] == 1000 - has_pstrain = settings.header["ioshl2"] == 1000 - n_history_vars = settings.header["neips"] - n_layer_vars = settings.n_shell_layers * (6 * has_stress + has_pstrain + n_history_vars) - - tshell_data = np.zeros((n_tshells, n_tshell_vars), settings.ftype) - tshell_layer_data = tshell_data[:, :n_layer_vars].reshape(( - n_tshells, - settings.n_shell_layers, - -1, - )) - tshell_nonlayer_data = tshell_data[:, n_layer_vars:] - - # TSHELL STRESS - if has_stress: - if ArrayType.element_tshell_stress in self.arrays: - array = self.arrays[ArrayType.element_tshell_stress][i_timestep] - tshell_layer_data[:, :, 0:6] = array - - # TSHELL EFF. PLASTIC STRAIN - if has_pstrain: - if ArrayType.element_tshell_effective_plastic_strain in self.arrays: - array = self.arrays[ArrayType.element_tshell_effective_plastic_strain][i_timestep] - start_index = 6 * has_stress - tshell_layer_data[:, :, start_index] = array - - # TSHELL HISTORY VARS - if n_history_vars != 0: - if ArrayType.element_tshell_history_variables in self.arrays: - array = self.arrays[ArrayType.element_tshell_history_variables][i_timestep] - start_index = 6 * has_stress + has_pstrain - end_index = start_index + array.shape[2] - tshell_layer_data[:, :, start_index:end_index] = array - - # TSHELL STRAIN - if settings.header["istrn"]: - if ArrayType.element_tshell_strain in self.arrays: - array = self.arrays[ArrayType.element_tshell_strain][i_timestep] - start_index = 6 * has_stress + has_pstrain + n_history_vars - tshell_nonlayer_data[:, :] = array.reshape(n_tshells, 12) - - n_bytes_written = fp.write(settings.pack(tshell_data, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = ( - settings.header["nv3dt"] * abs(settings.header["nelth"]) * settings.wordsize - ) - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_tshells", n_bytes_written) - - return n_bytes_written - - def _write_states_beams( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - n_beams = settings.header["nel2"] - n_beam_vars = settings.header["nv1d"] - if n_beams <= 0 or n_beam_vars <= 0: - return 0 - - n_beam_layers = settings.header["beamip"] - n_beam_history_vars = settings.header["neipb"] - - _check_ndim( - self, - { - ArrayType.element_beam_axial_force: ["n_timesteps", "n_beams"], - ArrayType.element_beam_shear_force: ["n_timesteps", "n_beams", "fs_ft"], - ArrayType.element_beam_bending_moment: ["n_timesteps", "n_beams", "ms_mt"], - ArrayType.element_beam_torsion_moment: ["n_timesteps", "n_beams"], - ArrayType.element_beam_shear_stress: [ - "n_timesteps", - "n_beams", - "n_beam_layers", - "ฯƒrs_ฯƒtr", - ], - ArrayType.element_beam_axial_stress: ["n_timesteps", "n_beams", "n_beam_layers"], - ArrayType.element_beam_plastic_strain: ["n_timesteps", "n_beams", "n_beam_layers"], - ArrayType.element_beam_axial_strain: ["n_timesteps", "n_beams", "n_beam_layers"], - ArrayType.element_beam_history_vars: [ - "n_timesteps", - "n_beams", - "n_beam_layers+3", - "n_beam_history_vars", - ], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.element_beam_axial_force: 0, - ArrayType.element_beam_shear_force: 0, - ArrayType.element_beam_bending_moment: 0, - ArrayType.element_beam_torsion_moment: 0, - ArrayType.element_beam_shear_stress: 0, - ArrayType.element_beam_axial_stress: 0, - ArrayType.element_beam_plastic_strain: 0, - ArrayType.element_beam_axial_strain: 0, - ArrayType.element_beam_history_vars: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - array_dims = { - ArrayType.element_beam_axial_force: 1, - ArrayType.element_beam_shear_force: 1, - ArrayType.element_beam_bending_moment: 1, - ArrayType.element_beam_torsion_moment: 1, - ArrayType.element_beam_shear_stress: 1, - ArrayType.element_beam_axial_stress: 1, - ArrayType.element_beam_plastic_strain: 1, - ArrayType.element_beam_axial_strain: 1, - ArrayType.element_beam_history_vars: 1, - } - self.check_array_dims(array_dims, "n_beams") - self.check_array_dims({ArrayType.element_beam_shear_force: 2}, "fs_ft", 2) - self.check_array_dims({ArrayType.element_beam_bending_moment: 2}, "ms_mt", 2) - array_dims = { - ArrayType.element_beam_shear_stress: 2, - ArrayType.element_beam_axial_stress: 2, - ArrayType.element_beam_plastic_strain: 2, - ArrayType.element_beam_axial_strain: 2, - ArrayType.element_beam_history_vars: 2, - } - n_beam_layers = self.check_array_dims(array_dims, "n_beam_layers") - self.check_array_dims({ArrayType.element_beam_shear_stress: 3}, "ฯƒrs_ฯƒtr", 2) - self.check_array_dims( - {ArrayType.element_beam_history_vars: 2}, "n_modes", n_beam_layers + 3 - ) - - # allocate buffer - beam_data = np.zeros((n_beams, n_beam_vars), dtype=settings.ftype) - n_layer_vars_total = 5 * n_beam_layers - beam_layer_data = beam_data[:, 6 : 6 + n_layer_vars_total].reshape(( - n_beams, - n_beam_layers, - 5, - )) - beam_history_vars = beam_data[:, 6 + n_layer_vars_total :].reshape(( - n_beams, - 3 + n_beam_layers, - n_beam_history_vars, - )) - - # BEAM AXIAL FORCE - if ArrayType.element_beam_axial_force in self.arrays: - array = self.arrays[ArrayType.element_beam_axial_force][i_timestep] - beam_data[:, 0] = array - - # BEAM SHEAR FORCE - if ArrayType.element_beam_shear_force in self.arrays: - array = self.arrays[ArrayType.element_beam_shear_force][i_timestep] - beam_data[:, 1:3] = array - - # BEAM BENDING MOMENTUM - if ArrayType.element_beam_bending_moment in self.arrays: - array = self.arrays[ArrayType.element_beam_bending_moment][i_timestep] - beam_data[:, 3:5] = array - - # BEAM TORSION MOMENTUM - if ArrayType.element_beam_torsion_moment in self.arrays: - array = self.arrays[ArrayType.element_beam_torsion_moment][i_timestep] - beam_data[:, 5] = array - - if n_beam_layers: - array = ( - self.arrays[ArrayType.element_beam_axial_stress][i_timestep] - if ArrayType.element_beam_axial_stress in self.arrays - else np.zeros((n_beams, n_beam_layers), dtype=settings.ftype) - ) - beam_layer_data[:, :, 0] = array - - array = ( - self.arrays[ArrayType.element_beam_shear_stress][i_timestep] - if ArrayType.element_beam_shear_stress in self.arrays - else np.zeros((n_beams, n_beam_layers, 2), dtype=settings.ftype) - ) - beam_layer_data[:, :, 1:3] = array - - array = ( - self.arrays[ArrayType.element_beam_plastic_strain][i_timestep] - if ArrayType.element_beam_plastic_strain in self.arrays - else np.zeros((n_beams, n_beam_layers), dtype=settings.ftype) - ) - beam_layer_data[:, :, 3] = array - - array = ( - self.arrays[ArrayType.element_beam_axial_strain][i_timestep] - if ArrayType.element_beam_axial_strain in self.arrays - else np.zeros((n_beams, n_beam_layers), dtype=settings.ftype) - ) - beam_layer_data[:, :, 4] = array - - # BEAM HISTORY VARIABLES - if n_beam_history_vars: - array = ( - self.arrays[ArrayType.element_beam_history_vars][i_timestep] - if ArrayType.element_beam_history_vars in self.arrays - else np.zeros( - (n_beams, n_beam_layers + 3, n_beam_history_vars), dtype=settings.ftype - ) - ) - beam_history_vars[:, :, :] = array - - n_bytes_written = fp.write(settings.pack(beam_data, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = settings.header["nv1d"] * settings.header["nel2"] * settings.wordsize - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_tshells", n_bytes_written) - - return n_bytes_written - - def _write_states_shells( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - n_shells = settings.header["nel4"] - n_shell_vars = settings.header["nv2d"] - n_rigid_shells = settings.n_rigid_shells - is_d3part = self.header.filetype == D3plotFiletype.D3PART - # d3part writes results also for rigid shells - n_reduced_shells = n_shells if is_d3part else n_shells - n_rigid_shells - - if n_reduced_shells <= 0 or n_shell_vars <= 0: - return 0 - - has_stress = settings.header["ioshl1"] == 1000 - has_pstrain = settings.header["ioshl2"] == 1000 - has_forces = settings.header["ioshl3"] == 1000 - has_else = settings.header["ioshl4"] == 1000 - has_strain = settings.header["istrn"] != 0 - n_shell_history_vars = settings.header["neips"] - - _check_ndim( - self, - { - ArrayType.element_shell_stress: [ - "n_timesteps", - "n_shells", - "n_shell_layers", - "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz", - ], - ArrayType.element_shell_effective_plastic_strain: [ - "n_timesteps", - "n_shells", - "n_shell_layers", - ], - ArrayType.element_shell_history_vars: [ - "n_timesteps", - "n_shells", - "n_shell_layers", - "n_shell_history_vars", - ], - ArrayType.element_shell_bending_moment: ["n_timesteps", "n_shells", "mx_my_mxy"], - ArrayType.element_shell_shear_force: ["n_timesteps", "n_shells", "qx_qy"], - ArrayType.element_shell_normal_force: ["n_timesteps", "n_shells", "nx_ny_nxy"], - ArrayType.element_shell_thickness: ["n_timesteps", "n_shells"], - ArrayType.element_shell_unknown_variables: [ - "n_timesteps", - "n_shells", - "n_extra_vars", - ], - ArrayType.element_shell_internal_energy: ["n_timesteps", "n_shells"], - ArrayType.element_shell_strain: [ - "n_timesteps", - "n_shells", - "upper_lower", - "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", - ], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.element_shell_stress: 0, - ArrayType.element_shell_effective_plastic_strain: 0, - ArrayType.element_shell_history_vars: 0, - ArrayType.element_shell_bending_moment: 0, - ArrayType.element_shell_shear_force: 0, - ArrayType.element_shell_normal_force: 0, - ArrayType.element_shell_thickness: 0, - ArrayType.element_shell_unknown_variables: 0, - ArrayType.element_shell_internal_energy: 0, - ArrayType.element_shell_strain: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.element_shell_stress: 1, - ArrayType.element_shell_effective_plastic_strain: 1, - ArrayType.element_shell_history_vars: 1, - ArrayType.element_shell_bending_moment: 1, - ArrayType.element_shell_shear_force: 1, - ArrayType.element_shell_normal_force: 1, - ArrayType.element_shell_thickness: 1, - ArrayType.element_shell_unknown_variables: 1, - ArrayType.element_shell_internal_energy: 1, - ArrayType.element_shell_strain: 1, - } - n_reduced_shells = self.check_array_dims(array_dims, "n_shells") - if not is_d3part and n_reduced_shells != n_shells - n_rigid_shells: - msg = ( - "Parts with mattyp 20 (rigid material) were specified." - " For these parts no state data is output in dyna." - " The state arrays are thus expected output data for only" - f" {n_shells - n_rigid_shells} shells and not {n_reduced_shells}." - ) - raise ValueError(msg) - - array_dims = { - ArrayType.element_shell_stress: 2, - ArrayType.element_shell_effective_plastic_strain: 2, - ArrayType.element_shell_history_vars: 2, - } - n_shell_layers = self.check_array_dims(array_dims, "n_shell_layers") - - self.check_array_dims({ArrayType.element_shell_stress: 3}, "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz", 6) - self.check_array_dims({ArrayType.element_shell_bending_moment: 2}, "mx_my_mxy", 3) - self.check_array_dims({ArrayType.element_shell_shear_force: 2}, "qx_qy") - self.check_array_dims({ArrayType.element_shell_strain: 2}, "upper_lower", 2) - self.check_array_dims({ArrayType.element_shell_strain: 3}, "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", 6) - - # allocate buffer - shell_data = np.zeros((n_reduced_shells, n_shell_vars), dtype=settings.ftype) - n_layer_vars = has_stress * 6 + has_pstrain + n_shell_history_vars - n_layer_vars_total = n_layer_vars * n_shell_layers - - shell_layer_data = shell_data[:, :n_layer_vars_total].reshape(( - n_reduced_shells, - n_shell_layers, - n_layer_vars, - )) - shell_nonlayer_data = shell_data[:, n_layer_vars_total:] - - start_layer_index = 0 - end_layer_index = 0 - - # SHELL STRESS - if has_stress: - start_layer_index = 0 - end_layer_index = 6 - if ArrayType.element_shell_stress in self.arrays: - array = self.arrays[ArrayType.element_shell_stress][i_timestep] - shell_layer_data[:, :, start_layer_index:end_layer_index] = array - - # EFF PSTRAIN - if has_pstrain: - start_layer_index = end_layer_index - end_layer_index = start_layer_index + has_pstrain - if ArrayType.element_shell_effective_plastic_strain in self.arrays: - array = self.arrays[ArrayType.element_shell_effective_plastic_strain][i_timestep] - shell_layer_data[:, :, start_layer_index:end_layer_index] = array.reshape(( - n_reduced_shells, - n_shell_layers, - 1, - )) - - # SHELL HISTORY VARS - if n_shell_history_vars: - start_layer_index = end_layer_index - end_layer_index = start_layer_index + n_shell_history_vars - if ArrayType.element_shell_history_vars in self.arrays: - array = self.arrays[ArrayType.element_shell_history_vars][i_timestep] - n_hist_vars_arr = array.shape[2] - end_layer_index2 = start_layer_index + min(n_hist_vars_arr, n_shell_history_vars) - shell_layer_data[:, :, start_layer_index:end_layer_index2] = array - - start_index = 0 - end_index = 0 - - # SHELL FORCES - if has_forces: - start_index = end_index - end_index = start_index + 8 - - # MOMENTUM - if ArrayType.element_shell_bending_moment in self.arrays: - start_index2 = start_index - end_index2 = start_index + 3 - array = self.arrays[ArrayType.element_shell_bending_moment][i_timestep] - shell_nonlayer_data[:, start_index2:end_index2] = array - - # SHEAR - if ArrayType.element_shell_shear_force in self.arrays: - start_index2 = start_index + 3 - end_index2 = start_index + 5 - array = self.arrays[ArrayType.element_shell_shear_force][i_timestep] - shell_nonlayer_data[:, start_index2:end_index2] = array - - # NORMAL - if ArrayType.element_shell_normal_force in self.arrays: - start_index2 = start_index + 5 - end_index2 = start_index + 8 - array = self.arrays[ArrayType.element_shell_normal_force][i_timestep] - shell_nonlayer_data[:, start_index2:end_index2] = array - - if has_else: - start_index = end_index - end_index = start_index + 3 - - # THICKNESS - if ArrayType.element_shell_thickness in self.arrays: - start_index2 = start_index - end_index2 = start_index + 1 - array = self.arrays[ArrayType.element_shell_thickness][i_timestep] - shell_nonlayer_data[:, start_index2:end_index2] = array.reshape(( - n_reduced_shells, - 1, - )) - - # ELEMENT SPECIFIC VARS - if ArrayType.element_shell_unknown_variables in self.arrays: - start_index2 = start_index + 1 - end_index2 = start_index + 3 - array = self.arrays[ArrayType.element_shell_unknown_variables][i_timestep] - shell_nonlayer_data[:, start_index2:end_index2] = array - - # SHELL STRAIN - # - # Strain is squeezed between the 3rd and 4th var of the else block - if has_strain: - start_index = end_index - end_index = start_index + 12 - - if ArrayType.element_shell_strain in self.arrays: - array = self.arrays[ArrayType.element_shell_strain][i_timestep] - shell_nonlayer_data[:, start_index:end_index] = array.reshape(( - n_reduced_shells, - 12, - )) - - # INTERNAL ENERGY - if has_else: - start_index = end_index - end_index = start_index + 1 - - if ArrayType.element_shell_internal_energy in self.arrays: - array = self.arrays[ArrayType.element_shell_internal_energy][i_timestep] - shell_nonlayer_data[:, start_index:end_index] = array.reshape((n_reduced_shells, 1)) - - # THERMAL STRAIN TENSOR - if settings.has_plastic_strain_tensor: - start_index = end_index - end_index = start_index + n_shell_layers * 6 - - if ArrayType.element_shell_plastic_strain_tensor in self.arrays: - array = self.arrays[ArrayType.element_shell_plastic_strain_tensor][i_timestep] - shell_nonlayer_data[:, start_index:end_index] = array.reshape(( - n_reduced_shells, - n_shell_layers * 6, - )) - - # PLASTIC THERMAL TENSOR - if settings.has_thermal_strain_tensor: - start_index = end_index - end_index = start_index + 6 - - if ArrayType.element_shell_thermal_strain_tensor in self.arrays: - array = self.arrays[ArrayType.element_shell_thermal_strain_tensor][i_timestep] - shell_nonlayer_data[:, start_index:end_index] = array.reshape((n_reduced_shells, 6)) - - n_bytes_written = fp.write(settings.pack(shell_data, dtype_hint=np.floating)) - - # check bytes - # *(settings.header["nel4"]-settings.n_rigid_shells)\ - n_bytes_expected = settings.header["nv2d"] * n_reduced_shells * settings.wordsize - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_shells", n_bytes_written) - - return n_bytes_written - - def _write_states_deletion_info( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - if settings.mdlopt <= 0: - return 0 - - n_bytes_written = 0 - n_bytes_expected = 0 - - # NODE DELETION - if settings.mdlopt == 1: - _check_ndim(self, {ArrayType.node_is_alive: ["n_timesteps", "n_nodes"]}) - - array_dims = {ArrayType.global_timesteps: 0, ArrayType.node_is_alive: 0} - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = {ArrayType.node_coordinates: 0, ArrayType.node_is_alive: 1} - self.check_array_dims(array_dims, "n_nodes") - - n_nodes = settings.header["numnp"] - - array = ( - self.arrays[ArrayType.node_is_alive] - if ArrayType.node_is_alive in self.arrays - else np.zeros(n_nodes, dtype=settings.ftype) - ) - - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # check - n_bytes_expected = settings.header["numnp"] * settings.wordsize - - # ELEMENT DELETION - elif settings.mdlopt == 2: - _check_ndim( - self, - { - ArrayType.element_solid_is_alive: ["n_timesteps", "n_solids"], - ArrayType.element_shell_is_alive: ["n_timesteps", "n_shells"], - ArrayType.element_beam_is_alive: ["n_timesteps", "n_beams"], - ArrayType.element_tshell_is_alive: ["n_timesteps", "n_tshells"], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.element_solid_is_alive: 0, - ArrayType.element_shell_is_alive: 0, - ArrayType.element_beam_is_alive: 0, - ArrayType.element_tshell_is_alive: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.element_solid_node_indexes: 0, - ArrayType.element_solid_is_alive: 1, - } - self.check_array_dims(array_dims, "n_solids") - - array_dims = { - ArrayType.element_beam_node_indexes: 0, - ArrayType.element_beam_is_alive: 1, - } - self.check_array_dims(array_dims, "n_beams") - - array_dims = { - ArrayType.element_shell_node_indexes: 0, - ArrayType.element_shell_is_alive: 1, - } - self.check_array_dims(array_dims, "n_shells") - - array_dims = { - ArrayType.element_tshell_node_indexes: 0, - ArrayType.element_tshell_is_alive: 1, - } - self.check_array_dims(array_dims, "n_tshells") - - n_solids = settings.header["nel8"] - n_tshells = settings.header["nelth"] - n_shells = settings.header["nel4"] - n_beams = settings.header["nel2"] - - # SOLID DELETION - array = ( - self.arrays[ArrayType.element_solid_is_alive][i_timestep] - if ArrayType.element_solid_is_alive in self.arrays - else np.ones(n_solids, dtype=settings.ftype) - ) - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # THICK SHELL DELETION - array = ( - self.arrays[ArrayType.element_tshell_is_alive][i_timestep] - if ArrayType.element_tshell_is_alive in self.arrays - else np.ones(n_tshells, dtype=settings.ftype) - ) - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # SHELL DELETION - array = ( - self.arrays[ArrayType.element_shell_is_alive][i_timestep] - if ArrayType.element_shell_is_alive in self.arrays - else np.ones(n_shells, dtype=settings.ftype) - ) - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # BEAM DELETION - array = ( - self.arrays[ArrayType.element_beam_is_alive][i_timestep] - if ArrayType.element_beam_is_alive in self.arrays - else np.ones(n_beams, dtype=settings.ftype) - ) - n_bytes_written += fp.write(settings.pack(array, dtype_hint=np.floating)) - - # check - n_bytes_expected = ( - settings.header["nel2"] - + settings.header["nel4"] - + abs(settings.header["nel8"]) - + settings.header["nelth"] - ) * settings.wordsize - - else: - msg = f"Invalid mdlopt flag during write process: {settings.mdlopt}" - raise RuntimeError(msg) - - # check bytes - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_deletion_info", n_bytes_written) - - return n_bytes_written - - def _write_states_sph( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - if settings.header["nmsph"] <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.sph_deletion: ["n_timesteps", "n_particles"], - ArrayType.sph_radius: ["n_timesteps", "n_particles"], - ArrayType.sph_pressure: ["n_timesteps", "n_particles"], - ArrayType.sph_stress: ["n_timesteps", "n_particles", "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz"], - ArrayType.sph_effective_plastic_strain: ["n_timesteps", "n_particles"], - ArrayType.sph_density: ["n_timesteps", "n_particles"], - ArrayType.sph_internal_energy: ["n_timesteps", "n_particles"], - ArrayType.sph_n_neighbors: ["n_timesteps", "n_particles"], - ArrayType.sph_strain: ["n_timesteps", "n_particles", "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz"], - ArrayType.sph_mass: ["n_timesteps", "n_particles"], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.sph_deletion: 0, - ArrayType.sph_radius: 0, - ArrayType.sph_pressure: 0, - ArrayType.sph_stress: 0, - ArrayType.sph_effective_plastic_strain: 0, - ArrayType.sph_density: 0, - ArrayType.sph_internal_energy: 0, - ArrayType.sph_n_neighbors: 0, - ArrayType.sph_strain: 0, - ArrayType.sph_mass: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.sph_node_indexes: 0, - ArrayType.sph_deletion: 1, - ArrayType.sph_radius: 1, - ArrayType.sph_pressure: 1, - ArrayType.sph_stress: 1, - ArrayType.sph_effective_plastic_strain: 1, - ArrayType.sph_density: 1, - ArrayType.sph_internal_energy: 1, - ArrayType.sph_n_neighbors: 1, - ArrayType.sph_strain: 1, - ArrayType.sph_mass: 1, - } - n_particles = self.check_array_dims(array_dims, "n_particles") - self.check_array_dims({ArrayType.sph_stress: 2}, "ฯƒx_ฯƒy_ฯƒz_ฯƒxy_ฯƒyz_ฯƒxz", 6) - self.check_array_dims({ArrayType.sph_strain: 2}, "ฮตx_ฮตy_ฮตz_ฮตxy_ฮตyz_ฮตxz", 6) - - n_sph_variables = settings.header["numsph"] - - sph_data = np.zeros((n_particles, n_sph_variables)) - - start_index = 0 - end_index = 0 - - # SPH MATERIAL AND DELETION - start_index = 0 - end_index = 1 - array = ( - self.arrays[ArrayType.sph_deletion][i_timestep] - if ArrayType.sph_deletion in self.arrays - else np.ones(n_particles) - ) - sph_data[:, start_index:end_index] = array - - # INFLUENCE RADIUS - if settings.header["isphfg2"]: - start_index = end_index - end_index = start_index + n_particles - if ArrayType.sph_radius in self.arrays: - array = self.arrays[ArrayType.sph_radius][i_timestep] - sph_data[:, start_index:end_index] = array - - # PRESSURE - if settings.header["isphfg3"]: - start_index = end_index - end_index = start_index + n_particles - if ArrayType.sph_pressure in self.arrays: - array = self.arrays[ArrayType.sph_pressure][i_timestep] - sph_data[:, start_index:end_index] = array - - # STRESS - if settings.header["isphfg4"]: - start_index = end_index - end_index = start_index + 6 * n_particles - if ArrayType.sph_stress in self.arrays: - array = self.arrays[ArrayType.sph_stress][i_timestep] - sph_data[:, start_index:end_index] = array - - # PSTRAIN - if settings.header["isphfg5"]: - start_index = end_index - end_index = start_index + n_particles - if ArrayType.sph_effective_plastic_strain in self.arrays: - array = self.arrays[ArrayType.sph_effective_plastic_strain][i_timestep] - sph_data[:, start_index:end_index] = array - - # DENSITY - if settings.header["isphfg6"]: - start_index = end_index - end_index = start_index + n_particles - if ArrayType.sph_density in self.arrays: - array = self.arrays[ArrayType.sph_density][i_timestep] - sph_data[:, start_index:end_index] = array - - # INTERNAL ENERGY - if settings.header["isphfg7"]: - start_index = end_index - end_index = start_index + n_particles - if ArrayType.sph_internal_energy in self.arrays: - array = self.arrays[ArrayType.sph_internal_energy][i_timestep] - sph_data[:, start_index:end_index] = array - - # INTERNAL ENERGY - if settings.header["isphfg8"]: - start_index = end_index - end_index = start_index + n_particles - if ArrayType.sph_n_neighbors in self.arrays: - array = self.arrays[ArrayType.sph_n_neighbors][i_timestep] - sph_data[:, start_index:end_index] = array - - # STRAIN - if settings.header["isphfg9"]: - start_index = end_index - end_index = start_index + n_particles * 6 - if ArrayType.sph_strain in self.arrays: - array = self.arrays[ArrayType.sph_strain][i_timestep] - sph_data[:, start_index:end_index] = array - - # MASS - if settings.header["isphfg10"]: - start_index = end_index - end_index = start_index + n_particles - if ArrayType.sph_mass in self.arrays: - array = self.arrays[ArrayType.sph_mass][i_timestep] - sph_data[:, start_index:end_index] = array - - n_bytes_written = fp.write(settings.pack(sph_data, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = ( - settings.header["nv2d"] - * (settings.header["nel4"] - settings.header["numrbe"]) - * settings.wordsize - ) - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_sph", n_bytes_written) - - return n_bytes_written - - def _write_states_airbags( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - if settings.header["npefg"] <= 0: - return 0 - - _check_ndim( - self, - { - ArrayType.airbag_n_active_particles: ["n_timesteps", "n_airbags"], - ArrayType.airbag_bag_volume: ["n_timesteps", "n_airbags"], - ArrayType.airbag_particle_gas_id: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_chamber_id: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_leakage: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_mass: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_radius: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_spin_energy: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_translation_energy: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_nearest_segment_distance: ["n_timesteps", "n_particles"], - ArrayType.airbag_particle_position: ["n_timesteps", "n_particles", "x_y_z"], - ArrayType.airbag_particle_velocity: ["n_timesteps", "n_particles", "vx_vy_vz"], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.airbag_n_active_particles: 0, - ArrayType.airbag_bag_volume: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.airbags_ids: 0, - ArrayType.airbag_n_active_particles: 1, - ArrayType.airbag_bag_volume: 1, - } - n_airbags = self.check_array_dims(array_dims, "n_airbags") - if n_airbags != settings.header["npefg"] % 1000: - raise ValueError( - f"Expected n_airbags to equal settings.header['npefg'] % 1000, but got {n_airbags}" - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.airbag_particle_gas_id: 0, - ArrayType.airbag_particle_chamber_id: 0, - ArrayType.airbag_particle_leakage: 0, - ArrayType.airbag_particle_mass: 0, - ArrayType.airbag_particle_radius: 0, - ArrayType.airbag_particle_spin_energy: 0, - ArrayType.airbag_particle_translation_energy: 0, - ArrayType.airbag_particle_nearest_segment_distance: 0, - ArrayType.airbag_particle_position: 0, - ArrayType.airbag_particle_velocity: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.airbag_particle_gas_id: 1, - ArrayType.airbag_particle_chamber_id: 1, - ArrayType.airbag_particle_leakage: 1, - ArrayType.airbag_particle_mass: 1, - ArrayType.airbag_particle_radius: 1, - ArrayType.airbag_particle_spin_energy: 1, - ArrayType.airbag_particle_translation_energy: 1, - ArrayType.airbag_particle_nearest_segment_distance: 1, - ArrayType.airbag_particle_position: 1, - ArrayType.airbag_particle_velocity: 1, - } - n_particles = self.check_array_dims(array_dims, "n_particles") - - self.check_array_dims({ArrayType.airbag_particle_position: 2}, "x_y_z", 3) - - self.check_array_dims({ArrayType.airbag_particle_velocity: 2}, "vx_vy_vz", 3) - - # Info: - # we cast integers to floats here (no conversion, just a cast) - # to be able to concatenate the arrays while preserving the - # bytes internally. - - # AIRBAG STATE DATA - airbag_n_active_particles = ( - self.arrays[ArrayType.airbag_n_active_particles][i_timestep] - if ArrayType.airbag_n_active_particles in self.arrays - else np.zeros(n_airbags, dtype=settings.itype) - ) - airbag_n_active_particles = airbag_n_active_particles.view(settings.ftype) - - airbag_bag_volume = ( - self.arrays[ArrayType.airbag_bag_volume][i_timestep] - if ArrayType.airbag_bag_volume in self.arrays - else np.zeros(n_airbags, dtype=settings.ftype) - ) - - airbag_data = np.concatenate( - [ - airbag_n_active_particles.reshape(n_airbags, 1), - airbag_bag_volume.reshape(n_airbags, 1), - ], - axis=1, - ) - n_bytes_written = fp.write(settings.pack(airbag_data, dtype_hint=np.floating)) - - # particle var names - array_particle_list = [] - - # PARTICLE GAS ID - array = ( - self.arrays[ArrayType.airbag_particle_gas_id][i_timestep] - if ArrayType.airbag_particle_gas_id in self.arrays - else np.zeros(n_particles, dtype=settings.itype) - ) - array = array.view(settings.ftype) - array_particle_list.append(array.reshape(-1, 1)) - - # PARTICLE CHAMBER ID - array = ( - self.arrays[ArrayType.airbag_particle_chamber_id][i_timestep] - if ArrayType.airbag_particle_chamber_id in self.arrays - else np.zeros(n_particles, dtype=settings.itype) - ) - array = array.view(settings.ftype) - array_particle_list.append(array.reshape(-1, 1)) - - # PARTICLE LEAKAGE - array = ( - self.arrays[ArrayType.airbag_particle_leakage][i_timestep] - if ArrayType.airbag_particle_leakage in self.arrays - else np.zeros(n_particles, dtype=settings.itype) - ) - array = array.view(settings.ftype) - array_particle_list.append(array.reshape(-1, 1)) - - # PARTICLE POSITION - array = ( - self.arrays[ArrayType.airbag_particle_position][i_timestep] - if ArrayType.airbag_particle_position in self.arrays - else np.zeros((n_particles, 3), dtype=settings.ftype) - ) - array_particle_list.append(array) - - # PARTICLE VELOCITY - array = ( - self.arrays[ArrayType.airbag_particle_velocity][i_timestep] - if ArrayType.airbag_particle_velocity in self.arrays - else np.zeros((n_particles, 3), dtype=settings.ftype) - ) - array_particle_list.append(array) - - # PARTICLE MASS - array = ( - self.arrays[ArrayType.airbag_particle_mass][i_timestep] - if ArrayType.airbag_particle_mass in self.arrays - else np.zeros(n_particles, dtype=settings.ftype) - ) - array_particle_list.append(array.reshape(-1, 1)) - - # PARTICLE RADIUS - array = ( - self.arrays[ArrayType.airbag_particle_radius][i_timestep] - if ArrayType.airbag_particle_radius in self.arrays - else np.zeros(n_particles, dtype=settings.ftype) - ) - array_particle_list.append(array.reshape(-1, 1)) - - # PARTICLE SPIN ENERGY - array = ( - self.arrays[ArrayType.airbag_particle_spin_energy][i_timestep] - if ArrayType.airbag_particle_spin_energy in self.arrays - else np.zeros(n_particles, dtype=settings.ftype) - ) - array_particle_list.append(array.reshape(-1, 1)) - - # PARTICLE TRANSL ENERGY - array = ( - self.arrays[ArrayType.airbag_particle_translation_energy][i_timestep] - if ArrayType.airbag_particle_translation_energy in self.arrays - else np.zeros(n_particles, dtype=settings.ftype) - ) - array_particle_list.append(array.reshape(-1, 1)) - - # PARTICLE NEAREST NEIGHBOR DISTANCE - array = ( - self.arrays[ArrayType.airbag_particle_nearest_segment_distance][i_timestep] - if ArrayType.airbag_particle_nearest_segment_distance in self.arrays - else np.zeros(n_particles, dtype=settings.ftype) - ) - array_particle_list.append(array.reshape(-1, 1)) - - airbag_particle_data = np.concatenate(array_particle_list, axis=1) - n_bytes_written += fp.write(settings.pack(airbag_particle_data, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = (2 * n_airbags + n_particles * 14) * settings.wordsize - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_airbags", n_bytes_written) - - return n_bytes_written - - def _write_states_rigid_road( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - if settings.header["ndim"] <= 5: - return 0 - - _check_ndim( - self, - { - ArrayType.rigid_road_displacement: ["n_timesteps", "n_rigid_roads", "x_y_z"], - ArrayType.rigid_road_velocity: ["n_timesteps", "n_rigid_roads", "vx_vy_vz"], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.rigid_road_displacement: 0, - ArrayType.rigid_road_velocity: 0, - } - self.check_array_dims(array_dims, "n_rigid_roads") - - array_dims = { - ArrayType.rigid_road_segment_road_id: 0, - ArrayType.rigid_road_displacement: 1, - ArrayType.rigid_road_velocity: 1, - } - n_rigid_roads = self.check_array_dims(array_dims, "n_rigid_roads") - - self.check_array_dims({ArrayType.rigid_road_displacement: 2}, "x_y_z", 3) - - self.check_array_dims({ArrayType.rigid_road_velocity: 2}, "vx_vy_vz", 3) - - rigid_road_data = np.zeros((n_rigid_roads, 2, 3), dtype=settings.ftype) - - # RIGID ROAD DISPLACEMENT - if ArrayType.rigid_road_displacement in self.arrays: - array = self.arrays[ArrayType.rigid_road_displacement][i_timestep] - rigid_road_data[:, 0, :] = array - - # RIGID ROAD VELOCITY - if ArrayType.rigid_road_velocity in self.arrays: - array = self.arrays[ArrayType.rigid_road_velocity][i_timestep] - rigid_road_data[:, 1, :] = array - - n_bytes_written = fp.write(settings.pack(rigid_road_data, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = settings.header["nv1d"] * settings.header["nel2"] * settings.wordsize - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_rigid_road", n_bytes_written) - - return n_bytes_written - - def _write_states_rigid_bodies( - self, fp: typing.IO[Any], i_timestep: int, settings: D3plotWriterSettings - ) -> int: - if 8 <= settings.header["ndim"] <= 9: - pass - else: - return 0 - - has_reduced_data = settings.header["ndim"] == 9 - - _check_ndim( - self, - { - ArrayType.rigid_body_coordinates: ["n_timesteps", "n_rigid_bodies", "x_y_z"], - ArrayType.rigid_body_rotation_matrix: ["n_timesteps", "n_rigid_bodies", "matrix"], - ArrayType.rigid_body_velocity: ["n_timesteps", "n_rigid_bodies", "vx_vy_vz"], - ArrayType.rigid_body_rot_velocity: ["n_timesteps", "n_rigid_bodies", "rvx_rvy_rvz"], - ArrayType.rigid_body_acceleration: ["n_timesteps", "n_rigid_bodies", "ax_ay_az"], - ArrayType.rigid_body_rot_acceleration: [ - "n_timesteps", - "n_rigid_bodies", - "rax_ray_raz", - ], - }, - ) - - array_dims = { - ArrayType.global_timesteps: 0, - ArrayType.rigid_body_coordinates: 0, - ArrayType.rigid_body_rotation_matrix: 0, - ArrayType.rigid_body_velocity: 0, - ArrayType.rigid_body_rot_velocity: 0, - ArrayType.rigid_body_acceleration: 0, - ArrayType.rigid_body_rot_acceleration: 0, - } - self.check_array_dims(array_dims, "n_timesteps") - - array_dims = { - ArrayType.rigid_body_part_indexes: 1, - ArrayType.rigid_body_coordinates: 1, - ArrayType.rigid_body_rotation_matrix: 1, - ArrayType.rigid_body_velocity: 1, - ArrayType.rigid_body_rot_velocity: 1, - ArrayType.rigid_body_acceleration: 1, - ArrayType.rigid_body_rot_acceleration: 1, - } - n_rigid_bodies = self.check_array_dims(array_dims, "n_rigid_bodies") - - self.check_array_dims({ArrayType.rigid_body_coordinates: 2}, "x_y_z", 3) - - self.check_array_dims({ArrayType.rigid_body_rotation_matrix: 2}, "matrix", 9) - - self.check_array_dims({ArrayType.rigid_body_velocity: 2}, "vx_vy_vz", 3) - - self.check_array_dims({ArrayType.rigid_body_rot_velocity: 2}, "rvx_rvy_rvz", 3) - - self.check_array_dims({ArrayType.rigid_body_acceleration: 2}, "ax_ay_az", 3) - - self.check_array_dims({ArrayType.rigid_body_rot_acceleration: 2}, "rax_ray_raz", 3) - - # allocate block - rigid_body_data = ( - np.zeros((n_rigid_bodies, 12), dtype=settings.ftype) - if has_reduced_data - else np.zeros((n_rigid_bodies, 24), dtype=settings.ftype) - ) - - start_index = 0 - end_index = 0 - - # COORDINATES - if ArrayType.rigid_body_coordinates in self.arrays: - start_index = end_index - end_index = start_index + 3 - array = self.arrays[ArrayType.rigid_body_coordinates][i_timestep] - rigid_body_data[:, start_index:end_index] = array - - # ROTATION MATRIX - if ArrayType.rigid_body_rotation_matrix in self.arrays: - start_index = end_index - end_index = start_index + 9 - array = self.arrays[ArrayType.rigid_body_coordinates][i_timestep] - rigid_body_data[:, start_index:end_index] = array - - if not has_reduced_data: - # VELOCITY - if ArrayType.rigid_body_velocity in self.arrays: - start_index = end_index - end_index = start_index + 3 - array = self.arrays[ArrayType.rigid_body_velocity][i_timestep] - rigid_body_data[:, start_index:end_index] = array - - # ROTATION VELOCITY - if ArrayType.rigid_body_rot_velocity in self.arrays: - start_index = end_index - end_index = start_index + 3 - array = self.arrays[ArrayType.rigid_body_rot_velocity][i_timestep] - rigid_body_data[:, start_index:end_index] = array - - # ACCELERATION - if ArrayType.rigid_body_acceleration in self.arrays: - start_index = end_index - end_index = start_index + 3 - array = self.arrays[ArrayType.rigid_body_acceleration][i_timestep] - rigid_body_data[:, start_index:end_index] = array - - # ROTATION ACCELERATION - if ArrayType.rigid_body_rot_acceleration in self.arrays: - start_index = end_index - end_index = start_index + 3 - array = self.arrays[ArrayType.rigid_body_rot_acceleration][i_timestep] - rigid_body_data[:, start_index:end_index] = array - - n_bytes_written = fp.write(settings.pack(rigid_body_data, dtype_hint=np.floating)) - - # check bytes - n_bytes_expected = settings.header["nv1d"] * settings.header["nel2"] * settings.wordsize - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - # log - msg = "%s wrote %d bytes." - LOGGER.debug(msg, "_write_states_rigid_bodies", n_bytes_written) - - return n_bytes_written - - def check_array_dims( - self, array_dimensions: dict[str, int], dimension_name: str, dimension_size: int = -1 - ): - """This function checks if multiple arrays share an array dimensions - with the same size. - - Parameters - ---------- - array_dimensions: Dict[str, int] - Array name and expected number of dimensions as dict - dimension_name: str - Name of the array dimension for error messages - dimension_size: int - Optional expected size. If not set then all entries must equal - the first value collected. - - Raises - ------ - ValueError - If dimensions do not match in any kind of way. - """ - - dimension_size_dict = {} - - # collect all dimensions - for typename, dimension_index in array_dimensions.items(): - if typename not in self.arrays: - continue - - array = self.arrays[typename] - - if dimension_index >= array.ndim: - msg = ( - f"Array '{typename}' requires at least " - f"{dimension_index} dimensions ({dimension_name})" - ) - raise ValueError(msg) - - dimension_size_dict[typename] = array.shape[dimension_index] - - # static dimension - if dimension_size >= 0: - arrays_with_wrong_dims = { - typename: size - for typename, size in dimension_size_dict.items() - if size != dimension_size - } - - if arrays_with_wrong_dims: - msg = "The dimension %s of the following arrays is expected to have size %d:\n%s" - msg_arrays = [ - f" - name: {typename} dim: {array_dimensions[typename]} size: {size}" - for typename, size in arrays_with_wrong_dims.items() - ] - raise ValueError(msg, dimension_name, dimension_size, "\n".join(msg_arrays)) - - # dynamic dimensions - elif dimension_size_dict: - unique_sizes = np.unique(list(dimension_size_dict.values())) - if len(unique_sizes) > 1: - msg = "Inconsistency in array dim '%d' detected:\n%s" - size_list = [ - f" - name: {typename}, dim: {array_dimensions[typename]}, size: {size}" - for typename, size in dimension_size_dict.items() - ] - raise ValueError(msg, dimension_name, "\n".join(size_list)) - if len(unique_sizes) == 1: - dimension_size = unique_sizes[0] - - if dimension_size < 0: - return 0 - - return dimension_size - - @staticmethod - def _compare_n_bytes_checksum(n_bytes_written: int, n_bytes_expected: int): - """Throw if the byte checksum was not ok - - Parameters - ---------- - n_bytes_written: int - bytes written to the file - n_bytes_expected: int - bytes expected from the header computation - - Raises - ------ - RuntimeError - If the byte count doesn't match. - """ - if n_bytes_expected != n_bytes_written: - msg = ( - f"byte checksum wrong: {n_bytes_expected} (header) != {n_bytes_written} (checksum)" - ) - raise RuntimeError(msg) - - def _get_zero_byte_padding(self, n_bytes_written: int, block_size_bytes: int): - """Compute the zero byte-padding at the end of files - - Parameters - ---------- - n_bytes_written: int - number of bytes already written to file - block_size_bytes: int - byte block size of the file - - Returns - ------- - zero_bytes: bytes - zero-byte padding ready to be written to the file - """ - - if block_size_bytes > 0: - remaining_bytes = n_bytes_written % block_size_bytes - n_bytes_to_fill = block_size_bytes - remaining_bytes if remaining_bytes != 0 else 0 - return b"\x00" * n_bytes_to_fill - - return b"" - - def compare(self, d3plot2, array_eps: Union[float, None] = None): - """Compare two d3plots and print the info - - Parameters - ---------- - d3plot2: D3plot - second d3plot - array_eps: float or None - tolerance for arrays - - Returns - ------- - hdr_differences: dict - differences in the header - array_differences: dict - difference between arrays as message - - Examples - -------- - Comparison of a femzipped file and an uncompressed file. Femzip - is a lossy compression, thus precision is traded for memory. - - >>> d3plot1 = D3plot("path/to/d3plot") - >>> d3plot2 = D3plot("path/to/d3plot.fz") - >>> hdr_diff, array_diff = d3plot1.compare(d3plot2) - >>> for arraytype, msg in array_diff.items(): - >>> print(name, msg) - node_coordinates ฮ”max = 0.050048828125 - node_displacement ฮ”max = 0.050048828125 - node_velocity ฮ”max = 0.050048828125 - node_acceleration ฮ”max = 49998984.0 - element_beam_axial_force ฮ”max = 6.103515625e-05 - element_shell_stress ฮ”max = 0.0005035400390625 - element_shell_thickness ฮ”max = 9.999999717180685e-10 - element_shell_unknown_variables ฮ”max = 0.0005000010132789612 - element_shell_internal_energy ฮ”max = 188.41957092285156 - - """ - - # pylint: disable = too-many-nested-blocks - - if not isinstance(d3plot2, D3plot): - raise TypeError(f"d3plot2 must be an instance of D3plot, got {type(d3plot2)}") - - d3plot1 = self - - hdr_differences = d3plot1.header.compare(d3plot2.header) - - # ARRAY COMPARISON - array_differences = {} - - array_names = list(d3plot1.arrays.keys()) + list(d3plot2.arrays.keys()) - - for name in array_names: - array1 = ( - d3plot1.arrays[name] if name in d3plot1.arrays else "Array is missing in original" - ) - - array2 = d3plot2.arrays[name] if name in d3plot2.arrays else "Array is missing in other" - - # d3parts write results for rigid shells. - # when rewriting as d3plot we simply - # don't write the part_material_types - # array which is the same as having no - # rigid shells. - d3plot1_is_d3part = d3plot1.header.filetype == D3plotFiletype.D3PART - d3plot2_is_d3part = d3plot2.header.filetype == D3plotFiletype.D3PART - if name == "part_material_type" and (d3plot1_is_d3part or d3plot2_is_d3part): - continue - - # we have an array to compare - if isinstance(array1, str): - array_differences[name] = array1 - elif isinstance(array2, str): - array_differences[name] = array2 - elif isinstance(array2, np.ndarray): - comparison = False - - # compare arrays - if isinstance(array1, np.ndarray): - if array1.shape != array2.shape: - comparison = f"shape mismatch {array1.shape} != {array2.shape}" - elif np.issubdtype(array1.dtype, np.number) and np.issubdtype( - array2.dtype, np.number - ): - diff = np.abs(array1 - array2) - if diff.size: - if array_eps is not None: - diff2 = diff[diff > array_eps] - if diff2.size: - diff2_max = diff2.max() - if diff2_max: - comparison = f"ฮ”max = {diff2_max}" - else: - diff_max = diff.max() - if diff_max: - comparison = f"ฮ”max = {diff_max}" - else: - n_mismatches = (array1 != array2).sum() - if n_mismatches: - comparison = f"Mismatches: {n_mismatches}" - - else: - comparison = "Arrays don't match" - - # print - if comparison: - array_differences[name] = comparison - - return hdr_differences, array_differences - - def get_part_filter( - self, filter_type: FilterType, part_ids: Iterable[int], for_state_array: bool = True - ) -> np.ndarray: - """Get a part filter for different entities - - Parameters - ---------- - filter_type: lasso.dyna.FilterType - the array type to filter for (beam, shell, solid, tshell, node) - part_ids: Iterable[int] - part ids to filter out - for_state_array: bool - if the filter is meant for a state array. Makes a difference - for shells if rigid bodies are in the model (mattyp == 20) - - Returns - ------- - mask: np.ndarray - mask usable on arrays to filter results - - Examples - -------- - >>> from lasso.dyna import D3plot, ArrayType, FilterType - >>> d3plot = D3plot("path/to/d3plot") - >>> mask = d3plot.get_part_filter(FilterType.SHELL) - >>> shell_stress = d3plot.arrays[ArrayType.element_shell_stress] - >>> shell_stress.shape - (34, 7463, 3, 6) - >>> # select only parts from part_ids - >>> part_ids = [13, 14] - >>> mask = d3plot.get_part_filter(FilterType.PART, part_ids) - >>> shell_stress_parts = shell_stress[:, mask] - """ - - # nodes are treated separately - if filter_type == FilterType.NODE: - node_index_arrays = [] - - if ArrayType.element_shell_node_indexes in self.arrays: - shell_filter = self.get_part_filter( - FilterType.SHELL, part_ids, for_state_array=False - ) - shell_node_indexes = self.arrays[ArrayType.element_shell_node_indexes] - node_index_arrays.append(shell_node_indexes[shell_filter].flatten()) - - if ArrayType.element_solid_node_indexes in self.arrays: - solid_filter = self.get_part_filter( - FilterType.SOLID, part_ids, for_state_array=False - ) - solid_node_indexes = self.arrays[ArrayType.element_solid_node_indexes] - node_index_arrays.append(solid_node_indexes[solid_filter].flatten()) - - if ArrayType.element_tshell_node_indexes in self.arrays: - tshell_filter = self.get_part_filter( - FilterType.TSHELL, part_ids, for_state_array=False - ) - tshell_node_indexes = self.arrays[ArrayType.element_tshell_node_indexes] - node_index_arrays.append(tshell_node_indexes[tshell_filter].flatten()) - - return np.unique(np.concatenate(node_index_arrays)) - - # we need part ids first - if ArrayType.part_ids in self.arrays: - d3plot_part_ids = self.arrays[ArrayType.part_ids] - elif ArrayType.part_titles_ids in self.arrays: - d3plot_part_ids = self.arrays[ArrayType.part_titles_ids] - else: - msg = "D3plot does neither contain '%s' nor '%s'" - raise RuntimeError(msg, ArrayType.part_ids, ArrayType.part_titles_ids) - - # if we filter parts we can stop here - if filter_type == FilterType.PART: - return np.isin(d3plot_part_ids, part_ids) - - # get part indexes from part ids - part_indexes = np.argwhere(np.isin(d3plot_part_ids, part_ids)).flatten() - - # associate part indexes with entities - if filter_type == FilterType.BEAM: - entity_part_indexes = self.arrays[ArrayType.element_beam_part_indexes] - elif filter_type == FilterType.SHELL: - entity_part_indexes = self.arrays[ArrayType.element_shell_part_indexes] - - # shells may contain "rigid body shell elements" - # for these shells no state data is output and thus - # the state arrays have a reduced element count - if for_state_array and self._material_section_info.n_rigid_shells != 0: - mat_types = self.arrays[ArrayType.part_material_type] - mat_type_filter = mat_types[entity_part_indexes] != 20 - entity_part_indexes = entity_part_indexes[mat_type_filter] - - elif filter_type == FilterType.TSHELL: - entity_part_indexes = self.arrays[ArrayType.element_tshell_part_indexes] - elif filter_type == FilterType.SOLID: - entity_part_indexes = self.arrays[ArrayType.element_solid_part_indexes] - else: - msg = "Invalid filter_type '%s'. Use lasso.dyna.FilterType." - raise ValueError(msg, filter_type) - - mask = np.isin(entity_part_indexes, part_indexes) - return mask - - @staticmethod - def enable_logger(enable: bool): - """Enable the logger for this class - - Parameters - ---------- - enable: bool - whether to enable logging for this class - """ - - if enable: - LOGGER.setLevel(logging.DEBUG) - else: - LOGGER.setLevel(logging.NOTSET) diff --git a/src/lasso/dyna/d3plot_header.py b/src/lasso/dyna/d3plot_header.py deleted file mode 100644 index d2000c6..0000000 --- a/src/lasso/dyna/d3plot_header.py +++ /dev/null @@ -1,1199 +0,0 @@ -import enum -from typing import Any, Union - -import numpy as np -import rich - -from lasso.io.binary_buffer import BinaryBuffer -from lasso.logging import get_logger - - -# We have a lot of docstrings here but even if not so, we want to contain the -# code here. -# pylint: disable=too-many-lines - -LOGGER = get_logger(__file__) - - -def get_digit(number: int, i_digit: int) -> int: - """Get a digit from a number - - Parameters - ---------- - number: int - number to get digit from - i_digit: int - index of the digit - - Returns - ------- - digit: int - digit or 0 if i_digit is too large - - Notes - ----- - `i_digit` does refer to a digit from the - lowest position counting. Thus, - 123 with `i_digit=0` is `3`. - """ - digit_list = [] - - # pylint: disable = inconsistent-return-statements - def _get_digit_recursive(x: int): - if x < 10: - digit_list.append(x) - return x - _get_digit_recursive(x // 10) - digit_list.append(x % 10) - - # do the thing - _get_digit_recursive(number) - - # revert list from smallest to biggest - digit_list = digit_list[::-1] - - return digit_list[i_digit] if i_digit < len(digit_list) else 0 - - -class D3plotFiletype(enum.Enum): - """Enum for the filetype of a D3plot""" - - D3PLOT = 1 - D3PART = 5 - D3EIGV = 11 - INTFOR = 4 - - -def d3plot_filetype_from_integer(value: int) -> D3plotFiletype: - """Get a D3plotFiletype object from an integer - - Parameters - ---------- - value: int - integer value representing the filetype - - Returns - ------- - filetype: D3plotFiletype - d3plot filetype object - - Raises - ------ - RuntimeError if invalid value. - """ - - valid_entries = { - entry.value: entry - for entry in D3plotFiletype.__members__.values() - if entry.value != 4 # no intfor - } - - if value not in valid_entries: - valid_filetypes = ",".join( - f"{key} ({value.value})" - for key, value in D3plotFiletype.__members__.items() - if value.value != 4 - ) - err_msg = f"Invalid filetype value of {value}. Expected one of: {valid_filetypes}" - raise ValueError(err_msg) - - return valid_entries[value] - - -# pylint: disable = too-many-instance-attributes -class D3plotHeader: - """Class for reading only header information of a d3plot - - Attributes - ---------- - filepath: str - Filepath of the processed file. - itype: np.dtype - Integer type of d3plot. - ftype: np.dtype - Floating point type of d3plot. - wordsize: int - size of words in bytes (4 = single precision, 8 = double precision). - raw_header: Dict[str, Any] - Raw header data as dict. - external_numbers_dtype: np.dtype - Integer type of user ids. - n_header_bytes: int - Number of bytes of header (at least 256 or more). - title: str - Main title. - title2: str - Optional, secondary title. - runtime: int - Runtime of the d3plot as timestamp. - filetype: D3plotFiletype - Filetype such as d3plot or d3part. - source_version: int - Source version of LS-Dyna. - release_version: str - Release version of LS-Dyna. - version: float - Version of LS-Dyna. - extra_long_header: bool - If header was longer than default. - n_dimensions: int - Number of dimensions, usually three. - n_global_vars: int - How many global vars for each state. - n_adapted_element_pairs: int - How many adapted element pairs. - has_node_deletion_data: bool - If node deletion data is present. - has_element_deletion_data: bool - If element deletion data is present. - has_numbering_section: bool - If a user numbering section is present. - has_material_type_section: bool - If material type section was written. - n_numbering_section_words: int - Amount of words for numbering section. - has_invariant_numbering: bool - If invariant numbering is used whatever that means. - quadratic_elems_has_full_connectivity: bool - If quadric elements have full connectivity. - quadratic_elems_has_data_at_integration_points: bool - If quadric elements data is at integration points. - n_post_branches: int - Unused and unknown. - n_types: Tuple[int, ...] - Behind geometry these are integers indicating additional data such as - part names. - n_parts: int - Obviously number of parts. - n_nodes: int - Number of nodes. - has_node_temperatures: bool - If node temperature is present. - has_node_temperature_layers: bool - If node temperatures are layered. - has_node_heat_flux: bool - If node heat flux is present. - has_node_mass_scaling: bool - Mass scaling is written. - has_node_displacement: bool - Node displacement is written. - has_node_velocity: bool - Node velocity is written. - has_node_acceleration: bool - Node acceleration is written. - has_node_temperature_gradient: bool - Node temperature gradient is written. - has_node_residual_forces: bool - Node residual forces are written. - has_node_residual_moments: bool - Node residual moments are written. - has_node_max_contact_penetration_absolute: bool - Node contact penetration info exist. - has_node_max_contact_penetration_relative: bool - Node relative contact penetration info was written. - has_node_contact_energy_density: int - Node energy density was written. - n_shell_tshell_layers: int - Number of layers for shells and thick shells. - n_shell_tshell_history_vars: int - Number of history vars for shells and thick shells. - has_shell_tshell_stress: bool - If shells and thick shells have stresses. - has_shell_tshell_pstrain: bool - If shells and thick shells have eff. plastic strain. - has_element_strain: bool - If all elements have strain. - has_solid_shell_plastic_strain_tensor: bool - If solids have plastic strain tensor. - has_solid_shell_thermal_strain_tensor: bool - If solids have thermal strain tensor. - n_solids: int - Number of solids. - n_solid_vars: int - Number of solid variables per element and state. - n_solid_materials: int - Number of solid materials/parts. - n_solid_history_vars: int - Number of solid history variables. - n_solid_thermal_vars: int - Number of solid thermal variables. - n_solids_20_node_hexas: int - Number of 20-node solid hexas. - n_solids_27_node_hexas: int - Number of 27-node solid hexas. - n_solids_21_node_pentas: int - Number of 21-node solid pentas. - n_solids_15_node_tetras: int - Number of 15-node solid tetras. - n_solids_20_node_tetras: int - Number of 20-node solid tetras. - n_solids_40_node_pentas: int - Number of 40-node solid pentas. - n_solids_64_node_hexas: int - Number of 64-node solid hexas. - has_solid_2_extra_nodes: bool - If two extra nodes were written for solids. - has_solid_stress: bool - If solid stress is present. - has_solid_pstrain: bool - If solid eff. plastic strain is present. - has_quadratic_solids: bool - If quadratic solids were used. - has_cubic_solids: bool - If cubic solids were used. - has_solid_internal_energy_density: bool - If solids have internal energy density. - n_solid_layers: int - Number of solid layers. - n_shells: int - Number of shells. - n_shell_vars: int - Number of shell vars per element and state. - n_shell_materials: int - Number of shell materials/parts. - n_shells_8_nodes: int - Number of 8-node shells. - has_shell_four_inplane_gauss_points: bool - If shells have four inplace gaussian integration points. - has_shell_forces: bool - If shell forces are present. - has_shell_extra_variables: bool - If extra shell variables such as forces are present. - has_shell_internal_energy_density: bool - If shell internal energy density is present. - n_thick_shells: int - Number of thick shell elements. - n_thick_shell_vars: int - Number of thick shell element vars. - n_thick_shell_materials: int - Number of thick shell materials/parts. - has_thick_shell_energy_density: bool - If thick shells have energy density. - thick_shell_energy_density_position: int - Nnused. - n_beams: int - Number of beam elements. - n_beam_vars: int - Number of state variables per beam element. - n_beam_materials: int - Number of beam materials. - n_beam_history_vars: int - Number of beam history variables. - n_airbags: int - Number of airbags. - has_airbag_n_chambers: bool - If airbags have number of chambers var. - has_rigid_road_surface: bool - If rigid road surface was written. - has_rigid_body_data: bool - If rigid body section was written. - has_reduced_rigid_body_data: bool - If the reduced set of rigid body data was written. - n_rigid_wall_vars: int - Number of rigid wall vars. - n_sph_nodes: int - Number of sph nodes. - n_sph_materials: int - Number of sph materials. - n_ale_materials: int - Number of ale materials. - n_ale_fluid_groups: int - Number of ale fluid groups. - has_cfd_data: bool - If CFD-Data was written. - has_multi_solver_data: bool - If multi-solver data was written. - cfd_extra_data: int - If cfd data contains extra section. - legacy_code_type: int - Originally a code indicator but unused nowadays. - unused_numst: int - Unused and not explained in docs. - """ - - # meta - filepath: str = "" - - # file info - itype: np.dtype = np.int32 - ftype: np.dtype = np.float32 - wordsize: int = 4 - raw_header: dict[str, Any] = {} - external_numbers_dtype = np.int32 - n_header_bytes: int = 0 - - # header - title: str = "" - title2: str = "" - runtime: int = 0 - filetype: D3plotFiletype = D3plotFiletype.D3PLOT - - source_version: int = 0 - release_version: str = "" - version: float = 0.0 - extra_long_header: bool = False - - # general info - n_dimensions: int = 3 - n_global_vars: int = 0 - n_adapted_element_pairs: int = 0 - has_node_deletion_data: bool = False - has_element_deletion_data: bool = False - has_numbering_section: bool = False - has_material_type_section: bool = False - n_numbering_section_words: int = 0 - has_invariant_numbering: bool = False - quadratic_elems_has_full_connectivity: bool = False - quadratic_elems_has_data_at_integration_points: bool = False - n_post_branches: int = 0 - n_types: tuple[int, ...] = () - - # parts - n_parts: int = 0 - - # nodes - n_nodes: int = 0 - has_node_temperatures: bool = False - has_node_temperature_layers: bool = False - has_node_heat_flux: bool = False - has_node_mass_scaling: bool = False - has_node_displacement: bool = False - has_node_velocity: bool = False - has_node_acceleration: bool = False - has_node_temperature_gradient: bool = False - has_node_residual_forces: bool = False - has_node_residual_moments: bool = False - has_node_max_contact_penetration_absolute: bool = False - has_node_max_contact_penetration_relative: bool = False - has_node_contact_energy_density: int = False - - # elements - n_shell_tshell_layers: int = 3 - n_shell_tshell_history_vars: int = 0 - has_shell_tshell_stress: bool = False - has_shell_tshell_pstrain: bool = False - has_element_strain: bool = False - has_solid_shell_plastic_strain_tensor: bool = False - has_solid_shell_thermal_strain_tensor: bool = False - - # solids - n_solids: int = 0 - n_solid_vars: int = 0 - n_solid_materials: int = 0 - n_solid_history_vars: int = 0 - n_solid_thermal_vars: int = 0 - n_solids_20_node_hexas: int = 0 - n_solids_27_node_hexas: int = 0 - n_solids_21_node_pentas: int = 0 - n_solids_15_node_tetras: int = 0 - n_solids_20_node_tetras: int = 0 - n_solids_40_node_pentas: int = 0 - n_solids_64_node_hexas: int = 0 - has_solid_2_extra_nodes: bool = False - has_solid_stress: bool = False - has_solid_pstrain: bool = False - has_quadratic_solids: bool = False - has_cubic_solids: bool = False - has_solid_internal_energy_density: bool = False - - # shells - n_shells: int = 0 - n_shell_vars: int = 0 - n_shell_materials: int = 0 - n_shells_8_nodes: int = 0 - has_shell_four_inplane_gauss_points: bool = False - has_shell_forces: bool = False - has_shell_extra_variables: bool = False - has_shell_internal_energy_density: bool = False - # has_shell_internal_energy: bool = False - - # thick shells - n_thick_shells: int = 0 - n_thick_shell_vars: int = 0 - n_thick_shell_materials: int = 0 - has_thick_shell_energy_density: bool = False - thick_shell_energy_density_position: int = 0 - - # beams - n_beams: int = 0 - n_beam_vars: int = 0 - n_beam_materials: int = 0 - n_beam_history_vars: int = 0 - - # airbags - n_airbags: int = 0 - has_airbag_n_chambers: bool = False - - # rigid roads - has_rigid_road_surface: bool = False - - # rigid bodies - has_rigid_body_data: bool = False - has_reduced_rigid_body_data: bool = False - - # sph - n_sph_nodes: int = 0 - n_sph_materials: int = 0 - - # ale - n_ale_materials: int = 0 - n_ale_fluid_groups: int = 0 - - # cfd - has_cfd_data: bool = False - - # multi-solver - has_multi_solver_data: bool = False - cfd_extra_data: int = 0 - - # historical artifacts - legacy_code_type: int = 6 - unused_numst: int = 0 - - def __init__(self, filepath: Union[str, BinaryBuffer, None] = None): - """Create a D3plotHeader instance - - Parameters - ---------- - filepath: Union[str, BinaryBuffer, None] - path to a d3plot file or a buffer holding d3plot memory - - Returns - ------- - header: D3plotHeader - d3plot header instance - - Examples - -------- - Create an empty header file - - >>> header = D3plotHeader() - - Now load only the header of a d3plot. - - >>> header.load_file("path/to/d3plot") - - Or we can do the above together. - - >>> header = D3plotHeader("path/to/d3plot") - - Notes - ----- - This class does not load the entire memory of a d3plot - but merely what is required to parse the header information. - Thus, it is safe to use on big files. - """ - - if filepath is not None: - self.load_file(filepath) - - def print(self) -> None: - """Print the header""" - rich.print(self.__dict__) - - def _read_file_buffer(self, filepath: str) -> BinaryBuffer: - """Reads a d3plots header - - Parameters - ---------- - filepath: str - path to d3plot - - Returns - ------- - bb: BinaryBuffer - buffer holding the exact header data in binary form - """ - - LOGGER.debug("_read_file_buffer start") - LOGGER.debug("filepath: %s", filepath) - - # load first 64 single words - n_words_header = 64 - n_bytes_hdr_guessed = 64 * self.wordsize - bb = BinaryBuffer(filepath, n_bytes_hdr_guessed) - - # check if single or double - self.wordsize, self.itype, self.ftype = self._determine_file_settings(bb) - - # Oops, seems other wordsize is used - if self.wordsize != D3plotHeader.wordsize: - bb = BinaryBuffer(filepath, n_words_header * self.wordsize) - - # check for extra long header - n_header_bytes = self._determine_n_bytes(bb, self.wordsize) - if len(bb) <= n_header_bytes: - bb = BinaryBuffer(filepath, n_bytes=n_header_bytes) - - LOGGER.debug("_read_file_buffer end") - - return bb - - def _determine_n_bytes(self, bb: BinaryBuffer, wordsize: int) -> int: - """Determines how many bytes the header has - - Returns - ------- - size: int - size of the header in bytes - """ - - LOGGER.debug("_determine_n_bytes start") - - n_base_words = 64 - min_n_bytes = n_base_words * wordsize - - if len(bb) < n_base_words * wordsize: - err_msg = "File or file buffer must have at least '{0}' bytes instead of '{1}'" - raise RuntimeError(err_msg.format(min_n_bytes, len(bb))) - - n_extra_header_words = int(bb.read_number(57 * self.wordsize, self.itype)) - - LOGGER.debug("_determine_n_bytes end") - - return (n_base_words + n_extra_header_words) * wordsize - - def load_file(self, file: Union[str, BinaryBuffer]) -> "D3plotHeader": - """Load d3plot header from a d3plot file - - Parameters - ---------- - file: Union[str, BinaryBuffer] - path to d3plot or `BinaryBuffer` holding memory of d3plot - - Returns - ------- - self: D3plotHeader - returning self on success - - Notes - ----- - This routine only loads the minimal amount of data - that is necessary. Thus it is safe to use on huge files. - - Examples - -------- - >>> header = D3plotHeader().load_file("path/to/d3plot") - >>> header.n_shells - 19684 - """ - - # pylint: disable = too-many-locals, too-many-branches, too-many-statements - - LOGGER.debug("_load_file start") - LOGGER.debug("file: %s", file) - - if not isinstance(file, (str, BinaryBuffer)): - err_msg = "Argument 'file' must have type 'str' or 'lasso.io.BinaryBuffer'." - raise ValueError(err_msg) - - # get the memory - if isinstance(file, str): - bb = self._read_file_buffer(file) - self.n_header_bytes = len(bb) - else: - bb = file - self.wordsize, self.itype, self.ftype = self._determine_file_settings(bb) - self.n_header_bytes = self._determine_n_bytes(bb, self.wordsize) - - LOGGER.debug("n_header_bytes: %d", self.n_header_bytes) - - # read header - header_words = { - "title": [0 * self.wordsize, str, 9 * self.wordsize], - "runtime": [10 * self.wordsize, self.itype], - "filetype": [11 * self.wordsize, self.itype], - "source_version": [12 * self.wordsize, self.itype], - "release_version": [13 * self.wordsize, str, 1 * self.wordsize], - "version": [14 * self.wordsize, self.ftype], - "ndim": [15 * self.wordsize, self.itype], - "numnp": [16 * self.wordsize, self.itype], - "icode": [17 * self.wordsize, self.itype], - "nglbv": [18 * self.wordsize, self.itype], - "it": [19 * self.wordsize, self.itype], - "iu": [20 * self.wordsize, self.itype], - "iv": [21 * self.wordsize, self.itype], - "ia": [22 * self.wordsize, self.itype], - "nel8": [23 * self.wordsize, self.itype], - "nummat8": [24 * self.wordsize, self.itype], - "numds": [25 * self.wordsize, self.itype], - "numst": [26 * self.wordsize, self.itype], - "nv3d": [27 * self.wordsize, self.itype], - "nel2": [28 * self.wordsize, self.itype], - "nummat2": [29 * self.wordsize, self.itype], - "nv1d": [30 * self.wordsize, self.itype], - "nel4": [31 * self.wordsize, self.itype], - "nummat4": [32 * self.wordsize, self.itype], - "nv2d": [33 * self.wordsize, self.itype], - "neiph": [34 * self.wordsize, self.itype], - "neips": [35 * self.wordsize, self.itype], - "maxint": [36 * self.wordsize, self.itype], - "nmsph": [37 * self.wordsize, self.itype], - "ngpsph": [38 * self.wordsize, self.itype], - "narbs": [39 * self.wordsize, self.itype], - "nelt": [40 * self.wordsize, self.itype], - "nummatt": [41 * self.wordsize, self.itype], - "nv3dt": [42 * self.wordsize, self.itype], - "ioshl1": [43 * self.wordsize, self.itype], - "ioshl2": [44 * self.wordsize, self.itype], - "ioshl3": [45 * self.wordsize, self.itype], - "ioshl4": [46 * self.wordsize, self.itype], - "ialemat": [47 * self.wordsize, self.itype], - "ncfdv1": [48 * self.wordsize, self.itype], - "ncfdv2": [49 * self.wordsize, self.itype], - "nadapt": [50 * self.wordsize, self.itype], - "nmmat": [51 * self.wordsize, self.itype], - "numfluid": [52 * self.wordsize, self.itype], - "inn": [53 * self.wordsize, self.itype], - "npefg": [54 * self.wordsize, self.itype], - "nel48": [55 * self.wordsize, self.itype], - "idtdt": [56 * self.wordsize, self.itype], - "extra": [57 * self.wordsize, self.itype], - } - - header_extra_words = { - "nel20": [64 * self.wordsize, self.itype], - "nt3d": [65 * self.wordsize, self.itype], - "nel27": [66 * self.wordsize, self.itype], - "neipb": [67 * self.wordsize, self.itype], - "nel21p": [68 * self.wordsize, self.itype], - "nel15t": [69 * self.wordsize, self.itype], - "soleng": [70 * self.wordsize, self.itype], - "nel20t": [71 * self.wordsize, self.itype], - "nel40p": [72 * self.wordsize, self.itype], - "nel64": [73 * self.wordsize, self.itype], - "quadr": [74 * self.wordsize, self.itype], - "cubic": [75 * self.wordsize, self.itype], - "tsheng": [76 * self.wordsize, self.itype], - "nbranch": [77 * self.wordsize, self.itype], - "penout": [78 * self.wordsize, self.itype], - "engout": [79 * self.wordsize, self.itype], - } - - # read header for real - self.raw_header = self.read_words(bb, header_words) - - if self.raw_header["extra"] != 0: - self.read_words(bb, header_extra_words, self.raw_header) - else: - for name, (_, dtype) in header_extra_words.items(): - self.raw_header[name] = dtype() - - # PARSE HEADER (no fun ahead) - if isinstance(file, str): - self.filepath = file - elif isinstance(file, BinaryBuffer): - if isinstance(file.filepath_, str): - self.filepath = file.filepath_ - elif isinstance(file.filepath_, list) and len(file.filepath_) > 0: - self.filepath = file.filepath_[0] - - self.title = self.raw_header["title"].strip() - self.runtime = self.raw_header["runtime"] - - # filetype - filetype = self.raw_header["filetype"] - if filetype > 1000: - filetype -= 1000 - self.external_numbers_dtype = np.int64 - else: - self.external_numbers_dtype = np.int32 - - self.filetype = d3plot_filetype_from_integer(filetype) - - self.source_version = self.raw_header["source_version"] - self.release_version = self.raw_header["release_version"] # .split("\0", 1)[0] - self.version = self.raw_header["version"] - - # ndim - ndim = self.raw_header["ndim"] - if ndim in (5, 7): - self.has_material_type_section = True - ndim = 3 - # self.raw_header['elem_connectivity_unpacked'] = True - if ndim == 4: - ndim = 3 - # self.raw_header['elem_connectivity_unpacked'] = True - if 5 < ndim < 8: - ndim = 3 - self.has_rigid_road_surface = True - if ndim in (8, 9): - ndim = 3 - self.has_rigid_body_data = True - if self.raw_header["ndim"] == 9: - self.has_rigid_road_surface = True - self.has_reduced_rigid_body_data = True - if ndim not in (2, 3): - raise RuntimeError(f"Invalid header entry ndim: {self.raw_header['ndim']}") - - self.n_nodes = self.raw_header["numnp"] - self.legacy_code_type = self.raw_header["icode"] - self.n_global_vars = self.raw_header["nglbv"] - - # it - # - mass scaling - # - node temperature - # - node heat flux - if get_digit(self.raw_header["it"], 1) == 1: - self.has_node_mass_scaling = True - it_first_digit = get_digit(self.raw_header["it"], 0) - if it_first_digit == 1: - self.has_node_temperatures = True - elif it_first_digit == 2: - self.has_node_temperatures = True - self.has_node_heat_flux = True - elif it_first_digit == 3: - self.has_node_temperatures = True - self.has_node_heat_flux = True - self.has_node_temperature_layers = True - - # iu iv ia - self.has_node_displacement = self.raw_header["iu"] != 0 - self.has_node_velocity = self.raw_header["iv"] != 0 - self.has_node_acceleration = self.raw_header["ia"] != 0 - - # nel8 - self.n_solids = abs(self.raw_header["nel8"]) - if self.raw_header["nel8"] < 0: - self.has_solid_2_extra_nodes = True - - # nummat8 - self.n_solid_materials = self.raw_header["nummat8"] - - # numds - self.has_shell_four_inplane_gauss_points = self.raw_header["numds"] < 0 - - # numst - self.unused_numst = self.raw_header["numst"] - - # nv3d - self.n_solid_vars = self.raw_header["nv3d"] - - # nel2 - self.n_beams = self.raw_header["nel2"] - - # nummat2 - self.n_beam_materials = self.raw_header["nummat2"] - - # nv1d - self.n_beam_vars = self.raw_header["nv1d"] - - # nel4 - self.n_shells = self.raw_header["nel4"] - - # nummat4 - self.n_shell_materials = self.raw_header["nummat4"] - - # nv2d - self.n_shell_vars = self.raw_header["nv2d"] - - # neiph - self.n_solid_history_vars = self.raw_header["neiph"] - - # neips - self.n_shell_tshell_history_vars = self.raw_header["neips"] - - # maxint - maxint = self.raw_header["maxint"] - if maxint > 0: - self.n_shell_tshell_layers = maxint - elif maxint <= -10000: - self.has_element_deletion_data = True - self.n_shell_tshell_layers = abs(maxint) - 10000 - elif maxint < 0: - self.has_node_deletion_data = True - self.n_shell_tshell_layers = abs(maxint) - - # nmsph - self.n_sph_nodes = self.raw_header["nmsph"] - - # ngpsph - self.n_sph_materials = self.raw_header["ngpsph"] - - # narbs - self.has_numbering_section = self.raw_header["narbs"] != 0 - self.n_numbering_section_words = self.raw_header["narbs"] - - # nelt - self.n_thick_shells = self.raw_header["nelt"] - - # nummatth - self.n_thick_shell_materials = self.raw_header["nummatt"] - - # nv3dt - self.n_thick_shell_vars = self.raw_header["nv3dt"] - - # ioshl1 - if self.raw_header["ioshl1"] == 1000: - self.has_shell_tshell_stress = True - self.has_solid_stress = True - elif self.raw_header["ioshl1"] == 999: - self.has_solid_stress = True - - # ioshl2 - if self.raw_header["ioshl2"] == 1000: - self.has_shell_tshell_pstrain = True - self.has_solid_pstrain = True - elif self.raw_header["ioshl2"] == 999: - self.has_solid_pstrain = True - - # ioshl3 - self.has_shell_forces = self.raw_header["ioshl3"] == 1000 - - # ioshl4 - self.has_shell_extra_variables = self.raw_header["ioshl4"] == 1000 - - # ialemat - self.n_ale_materials = self.raw_header["ialemat"] - - # ncfdv1 - ncfdv1 = self.raw_header["ncfdv1"] - if ncfdv1 == 67108864: - self.has_multi_solver_data = True - elif ncfdv1 != 0: - self.has_cfd_data = True - - # ncfdv2 - # unused - - # nadapt - self.n_adapted_element_pairs = self.raw_header["nadapt"] - - # nmmat - self.n_parts = self.raw_header["nmmat"] - - # numfluid - self.n_ale_fluid_groups = self.raw_header["numfluid"] - - # inn - self.has_invariant_numbering = self.raw_header["inn"] != 0 - - # nepfg - npefg = self.raw_header["npefg"] - self.n_airbags = npefg % 1000 - self.has_airbag_n_chambers = npefg // 1000 == 4 - - # nel48 - self.n_shells_8_nodes = self.raw_header["nel48"] - - # idtdt - self.has_node_temperature_gradient = get_digit(self.raw_header["idtdt"], 0) == 1 - self.has_node_residual_forces = get_digit(self.raw_header["idtdt"], 1) == 1 - self.has_node_residual_moments = self.has_node_residual_forces - self.has_solid_shell_plastic_strain_tensor = get_digit(self.raw_header["idtdt"], 2) == 1 - self.has_solid_shell_thermal_strain_tensor = get_digit(self.raw_header["idtdt"], 3) == 1 - if self.raw_header["idtdt"] > 100: - self.has_element_strain = get_digit(self.raw_header["idtdt"], 4) == 1 - # took a 1000 years to figure this out ... - # Warning: 4 gaussian points are not considered - elif self.n_shell_vars > 0: - if ( - self.n_shell_vars - - self.n_shell_tshell_layers - * ( - 6 * self.has_shell_tshell_stress - + self.has_shell_tshell_pstrain - + self.n_shell_tshell_history_vars - ) - - 8 * self.has_shell_forces - - 4 * self.has_shell_extra_variables - ) > 1: - self.has_element_strain = True - # else: - # self.has_element_strain = False - elif self.n_thick_shell_vars > 0: - if ( - self.n_thick_shell_vars - - self.n_shell_tshell_layers - * ( - 6 * self.has_shell_tshell_stress - + self.has_shell_tshell_pstrain - + self.n_shell_tshell_history_vars - ) - ) > 1: - self.has_element_strain = True - # else: - # self.has_element_strain = False - # else: - # self.has_element_strain = False - - # internal energy - # shell_vars_behind_layers = (self.n_shell_vars - - # (self.n_shell_tshell_layers * ( - # 6 * self.has_shell_tshell_stress + - # self.has_shell_tshell_pstrain + - # self.n_shell_tshell_history_vars) + - # 8 * self.has_shell_forces - # + 4 * self.has_shell_extra_variables)) - - # if not self.has_element_strain: - # if shell_vars_behind_layers > 1 and shell_vars_behind_layers < 6: - # self.has_shell_internal_energy = True - # else: - # self.has_shell_internal_energy = False - # elif self.has_element_strain: - # if shell_vars_behind_layers > 12: - # self.has_shell_internal_energy = True - # else: - # self.has_shell_internal_energy = False - - # nel20 - if "nel20" in self.raw_header: - self.n_solids_20_node_hexas = self.raw_header["nel20"] - - # nt3d - if "nt3d" in self.raw_header: - self.n_solid_thermal_vars = self.raw_header["nt3d"] - - # nel27 - if "nel27" in self.raw_header: - self.n_solids_27_node_hexas = self.raw_header["nel27"] - - # neipb - if "neipb" in self.raw_header: - self.n_beam_history_vars = self.raw_header["neipb"] - - # nel21p - if "nel21p" in self.raw_header: - self.n_solids_21_node_pentas = self.raw_header["nel21p"] - - # nel15t - if "nel15t" in self.raw_header: - self.n_solids_15_node_tetras = self.raw_header["nel15t"] - - # soleng - if "soleng" in self.raw_header: - self.has_solid_internal_energy_density = self.raw_header["soleng"] - - # nel20t - if "nel20t" in self.raw_header: - self.n_solids_20_node_tetras = self.raw_header["nel20t"] - - # nel40p - if "nel40p" in self.raw_header: - self.n_solids_40_node_pentas = self.raw_header["nel40p"] - - # nel64 - if "nel64" in self.raw_header: - self.n_solids_64_node_hexas = self.raw_header["nel64"] - - # quadr - if "quadr" in self.raw_header: - quadr = self.raw_header["quadr"] - if quadr == 1: - self.quadratic_elems_has_full_connectivity = True - elif quadr == 2: - self.quadratic_elems_has_full_connectivity = True - self.quadratic_elems_has_data_at_integration_points = True - - # cubic - if "cubic" in self.raw_header: - self.has_cubic_solids = self.raw_header["cubic"] != 0 - - # tsheng - if "tsheng" in self.raw_header: - self.has_thick_shell_energy_density = self.raw_header["tsheng"] != 0 - - # nbranch - if "nbranch" in self.raw_header: - self.n_post_branches = self.raw_header["nbranch"] - - # penout - if "penout" in self.raw_header: - penout = self.raw_header["penout"] - if penout == 1: - self.has_node_max_contact_penetration_absolute = True - if penout == 2: - self.has_node_max_contact_penetration_absolute = True - self.has_node_max_contact_penetration_relative = True - - # engout - if "engout" in self.raw_header: - self.has_node_contact_energy_density = self.raw_header["engout"] == 1 - - return self - - @property - def has_femzip_indicator(self) -> bool: - """If the femzip indicator can be found in the header - - Notes - ----- - Only use on raw files. - - If the header displays a femzip indicator then the file - is femzipped. If you load the femzip file as such then - this indicator will not be set, since femzip itself - corrects the indicator again. - """ - if "nmmat" in self.raw_header: - return self.raw_header["nmmat"] == 76_893_465 - return False - - @property - def n_rigid_wall_vars(self) -> int: - """number of rigid wall vars - - Notes - ----- - Depends on lsdyna version. - """ - return 4 if self.version >= 971 else 1 - - @property - def n_solid_layers(self) -> int: - """number of solid layers - - Returns - ------- - n_solid_layers: int - """ - n_solid_base_vars = ( - 6 * self.has_solid_stress + self.has_solid_pstrain + self.n_solid_history_vars - ) - - return 8 if self.n_solid_vars // max(n_solid_base_vars, 1) >= 8 else 1 - - def read_words(self, bb: BinaryBuffer, words_to_read: dict, storage_dict: dict = None): - """Read several words described by a dict - - Parameters - ---------- - bb: BinaryBuffer - words_to_read: dict - this dict describes the words to be read. One entry - must be a tuple of len two (byte position and dtype) - storage_dict: dict - in this dict the read words will be saved - - Returns - ------- - storage_dict: dict - the storage dict given as arg or a new dict if none was given - """ - - if storage_dict is None: - storage_dict = {} - - for name, data in words_to_read.items(): - # check buffer length - if data[0] >= len(bb): - continue - - # read data - if data[1] == self.itype: - storage_dict[name] = int(bb.read_number(data[0], data[1])) - elif data[1] == self.ftype: - storage_dict[name] = float(bb.read_number(data[0], data[1])) - elif data[1] is str: - try: - storage_dict[name] = bb.read_text(data[0], data[2]) - except UnicodeDecodeError: - storage_dict[name] = "" - - else: - raise RuntimeError(f"Encountered unknown dtype {str(data[1])} during reading.") - - return storage_dict - - @staticmethod - def _determine_file_settings( - bb: Union[BinaryBuffer, None] = None, - ) -> tuple[int, Union[np.int32, np.int64], Union[np.float32, np.float64]]: - """Determine the precision of the file - - Parameters - ---------- - bb: Union[BinaryBuffer, None] - binary buffer from the file - - Returns - ------- - wordsize: int - size of each word in bytes - itype: np.dtype - type of integers - ftype: np.dtype - type of floats - """ - - LOGGER.debug("_determine_file_settings") - - word_size = 4 - itype = np.int32 - ftype = np.float32 - - # test file type flag (1=d3plot, 5=d3part, 11=d3eigv) - - if isinstance(bb, BinaryBuffer): - # single precision - value = bb.read_number(44, np.int32) - if value > 1000: - value -= 1000 - if value in ( - D3plotFiletype.D3PLOT.value, - D3plotFiletype.D3PART.value, - D3plotFiletype.D3EIGV.value, - ): - word_size = 4 - itype = np.int32 - ftype = np.float32 - - LOGGER.debug("wordsize=%d itype=%s ftype=%s", word_size, itype, ftype) - LOGGER.debug("_determine_file_settings end") - - return word_size, itype, ftype - - # double precision - value = bb.read_number(88, np.int64) - if value > 1000: - value -= 1000 - if value in ( - D3plotFiletype.D3PLOT.value, - D3plotFiletype.D3PART.value, - D3plotFiletype.D3EIGV.value, - ): - word_size = 8 - itype = np.int64 - ftype = np.float64 - - LOGGER.debug("wordsize=%d itype=%s ftype=%s", word_size, itype, ftype) - LOGGER.debug("_determine_file_settings end") - - return word_size, itype, ftype - - raise RuntimeError(f"Unknown file type '{value}'.") - - LOGGER.debug("wordsize=%d itype=%s ftype=%s", word_size, itype, ftype) - LOGGER.debug("_determine_file_settings end") - - return word_size, itype, ftype - - def compare(self, other: "D3plotHeader") -> dict[str, tuple[Any, Any]]: - """Compare two headers and get the differences - - Parameters - ---------- - other: D3plotHeader - other d3plot header instance - - Returns - ------- - differences: Dict[str, Tuple[Any, Any]] - The different entries of both headers in a dict - """ - if not isinstance(other, D3plotHeader): - raise TypeError( - "Only D3plotHeaders instances are supported. " - f"Detected {type(other)} is unsupported." - ) - - differences = {} - names = {*self.raw_header.keys(), *other.raw_header.keys()} - for name in names: - value1 = self.raw_header[name] if name in self.raw_header else "missing" - value2 = other.raw_header[name] if name in self.raw_header else "missing" - if value1 != value2: - differences[name] = (value1, value2) - - return differences diff --git a/src/lasso/dyna/femzip_mapper.py b/src/lasso/dyna/femzip_mapper.py deleted file mode 100644 index ac7ecee..0000000 --- a/src/lasso/dyna/femzip_mapper.py +++ /dev/null @@ -1,867 +0,0 @@ -import logging -import re -import traceback -from typing import Union - -import numpy as np - -from lasso.dyna.array_type import ArrayType -from lasso.femzip.femzip_api import FemzipAPI, FemzipFileMetadata, VariableInfo -from lasso.femzip.fz_config import FemzipArrayType, FemzipVariableCategory, get_last_int_of_line - - -TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE: dict[ - tuple[FemzipArrayType, FemzipVariableCategory], set[str] -] = { - # GLOBAL - (FemzipArrayType.GLOBAL_DATA, FemzipVariableCategory.GLOBAL): { - # ArrayType.global_timesteps, - ArrayType.global_internal_energy, - ArrayType.global_kinetic_energy, - ArrayType.global_total_energy, - ArrayType.global_velocity, - }, - # PART - (FemzipArrayType.PART_RESULTS, FemzipVariableCategory.PART): { - ArrayType.part_hourglass_energy, - ArrayType.part_internal_energy, - ArrayType.part_kinetic_energy, - ArrayType.part_mass, - ArrayType.part_velocity, - }, - # NODE - (FemzipArrayType.NODE_DISPLACEMENT, FemzipVariableCategory.NODE): {ArrayType.node_displacement}, - (FemzipArrayType.NODE_ACCELERATIONS, FemzipVariableCategory.NODE): { - ArrayType.node_acceleration - }, - (FemzipArrayType.NODE_VELOCITIES, FemzipVariableCategory.NODE): {ArrayType.node_velocity}, - (FemzipArrayType.NODE_TEMPERATURES, FemzipVariableCategory.NODE): {ArrayType.node_temperature}, - (FemzipArrayType.NODE_HEAT_FLUX, FemzipVariableCategory.NODE): {ArrayType.node_heat_flux}, - (FemzipArrayType.NODE_MASS_SCALING, FemzipVariableCategory.NODE): {ArrayType.node_mass_scaling}, - (FemzipArrayType.NODE_TEMPERATURE_GRADIENT, FemzipVariableCategory.NODE): { - ArrayType.node_temperature_gradient - }, - # BEAM - (FemzipArrayType.BEAM_AXIAL_FORCE, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_axial_force - }, - (FemzipArrayType.BEAM_S_BENDING_MOMENT, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_bending_moment - }, - (FemzipArrayType.BEAM_T_BENDING_MOMENT, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_bending_moment - }, - (FemzipArrayType.BEAM_S_SHEAR_RESULTANT, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_shear_force - }, - (FemzipArrayType.BEAM_T_SHEAR_RESULTANT, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_shear_force - }, - (FemzipArrayType.BEAM_TORSIONAL_MOMENT, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_torsion_moment - }, - (FemzipArrayType.BEAM_AXIAL_STRESS, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_axial_stress - }, - (FemzipArrayType.BEAM_SHEAR_STRESS_RS, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_shear_stress - }, - (FemzipArrayType.BEAM_SHEAR_STRESS_TR, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_shear_stress - }, - (FemzipArrayType.BEAM_PLASTIC_STRAIN, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_plastic_strain - }, - (FemzipArrayType.BEAM_AXIAL_STRAIN, FemzipVariableCategory.BEAM): { - ArrayType.element_beam_axial_strain - }, - # SHELL - (FemzipArrayType.STRESS_X, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, - (FemzipArrayType.STRESS_Y, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, - (FemzipArrayType.STRESS_Z, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, - (FemzipArrayType.STRESS_XY, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, - (FemzipArrayType.STRESS_YZ, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, - (FemzipArrayType.STRESS_XZ, FemzipVariableCategory.SHELL): {ArrayType.element_shell_stress}, - (FemzipArrayType.EFF_PSTRAIN, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_effective_plastic_strain - }, - (FemzipArrayType.HISTORY_VARS, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_history_vars - }, - (FemzipArrayType.BENDING_MOMENT_MX, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_bending_moment - }, - (FemzipArrayType.BENDING_MOMENT_MY, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_bending_moment - }, - (FemzipArrayType.BENDING_MOMENT_MXY, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_bending_moment - }, - (FemzipArrayType.SHEAR_FORCE_X, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_shear_force - }, - (FemzipArrayType.SHEAR_FORCE_Y, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_shear_force - }, - (FemzipArrayType.NORMAL_FORCE_X, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_normal_force - }, - (FemzipArrayType.NORMAL_FORCE_Y, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_normal_force - }, - (FemzipArrayType.NORMAL_FORCE_XY, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_normal_force - }, - (FemzipArrayType.THICKNESS, FemzipVariableCategory.SHELL): {ArrayType.element_shell_thickness}, - (FemzipArrayType.UNKNOWN_1, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_unknown_variables - }, - (FemzipArrayType.UNKNOWN_2, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_unknown_variables - }, - (FemzipArrayType.STRAIN_INNER_X, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_INNER_Y, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_INNER_Z, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_INNER_XY, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_INNER_YZ, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_INNER_XZ, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_OUTER_X, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_OUTER_Y, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_OUTER_Z, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_OUTER_XY, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_OUTER_YZ, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.STRAIN_OUTER_XZ, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_strain - }, - (FemzipArrayType.INTERNAL_ENERGY, FemzipVariableCategory.SHELL): { - ArrayType.element_shell_internal_energy - }, - # THICK SHELL - (FemzipArrayType.STRESS_X, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_stress - }, - (FemzipArrayType.STRESS_Y, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_stress - }, - (FemzipArrayType.STRESS_Z, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_stress - }, - (FemzipArrayType.STRESS_XY, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_stress - }, - (FemzipArrayType.STRESS_YZ, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_stress - }, - (FemzipArrayType.STRESS_XZ, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_stress - }, - (FemzipArrayType.EFF_PSTRAIN, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_effective_plastic_strain - }, - (FemzipArrayType.STRAIN_OUTER_X, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_OUTER_Y, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_OUTER_Z, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_OUTER_XY, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_OUTER_YZ, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_OUTER_XZ, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_INNER_X, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_INNER_Y, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_INNER_Z, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_INNER_XY, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_INNER_YZ, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - (FemzipArrayType.STRAIN_INNER_XZ, FemzipVariableCategory.THICK_SHELL): { - ArrayType.element_tshell_strain - }, - # SOLID - (FemzipArrayType.STRESS_X, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, - (FemzipArrayType.STRESS_Y, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, - (FemzipArrayType.STRESS_Z, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, - (FemzipArrayType.STRESS_XY, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, - (FemzipArrayType.STRESS_YZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, - (FemzipArrayType.STRESS_XZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_stress}, - (FemzipArrayType.EFF_PSTRAIN, FemzipVariableCategory.SOLID): { - ArrayType.element_solid_effective_plastic_strain - }, - (FemzipArrayType.HISTORY_VARS, FemzipVariableCategory.SOLID): { - ArrayType.element_solid_history_variables - }, - (FemzipArrayType.STRAIN_X, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, - (FemzipArrayType.STRAIN_Y, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, - (FemzipArrayType.STRAIN_Z, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, - (FemzipArrayType.STRAIN_XY, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, - (FemzipArrayType.STRAIN_YZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, - (FemzipArrayType.STRAIN_XZ, FemzipVariableCategory.SOLID): {ArrayType.element_solid_strain}, - # AIRBAG - (FemzipArrayType.AIRBAG_STATE_GEOM, FemzipVariableCategory.CPM_AIRBAG): { - ArrayType.airbag_n_active_particles, - ArrayType.airbag_bag_volume, - }, - # AIRBAG PARTICLES - (FemzipArrayType.AIRBAG_PARTICLE_GAS_CHAMBER_ID, FemzipVariableCategory.CPM_INT_VAR): { - ArrayType.airbag_particle_gas_id - }, - (FemzipArrayType.AIRBAG_PARTICLE_CHAMBER_ID, FemzipVariableCategory.CPM_INT_VAR): { - ArrayType.airbag_particle_chamber_id - }, - (FemzipArrayType.AIRBAG_PARTICLE_LEAKAGE, FemzipVariableCategory.CPM_INT_VAR): { - ArrayType.airbag_particle_leakage - }, - (FemzipArrayType.AIRBAG_PARTICLE_MASS, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_mass - }, - (FemzipArrayType.AIRBAG_PARTICLE_POS_X, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_position - }, - (FemzipArrayType.AIRBAG_PARTICLE_POS_Y, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_position - }, - (FemzipArrayType.AIRBAG_PARTICLE_POS_Z, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_position - }, - (FemzipArrayType.AIRBAG_PARTICLE_VEL_X, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_velocity - }, - (FemzipArrayType.AIRBAG_PARTICLE_VEL_Y, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_velocity - }, - (FemzipArrayType.AIRBAG_PARTICLE_VEL_Z, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_velocity - }, - (FemzipArrayType.AIRBAG_PARTICLE_RADIUS, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_radius - }, - (FemzipArrayType.AIRBAG_PARTICLE_SPIN_ENERGY, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_spin_energy - }, - (FemzipArrayType.AIRBAG_PARTICLE_TRAN_ENERGY, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_translation_energy - }, - (FemzipArrayType.AIRBAG_PARTICLE_NEIGHBOR_DIST, FemzipVariableCategory.CPM_FLOAT_VAR): { - ArrayType.airbag_particle_nearest_segment_distance - }, -} - -# indexes for various femzip arrays -stress_index = { - FemzipArrayType.STRESS_X.value: 0, - FemzipArrayType.STRESS_Y.value: 1, - FemzipArrayType.STRESS_Z.value: 2, - FemzipArrayType.STRESS_XY.value: 3, - FemzipArrayType.STRESS_YZ.value: 4, - FemzipArrayType.STRESS_XZ.value: 5, - FemzipArrayType.NORMAL_FORCE_X.value: 0, - FemzipArrayType.NORMAL_FORCE_Y.value: 1, - FemzipArrayType.NORMAL_FORCE_XY.value: 2, - FemzipArrayType.SHEAR_FORCE_X.value: 0, - FemzipArrayType.SHEAR_FORCE_Y.value: 1, - FemzipArrayType.STRAIN_INNER_X.value: 0, - FemzipArrayType.STRAIN_INNER_Y.value: 1, - FemzipArrayType.STRAIN_INNER_Z.value: 2, - FemzipArrayType.STRAIN_INNER_XY.value: 3, - FemzipArrayType.STRAIN_INNER_YZ.value: 4, - FemzipArrayType.STRAIN_INNER_XZ.value: 5, - FemzipArrayType.STRAIN_OUTER_X.value: 0, - FemzipArrayType.STRAIN_OUTER_Y.value: 1, - FemzipArrayType.STRAIN_OUTER_Z.value: 2, - FemzipArrayType.STRAIN_OUTER_XY.value: 3, - FemzipArrayType.STRAIN_OUTER_YZ.value: 4, - FemzipArrayType.STRAIN_OUTER_XZ.value: 5, - FemzipArrayType.BEAM_S_SHEAR_RESULTANT.value: 0, - FemzipArrayType.BEAM_T_SHEAR_RESULTANT.value: 1, - FemzipArrayType.BEAM_S_BENDING_MOMENT.value: 0, - FemzipArrayType.BEAM_T_BENDING_MOMENT.value: 1, - FemzipArrayType.STRAIN_X.value: 0, - FemzipArrayType.STRAIN_Y.value: 1, - FemzipArrayType.STRAIN_Z.value: 2, - FemzipArrayType.STRAIN_XY.value: 3, - FemzipArrayType.STRAIN_YZ.value: 4, - FemzipArrayType.STRAIN_XZ.value: 5, - FemzipArrayType.BEAM_SHEAR_STRESS_RS.value: 0, - FemzipArrayType.BEAM_SHEAR_STRESS_TR.value: 1, - FemzipArrayType.AIRBAG_PARTICLE_POS_X.value: 0, - FemzipArrayType.AIRBAG_PARTICLE_POS_Y.value: 1, - FemzipArrayType.AIRBAG_PARTICLE_POS_Z.value: 2, - FemzipArrayType.AIRBAG_PARTICLE_VEL_X.value: 0, - FemzipArrayType.AIRBAG_PARTICLE_VEL_Y.value: 1, - FemzipArrayType.AIRBAG_PARTICLE_VEL_Z.value: 2, - FemzipArrayType.BENDING_MOMENT_MX.value: 0, - FemzipArrayType.BENDING_MOMENT_MY.value: 1, - FemzipArrayType.BENDING_MOMENT_MXY.value: 2, - FemzipArrayType.UNKNOWN_1.value: 0, - FemzipArrayType.UNKNOWN_2.value: 1, -} - - -def femzip_to_d3plot( - result_arrays: dict[tuple[int, str, FemzipVariableCategory], np.ndarray], -) -> dict[str, np.ndarray]: - """Map femzip arrays to d3plot arrays - - Parameters - ---------- - result_arrays: - femzip arrays - """ - mapper = FemzipMapper() - mapper.map(result_arrays) - - return mapper.d3plot_arrays - - -class ArrayShapeInfo: - """ArrayShapeInfo describes the shape of arrays""" - - n_layers: Union[int, None] = None - n_vars: Union[int, None] = None - n_entries: Union[int, None] = None - n_timesteps: Union[int, None] = None - - def _set_attr(self, attr_name: str, value: Union[int, None]) -> None: - self_attr_value = getattr(self, attr_name) - if value is not None: - if self_attr_value is None: - setattr(self, attr_name, value) - else: - setattr(self, attr_name, max(self_attr_value, value)) - - def set_n_layers(self, n_layers: Union[int, None]) -> None: - """Set the number of layers - - Parameters - ---------- - n_layers : Union[int, None] - number of layers - """ - self._set_attr("n_layers", n_layers) - - def set_n_vars(self, n_vars: Union[int, None]) -> None: - """Set the number of variables - - Parameters - ---------- - n_vars : Union[int, None] - number of variables - """ - self._set_attr("n_vars", n_vars) - - def set_n_entries(self, n_entries: Union[int, None]) -> None: - """Set the number of entries - - Parameters - ---------- - n_vars : Union[int, None] - number of entries - """ - self._set_attr("n_entries", n_entries) - - def set_n_timesteps(self, n_timesteps: Union[int, None]) -> None: - """Set the number of timesteps - - Parameters - ---------- - n_vars : Union[int, None] - number of timesteps - """ - self._set_attr("n_timesteps", n_timesteps) - - def to_shape(self) -> tuple[int, ...]: - """Set the number of variables - - Returns - ---------- - shape : Tuple[int, ...] - total shape - """ - - shape = [self.n_timesteps, self.n_entries] - fortran_offset = 1 - if self.n_layers is not None: - shape.append(self.n_layers + fortran_offset) - if self.n_vars is not None: - shape.append(self.n_vars + fortran_offset) - return tuple(shape) - - -class D3plotArrayMapping: - """D3plotArrayMapping maps femzip arrays to d3plot arrays""" - - d3plot_array_type: str - d3_layer_slice: Union[slice, int, None] = None - d3_var_slice: Union[slice, int, None] = None - - fz_layer_slice: Union[slice, int, None] = None - fz_var_slice: Union[slice, int, None] = None - - just_assign: bool = False - - def to_slice(self) -> tuple[Union[int, slice], ...]: - """Get the slices mapping a femzip array to a d3plot array - - Returns - ------- - slices: Tuple[Union[int, slice], ...] - """ - slices: list[Union[slice, int]] = [slice(None), slice(None)] - if self.d3_layer_slice is not None: - slices.append(self.d3_layer_slice) - if self.d3_var_slice is not None: - slices.append(self.d3_var_slice) - return tuple(slices) - - -class FemzipArrayInfo: - """FemzipArrayInfo contains information about the femzip array""" - - # pylint: disable = too-many-instance-attributes - - full_name: str = "" - short_name: str = "" - index: int = -1 - category: FemzipVariableCategory - array_type: FemzipArrayType - array: np.ndarray - - i_layer: Union[int, None] = None - i_var: Union[int, None] = None - - mappings: list[D3plotArrayMapping] - - def __init__(self): - self.mappings = [] - - def __str__(self) -> str: - return f"""FemzipArrayInfo: - full_name = {self.full_name} - short_name = {self.short_name} - index = {self.index} - category = {self.category} - array_type = {self.array_type}> - i_layer = {self.i_layer} - i_var = {self.i_var}""" - - -class FemzipMapper: - """Class for mapping femzip variable data to d3plots.""" - - # regex pattern for reading variables - name_separation_pattern = re.compile(r"(^[^(\n]+)(\([^\)]+\))*") - - FORTRAN_OFFSET: int = 1 - - _d3plot_arrays: dict[str, np.ndarray] = {} - _fz_array_slices = {} - - def __init__(self): - pass - - def map(self, result_arrays: dict[tuple[int, str, FemzipVariableCategory], np.ndarray]): - """Map femzip data to d3plot arrays. - - Parameters - ---------- - result_arrays: - femzip variable data - """ - self._d3plot_arrays = {} - self._fz_array_slices = {} - - # convert to internal datastructure - array_infos = self._convert(result_arrays) - - # build the array shapes - d3plot_array_shapes = self._build(array_infos) - - # init the numpy arrays - self._d3plot_arrays = self._allocate_d3plot_arrays(d3plot_array_shapes) - - # add all the data to its right place - self._map_arrays(array_infos, self._d3plot_arrays) - - def _convert( - self, result_arrays: dict[tuple[int, str, FemzipVariableCategory], np.ndarray] - ) -> list[FemzipArrayInfo]: - """Convert femzip result arrays into array infos - - Parameters - ---------- - result_arrays: Dict[Tuple[int, str, FemzipVariableCategory], np.ndarray] - result arrays from femzip - - Returns - ------- - array_infos: List[FemzipArrayInfo] - infos about femzip arrays - """ - - array_infos = [] - - # convert - for (fz_index, fz_name, fz_cat), array in result_arrays.items(): - femzip_array_info = FemzipArrayInfo() - femzip_array_info.index = fz_index - femzip_array_info.full_name = fz_name - femzip_array_info.category = fz_cat - femzip_array_info.array = array - femzip_array_info.array_type = FemzipArrayType.from_string(fz_name) - - var_name, i_layer, i_stress, i_history = self._parse_femzip_name(fz_name, fz_cat) - - femzip_array_info.short_name = var_name - femzip_array_info.i_layer = i_layer - femzip_array_info.i_var = i_stress if i_stress is not None else i_history - - array_infos.append(femzip_array_info) - - return array_infos - - @staticmethod - def _build(fz_arrays: list[FemzipArrayInfo]) -> dict[str, tuple[int, ...]]: - """Counts the occurrence of all variables in the result array such as the - number of layers and stresses. - - Parameters - --------- - fz_arrays: List[FemzipArrayInfo] - infos about femzip arrays - - Returns - ------- - d3plot_array_shapes: - shapes of the d3plot arrays required to be allocated - - Notes - ----- - Some variables only have partial stress results written for Sigma-x and Sigma-y - and layers one to three for example. - """ - shape_infos: dict[str, ArrayShapeInfo] = {} - name_count: dict[tuple[str, FemzipVariableCategory], int] = {} - - for arr_info in fz_arrays: - # print(arr_info) - - d3_array_types = TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE[ - (arr_info.array_type, arr_info.category) - ] - - # var_name = var_name.strip() - for array_type in d3_array_types: - # print(array_type) - array_shape_info = shape_infos.get(array_type) or ArrayShapeInfo() - - # beam layer vars always have same name but - # must be counted up as layers - if (arr_info.full_name, arr_info.category) in name_count: - count = name_count[(arr_info.full_name, arr_info.category)] - i_layer = count + 1 - name_count[(arr_info.full_name, arr_info.category)] = i_layer - else: - name_count[(arr_info.full_name, arr_info.category)] = 0 - - # update shape - array_shape_info.set_n_timesteps(arr_info.array.shape[0]) - array_shape_info.set_n_entries(arr_info.array.shape[1]) - array_shape_info.set_n_layers(arr_info.i_layer) - array_shape_info.set_n_vars(arr_info.i_var) - - shape_infos[array_type] = array_shape_info - - # where to put it - mapping = D3plotArrayMapping() - mapping.d3plot_array_type = array_type - if arr_info.i_layer is not None: - mapping.d3_layer_slice = arr_info.i_layer - if arr_info.i_var is not None: - mapping.d3_var_slice = arr_info.i_var - # arrays to copy: - # - node displacement, velocity, acceleration - # - airbag integer vars (so we don't need to cast) - if ( - arr_info.array.ndim == 3 - or arr_info.category == FemzipVariableCategory.CPM_INT_VAR - ): - mapping.just_assign = True - - arr_info.mappings.append(mapping) - - # correct layers - # if a field has the same name for multiple - # layers such as beam axial stress, we needed - # to count in order to determine if it had layers - # now we need to correct i_layers from None to 0 for them - name_count2 = {} - for arr_info in fz_arrays: - count = name_count[(arr_info.full_name, arr_info.category)] - - if count != 0 and arr_info.i_layer is None: - count2 = name_count2.get((arr_info.full_name, arr_info.category), -1) - count2 += 1 - arr_info.i_layer = count2 - name_count2[(arr_info.full_name, arr_info.category)] = count2 - - for mapping in arr_info.mappings: - shape_info = shape_infos[mapping.d3plot_array_type] - shape_info.set_n_layers(count) - mapping.d3_layer_slice = count2 - - # all arrays which are simply copied (slice has len 2 and only one target) - # get a just assign flag - if len(arr_info.mappings) == 2 and len(arr_info.mappings[0].to_slice()) == 2: - arr_info.mappings[0].just_assign = True - - d3_array_types = TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE[ - (arr_info.array_type, arr_info.category) - ] - - for array_type in d3_array_types: - del shape_infos[array_type] - - return {name: info.to_shape() for name, info in shape_infos.items()} - - def _map_arrays(self, array_infos: list[FemzipArrayInfo], d3plot_arrays: dict[str, np.ndarray]): - """Allocate a femzip variable to its correct position in - the d3plot array dictionary. - - Parameters - --------- - array_infos: List[FemzipArrayInfo] - femzip variables stored in a dictionary - d3plot_arrays: Dict[str, np.ndarray] - d3plot arrays pre-allocated - - Notes - ----- - The keys are the femzip array name (un-parsed) - and the category of the variable as an enum. - """ - for arr_info in array_infos: - if arr_info.category == FemzipVariableCategory.CPM_AIRBAG: - d3plot_arrays[ArrayType.airbag_n_active_particles] = arr_info.array[:, :, 0].view( - np.int32 - ) - d3plot_arrays[ArrayType.airbag_bag_volume] = arr_info.array[:, :, 1] - else: - for mapping in arr_info.mappings: - if mapping.just_assign: - d3plot_arrays[mapping.d3plot_array_type] = arr_info.array - continue - - slices = mapping.to_slice() - d3plot_array = d3plot_arrays[mapping.d3plot_array_type] - - # for femzip arrays with same name first var_index is missing - if d3plot_array.ndim == 3 and len(slices) == 2 and arr_info.array.ndim == 2: - slices = (*slices, 0) - - d3plot_array[slices] = arr_info.array - - def _allocate_d3plot_arrays( - self, array_shapes: dict[str, tuple[int, ...]] - ) -> dict[str, np.ndarray]: - """Initialize all the d3plot arrays. - - Parameters - ---------- - array_shapes: array_shapes: Dict[str, Tuple[int, ...]] - array shapes required to be allocated - - Returns - ------- - d3plot_arrays: Dict[str, np.ndarray] - d3plot arrays pre-allocated - """ - d3plot_arrays = {} - for key, shape in array_shapes.items(): - d3plot_arrays[key] = np.empty(shape, dtype=np.float32) - return d3plot_arrays - - @property - def d3plot_arrays(self): - """Returns the mapped d3plot arrays.""" - return self._d3plot_arrays - - def _parse_femzip_name( - self, fz_name: str, var_type: FemzipVariableCategory - ) -> tuple[str, Union[int, None], Union[int, None], Union[int, None]]: - """Parses the femzip variable names. - - Parameters - ---------- - fz_name: - cryptic femzip variable name we need to parse - var_type: - the category of this variable e.g. shells, parts, global etc. - - Returns - ------- - var_name: - femzip variable name without integration and layer info - i_layer: - layer index - i_stress: - stress index - i_history: - history variable index - """ - matches = self.name_separation_pattern.findall(fz_name) - if not len(matches) == 1: - err_msg = "Could not match femzip array name: {0}" - raise ValueError(err_msg.format(fz_name)) - if not len(matches[0]) == 2: - err_msg = "Could not match femzip array name: {0}" - raise ValueError(err_msg.format(fz_name)) - - (first_grp, second_grp) = matches[0] - var_name, extra_value = get_last_int_of_line(first_grp) - var_name = var_name.strip() - - # the slice 1:-1 leaves out the brackets '(' and ')' - _, i_layer = get_last_int_of_line(second_grp[1:-1]) - - if i_layer is not None: - i_layer -= self.FORTRAN_OFFSET - - i_history: Union[int, None] = None - - if var_type != FemzipVariableCategory.PART or var_type != FemzipVariableCategory.GLOBAL: - i_history = extra_value - - if i_history: - i_history -= self.FORTRAN_OFFSET - - # set var name to the un-formatted femzip array type name - if "Epsilon" in var_name: - var_name = fz_name.strip() - if "inner" in var_name: - i_layer = 0 - elif "outer" in var_name: - i_layer = 1 - else: - # solid strain - i_layer = 0 - - i_stress: Union[int, None] = stress_index.get(var_name, None) - - return var_name, i_layer, i_stress, i_history - - -def filter_femzip_variables( - file_metadata: FemzipFileMetadata, d3plot_array_filter: Union[set[str], None] -) -> FemzipFileMetadata: - """Filters variable infos regarding d3plot array types - - Parameters - ---------- - file_metadata: FemzipFileMetadata - metadata of femzip file including contained variables - d3plot_array_filter: Union[Set[str], None] - array types to filter for if wanted - - Returns - ------- - file_metadata: FemzipFileMetadata - filtered array according to array types - """ - - # pylint: disable = too-many-locals - - # find out which arrays we need and - vars_to_copy: list[int] = [] - - for i_var in range(file_metadata.number_of_variables): - try: - var_info: VariableInfo = file_metadata.variable_infos[i_var] - var_type: int = var_info.var_type - var_index: int = var_info.var_index - var_name: str = var_info.name.decode("utf-8") - - logging.debug("%d, %d, %s", var_type, var_index, var_name.strip()) - - if var_type == FemzipVariableCategory.GEOMETRY.value: - continue - - # find out which array from name - try: - fz_array_type = FemzipArrayType.from_string(var_name) - except ValueError: - warn_msg = ( - "Warning: lasso-python does not support femzip result" - f" field '{var_name.strip()}' category type '{var_type}'." - ) - logging.warning(warn_msg) - continue - - # check if we asked for the array - matching_array_types = TRANSL_FEMZIP_ARRATYPE_TO_D3PLOT_ARRAYTYPE[ - (fz_array_type, FemzipVariableCategory(var_type)) - ] - - if d3plot_array_filter is not None: - if not matching_array_types.intersection(d3plot_array_filter): - continue - vars_to_copy.append(i_var) - except Exception: - trb_msg = traceback.format_exc() - err_msg = "An error occurred while preprocessing femzip variable information: %s" - logging.warning(err_msg, trb_msg) - - # copy filtered data - filtered_file_metadata = FemzipFileMetadata() - FemzipAPI.copy_struct(file_metadata, filtered_file_metadata) - filtered_file_metadata.number_of_variables = len(vars_to_copy) - - # pylint: disable = invalid-name - FilteredVariableInfoArrayType = len(vars_to_copy) * VariableInfo - filtered_info_array_data = FilteredVariableInfoArrayType() - - for i_var, src_i_var in enumerate(vars_to_copy): - FemzipAPI.copy_struct( - file_metadata.variable_infos[src_i_var], filtered_info_array_data[i_var] - ) - filtered_file_metadata.variable_infos = filtered_info_array_data - - return filtered_file_metadata diff --git a/src/lasso/dyna/filter_type.py b/src/lasso/dyna/filter_type.py deleted file mode 100644 index c7e75b4..0000000 --- a/src/lasso/dyna/filter_type.py +++ /dev/null @@ -1,33 +0,0 @@ -from enum import Enum - - -class FilterType(Enum): - """Used for filtering d3plot arrays - - Attributes - ---------- - BEAM: str - Filters for beam elements - SHELL: str - Filters for shell elements - SOLID: str - Filters for solid elements - TSHELL: str - Filters for thick shells elements - PART: str - Filters for parts - NODE: str - Filters for nodes - - Examples - -------- - >>> part_ids = [13, 14] - >>> d3plot.get_part_filter(FilterType.SHELL, part_ids) - """ - - BEAM = "beam" - SHELL = "shell" - SOLID = "solid" - TSHELL = "tshell" - PART = "part" - NODE = "node" diff --git a/src/lasso/dyna/lsda_py3.py b/src/lasso/dyna/lsda_py3.py deleted file mode 100644 index 4a719eb..0000000 --- a/src/lasso/dyna/lsda_py3.py +++ /dev/null @@ -1,641 +0,0 @@ -import glob -import struct - - -# We disable pylint here since this code is ancient code from LSTC and has the -# respective quality. I tried rewriting it but could not understand it at all -# in time. -# pylint: skip-file - - -class LsdaError(Exception): - """This is only here, so I can raise an error in case the data type - sizes are not what I expect""" - - -class _Diskfile: - """ - Handles all the low level file I/O. Nothing here should be - called directly by a user. - """ - - packsize = [0, "b", "h", 0, "i", 0, 0, 0, "q"] - packtype = [0, "b", "h", "i", "q", "B", "H", "I", "Q", "f", "d", "s"] - sizeof = [0, 1, 2, 4, 8, 1, 2, 4, 8, 4, 8, 1] - - def __init__(self, name, mode): - self.mode = mode # file open mode (r,r+,w,w+) - self.name = name # file name - self.ateof = 0 # 1 if the file pointer is at EOF - self.fp = open(name, mode + "b") - if mode[0] == "r": - s = self.fp.read(8) - header = struct.unpack("BBBBBBBB", s) - if header[0] > 8: - self.fp.seek(header[0]) - else: - header = [8, 8, 8, 1, 1, 0, 0, 0] - # Determine if my native ordering is big or little endian.... - b = struct.unpack("bbbb", struct.pack("i", 1)) - if b[0]: - header[5] = 1 - else: - header[5] = 0 - self.lengthsize = header[1] - self.offsetsize = header[2] - self.commandsize = header[3] - self.typesize = header[4] - if header[5] == 0: - self.ordercode = ">" - else: - self.ordercode = "<" - self.ounpack = self.ordercode + _Diskfile.packsize[self.offsetsize] - self.lunpack = self.ordercode + _Diskfile.packsize[self.lengthsize] - self.lcunpack = ( - self.ordercode - + _Diskfile.packsize[self.lengthsize] - + _Diskfile.packsize[self.commandsize] - ) - self.tolunpack = ( - self.ordercode - + _Diskfile.packsize[self.typesize] - + _Diskfile.packsize[self.offsetsize] - + _Diskfile.packsize[self.lengthsize] - ) - self.comp1 = self.typesize + self.offsetsize + self.lengthsize - self.comp2 = self.lengthsize + self.commandsize + self.typesize + 1 - if mode[0] != "r": - # Write initial header and ST offset command. - s = bytes("", "UTF-8") - for h in header: - s = s + struct.pack("B", h) - self.fp.write(s) - self.writecommand(17, Lsda.SYMBOLTABLEOFFSET) - self.writeoffset(17, 0) - self.lastoffset = 17 - - def readcommand(self): - """Read a LENGTH,COMMAND pair from the file at the current location""" - s = self.fp.read(self.lengthsize + self.commandsize) - return struct.unpack(self.lcunpack, s) - - def writecommand(self, length, cmd): - """Write a LENGTH,COMMAND pair to the file at the current location""" - s = struct.pack(self.lcunpack, length, cmd) - self.fp.write(s) - - def readoffset(self): - """Read an OFFSET from the file at the current location""" - s = self.fp.read(self.offsetsize) - return struct.unpack(self.ounpack, s)[0] - - def writeoffset(self, offset, value): - """Write an OFFSET to the file at the given location""" - self.fp.seek(offset, 0) - s = struct.pack(self.ounpack, value) - self.fp.write(s) - self.ateof = 0 - - def writelength(self, length): - """Write a LENGTH to the file at the current location""" - s = struct.pack(self.lunpack, length) - self.fp.write(s) - - def writecd(self, directory): - """Write a whole CD command to the file at the current location""" - length = self.lengthsize + self.commandsize + len(directory) - s = struct.pack(self.lcunpack, length, Lsda.CD) - self.fp.write(s) - if isinstance(directory, str): - self.fp.write(bytes(directory, "utf-8")) - else: - self.fp.write(directory) - - def writestentry(self, r): - """Write a VARIABLE command (symbol table entry) to the file at - the current location""" - length = ( - 2 * self.lengthsize + self.commandsize + len(r.name) + self.typesize + self.offsetsize - ) - s = struct.pack(self.lcunpack, length, Lsda.VARIABLE) - self.fp.write(s) - if isinstance(r.name, str): - self.fp.write(bytes(r.name, "utf-8")) - else: - self.fp.write(r.name) - s = struct.pack(self.tolunpack, r.type, r.offset, r.length) - self.fp.write(s) - - def writedata(self, sym, data): - """Write a DATA command to the file at the current location""" - nlen = len(sym.name) - length = ( - self.lengthsize - + self.commandsize - + self.typesize - + 1 - + nlen - + self.sizeof[sym.type] * sym.length - ) - sym.offset = self.fp.tell() - self.fp.write(struct.pack(self.lcunpack, length, Lsda.DATA)) - self.fp.write(struct.pack("bb", sym.type, nlen) + bytes(sym.name, "utf-8")) - # fmt=self.ordercode+self.packtype[sym.type]*sym.length - fmt = f"{self.ordercode}{sym.length}{self.packtype[sym.type]}" - self.fp.write(struct.pack(fmt, *data)) - sym.file = self - - -class Symbol: - """ - A directory tree structure. A Symbol can be a directory (type==0) - or data - """ - - def __init__(self, name="", parent=0): - self.name = name # name of var or directory - self.type = 0 # data type - self.offset = 0 # offset of DATA record in file - self.length = 0 # number of data entries, or # of children - self.file = 0 # which file the data is in - self.children = {} # directory contents - self.parent = parent # directory that holds me - if parent: - parent.children[name] = self - parent.length = len(parent.children) - - def path(self): - """Return absolute path for this Symbol""" - if not self.parent: - return "/" - sym = self - ret = "/" + sym.name - while sym.parent and sym.parent.name != "/": - sym = sym.parent - ret = "/" + sym.name + ret - return ret - - def get(self, name): - """Return the Symbol with the indicated name. The name can be - prefixed with a relative or absolute path""" - # If I am just a variable, let my parent handle this - if self.type != 0: - return self.parent.get(name) - # If I have this variable, return it - if name in self.children: - return self.children[name] - # If name has a path component, then look for it there - if name[0] == "/": # absolute path - parts = name.split("/")[1:] - sym = self - while sym.parent: - sym = sym.parent - for i in range(len(parts)): - if parts[i] in sym.children: - sym = sym.children[parts[i]] - else: - return None - return sym - if name[0] == ".": # relative path - parts = name.split("/")[1:] - # Throw out any "." in the path -- those are just useless.... - parts = filter(lambda p: p != ".", parts) - if len(parts) == 0: - return self - sym = self - for i in range(parts): - if parts[i] == "..": - if sym.parent: - sym = sym.parent - elif parts[i] in sym: - sym = sym.children[parts[i]] - else: - return None - return sym - # Not found - return None - - def lread(self, start=0, end=2000000000): - """Read data from the file. - If this symbol is a DIRECTORY, this returns a sorted list of the - contents of the directory, and "start" and "end" are ignored. - Otherwise, read and return data[start:end] (including start but - not including end -- standard Python slice behavior). - This routine does NOT follow links.""" - if self.type == 0: # directory -- return listing - return sorted(self.children.keys()) - end = min(end, self.length) - if end < 0: - end = self.length + end - if start > self.length: - return () - if start < 0: - start = self.length + start - if start >= end: - return () - size = _Diskfile.sizeof[self.type] - pos = self.offset + self.file.comp2 + len(self.name) + start * size - self.file.fp.seek(pos) - self.file.ateof = 0 - # format = self.file.ordercode + _Diskfile.packtype[self.type]*(end-start) - # return struct.unpack(format,self.file.fp.read(size*(end-start))) - fmt = f"{(self.file.ordercode)}{end - start}{_Diskfile.packtype[self.type]}" - if self.type == Lsda.LINK: - return struct.unpack(fmt, self.file.fp.read(size * (end - start)))[0] - else: - return struct.unpack(fmt, self.file.fp.read(size * (end - start))) - - def read(self, start=0, end=2000000000): - """Read data from the file. Same as lread, but follows links""" - return _resolve_link(self).lread(start, end) - - def read_raw(self, start=0, end=2000000000): - """Read data from the file and return as bytestring""" - if self.type == 0: # directory -- return listing - return sorted(self.children.keys()) - end = min(end, self.length) - if end < 0: - end = self.length + end - if start > self.length: - return () - if start < 0: - start = self.length + start - if start >= end: - return () - size = _Diskfile.sizeof[self.type] - pos = self.offset + self.file.comp2 + len(self.name) + start * size - self.file.fp.seek(pos) - self.file.ateof = 0 - size = size * (end - start) - return self.file.fp.read(size) - - -def _resolve_link(var): - """Follow a link to find what it finally resolves to""" - ret = var - while ret.type == Lsda.LINK: - ret = ret.get(ret.lread()) - return ret - - -def _readentry(f, reclen, parent): - """ - Read a VARIABLE record from the file, and construct the proper Symbol - Users should never call this. - """ - s = f.fp.read(reclen) - n = reclen - f.comp1 - name = s[:n] - # If parent already has a symbol by this name, orphan it.... - # if parent.children.has_key(name)): - if name in parent.children: - var = parent.children[name] - else: - var = Symbol(name, parent) - (var.type, var.offset, var.length) = struct.unpack(f.tolunpack, s[n:]) - var.file = f - - -def _readsymboltable(lsda, f): - """ - Read all the SYMBOLTABLEs in the current file - Users should never call this. - """ - f.ateof = 0 - while 1: - f.lastoffset = f.fp.tell() - offset = f.readoffset() - if offset == 0: - return - f.fp.seek(offset) - (clen, cmd) = f.readcommand() - if cmd != Lsda.BEGINSYMBOLTABLE: - return - while 1: - (clen, cmd) = f.readcommand() - clen = clen - f.commandsize - f.lengthsize - if cmd == Lsda.CD: - path = f.fp.read(clen) - lsda.cd(path, 1) - elif cmd == Lsda.VARIABLE: - _readentry(f, clen, lsda.cwd) - else: # is end of symbol table...get next part if there is one - break - - -def _writesymboltable(lsda, f): - """ - Collect all the symbols we want to write out, and sort - them by path. This is a bit strange: the symbols don't store - the path, but build it when needed. So build it, and store - (symbol,path) pairs, then sort by path. "path" returns the full - path to the symbol, and we only want the directory it is in, so - get the path of its parent instead. - """ - if len(lsda.dirty_symbols) == 0: - return - - slist = [] - for s in lsda.dirty_symbols: - p = s.parent.path() - slist.append((s, p)) - # slist.sort(key = lambda r1,r2: cmp(r1[1],r2[1])) - slist.sort(key=lambda x: x[1]) - lsda.dirty_symbols = set() - - # Move to end of the file and write the symbol table - if not f.ateof: - f.fp.seek(0, 2) - f.ateof = 1 - start_st_at = f.fp.tell() - f.writecommand(0, Lsda.BEGINSYMBOLTABLE) - cwd = None - - # Write all records - for s, path in slist: - if path != cwd: - cdcmd = _get_min_cd(cwd, path) - f.writecd(cdcmd) - cwd = path - f.writestentry(s) - - # Finish ST: write END record, and patch up ST length - cmdlen = f.offsetsize + f.lengthsize + f.commandsize - f.writecommand(cmdlen, Lsda.ENDSYMBOLTABLE) - nextoffset = f.fp.tell() - f.writeoffset(nextoffset, 0) - cmdlen = nextoffset + f.offsetsize - start_st_at - f.fp.seek(start_st_at) - f.writelength(cmdlen) - - # Purge symbol table, if we are only writing - if f.mode == "w": - cwd = lsda.cwd - cwd.children = {} - while cwd.parent: - cwd.parent.children = {cwd.name: cwd} - cwd = cwd.parent - - # And add link from previous ST - f.writeoffset(f.lastoffset, start_st_at) - f.lastoffset = nextoffset - f.ateof = 0 - - -def _get_min_cd(cwd, cd): - """ - Given two absolute paths, return the shortest "cd" string that - gets from the first (cwd) to the second (cd) - """ - if cwd is None: - return cd - - # Find common part of path - have = cwd.split("/")[1:] - want = cd.split("/")[1:] - nhave = len(have) - nwant = len(want) - n = min(nhave, nwant) - head = 0 - head_length = 0 - for i in range(n): - if have[i] != want[i]: - break - head = i + 1 - head_length = head_length + len(have[i]) - if head == 0: - return cd - - # head = # of common components. - # head_length = string length of common part of path (sans "/" separators) - # tail1 = Number of components we would need ".." leaders for - tail1 = nhave - head - - # Now see if "cd" is shorter than "../../tail_part" - if 2 * tail1 >= head_length: - return cd - - # nope, the ".." version is shorter.... - return tail1 * "../" + "/".join(want[head:]) - - -class Lsda: - """ - Main class: holds all the Symbols for an LSDA file, and has methods - for reading data from and writing data to the file - """ - - CD = 2 - DATA = 3 - VARIABLE = 4 - BEGINSYMBOLTABLE = 5 - ENDSYMBOLTABLE = 6 - SYMBOLTABLEOFFSET = 7 - I1 = 1 - I2 = 2 - I4 = 3 - I8 = 4 - U1 = 5 - U2 = 6 - U4 = 7 - U8 = 8 - R4 = 9 - R8 = 10 - LINK = 11 - - def __init__(self, files, mode="r"): - """Creates the LSDA structure, opens the file and reads the - SYMBOLTABLE (if reading), or creates the initial file contents - (if writing). "files" is a tuple of file names to be opened - and treated as a single file. All the %XXX continuation files - will be automatically included. "mode" is the file open mode: - "r", "r+", "w", or "w+". If a "w" mode is selected, "files" - must contain only a single file name""" - - # If they only input a single name, put it in a tuple, so I can - # accept input of either kind - if not types_ok: - raise LsdaError - if not isinstance(files, (tuple, list)): - files = (files,) - self.files = [] - - if mode[0] == "r": - # Open all the files in the list that is input, and anything - # that looks like a continuation of one of them. - nameset = set() - for name in files: - nameset.add(name) - nameset = nameset.union(set(glob.glob(name + "%[0-9][0-9]*"))) - - # Convert to a list and sort, because if I'm going to be writing, - # I want the last one in the list to be the last one of its family - namelist = list(nameset) - namelist.sort() - for file in namelist: - self.files.append(_Diskfile(file, mode)) - self.root = Symbol("/") - for f in self.files: - # We are already positioned to read the SYMBOLTABLEOFFSET record - _, cmd = f.readcommand() - self.cwd = self.root - if cmd == Lsda.SYMBOLTABLEOFFSET: - _readsymboltable(self, f) - else: - if len(files) > 1: - return None # can't open multiple files for WRITING - self.files.append(_Diskfile(files[0], mode)) - self.root = Symbol("/") - self.cwd = self.root - self.dirty_symbols = set() - self.lastpath = None - self.mode = mode - - # writing will always be to the last one of the files - if mode == "r": - self.fw = None - self.make_dirs = 0 - else: - self.fw = self.files[-1] - self.make_dirs = 1 - - def __del__(self): # close files - self.flush() - for f in self.files: - if not f.fp.closed: - f.fp.close() - - def cd(self, path, create=2): # change CWD - """Change the current working directory in the file. The optional - argument "create" is for internal use only""" - # DEBUG FIX qd-codie: - # Someone forgot to decode bytes into str here. Due to this the - # following comparisons always went wrong (of course they were) - # not similar ... - if isinstance(path, bytes): - path = path.decode("utf-8") - if path == "/": - self.cwd = self.root - return self.root - if path[-1] == "/": # remove trailing / - path = path[:-1] - if path[0] == "/": # absolute path - path = path[1:] - self.cwd = self.root - # path = string.split(path,"/") - # print(type(path)) - if isinstance(path, bytes): - path = str(path, "utf-8").split("/") - else: - path = path.split("/") - - for part in path: - if part == "..": - if self.cwd.parent: - self.cwd = self.cwd.parent - # if self.cwd.children.has_key(part)): - elif part in self.cwd.children: - self.cwd = self.cwd.children[part] - if self.cwd.type != 0: # component is a variable, not a directory! - self.cwd = self.cwd.parent - break - elif create == 1 or (create == 2 and self.make_dirs == 1): - self.cwd = Symbol(part, self.cwd) # Create directory on the fly - else: # component in path is missing - break - return self.cwd - - def write(self, name, data_type, data): - """Write a new DATA record to the file. Creates and returns - the Symbol for the data written""" - if self.fw is None: - return None - - # want a tuple, but if they hand us a single value that should work too... - try: - _ = data[0] - except TypeError: - data = (data,) - pwd = self.cwd.path() - if not self.fw.ateof: - self.fw.fp.seek(0, 2) - self.fw.ateof = 1 - if pwd != self.lastpath: - cdcmd = _get_min_cd(self.lastpath, pwd) - self.fw.writecd(cdcmd) - self.lastpath = pwd - - # Overwrite existing symbol if there is one - if name in self.cwd.children: - sym = self.cwd.children[name] - else: - sym = Symbol(name, self.cwd) - sym.type = data_type - sym.length = len(data) - self.fw.writedata(sym, data) - self.dirty_symbols.add(sym) - return sym - - def close(self): - """Close the file""" - self.flush() - for f in self.files: - if not f.fp.closed: - f.fp.close() - self.files = [] - - def get(self, path): - """Return the Symbol with the indicated name. The name can be - prefixed with a relative or absolute path""" - return self.cwd.get(path) - - def flush(self): # write ST and flush file - """Write a SYMBOLTABLE as needed for any new DATA, and flush the file""" - if self.fw is None or self.fw.fp.closed: - return - _writesymboltable(self, self.fw) - self.fw.fp.flush() - - def filesize(self): - """Returns the current size, on disk, of the file we are currently - writing to. Returns 0 for files that are opened readonly""" - if self.fw is None: - return 0 - if not self.fw.ateof: - self.fw.fp.seek(0, 2) - self.fw.ateof = 1 - return self.fw.fp.tell() - - def nextfile(self): # Open next file in sequence - """Flush the current output file and open the next file in the - sequence""" - if self.fw is None: - return None - if not self.fw.fp.closed: - _writesymboltable(self, self.fw) - self.fw.fp.flush() - parts = self.fw.name.split("%") - if len(parts) == 1: - ret = 1 - newname = parts[0] + "%001" - else: - ret = int(parts[1]) + 1 - newname = f"{parts[0]}%{ret:03d}" - if self.mode == "w": - self.fw = _Diskfile(newname, "w") - else: - self.fw = _Diskfile(newname, "w+") - self.files.append(self.fw) - self.lastpath = None - return ret - - -types = [("b", 1), ("h", 2), ("i", 4), ("q", 8), ("f", 4), ("d", 8)] -x = 17 -types_ok = 1 -for a, b in types: - s = struct.pack(a, x) - if len(s) != b: - print("LSDA: initialization error") - print(f"Data type {a} has length {len(s)} instead of {b}") - types_ok = 0 diff --git a/src/lasso/femzip/__init__.py b/src/lasso/femzip/__init__.py deleted file mode 100644 index 1837356..0000000 --- a/src/lasso/femzip/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .femzip_api import FemzipAPI - - -__all__ = ["FemzipAPI"] diff --git a/src/lasso/femzip/femzip_api.py b/src/lasso/femzip/femzip_api.py deleted file mode 100644 index 4c5d328..0000000 --- a/src/lasso/femzip/femzip_api.py +++ /dev/null @@ -1,1393 +0,0 @@ -import logging -import os -import re -import stat -import sys -import time -from ctypes import ( - CDLL, - POINTER, - Structure, - byref, - c_char_p, - c_float, - c_int, - c_int32, - c_int64, - c_uint64, - sizeof, -) -from pathlib import Path -from typing import Any, Union - -import numpy as np - -from .fz_config import FemzipArrayType, FemzipVariableCategory, get_last_int_of_line - - -# During next refactoring we should take a look at reducing the file size. -# pylint: disable = too-many-lines - -# The c-structs python wrappers set variables outside of the init method which -# is okay. -# pylint: disable = attribute-defined-outside-init - - -class FemzipException(Exception): - """Custom exception specifically for anything going wrong in femzip""" - - -class FemzipError(Structure): - """Struct representing femzip errors in c-code - - Attributes - ---------- - ier: c_int32 - Error code - msg: c_char_p - Error message - """ - - _fields_ = [("ier", c_int32), ("msg", c_char_p)] - - -class VariableInfo(Structure): - """Struct for details about a single femzip variable - - Attributes - ---------- - var_index: c_int32 - Index of the variable - name: c_char_p - Name from femzip - var_type: c_int32 - Variable type. See FemzipVariableCategory for translation. - var_size: c_int32 - Array size of the field variable. - """ - - _fields_ = [ - ("var_index", c_int32), - ("name", c_char_p), - ("var_type", c_int32), - ("var_size", c_int32), - ] - - -class FemzipFileMetadata(Structure): - """This struct contains metadata about femzip files. - - Attributes - ---------- - version_zip: c_float - activity_flag: c_int32 - number_of_variables: c_int32 - number_of_nodes: c_int32 - number_of_solid_elements: c_int32 - number_of_thick_shell_elements: c_int32 - number_of_1D_elements: c_int32 - number_of_tool_elements: c_int32 - number_of_shell_elements: c_int32 - number_of_solid_element_neighbors: c_int32 - number_of_rbe_element_neighbors: c_int32 - number_of_bar_elements: c_int32 - number_of_beam_elements: c_int32 - number_of_plotel_elements: c_int32 - number_of_spring_elements: c_int32 - number_of_damper_elements: c_int32 - number_of_joint_elements: c_int32 - number_of_joint_element_neighbors: c_int32 - number_of_bar_element_neighbors: c_int32 - number_of_beamcross_elements: c_int32 - number_of_spotweld_elements: c_int32 - number_of_rbe_elements: c_int32 - number_of_hexa20_elements: c_int32 - number_of_rigid_shell_elements: c_int32 - number_of_timesteps: c_int32 - variable_infos: POINTER(VariableInfo) - """ - - _fields_ = [ - ("version_zip", c_float), - ("activity_flag", c_int32), - ("number_of_variables", c_int32), - ("number_of_nodes", c_int32), - ("number_of_solid_elements", c_int32), - ("number_of_thick_shell_elements", c_int32), - ("number_of_1D_elements", c_int32), - ("number_of_tool_elements", c_int32), - ("number_of_shell_elements", c_int32), - ("number_of_solid_element_neighbors", c_int32), - ("number_of_rbe_element_neighbors", c_int32), - ("number_of_bar_elements", c_int32), - ("number_of_beam_elements", c_int32), - ("number_of_plotel_elements", c_int32), # NOTE typo? - ("number_of_spring_elements", c_int32), - ("number_of_damper_elements", c_int32), - ("number_of_joint_elements", c_int32), - ("number_of_joint_element_neighbors", c_int32), - ("number_of_bar_element_neighbors", c_int32), - ("number_of_beamcross_elements", c_int32), - ("number_of_spotweld_elements", c_int32), - ("number_of_rbe_elements", c_int32), - ("number_of_hexa20_elements", c_int32), - ("number_of_rigid_shell_elements", c_int32), - ("number_of_timesteps", c_int32), - ("variable_infos", POINTER(VariableInfo)), - ] - - -class FemzipBufferInfo(Structure): - """This struct describes necessary buffer sizes for reading the file - - Attributes - ---------- - n_timesteps: c_uint64 - Number of timesteps - timesteps: POINTER(c_float) - Time for each timestep - size_geometry: c_uint64 - Size of the geometry buffer - size_state: c_uint64 - Size of the state buffer - size_displacement: c_uint64 - Size for displacement array - size_activity: c_uint64 - Size for activity array (deletion stuff) - size_post: c_uint64 - Size of the post region of which I currently don't know anymore what it - was. - size_titles: c_uint64 - Size of the titles region behind the geometry. - """ - - _fields_ = [ - ("n_timesteps", c_uint64), - ("timesteps", POINTER(c_float)), - ("size_geometry", c_uint64), - ("size_state", c_uint64), - ("size_displacement", c_uint64), - ("size_activity", c_uint64), - ("size_post", c_uint64), - ("size_titles", c_uint64), - ] - - -class FemzipAPIStatus(Structure): - """This struct summarizes the state of the femzip API library. The library - has a shared, global state which is stored in static variables. The state - of the gloval vars is tracked by this struct. - - Attributes - ---------- - is_file_open: c_int32 - Whether a femzip file is opened and being processed. - is_geometry_read: c_int32 - Whether the geometry was already read. - is_states_open: c_int32 - Whether processing of the states was started. - i_timestep_state: c_int32 - Counter of timestep processing. - i_timestep_activity: c_int32 - Counter of activity data for timesteps. - """ - - _fields_ = [ - ("is_file_open", c_int32), - ("is_geometry_read", c_int32), - ("is_states_open", c_int32), - ("i_timestep_state", c_int32), - ("i_timestep_activity", c_int32), - ] - - -class FemzipAPI: - """FemzipAPI contains wrapper functions around the femzip library.""" - - _api: Union[None, CDLL] = None - - @staticmethod - def load_dynamic_library(path: Path) -> CDLL: - """Load a library and check for correct execution - - Parameters - ---------- - path: str - path to the library - - Returns - ------- - library: CDLL - loaded library - """ - - # check executable rights - if not os.access(path, os.X_OK) or not os.access(path, os.R_OK): - os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC | stat.S_IREAD) - if not os.access(path, os.X_OK) or not os.access(path, os.R_OK): - err_msg = "Library '{0}' is not executable and couldn't change execution rights." - raise RuntimeError(err_msg.format(path)) - - return CDLL(path) - - @property - def api(self) -> CDLL: - """Returns the loaded, shared object library of the native interface - - Returns - ------- - shared_object_lib: CDLL - Loaded shared object library. - """ - - # pylint: disable = too-many-statements - - if self._api is None: - # Set the base path once - base_path = Path(__file__).parent - - # Set environment variables for FlexLM - os.environ["FLEXLM_BATCH"] = "1" - if "FLEXLM_TIMEOUT" not in os.environ: - os.environ["FLEXLM_TIMEOUT"] = "200000" - - # Platform-specific configurations - if sys.platform == "win32": - bin_dirpath = base_path / "lib" / "windows" - shared_lib_name = "api_extended.dll" - libs = [ - "libmmd.dll", - "libifcoremd.dll", - "libifportmd.dll", - "libiomp5md.dll", - "femzip_a_dyna_sidact_generic.dll", - "libfemzip_post_licgenerator_ext_flexlm.dll", - ] - else: - bin_dirpath = base_path / "lib" / "linux" - shared_lib_name = "api_extended.so" - libs = [ - "libiomp5.so", - "libintlc.so.5", - "libirng.so", - "libimf.so", - "libsvml.so", - "libfemzip_a_dyna_sidact_generic.so", - "libfemzip_post_licgenerator_ext_flexlm.so", - ] - - # Load all the dynamic libraries - for lib in libs: - self.load_dynamic_library(bin_dirpath / lib) - - # Load the main shared library - filepath = bin_dirpath / shared_lib_name - self._api = self.load_dynamic_library(filepath) - - # license check - self._api.has_femunziplib_license.restype = c_int - - # file check - self._api.is_sidact_file.argtypes = (c_char_p,) - self._api.is_sidact_file.restype = c_int - - # content infos - self._api.get_file_metadata.argtypes = (c_char_p, POINTER(FemzipFileMetadata)) - self._api.get_file_metadata.restype = FemzipError - - # free - self._api.free_variable_array.argtypes = (POINTER(FemzipFileMetadata),) - self._api.free_variable_array.restype = c_int32 - - # get buffer dims - self._api.get_buffer_info.argtypes = (c_char_p, POINTER(FemzipBufferInfo)) - self._api.get_buffer_info.restype = FemzipError - - # read geom - self._api.read_geometry.argtypes = ( - c_char_p, - POINTER(FemzipBufferInfo), - POINTER(c_int32), - c_int32, - ) - self._api.read_geometry.restype = FemzipError - - # read var - self._api.read_variables.argtypes = ( - POINTER(c_float), - c_int, - c_int, - POINTER(FemzipFileMetadata), - ) - self._api.read_variables.restype = FemzipError - - # femunzip version - self._api.is_femunzip_version_ok.argtypes = (c_char_p, POINTER(c_int)) - self._api.is_femunzip_version_ok.restype = FemzipError - - # femzip status - self._api.get_femzip_status.argtypes = () - self._api.get_femzip_status.restype = FemzipAPIStatus - - # get part titles - self._api.get_part_titles.argtypes = (c_char_p, POINTER(c_int32), c_int32) - self._api.get_part_titles.restype = FemzipError - - # finish reading states - self._api.finish_reading_states.argtypes = (POINTER(c_int32), c_int64) - self._api.finish_reading_states.restype = FemzipError - - # close file - self._api.close_current_file.argtypes = () - self._api.close_current_file.restype = FemzipError - - # read single state - self._api.read_single_state.argtypes = (c_int32, c_int32, POINTER(c_float), c_int64) - self._api.read_single_state.restype = FemzipError - - # read state activity - self._api.read_activity.argtypes = (c_int32, c_int32, POINTER(c_float)) - self._api.read_activity.restype = FemzipError - - # free buffer info - self._api.free_buffer_info.argtypes = (POINTER(FemzipBufferInfo),) - self._api.free_buffer_info.restype = c_int32 - - return self._api - - @staticmethod - def _parse_state_filter(state_filter: Union[set[int], None], n_timesteps: int) -> set[int]: - # convert negative indexes - state_filter_parsed = ( - {entry if entry >= 0 else entry + n_timesteps for entry in state_filter} - if state_filter is not None - else set(range(n_timesteps)) - ) - - # filter invalid indexes - state_filter_valid = {entry for entry in state_filter_parsed if 0 <= entry < n_timesteps} - - return state_filter_valid - - @staticmethod - def _check_femzip_error(err: FemzipError) -> None: - """Checks a femzip error coming from C (usually) - - Parameters - ---------- - err: FemzipError - c struct error - - Raises - ------ - FemzipException - If the error flag is set with the corresponding - error message. - """ - if err.ier != 0: - fz_error_msg = "Unknown" - try: - fz_error_msg = err.msg.decode("ascii") - except ValueError: - pass - - err_msg = "Error Code '{0}': {1}" - raise FemzipException(err_msg.format(err.ier, fz_error_msg)) - - @staticmethod - def struct_to_dict(struct: Structure) -> dict[str, Any]: - """Converts a ctypes struct into a dict - - Parameters - ---------- - struct: Structure - - Returns - ------- - fields: Dict[str, Any] - struct as dict - - Examples - -------- - >>> api.struct_to_dict(api.get_femzip_status()) - {'is_file_open': 1, 'is_geometry_read': 1, 'is_states_open': 0, - 'i_timestep_state': -1, 'i_timestep_activity': -1} - """ - # We access some internal members to do some magic. - # pylint: disable = protected-access - return {field_name: getattr(struct, field_name) for field_name, _ in struct._fields_} - - @staticmethod - def copy_struct(src: Structure, dest: Structure): - """Copies all fields from src struct to dest - - Parameters - ---------- - src: Structure - src struct - src: Structure - destination struct - - Examples - -------- - >>> err1 = FemzipError() - >>> err1.ier = -1 - >>> err1.msg = b"Oops" - >>> err2 = FemzipError() - >>> api.copy_struct(err1, err2) - >>> err2.ier - -1 - >>> err2.msg - b'Oops' - """ - # We access some internal members to do some magic. - # pylint: disable = protected-access - if src._fields_ != dest._fields_: - raise ValueError( - f"Source and destination fields do not match: {src._fields_} != {dest._fields_}" - ) - - for field_name, _ in src._fields_: - setattr(dest, field_name, getattr(src, field_name)) - - def get_part_titles( - self, filepath: str, buffer_info: Union[None, FemzipBufferInfo] = None - ) -> memoryview: - """Get the part title section - - Parameters - ---------- - filepath: str - path to femzip file - buffer_info: Union[None, FemzipBufferInfo] - buffer info if previously fetched - - Returns - ------- - mview: memoryview - memory of the part title section - """ - - # find out how much memory to allocate - buffer_info_parsed = self.get_buffer_info(filepath) if buffer_info is None else buffer_info - - # allocate memory - # pylint: disable = invalid-name - BufferType = c_int32 * (buffer_info_parsed.size_titles) - buffer = BufferType() - - # do the thing - err = self.api.get_part_titles( - filepath.encode("utf-8"), buffer, buffer_info_parsed.size_titles - ) - self._check_femzip_error(err) - - return memoryview(buffer).cast("B") - - def read_state_deletion_info( - self, buffer_info: FemzipBufferInfo, state_filter: Union[set[int], None] = None - ) -> np.ndarray: - """Get information which elements are alive - - Parameters - ---------- - buffer_info: FemzipBufferInfo - infos about buffer sizes - state_filter: Union[Set[int], None] - usable to read only specific states - - Notes - ----- - The `buffer` must have the size of at least - `buffer_info.size_activity`. - - Examples - -------- - >>> # get info about required memory - >>> buffer_info = api.get_buffer_info(filepath) - - >>> # first read geometry and leave file open! - >>> mview_geom = api.read_geometry(filepath, buffer_info, False) - - >>> # now read deletion info - >>> array_deletion = api.read_state_activity(buffer_info) - - >>> # close file - >>> api.close_current_file() - """ - - logging.debug("FemzipAPI.read_state_deletion_info start") - - # filter timesteps - state_filter_valid = self._parse_state_filter(state_filter, buffer_info.n_timesteps) - logging.debug("state filter: %s", state_filter_valid) - - # allocate memory - # pylint: disable = invalid-name - StateBufferType = c_float * buffer_info.size_activity - BufferType = c_float * (buffer_info.size_activity * len(state_filter_valid)) - buffer_c = BufferType() - - # major looping - n_timesteps_read = 0 - for i_timestep in range(buffer_info.n_timesteps): - logging.debug("i_timestep %d", i_timestep) - - # walk forward in buffer - state_buffer_ptr = StateBufferType.from_buffer( - buffer_c, sizeof(c_float) * buffer_info.size_activity * n_timesteps_read - ) - - # do the thing - err = self.api.read_activity(i_timestep, buffer_info.size_activity, state_buffer_ptr) - self._check_femzip_error(err) - - # increment buffer ptr if we needed this one - if i_timestep in state_filter_valid: - logging.debug("saved") - n_timesteps_read += 1 - state_filter_valid.remove(i_timestep) - - # we processe what we need - if not state_filter_valid: - break - - # convert buffer into array - array = np.frombuffer(buffer_c, dtype=np.float32).reshape(( - n_timesteps_read, - buffer_info.size_activity, - )) - - logging.debug("FemzipAPI.read_state_deletion_info end") - - return array - - # return memoryview(buffer_c).cast('B') - - def read_single_state( - self, - i_timestep: int, - buffer_info: FemzipBufferInfo, - state_buffer: Union[None, memoryview] = None, - ) -> memoryview: - """Read a single state - - Parameters - ---------- - i_timestep: int - timestep to be read - buffer_info: FemzipBufferInfo - infos about buffer sizes - state_buffer: Union[None, memoryview] - buffer in which the states are stored - - Notes - ----- - It is unclear to us why the state buffer needs to be given - in order to terminate state reading. - - Examples - -------- - >>> # get info about required memory - >>> buffer_info = api.get_buffer_info(filepath) - - >>> # first read geometry and leave file open - >>> mview_geom = api.read_geometry(filepath, buffer_info, False) - - >>> # now read a state - >>> mview_state = api.read_single_state(0, buffer_info=buffer_info) - - >>> # close file - >>> api.close_current_file() - """ - - if state_buffer is not None and "f" not in state_buffer.format: - err_msg = "The state buffer must have a float format ' None: - """Closes the current file handle(use not recommended) - - Notes - ----- - Closes a currently opened file by the API. There - is no arg because femzip can process only one file - at a time. - This can also be used in case of bugs. - - Examples - -------- - >>> api.close_current_file() - """ - err = self.api.close_current_file() - self._check_femzip_error(err) - - def get_femzip_status(self) -> FemzipAPIStatus: - """Check the status of the femzip api - - Returns - ------- - femzip_status: FemzipAPIStatus - c struct with info about femzip API - - Notes - ----- - This reports whether a file is currently - opened and how far it was processed. This - internal state is used to avoid internal - conflicts and crashes, thus is useful for - debugging. - - Examples - -------- - >>> print(api.struct_to_dict(api.get_femzip_status())) - {'is_file_open': 0, 'is_geometry_read': 0, 'is_states_open': 0, - 'i_timestep_state': -1, 'i_timestep_activity': -1} - """ - return self.api.get_femzip_status() - - def is_femunzip_version_ok(self, filepath: str) -> bool: - """Checks if the femunzip version can be handled - - Parameters - ---------- - filepath: str - path to the femzpi file - - Returns - ------- - version_ok: bool - - Examples - -------- - >>> api.is_femunzip_version_ok("path/to/d3plot.fz") - True - """ - is_ok = c_int(-1) - err = self.api.is_femunzip_version_ok(filepath.encode("ascii"), byref(is_ok)) - self._check_femzip_error(err) - return is_ok.value == 1 - - def has_femunziplib_license(self) -> bool: - """Checks whether the extended libraries are available - - Returns - ------- - has_license: bool - - Examples - -------- - >>> api.has_femunziplib_license() - False - """ - start_time = time.time() - has_license = self.api.has_femunziplib_license() == 1 - logging.debug("License check duration: %fs", (time.time() - start_time)) - return has_license - - def is_sidact_file(self, filepath: str) -> bool: - """Tests if a filepath points at a sidact file - - Parameters - ---------- - filepath: path to file - - Returns - ------- - is_sidact_file: bool - - Examples - -------- - >>> api.is_sidact_file("path/to/d3plot.fz") - True - >>> api.is_sidact_file("path/to/d3plot") - False - >>> api.is_sidact_file("path/to/non/existing/file") - False - """ - return self.api.is_sidact_file(filepath.encode("ascii")) == 1 - - def get_buffer_info(self, filepath: str) -> FemzipBufferInfo: - """Get the dimensions of the buffers for femzip - - Parameters - ---------- - filepath: str - path to femzip file - - Returns - ------- - buffer_info: FemzipBufferInfo - c struct with infos about the memory required by femzip - - Examples - -------- - >>> # read memory demand info first - >>> buffer_info = api.get_buffer_info(filepath) - >>> # buffer info is a c struct, but we can print it - >>> api.struct_to_dict(buffer_info) - {'n_timesteps': 12, - 'timesteps': , - 'size_geometry': 537125, 'size_state': 1462902, 'size_displacement': 147716, - 'size_activity': 47385, 'size_post': 1266356, 'size_titles': 1448} - >>> for i_timestep in range(buffer_info.n_timesteps): - >>> print(buffer_info.timesteps[i_timestep]) - 0.0 - 0.9998100399971008 - 1.9998900890350342 - 2.9999701976776123 - 3.9997801780700684 - """ - buffer_info = FemzipBufferInfo() - - err = self.api.get_buffer_info(filepath.encode("ascii"), byref(buffer_info)) - self._check_femzip_error(err) - - # we need to copy the timesteps from C to Python - buffer_info_2 = FemzipBufferInfo() - - # pylint: disable = invalid-name - TimestepsType = c_float * buffer_info.n_timesteps - timesteps_buffer = TimestepsType() - for i_timestep in range(buffer_info.n_timesteps): - timesteps_buffer[i_timestep] = buffer_info.timesteps[i_timestep] - buffer_info_2.timesteps = timesteps_buffer - - self.copy_struct(buffer_info, buffer_info_2) - buffer_info_2.timesteps = timesteps_buffer - - # free C controlled memory - self.api.free_buffer_info(byref(buffer_info)) - - return buffer_info_2 - - def read_geometry( - self, - filepath: str, - buffer_info: Union[FemzipBufferInfo, None] = None, - close_file: bool = True, - ) -> memoryview: - """Read the geometry buffer from femzip - - Parameters - ---------- - filepath: str - path to femzpi file - buffer_info: Union[FemzipBufferInfo, None] - struct with info regarding required memory for femzip - close_file: bool - it is useful to leave the file open if - states are processed right afterwards - - Returns - ------- - buffer: memoryview - memoryview of buffer - - Notes - ----- - If the file isn't closed appropriately bugs and crashes - might occur. - - Examples - -------- - >>> mview = api.read_geometry(filepath, buffer_info) - """ - - # find out how much memory to allocate - buffer_info = self.get_buffer_info(filepath) if buffer_info is None else buffer_info - - # allocate memory - # pylint: disable = invalid-name - GeomBufferType = c_int * (buffer_info.size_geometry + buffer_info.size_titles) - buffer = GeomBufferType() - - # read geometry - err = self.api.read_geometry( - filepath.encode("ascii"), byref(buffer_info), buffer, c_int32(close_file) - ) - - self._check_femzip_error(err) - - return memoryview(buffer).cast("B") - - def read_states( - self, - filepath: str, - buffer_info: Union[FemzipBufferInfo, None] = None, - state_filter: Union[set[int], None] = None, - ) -> np.ndarray: - """Reads all femzip state information - - Parameters - ---------- - filepath: str - path to femzip file - buffer_info: Union[FemzipBufferInfo, None] - struct with info regarding required memory for femzip - state_filter: Union[Set[int], None] - usable to load only specific states - - Returns - ------- - buffer: memoryview - buffer containing all state data - - Examples - -------- - >>> buffer_info = api.get_buffer_info("path/to/d3plot.fz") - >>> array_states = api.read_states("path/to/d3plot.fz", buffer_info) - """ - - buffer_info_parsed = self.get_buffer_info(filepath) if buffer_info is None else buffer_info - - # filter invalid indexes - state_filter_valid = self._parse_state_filter(state_filter, buffer_info_parsed.n_timesteps) - - n_states_to_allocate = ( - buffer_info_parsed.n_timesteps if state_filter is None else len(state_filter_valid) - ) - - # allocate buffer - # pylint: disable = invalid-name - BufferType = c_float * (buffer_info_parsed.size_state * n_states_to_allocate) - buffer = BufferType() - - n_timesteps_read = 0 - for i_timestep in range(buffer_info_parsed.n_timesteps): - # forward pointer in buffer - buffer_state = buffer[buffer_info.size_state * n_timesteps_read] - - # read state data - self.read_single_state(i_timestep, buffer_info_parsed, buffer_state) - - if i_timestep in state_filter_valid: - n_timesteps_read += 1 - state_filter_valid.remove(i_timestep) - - if not state_filter_valid: - break - - array = np.from_buffer(buffer, dtype=np.float32).reshape(( - n_timesteps_read, - buffer_info_parsed.size_state, - )) - - return array - - def get_file_metadata(self, filepath: str) -> FemzipFileMetadata: - """Get infos about the femzip variables in the file - - Parameters - ---------- - filepath: str - path to femzip file - - Returns - ------- - file_metadata: FemzipFileMetadata - c struct with infos about the femzip file - - Notes - ----- - This is for direct interaction with the C-API, thus should - not be used by users. - - Examples - -------- - >>> file_metadata = api.get_file_metadata("path/to/d3plot.fz") - >>> # print general internals - >>> api.struct_to_dict(file_metadata) - {'version_zip': 605.0, 'activity_flag': 1, 'number_of_variables': 535, ...} - - >>> # We can iterate the variable names contained in the file - >>> print( - [file_metadata.variable_infos[i_var].name.decode("utf8").strip() - for i_var in range(file_metadata.number_of_variables)] - ) - ['global', 'Parts: Energies and others', 'coordinates', 'velocities', ...] - """ - file_metadata = FemzipFileMetadata() - - # get variable infos - err = self.api.get_file_metadata(filepath.encode("ascii"), byref(file_metadata)) - self._check_femzip_error(err) - - # transfer memory to python - file_metadata2 = self._copy_variable_info_array(file_metadata) - - # release c memory - self.api.free_variable_array(byref(file_metadata)) - - return file_metadata2 - - def _get_variables_state_buffer_size( - self, - n_parts: int, - n_rigid_walls: int, - n_rigid_wall_vars: int, - n_airbag_particles: int, - n_airbags: int, - file_metadata: FemzipFileMetadata, - ) -> int: - # pylint: disable=too-many-arguments - # pylint: disable=too-many-locals - # pylint: disable=too-many-branches - # pylint: disable=too-many-statements - - buffer_size_state = 0 - var_indexes_to_remove: set[int] = set() - for i_var in range(file_metadata.number_of_variables): - var_info = file_metadata.variable_infos[i_var] - variable_name = var_info.name.decode("utf-8") - variable_category = FemzipVariableCategory.from_int(var_info.var_type) - if variable_category == FemzipVariableCategory.NODE: - variable_multiplier = 1 - if ( - FemzipArrayType.NODE_DISPLACEMENT.value in variable_name - or FemzipArrayType.NODE_VELOCITIES.value in variable_name - or FemzipArrayType.NODE_ACCELERATIONS.value in variable_name - ): - variable_multiplier = 3 - - array_size = file_metadata.number_of_nodes * variable_multiplier - buffer_size_state += array_size - file_metadata.variable_infos[i_var].var_size = array_size - - elif variable_category == FemzipVariableCategory.SHELL: - array_size = ( - file_metadata.number_of_shell_elements - - file_metadata.number_of_rigid_shell_elements - ) - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += array_size - elif variable_category == FemzipVariableCategory.SOLID: - array_size = file_metadata.number_of_solid_elements - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += array_size - elif variable_category == FemzipVariableCategory.BEAM: - array_size = file_metadata.number_of_1D_elements - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += file_metadata.number_of_1D_elements - elif variable_category == FemzipVariableCategory.THICK_SHELL: - array_size = file_metadata.number_of_thick_shell_elements - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += file_metadata.number_of_thick_shell_elements - elif variable_category == FemzipVariableCategory.GLOBAL: - array_size = 6 - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += array_size - elif variable_category == FemzipVariableCategory.PART: - logging.debug("n_parts: %d", n_parts) - array_size = n_parts * 7 + n_rigid_walls * n_rigid_wall_vars - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += array_size - elif variable_category == FemzipVariableCategory.CPM_FLOAT_VAR: - array_size = n_airbag_particles - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += array_size - elif variable_category == FemzipVariableCategory.CPM_INT_VAR: - array_size = n_airbag_particles - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += array_size - elif variable_category == FemzipVariableCategory.CPM_AIRBAG: - array_size = n_airbags * 2 - file_metadata.variable_infos[i_var].var_size = array_size - buffer_size_state += array_size - else: - warn_msg = "Femzip variable category '%s' is not supported" - logging.warning(warn_msg, variable_category) - var_indexes_to_remove.add(i_var) - - # one more for end marker - buffer_size_state += 1 - - return buffer_size_state - - def _decompose_read_variables_array( - self, - n_parts: int, - n_rigid_walls: int, - n_rigid_wall_vars: int, - n_airbag_particles: int, - n_airbags: int, - all_vars_array: np.ndarray, - n_timesteps_read: int, - file_metadata: FemzipFileMetadata, - ) -> dict[tuple[int, str, FemzipVariableCategory], np.ndarray]: - # pylint: disable=too-many-arguments - # pylint: disable=too-many-locals - # pylint: disable=too-many-branches - # pylint: disable=too-many-statements - - # decompose array - result_arrays: dict[tuple[int, str, FemzipVariableCategory], np.ndarray] = {} - var_pos = 0 - for i_var in range(file_metadata.number_of_variables): - var_info: VariableInfo = file_metadata.variable_infos[i_var] - variable_name: str = var_info.name.decode("utf-8") - variable_index: int = var_info.var_index - variable_type = FemzipArrayType.from_string(variable_name) - variable_category = FemzipVariableCategory.from_int(var_info.var_type) - - if variable_category == FemzipVariableCategory.NODE: - if variable_type.value in ( - FemzipArrayType.NODE_DISPLACEMENT.value, - FemzipArrayType.NODE_VELOCITIES.value, - FemzipArrayType.NODE_ACCELERATIONS.value, - ): - array_size = file_metadata.number_of_nodes * 3 - var_array = all_vars_array[:, var_pos : var_pos + array_size].reshape(( - n_timesteps_read, - file_metadata.number_of_nodes, - 3, - )) - var_pos += array_size - result_arrays[(variable_index, variable_name, FemzipVariableCategory.NODE)] = ( - var_array - ) - else: - array_size = file_metadata.number_of_nodes - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[(variable_index, variable_name, FemzipVariableCategory.NODE)] = ( - var_array - ) - - elif variable_category == FemzipVariableCategory.SHELL: - array_size = ( - file_metadata.number_of_shell_elements - - file_metadata.number_of_rigid_shell_elements - ) - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[(variable_index, variable_name, FemzipVariableCategory.SHELL)] = ( - var_array - ) - elif variable_category == FemzipVariableCategory.SOLID: - array_size = file_metadata.number_of_solid_elements - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[(variable_index, variable_name, FemzipVariableCategory.SOLID)] = ( - var_array - ) - elif variable_category == FemzipVariableCategory.BEAM: - array_size = file_metadata.number_of_1D_elements - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[variable_index, variable_name, FemzipVariableCategory.BEAM] = ( - var_array - ) - elif variable_category == FemzipVariableCategory.THICK_SHELL: - array_size = file_metadata.number_of_thick_shell_elements - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[variable_index, variable_name, FemzipVariableCategory.THICK_SHELL] = ( - var_array - ) - elif variable_category == FemzipVariableCategory.GLOBAL: - array_size = 6 - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[variable_index, variable_name, FemzipVariableCategory.GLOBAL] = ( - var_array - ) - elif variable_category == FemzipVariableCategory.PART: - array_size = n_parts * 7 + n_rigid_walls * n_rigid_wall_vars - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[variable_index, variable_name, FemzipVariableCategory.PART] = ( - var_array - ) - elif variable_category == FemzipVariableCategory.CPM_FLOAT_VAR: - array_size = n_airbag_particles - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_pos += array_size - result_arrays[variable_index, variable_name, variable_category] = var_array - elif variable_category == FemzipVariableCategory.CPM_INT_VAR: - array_size = n_airbag_particles - var_array = all_vars_array[:, var_pos : var_pos + array_size].view(np.int32) - var_pos += array_size - result_arrays[variable_index, variable_name, variable_category] = var_array - elif variable_category == FemzipVariableCategory.CPM_AIRBAG: - n_airbag_vars = 2 - array_size = n_airbags * n_airbag_vars - var_array = all_vars_array[:, var_pos : var_pos + array_size] - var_array = var_array.reshape((var_array.shape[0], n_airbags, n_airbag_vars)) - var_pos += array_size - result_arrays[variable_index, variable_name, variable_category] = var_array - else: - err_msg = "Femzip variable category '{0}' is not supported" - raise RuntimeError(err_msg) - - return result_arrays - - def read_variables( - self, - file_metadata: FemzipFileMetadata, - n_parts: int, - n_rigid_walls: int, - n_rigid_wall_vars: int, - n_airbag_particles: int, - n_airbags: int, - state_filter: Union[set[int], None] = None, - ) -> dict[tuple[int, str, FemzipVariableCategory], np.ndarray]: - """Read specific variables from Femzip - - Parameters - ---------- - file_metadata: FemzipFileMetadata - metadata of file including which variables to read - n_parts: int - number of parts in the file - n_rigid_walls: int - number of rigid walls - n_rigid_wall_vars: int - number of rigid wall variables - n_airbag_particles: int - number of airbag particles in the file - n_airbags: int - state_filter: Union[Set[int], None] - used to read specific arrays - - Returns - ------- - arrays: dict - dictionary with d3plot arrays - """ - - # pylint: disable = too-many-arguments - # pylint: disable = too-many-locals - - # fetch metadata if required - n_timesteps = file_metadata.number_of_timesteps - logging.info("file_metadata: %s", self.struct_to_dict(file_metadata)) - - # log variable names - for i_var in range(file_metadata.number_of_variables): - var_info = file_metadata.variable_infos[i_var] - logging.debug("%s", self.struct_to_dict(var_info)) - - # estimate float buffer size - buffer_size_state = self._get_variables_state_buffer_size( - n_parts=n_parts, - n_rigid_walls=n_rigid_walls, - n_rigid_wall_vars=n_rigid_wall_vars, - n_airbag_particles=n_airbag_particles, - n_airbags=n_airbags, - file_metadata=file_metadata, - ) - logging.info("buffer_size_state: %s", buffer_size_state) - - # specify which states to read - states_to_copy = ( - {i_timestep for i_timestep in state_filter if i_timestep < n_timesteps + 1} - if state_filter is not None - else set(range(n_timesteps)) - ) - logging.info("states_to_copy: %s", states_to_copy) - - # take timesteps into account - buffer_size = len(states_to_copy) * buffer_size_state - logging.info("buffer_size: %s", buffer_size) - - # allocate memory - # pylint: disable = invalid-name - BufferType = c_float * buffer_size - buffer = BufferType() - - # do the thing - # pylint: disable = invalid-name - BufferStateType = c_float * buffer_size_state - n_timesteps_read = 0 - for i_timestep in range(n_timesteps): - logging.info("timestep: %d", i_timestep) - - buffer_ptr_state = BufferStateType.from_buffer( - buffer, sizeof(c_float) * n_timesteps_read * buffer_size_state - ) - - # read the variables into the buffer - fortran_offset = 1 - err = self.api.read_variables( - buffer_ptr_state, - buffer_size_state, - i_timestep + fortran_offset, - byref(file_metadata), - ) - self._check_femzip_error(err) - - # check if there is nothing to read anymore - # thus we can terminate earlier - if i_timestep in states_to_copy: - states_to_copy.remove(i_timestep) - n_timesteps_read += 1 - - if not states_to_copy: - logging.info("All states processed") - break - - array = np.ctypeslib.as_array(buffer, shape=(buffer_size,)).reshape((n_timesteps_read, -1)) - - # decompose total array into array pieces again - result_arrays = self._decompose_read_variables_array( - n_parts=n_parts, - n_rigid_walls=n_rigid_walls, - n_rigid_wall_vars=n_rigid_wall_vars, - n_airbag_particles=n_airbag_particles, - n_airbags=n_airbags, - all_vars_array=array, - n_timesteps_read=n_timesteps_read, - file_metadata=file_metadata, - ) - - return result_arrays - - def _copy_variable_info_array(self, file_metadata: FemzipFileMetadata) -> FemzipFileMetadata: - """Copies a variable info array into python memory - - Parameters - ---------- - file_metadata: FemzipFileMetadata - metadata object for femzip file - - Returns - ------- - file_metadata2: FemzipFileMetadata - very same data object but the data in - variable_infos is now managed by python and - not C anymore - """ - file_metadata2 = FemzipFileMetadata() - - # allocate memory on python side - data2 = (VariableInfo * file_metadata.number_of_variables)() - - # copy data - for i_var in range(file_metadata.number_of_variables): - var1 = file_metadata.variable_infos[i_var] - var2 = data2[i_var] - self.copy_struct(var1, var2) - - # assign - self.copy_struct(file_metadata, file_metadata2) - file_metadata2.variable_infos = data2 - return file_metadata2 - - -# NOTE: class-as-data-structure (B903) -# Class could be dataclass or namedtuple -# See: https://docs.astral.sh/ruff/rules/class-as-data-structure/ -class FemzipD3plotArrayMapping: # noqa B903 - """Contains information about how to map femzip arrays to d3plot arrays""" - - d3plot_array_type: str - i_integration_point: Union[int, None] - i_var_index: Union[int, None] - - fz_array_slices = tuple[slice] - - def __init__( - self, - d3plot_array_type: str, - fz_array_slices: tuple[slice] = (slice(None),), - i_integration_point: Union[int, None] = None, - i_var_index: Union[int, None] = None, - ): - self.d3plot_array_type = d3plot_array_type - self.fz_array_slices = fz_array_slices - self.i_integration_point = i_integration_point - self.i_var_index = i_var_index - - -class FemzipArrayMetadata: - """Contains metadata about femzip arrays""" - - array_type: FemzipArrayType - category: FemzipVariableCategory - d3plot_mappings: list[FemzipD3plotArrayMapping] - # set when parsed - fz_var_index: Union[int, None] = None - - def __init__( - self, - array_type: FemzipArrayType, - category: FemzipVariableCategory, - d3plot_mappings: list[FemzipD3plotArrayMapping], - ): - self.array_type = array_type - self.category = category - self.d3plot_mappings = d3plot_mappings - - def match(self, fz_name: str) -> bool: - """Checks if the given name matches the array - - Parameters - ---------- - fz_name: str - femzip array name - - Returns - ------- - match: bool - If the array metadata instance matches the given array - """ - return self.array_type.value in fz_name - - def parse(self, fz_var_name: str, fz_var_index: int) -> None: - """Parses the incoming femzip variable name and extracts infos - - Parameters - ---------- - fz_var_name: str - variable name from femzip - fz_var_index: int - variable index from femzip - """ - # matches anything until brackets start - pattern = re.compile(r"(^[^\(\n]+)(\([^\)]+\))*") - - matches = pattern.findall(fz_var_name) - - if not len(matches) == 1: - err_msg = f"Could not match femzip array name: {fz_var_name}" - raise RuntimeError(err_msg) - if not len(matches[0]) == 2: - err_msg = f"Could not match femzip array name: {fz_var_name}" - raise RuntimeError(err_msg) - - # first group contains - # - var name - # - var index (if existing) - # second group contains - # - integration layer index - (first_grp, second_grp) = matches[0] - _, var_index = get_last_int_of_line(first_grp) - - # the slice 1:-1 leaves out the brackets '(' and ')' - second_grp = second_grp[1:-1] - if "inner" in second_grp: - i_integration_point = 0 - elif "outer" in second_grp: - i_integration_point = 1 - else: - _, i_integration_point = get_last_int_of_line(second_grp) - - # setters - self.fz_var_index = fz_var_index - for mapping in self.d3plot_mappings: - mapping.i_integration_point = i_integration_point - mapping.i_var_index = var_index diff --git a/src/lasso/femzip/fz_config.py b/src/lasso/femzip/fz_config.py deleted file mode 100644 index 1129eee..0000000 --- a/src/lasso/femzip/fz_config.py +++ /dev/null @@ -1,226 +0,0 @@ -import enum -from typing import Union - - -def get_last_int_of_line(line: str) -> tuple[str, Union[None, int]]: - """Searches an integer in the line - - Parameters - ---------- - line: str - line to be searched - - Returns - ------- - rest_line: str - rest of line before match - number: Union[int, None] - number or None if not found - """ - for entry in line.split(): - if entry.isdigit(): - return line[: line.rfind(entry)], int(entry) - return line, None - - -class FemzipVariableCategory(enum.Enum): - """Enum for femzip variable categories - - Attributes - ---------- - GEOMETRY: int - -5 - PART: int - -2 - GLOBAL: int - -1 - NODE: int - 0 - SOLID: int - 1 - THICK_SHELL: int - 2 - BEAM: int - 3 - TOOLS: int - 4 - SHELL: int - 5 - SPH: int - 6 - FPM: int - 7 - CFD: int - 8 - CPM_FLOAT_VAR: int - 9 - CPM_AIRBAG: int - 10 - CPM_INT_VAR: int - 11 - RADIOSS_STATE_DATA: int - 12 - HEXA20: int - 13 - """ - - GEOMETRY = -5 - # REST_OF_HEADER_AND_GEOMETRY_UNCOMPRESSED = -3 - # ALL_STATE_EXCEPT_GEOMETRY_POSITION = -2 - # REST_OF_HEADER_AND_GEOMETRY_COMPRESSED = -1 - # EXTERNAL_NODE_IDS = 1 - # NODE_COORDINATES = 2 - # SOLID_ELEMENT_IDS = 3 - # SOLID_NEIGHBORS = 4 - # SOLID_MATERIALS = 5 - # THICK_SHELLS = (6, 7, 8) - # BEAMS = (9, 10, 11) - # TOOL_ELEMENTS = (12, 13, 14) - # SHELL_ELEMENTS = (15, 16, 17) - # HEADER_AND_PART_TITLES = -4 - # TIME = -3 - PART = -2 - GLOBAL = -1 - NODE = 0 - SOLID = 1 - THICK_SHELL = 2 - BEAM = 3 - TOOLS = 4 - SHELL = 5 - SPH = 6 - FPM = 7 - CFD = 8 - CPM_FLOAT_VAR = 9 - CPM_AIRBAG = 10 - CPM_INT_VAR = 11 - RADIOSS_STATE_DATA = 12 - HEXA20 = 13 - - @staticmethod - def from_int(number: int) -> "FemzipVariableCategory": - """Deserializes an integer into an enum - - Parameters - ---------- - number: int - number to turn into an enum - - Returns - ------- - enum_value: FemzipVariableCategory - """ - if number not in FEMZIP_CATEGORY_TRANSL_DICT: - err_msg = f"Error: Unknown femzip variable category: '{number}'" - raise RuntimeError(err_msg) - - return FEMZIP_CATEGORY_TRANSL_DICT[number] - - -FEMZIP_CATEGORY_TRANSL_DICT: dict[int, FemzipVariableCategory] = { - entry.value: entry for entry in FemzipVariableCategory.__members__.values() -} - - -class FemzipArrayType(enum.Enum): - """Enum for femzip array types""" - - GLOBAL_DATA = "global" - PART_RESULTS = "Parts: Energies and others" - # nodes - NODE_DISPLACEMENT = "coordinates" - NODE_TEMPERATURES = "temperatures" - NODE_ACCELERATIONS = "accelerations" - NODE_HEAT_FLUX = "heat_flux" - NODE_MASS_SCALING = "mass_scaling" - NODE_TEMPERATURE_GRADIENT = "dtdt" - NODE_VELOCITIES = "velocities" - - # beam - BEAM_S_SHEAR_RESULTANT = "s_shear_resultant" - BEAM_T_SHEAR_RESULTANT = "t_shear_resultant" - BEAM_S_BENDING_MOMENT = "s_bending_moment" - BEAM_T_BENDING_MOMENT = "t_bending_moment" - BEAM_AXIAL_FORCE = "axial_force" - BEAM_TORSIONAL_MOMENT = "torsional_resultant" - BEAM_AXIAL_STRESS = "axial_stress" - BEAM_SHEAR_STRESS_RS = "RS_shear_stress" - BEAM_SHEAR_STRESS_TR = "TR_shear_stress" - BEAM_PLASTIC_STRAIN = "plastic_strain" - BEAM_AXIAL_STRAIN = "axial_strain" - - # airbag - AIRBAG_STATE_GEOM = "CPMs_state_geometry" - AIRBAG_PARTICLE_POS_X = "Pos x" - AIRBAG_PARTICLE_POS_Y = "Pos y" - AIRBAG_PARTICLE_POS_Z = "Pos z" - AIRBAG_PARTICLE_VEL_X = "Vel x" - AIRBAG_PARTICLE_VEL_Y = "Vel y" - AIRBAG_PARTICLE_VEL_Z = "Vel z" - AIRBAG_PARTICLE_MASS = "Mass" - AIRBAG_PARTICLE_RADIUS = "Radius" - AIRBAG_PARTICLE_SPIN_ENERGY = "Spin En" - AIRBAG_PARTICLE_TRAN_ENERGY = "Tran En" - AIRBAG_PARTICLE_NEIGHBOR_DIST = "NS dist" - AIRBAG_PARTICLE_GAS_CHAMBER_ID = "GasC ID" - AIRBAG_PARTICLE_CHAMBER_ID = "Cham ID" - AIRBAG_PARTICLE_LEAKAGE = "Leakage" - - STRESS_X = "Sigma-x" - STRESS_Y = "Sigma-y" - STRESS_Z = "Sigma-z" - STRESS_XY = "Sigma-xy" - STRESS_YZ = "Sigma-yz" - STRESS_XZ = "Sigma-zx" - EFF_PSTRAIN = "Effective plastic strain" - HISTORY_VARS = "extra_value_per_element" - BENDING_MOMENT_MX = "bending_moment Mx" - BENDING_MOMENT_MY = "bending_moment My" - BENDING_MOMENT_MXY = "bending_moment Mxy" - SHEAR_FORCE_X = "shear_resultant Qx" - SHEAR_FORCE_Y = "shear_resultant Qy" - NORMAL_FORCE_X = "normal_resultant Nx" - NORMAL_FORCE_Y = "normal_resultant Ny" - NORMAL_FORCE_XY = "normal_resultant Nxy" - THICKNESS = "thickness" - UNKNOWN_1 = "element_dependent_variable_1" - UNKNOWN_2 = "element_dependent_variable_2" - STRAIN_INNER_X = "Epsilon-x (inner)" - STRAIN_INNER_Y = "Epsilon-y (inner)" - STRAIN_INNER_Z = "Epsilon-z (inner)" - STRAIN_INNER_XY = "Epsilon-xy (inner)" - STRAIN_INNER_YZ = "Epsilon-yz (inner)" - STRAIN_INNER_XZ = "Epsilon-zx (inner)" - STRAIN_OUTER_X = "Epsilon-x (outer)" - STRAIN_OUTER_Y = "Epsilon-y (outer)" - STRAIN_OUTER_Z = "Epsilon-z (outer)" - STRAIN_OUTER_XY = "Epsilon-xy (outer)" - STRAIN_OUTER_YZ = "Epsilon-yz (outer)" - STRAIN_OUTER_XZ = "Epsilon-zx (outer)" - INTERNAL_ENERGY = "internal_energy" - - STRAIN_X = "Epsilon-x (IP 1)" - STRAIN_Y = "Epsilon-y (IP 1)" - STRAIN_Z = "Epsilon-z (IP 1)" - STRAIN_XY = "Epsilon-xy (IP 1)" - STRAIN_YZ = "Epsilon-yz (IP 1)" - STRAIN_XZ = "Epsilon-zx (IP 1)" - - @staticmethod - def from_string(femzip_name: str) -> "FemzipArrayType": - """Converts a variable name to an array type string - - Parameters - ---------- - femzip_name: str - name of the variable given by femzip - - Returns - ------- - femzip_array_type: FemzipArrayType - """ - for fz_array_type in FemzipArrayType.__members__.values(): - if fz_array_type.value in femzip_name.strip(): - return fz_array_type - - err_msg = "Unknown femzip variable name: '{0}'" - raise ValueError(err_msg.format(femzip_name)) diff --git a/src/lasso/femzip/lib/linux/api_extended.so b/src/lasso/femzip/lib/linux/api_extended.so deleted file mode 100755 index c7bb067..0000000 Binary files a/src/lasso/femzip/lib/linux/api_extended.so and /dev/null differ diff --git a/src/lasso/femzip/lib/linux/libfemzip_a_dyna_sidact_generic.so b/src/lasso/femzip/lib/linux/libfemzip_a_dyna_sidact_generic.so deleted file mode 100755 index 15c45ab..0000000 Binary files a/src/lasso/femzip/lib/linux/libfemzip_a_dyna_sidact_generic.so and /dev/null differ diff --git a/src/lasso/femzip/lib/linux/libfemzip_post_licgenerator_ext_flexlm.so b/src/lasso/femzip/lib/linux/libfemzip_post_licgenerator_ext_flexlm.so deleted file mode 100755 index 03577f5..0000000 Binary files a/src/lasso/femzip/lib/linux/libfemzip_post_licgenerator_ext_flexlm.so and /dev/null differ diff --git a/src/lasso/femzip/lib/linux/libimf.so b/src/lasso/femzip/lib/linux/libimf.so deleted file mode 100755 index df078aa..0000000 Binary files a/src/lasso/femzip/lib/linux/libimf.so and /dev/null differ diff --git a/src/lasso/femzip/lib/linux/libintlc.so.5 b/src/lasso/femzip/lib/linux/libintlc.so.5 deleted file mode 100755 index 5b90779..0000000 Binary files a/src/lasso/femzip/lib/linux/libintlc.so.5 and /dev/null differ diff --git a/src/lasso/femzip/lib/linux/libiomp5.so b/src/lasso/femzip/lib/linux/libiomp5.so deleted file mode 100755 index 28abc66..0000000 Binary files a/src/lasso/femzip/lib/linux/libiomp5.so and /dev/null differ diff --git a/src/lasso/femzip/lib/linux/libirng.so b/src/lasso/femzip/lib/linux/libirng.so deleted file mode 100755 index f5afbf7..0000000 Binary files a/src/lasso/femzip/lib/linux/libirng.so and /dev/null differ diff --git a/src/lasso/femzip/lib/linux/libsvml.so b/src/lasso/femzip/lib/linux/libsvml.so deleted file mode 100755 index 25e124f..0000000 Binary files a/src/lasso/femzip/lib/linux/libsvml.so and /dev/null differ diff --git a/src/lasso/femzip/lib/windows/api_extended.dll b/src/lasso/femzip/lib/windows/api_extended.dll deleted file mode 100644 index f372914..0000000 Binary files a/src/lasso/femzip/lib/windows/api_extended.dll and /dev/null differ diff --git a/src/lasso/femzip/lib/windows/femzip_a_dyna_sidact_generic.dll b/src/lasso/femzip/lib/windows/femzip_a_dyna_sidact_generic.dll deleted file mode 100644 index b18f45e..0000000 Binary files a/src/lasso/femzip/lib/windows/femzip_a_dyna_sidact_generic.dll and /dev/null differ diff --git a/src/lasso/femzip/lib/windows/libfemzip_post_licgenerator_ext_flexlm.dll b/src/lasso/femzip/lib/windows/libfemzip_post_licgenerator_ext_flexlm.dll deleted file mode 100644 index 1c12d85..0000000 Binary files a/src/lasso/femzip/lib/windows/libfemzip_post_licgenerator_ext_flexlm.dll and /dev/null differ diff --git a/src/lasso/femzip/lib/windows/libifcoremd.dll b/src/lasso/femzip/lib/windows/libifcoremd.dll deleted file mode 100644 index ce0c7e1..0000000 Binary files a/src/lasso/femzip/lib/windows/libifcoremd.dll and /dev/null differ diff --git a/src/lasso/femzip/lib/windows/libifportmd.dll b/src/lasso/femzip/lib/windows/libifportmd.dll deleted file mode 100644 index 6d901ff..0000000 Binary files a/src/lasso/femzip/lib/windows/libifportmd.dll and /dev/null differ diff --git a/src/lasso/femzip/lib/windows/libiomp5md.dll b/src/lasso/femzip/lib/windows/libiomp5md.dll deleted file mode 100644 index cb6ae0b..0000000 Binary files a/src/lasso/femzip/lib/windows/libiomp5md.dll and /dev/null differ diff --git a/src/lasso/femzip/lib/windows/libmmd.dll b/src/lasso/femzip/lib/windows/libmmd.dll deleted file mode 100644 index 72eccde..0000000 Binary files a/src/lasso/femzip/lib/windows/libmmd.dll and /dev/null differ diff --git a/src/lasso/io/__init__.py b/src/lasso/io/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/lasso/io/binary_buffer.py b/src/lasso/io/binary_buffer.py deleted file mode 100644 index 0a81494..0000000 --- a/src/lasso/io/binary_buffer.py +++ /dev/null @@ -1,297 +0,0 @@ -import mmap -import os -from typing import Any, Union - -import numpy as np - - -class BinaryBuffer: - """This class is used to handle binary data""" - - def __init__(self, filepath: Union[str, None] = None, n_bytes: int = 0): - """Buffer used to read binary files - - Parameters - ---------- - filepath: Union[str, None] - path to a binary file - n_bytes: int - how many bytes to load (uses memory mapping) - - Returns - ------- - instance: BinaryBuffer - """ - self.filepath_ = None - self.sizes_ = [] - self.load(filepath, n_bytes) - - @property - def memoryview(self) -> memoryview: - """Get the underlying memoryview of the binary buffer - - Returns - ------- - mv_: memoryview - memoryview used to store the data - """ - return self.mv_ - - @memoryview.setter - def memoryview(self, new_mv): - """Set the memoryview of the binary buffer manually - - Parameters - ---------- - new_mv: memoryview - memoryview used to store the bytes - """ - if not isinstance(new_mv, memoryview): - raise TypeError(f"new_mv must be a memoryview, got {type(new_mv)}") - - self.mv_ = new_mv - self.sizes_ = [len(self.mv_)] - - def get_slice(self, start: int, end=Union[None, int], step: int = 1) -> "BinaryBuffer": - """Get a slice of the binary buffer - - Parameters - ---------- - start: int - start position in bytes - end: Union[int, None] - end position - step: int - step for slicing (default 1) - - Returns - ------- - new_buffer: BinaryBuffer - the slice as a new buffer - """ - - if start >= len(self): - raise IndexError(f"start index {start} out of range (length {len(self)})") - - if end is not None and end >= len(self): - raise IndexError(f"end index {end} out of range (length {len(self)})") - - end = len(self) if end is None else end - - new_binary_buffer = BinaryBuffer() - new_binary_buffer.memoryview = self.mv_[start:end:step] - - return new_binary_buffer - - def __len__(self) -> int: - """Get the length of the byte buffer - - Returns - ------- - len: int - """ - return len(self.mv_) - - @property - def size(self) -> int: - """Get the size of the byte buffer - - Returns - ------- - size: int - size of buffer in bytes - """ - return len(self.mv_) - - @size.setter - def size(self, size: int): - """Set the length of the byte buffer - - Parameters - ---------- - size: int - new size of the buffer - """ - - if len(self.mv_) > size: - self.mv_ = self.mv_[:size] - elif len(self.mv_) < size: - buffer = bytearray(self.mv_) + bytearray(b"0" * (size - len(self.mv_))) - self.mv_ = memoryview(buffer) - - def read_number(self, start: int, dtype: np.dtype) -> Union[float, int]: - """Read a number from the buffer - - Parameters - ---------- - start: int - at which byte to start reading - dtype: np.dtype - type of the number to read - - Returns - ------- - number: np.dtype - number with the type specified - """ - return np.frombuffer(self.mv_, dtype=dtype, count=1, offset=start)[0] - - def write_number(self, start: int, value: Any, dtype: np.dtype): - """Write a number to the buffer - - Parameters - ---------- - start: int - at which byte to start writing - value: Any - value to write - dtype: np.dtype - type of the number to write - """ - - wrapper = np.frombuffer(self.mv_[start:], dtype=dtype) - wrapper[0] = value - - def read_ndarray(self, start: int, length: int, step: int, dtype: np.dtype) -> np.ndarray: - """Read a numpy array from the buffer - - Parameters - ---------- - start: int - at which byte to start reading - length: int - length in bytes to read - step: int - byte step size (how many bytes to skip) - dtype: np.dtype - type of the number to read - - Returns - ------- - array: np.ndarray - """ - - return np.frombuffer(self.mv_[start : start + length : step], dtype=dtype) - - def write_ndarray(self, array: np.ndarray, start: int, step: int): - """Write a numpy array to the buffer - - Parameters - ---------- - array: np.ndarray - array to save to the file - start: int - start in bytes - step: int - byte step size (how many bytes to skip) - """ - - wrapper = np.frombuffer(self.mv_[start::step], dtype=array.dtype) - - np.copyto(wrapper[: array.size], array, casting="no") - - def read_text(self, start: int, length: int, step: int = 1, encoding: str = "utf8") -> str: - """Read text from the binary buffer - - Parameters - ---------- - start: int - start in bytes - length: int - length in bytes to read - step: int - byte step size - encoding: str - encoding used - """ - return self.mv_[start : start + length : step].tobytes().decode(encoding) - - def save(self, filepath: Union[str, None] = None): - """Save the binary buffer to a file - - Parameters - ---------- - filepath: str - path where to save the data - - Notes - ----- - Overwrites to original file if no filepath - is specified. - """ - - filepath_parsed = filepath if filepath else (self.filepath_[0] if self.filepath_ else None) - - if filepath_parsed is None: - return - - with open(filepath_parsed, "wb") as fp: - fp.write(self.mv_) - - self.filepath_ = filepath_parsed - - def load(self, filepath: Union[list[str], str, None] = None, n_bytes: int = 0): - """load a file - - Parameters - ---------- - filepath: Union[str, None] - path to the file to load - n_bytes: int - number of bytes to load (uses memory mapping if nonzero) - - Notes - ----- - If not filepath is specified, then the opened file is simply - reloaded. - """ - - filepath = filepath if filepath else self.filepath_ - - if not filepath: - return - - # convert to a list if only a single file is given - filepath_parsed = [filepath] if isinstance(filepath, str) else filepath - - # get size of all files - sizes = [os.path.getsize(path) for path in filepath_parsed] - - # reduce memory if required - sizes = [entry if n_bytes == 0 else min(n_bytes, entry) for entry in sizes] - - memorysize = sum(sizes) - - # allocate memory - buffer = memoryview(bytearray(b"0" * memorysize)) - - # read files and concatenate them - sizes_tmp = [0] + sizes - for i_path, path in enumerate(filepath_parsed): - with open(path, "br") as fp: - if n_bytes: - mm = mmap.mmap(fp.fileno(), sizes[i_path], access=mmap.ACCESS_READ) - buffer[sizes_tmp[i_path] :] = mm[: sizes[i_path]] - else: - fp.readinto(buffer[sizes_tmp[i_path] :]) - - self.filepath_ = filepath_parsed - self.sizes_ = sizes - self.mv_ = buffer - - def append(self, binary_buffer: "BinaryBuffer"): - """Append another binary buffer to this one - - Parameters - ---------- - binary_buffer: BinaryBuffer - buffer to append - """ - - if not isinstance(binary_buffer, BinaryBuffer): - raise TypeError( - f"binary_buffer must be an instance of BinaryBuffer, got {type(binary_buffer)}" - ) - - self.mv_ = memoryview(bytearray(self.mv_) + bytearray(binary_buffer.mv_)) - self.sizes_.append(len(binary_buffer)) diff --git a/src/lasso/io/files.py b/src/lasso/io/files.py deleted file mode 100644 index 985ae15..0000000 --- a/src/lasso/io/files.py +++ /dev/null @@ -1,84 +0,0 @@ -import contextlib -import glob -import os -import typing -from collections.abc import Iterator -from typing import Union - - -@contextlib.contextmanager -def open_file_or_filepath( - path_or_file: Union[str, typing.BinaryIO], mode: str -) -> Iterator[typing.BinaryIO]: - """This function accepts a file or filepath and handles closing correctly - - Parameters - ---------- - path_or_file: Union[str, typing.IO] - path or file - mode: str - filemode - - Yields - ------ - f: file object - """ - if isinstance(path_or_file, str): - # We open this file in binary mode anyway so no encoding is needed. - # pylint: disable = unspecified-encoding - f = file_to_close = open(path_or_file, mode) - else: - f = path_or_file - file_to_close = None - try: - yield f - finally: - if file_to_close: - file_to_close.close() - - -def collect_files( - dirpath: Union[str, list[str]], patterns: Union[str, list[str]], recursive: bool = False -): - """Collect files from directories - - Parameters - ---------- - dirpath: Union[str, List[str]] - path to one or multiple directories to search through - patterns: Union[str, List[str]] - patterns to search for - recursive: bool - whether to also search subdirs - - Returns - ------- - found_files: Union[List[str], List[List[str]]] - returns the list of files found for every pattern specified - - Examples - -------- - >>> png_images, jpeg_images = collect_files("./folder", ["*.png", "*.jpeg"]) - """ - - if not isinstance(dirpath, (list, tuple)): - dirpath = [dirpath] - if not isinstance(patterns, (list, tuple)): - patterns = [patterns] - - found_files = [] - for pattern in patterns: - files_with_pattern = [] - for current_dir in dirpath: - # files in root dir - files_with_pattern += glob.glob(os.path.join(current_dir, pattern)) - # subfolders - if recursive: - files_with_pattern += glob.glob(os.path.join(current_dir, "**", pattern)) - - found_files.append(sorted(files_with_pattern)) - - if len(found_files) == 1: - return found_files[0] - - return found_files diff --git a/src/lasso/logging.py b/src/lasso/logging.py deleted file mode 100644 index 26b3520..0000000 --- a/src/lasso/logging.py +++ /dev/null @@ -1,109 +0,0 @@ -import logging -import platform - -from lasso.utils.console_coloring import ConsoleColoring - - -# settings -MARKER_INFO = "[/]" -MARKER_RUNNING = "[~]" -MARKER_WARNING = "[!]" -MARKER_SUCCESS = "[Y]" if platform.system() == "Windows" else "[โœ”]" -MARKER_ERROR = "[X]" if platform.system() == "Windows" else "[โœ˜]" - -LOGGER_NAME = "lasso" - - -def str_info(msg: str): - """Format a message as stuff is running - - Parameters - ---------- - msg: str - message to format - - Returns - ------- - msg_ret: str - formatted message - """ - # return ConsoleColoring.blue("[/] {0}".format(msg), light=True) - return f"{MARKER_INFO} {msg}" - - -def str_running(msg: str): - """Format a message as stuff is running - - Parameters - ---------- - msg: str - message to format - - Returns - ------- - msg_ret: str - formatted message - """ - return f"{MARKER_RUNNING} {msg}" - - -def str_success(msg: str): - """Format a message as successful - - Parameters - ---------- - msg: str - message to format - - Returns - ------- - msg_ret: str - formatted message - """ - return ConsoleColoring.green(f"{MARKER_SUCCESS} {msg}") - - -def str_warn(msg: str): - """Format a string as a warning - - Parameters - ---------- - msg: str - message to format - - Returns - ------- - msg_ret: str - formatted message - """ - return ConsoleColoring.yellow(f"{MARKER_WARNING} {msg}") - - -def str_error(msg: str): - """Format a string as an error - - Parameters - ---------- - msg: str - message to format - - Returns - ------- - msg_ret: str - formatted message - """ - return ConsoleColoring.red(f"{MARKER_ERROR} {msg}") - - -def get_logger(file_flag: str) -> logging.Logger: - """Get the logger for the lasso module - - Returns - ------- - logger: logging.Logger - logger for the lasso module - """ - logging.basicConfig( - datefmt="[%(levelname)s] %(message)s [%(pathname)s %(funcName)s %(lineno)d]" - ) - return logging.getLogger(file_flag) diff --git a/src/lasso/math/__init__.py b/src/lasso/math/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/lasso/math/sampling.py b/src/lasso/math/sampling.py deleted file mode 100644 index 0e9853c..0000000 --- a/src/lasso/math/sampling.py +++ /dev/null @@ -1,78 +0,0 @@ -import random -from typing import Union - -import numpy as np -from sklearn.neighbors import KDTree - - -def unique_subsamples(start: int, end: int, n_samples: int, seed=None) -> np.ndarray: - """Retrieve unique subsample indexes - - Parameters - ---------- - start: int - starting index of population - end: int - ending index of population (end <= start) - n_samples: int - number of samples to draw - seed: int - seed for random number generator - - Returns - ------- - indexes: np.ndarray - unique sample indexes - """ - if start > end: - raise ValueError( - f"Invalid range: start ({start}) must be less than or equal to end ({end})" - ) - - n_samples = min(n_samples, end - start) - random.seed(seed) - indexes = np.array(random.sample(range(start, end), n_samples), dtype=np.int64) - random.seed() - return indexes - - -def homogenize_density( - points: np.ndarray, - dim: int = 2, - target_distance: Union[float, None] = None, - n_neighbors: int = 18, - seed=None, -) -> np.ndarray: - """homogenize a cloud density by probabilities - - Parameters - ---------- - points: np.ndarray - point cloud - dim: int - intrinsic dimension of the data - target_distance: float - target distance to aim for - n_neighbors: int - neighbors used for computation of average neighborhood distance - seed: int - seed for random number generator - - Returns - ------- - is_selected: np.ndarray - boolean array indicating which subsamples were selected - """ - n_neighbors = min(n_neighbors, len(points)) - - random.seed(seed) - d, _ = KDTree(points).query(points, k=n_neighbors + 1) - d_average = np.average(d[:, 1:], axis=1) - if target_distance is None: - target_distance = np.median(d_average) - is_selected = np.array([ - dist >= target_distance or random.random() < (dist / target_distance) ** dim - for i, dist in enumerate(d_average) - ]) - random.seed() - return is_selected diff --git a/src/lasso/math/stochastic.py b/src/lasso/math/stochastic.py deleted file mode 100644 index 635ebf5..0000000 --- a/src/lasso/math/stochastic.py +++ /dev/null @@ -1,26 +0,0 @@ -import numpy as np -from scipy import stats - - -def jensen_shannon_entropy(p: np.ndarray, q: np.ndarray) -> float: - """Jensen Shannon Entropy - - Parameters - ---------- - p: np.ndarray - first probability distribution - q: np.ndarray - second probability distribution - - Returns - ------- - js_divergence: float - Jensen-Shannon divergence - """ - p = np.asarray(p) - q = np.asarray(q) - # normalize - p = p / p.sum() - q = q / q.sum() - m = (p + q) / 2 - return (stats.entropy(p, m) + stats.entropy(q, m)) / 2 diff --git a/src/lasso/plotting/__init__.py b/src/lasso/plotting/__init__.py deleted file mode 100644 index c6a14ad..0000000 --- a/src/lasso/plotting/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .plot_shell_mesh import plot_shell_mesh - - -__all__ = ["plot_shell_mesh"] diff --git a/src/lasso/plotting/plot_shell_mesh.py b/src/lasso/plotting/plot_shell_mesh.py deleted file mode 100644 index ac67324..0000000 --- a/src/lasso/plotting/plot_shell_mesh.py +++ /dev/null @@ -1,239 +0,0 @@ -import io -import json -import os -import uuid -from base64 import b64encode -from typing import Union -from zipfile import ZIP_DEFLATED, ZipFile - -import numpy as np - - -def _read_file(filepath: str): - """This function reads file as str - - Parameters - ---------- - filepath : str - filepath of the file to read as string - - Returns - ------- - file_content : str - """ - - with open(filepath, encoding="utf-8") as fp_filepath: - return fp_filepath.read() - - -def plot_shell_mesh( - node_coordinates: np.ndarray, - shell_node_indexes: np.ndarray, - field: Union[np.ndarray, None] = None, - is_element_field: bool = True, - fringe_limits: Union[tuple[float, float], None] = None, -): - """Plot a mesh - - Parameters - ---------- - node_coordinates : np.ndarray - array of node coordinates for elements - shell_node_indexes : np.ndarray - node indexes of shells - field : Union[np.ndarray, None] - Array containing a field value for every element or node - is_element_field : bool - if the specified field is for elements or nodes - fringe_limits : Union[Tuple[float, float], None] - limits for the fringe bar. Set by default to min and max. - - Returns - ------- - html : str - html code for plotting as string - """ - - # pylint: disable = too-many-locals, too-many-statements - - if getattr(node_coordinates, "ndim", None) != 2: - raise ValueError( - f"node_coordinates must be 2-dimensional, " - f"got ndim={getattr(node_coordinates, 'ndim', 'unknown')}" - ) - - if getattr(node_coordinates, "shape", (None, None))[1] != 3: - raise ValueError( - f"node_coordinates must have shape[1] == 3, " - f"got shape={getattr(node_coordinates, 'shape', 'unknown')}" - ) - - if getattr(shell_node_indexes, "ndim", None) != 2: - raise ValueError( - f"shell_node_indexes must be 2-dimensional, " - f"got ndim={getattr(shell_node_indexes, 'ndim', 'unknown')}" - ) - - shape_1 = getattr(shell_node_indexes, "shape", (None, None))[1] - if shape_1 not in (3, 4): - raise ValueError(f"shell_node_indexes must have shape[1] of 3 or 4, got shape[1]={shape_1}") - - if isinstance(field, np.ndarray): - if getattr(field, "ndim", None) != 1: - raise ValueError( - f"field must be 1-dimensional, got ndim={getattr(field, 'ndim', 'unknown')}" - ) - - if is_element_field: - if ( - getattr(field, "shape", (None,))[0] - != getattr(shell_node_indexes, "shape", (None,))[0] - ): - raise ValueError( - f"field length {getattr(field, 'shape', (None,))[0]} does not match " - f"shell_node_indexes length {getattr(shell_node_indexes, 'shape', (None,))[0]}" - ) - elif getattr(field, "shape", (None,))[0] != getattr(node_coordinates, "shape", (None,))[0]: - raise ValueError( - f"field length {getattr(field, 'shape', (None,))[0]} does not match " - f"node_coordinates length {getattr(node_coordinates, 'shape', (None,))[0]}" - ) - - # cast types correctly - # the types MUST be float32 - node_coordinates = node_coordinates.astype(np.float32) - if isinstance(field, np.ndarray): - field = field.astype(np.float32) - - # distinguish tria and quads - is_quad = shell_node_indexes[:, 2] != shell_node_indexes[:, 3] - is_tria = np.logical_not(is_quad) - - # separate tria and quads ... I know its sad :( - tria_node_indexes = shell_node_indexes[is_tria][:, :3] - quad_node_indexes = shell_node_indexes[is_quad] - - # we can only plot tria, therefore we need to split quads - # into two trias - quad_node_indexes_tria1 = quad_node_indexes[:, :3] - # quad_node_indexes_tria2 = quad_node_indexes[:, [True, False, True, True]] - quad_node_indexes_tria2 = quad_node_indexes[:, [0, 2, 3]] - - # assemble elements for plotting - # This seems to take a lot of memory, and you are right, thinking this, - # the issue is just in order to plot fringe values, we need to output - # the element values at the 3 corner nodes. Since elements share nodes - # we can not use the same nodes, thus we need to create multiple nodes - # at the same position but with different fringe. - nodes_xyz = np.concatenate([ - node_coordinates[tria_node_indexes].reshape((-1, 3)), - node_coordinates[quad_node_indexes_tria1].reshape((-1, 3)), - node_coordinates[quad_node_indexes_tria2].reshape((-1, 3)), - ]) - - # fringe value and hover title - if isinstance(field, np.ndarray): - if is_element_field: - n_shells = len(shell_node_indexes) - n_tria = np.sum(is_tria) - n_quads = n_shells - n_tria - - # split field according to elements - field_tria = field[is_tria] - field_quad = field[is_quad] - - # allocate fringe array - node_fringe = np.zeros((len(field_tria) + 2 * len(field_quad), 3), dtype=np.float32) - - # set fringe values - node_fringe[:n_tria, 0] = field_tria - node_fringe[:n_tria, 1] = field_tria - node_fringe[:n_tria, 2] = field_tria - - node_fringe[n_tria : n_tria + n_quads, 0] = field_quad - node_fringe[n_tria : n_tria + n_quads, 1] = field_quad - node_fringe[n_tria : n_tria + n_quads, 2] = field_quad - - node_fringe[n_tria + n_quads : n_tria + 2 * n_quads, 0] = field_quad - node_fringe[n_tria + n_quads : n_tria + 2 * n_quads, 1] = field_quad - node_fringe[n_tria + n_quads : n_tria + 2 * n_quads, 2] = field_quad - - # flatty paddy - node_fringe = node_fringe.flatten() - else: - # copy & paste ftw - node_fringe = np.concatenate([ - field[tria_node_indexes].reshape((-1, 3)), - field[quad_node_indexes_tria1].reshape((-1, 3)), - field[quad_node_indexes_tria2].reshape((-1, 3)), - ]) - node_fringe = node_fringe.flatten() - - # element text - node_txt = [str(entry) for entry in node_fringe.flatten()] - else: - node_fringe = np.zeros(len(nodes_xyz), dtype=np.float32) - node_txt = [""] * len(nodes_xyz) - - # zip compression of data for HTML (reduces size) - zip_data = io.BytesIO() - with ZipFile(zip_data, "w", compression=ZIP_DEFLATED) as zipfile: - zipfile.writestr("/intensities", node_fringe.tostring()) - zipfile.writestr("/positions", nodes_xyz.tostring()) - zipfile.writestr("/text", json.dumps(node_txt)) - zip_data = b64encode(zip_data.getvalue()).decode("utf-8") - - # read html template - _html_template = _read_file( - os.path.join(os.path.dirname(__file__), "resources", "template.html") - ) - - # format html template file - min_value = 0 - max_value = 0 - if fringe_limits: - min_value = fringe_limits[0] - max_value = fringe_limits[1] - elif isinstance(field, np.ndarray): - min_value = field.min() - max_value = field.max() - - _html_div = _html_template.format( - div_id=uuid.uuid4(), lowIntensity=min_value, highIntensity=max_value, zdata=zip_data - ) - - # wrap it up with all needed js libraries - - script_string_js = '' - jszip_js_format = _read_file( - os.path.join(os.path.dirname(__file__), "resources", "jszip.min.js") - ) - jszip_three_format = _read_file( - os.path.join(os.path.dirname(__file__), "resources", "three.min.js") - ) - jszip_chroma_format = _read_file( - os.path.join(os.path.dirname(__file__), "resources", "chroma.min.js") - ) - jszip_jquery_format = _read_file( - os.path.join(os.path.dirname(__file__), "resources", "jquery.min.js") - ) - _html_jszip_js = script_string_js.format(jszip_js_format) - _html_three_js = script_string_js.format(jszip_three_format) - _html_chroma_js = script_string_js.format(jszip_chroma_format) - _html_jquery_js = script_string_js.format(jszip_jquery_format) - - # pylint: disable = consider-using-f-string - return f""" - - - - - {_html_jquery_js} - {_html_jszip_js} - {_html_three_js} - {_html_chroma_js} - - - {_html_div} - -""" diff --git a/src/lasso/plotting/resources/__init__.py b/src/lasso/plotting/resources/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/lasso/plotting/resources/chroma.min.js b/src/lasso/plotting/resources/chroma.min.js deleted file mode 100644 index 45aaecf..0000000 --- a/src/lasso/plotting/resources/chroma.min.js +++ /dev/null @@ -1,33 +0,0 @@ -/* -chroma.js - JavaScript library for color conversions - -Copyright (c) 2011-2015, Gregor Aisch -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. The name Gregor Aisch may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za=[].slice;ua=function(){var a,b,c,d,e;for(a={},e="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),d=0,b=e.length;dc&&(a=c),a},va=function(a){return a.length>=3?[].slice.call(a):a[0]},t=function(a){var b;for(b in a)b<3?(a[b]<0&&(a[b]=0),a[b]>255&&(a[b]=255)):3===b&&(a[b]<0&&(a[b]=0),a[b]>1&&(a[b]=1));return a},d=Math.PI,pa=Math.round,w=Math.cos,B=Math.floor,_=Math.pow,T=Math.log,ra=Math.sin,sa=Math.sqrt,m=Math.atan2,W=Math.max,l=Math.abs,g=2*d,e=d/3,b=d/180,f=180/d,s=function(){return arguments[0]instanceof a?arguments[0]:function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,arguments,function(){})},k=[],"undefined"!=typeof module&&null!==module&&null!=module.exports&&(module.exports=s),"function"==typeof define&&define.amd?define([],function(){return s}):(oa="undefined"!=typeof exports&&null!==exports?exports:this,oa.chroma=s),s.version="1.1.1",j={},h=[],i=!1,a=function(){function a(){var a,b,c,d,e,f,g,k,l;for(f=this,b=[],k=0,d=arguments.length;k3?b[3]:1]},ya=function(a){return pa(255*(a<=.00304?12.92*a:1.055*_(a,1/2.4)-.055))},O=function(a){return a>c.t1?a*a*a:c.t2*(a-c.t0)},c={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ga=function(){var a,b,c,d,e,f,g,h;return d=va(arguments),c=d[0],b=d[1],a=d[2],e=la(c,b,a),f=e[0],g=e[1],h=e[2],[116*g-16,500*(f-g),200*(g-h)]},ma=function(a){return(a/=255)<=.04045?a/12.92:_((a+.055)/1.055,2.4)},xa=function(a){return a>c.t3?_(a,1/3):a/c.t2+c.t0},la=function(){var a,b,d,e,f,g,h;return e=va(arguments),d=e[0],b=e[1],a=e[2],d=ma(d),b=ma(b),a=ma(a),f=xa((.4124564*d+.3575761*b+.1804375*a)/c.Xn),g=xa((.2126729*d+.7151522*b+.072175*a)/c.Yn),h=xa((.0193339*d+.119192*b+.9503041*a)/c.Zn),[f,g,h]},s.lab=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["lab"]),function(){})},j.lab=N,a.prototype.lab=function(){return ga(this._rgb)},n=function(a){var b,c,d,e,f,g,h,i,j,k,l;return a=function(){var b,c,d;for(d=[],c=0,b=a.length;c=0&&b[3]<=1?"rgb":void 0}}),C=function(a){var b,c,d,e,f,g;if(a.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==a.length&&7!==a.length||(a=a.substr(1)),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),g=parseInt(a,16),e=g>>16,d=g>>8&255,c=255&g,[e,d,c,1];if(a.match(/^#?([A-Fa-f0-9]{8})$/))return 9===a.length&&(a=a.substr(1)),g=parseInt(a,16),e=g>>24&255,d=g>>16&255,c=g>>8&255,b=pa((255&g)/255*100)/100,[e,d,c,b];if(null!=j.css&&(f=j.css(a)))return f;throw"unknown color: "+a},ca=function(a,b){var c,d,e,f,g,h,i;return null==b&&(b="rgb"),g=a[0],e=a[1],d=a[2],c=a[3],i=g<<16|e<<8|d,h="000000"+i.toString(16),h=h.substr(h.length-6),f="0"+pa(255*c).toString(16),f=f.substr(f.length-2),"#"+function(){switch(b.toLowerCase()){case"rgba":return h+f;case"argb":return f+h;default:return h}}()},j.hex=function(a){return C(a)},s.hex=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hex"]),function(){})},a.prototype.hex=function(a){return null==a&&(a="rgb"),ca(this._rgb,a)},h.push({p:10,test:function(a){if(1===arguments.length&&"string"===ua(a))return"hex"}}),F=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(a=va(arguments),e=a[0],k=a[1],g=a[2],0===k)i=d=b=255*g;else{for(n=[0,0,0],c=[0,0,0],m=g<.5?g*(1+k):g+k-g*k,l=2*g-m,e/=360,n[0]=e+1/3,n[1]=e,n[2]=e-1/3,f=h=0;h<=2;f=++h)n[f]<0&&(n[f]+=1),n[f]>1&&(n[f]-=1),6*n[f]<1?c[f]=l+6*(m-l)*n[f]:2*n[f]<1?c[f]=m:3*n[f]<2?c[f]=l+(m-l)*(2/3-n[f])*6:c[f]=l;j=[pa(255*c[0]),pa(255*c[1]),pa(255*c[2])],i=j[0],d=j[1],b=j[2]}return a.length>3?[i,d,b,a[3]]:[i,d,b]},ea=function(a,b,c){var d,e,f,g,h;return void 0!==a&&a.length>=3&&(g=a,a=g[0],b=g[1],c=g[2]),a/=255,b/=255,c/=255,f=Math.min(a,b,c),W=Math.max(a,b,c),e=(W+f)/2,W===f?(h=0,d=Number.NaN):h=e<.5?(W-f)/(W+f):(W-f)/(2-W-f),a===W?d=(b-c)/(W-f):b===W?d=2+(c-a)/(W-f):c===W&&(d=4+(a-b)/(W-f)),d*=60,d<0&&(d+=360),[d,h,e]},s.hsl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hsl"]),function(){})},j.hsl=F,a.prototype.hsl=function(){return ea(this._rgb)},G=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;if(a=va(arguments),e=a[0],p=a[1],r=a[2],r*=255,0===p)i=d=b=r;else switch(360===e&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60,f=B(e),c=e-f,g=r*(1-p),h=r*(1-p*c),q=r*(1-p*(1-c)),f){case 0:j=[r,q,g],i=j[0],d=j[1],b=j[2];break;case 1:k=[h,r,g],i=k[0],d=k[1],b=k[2];break;case 2:l=[g,r,q],i=l[0],d=l[1],b=l[2];break;case 3:m=[g,h,r],i=m[0],d=m[1],b=m[2];break;case 4:n=[q,g,r],i=n[0],d=n[1],b=n[2];break;case 5:o=[r,g,h],i=o[0],d=o[1],b=o[2]}return i=pa(i),d=pa(d),b=pa(b),[i,d,b,a.length>3?a[3]:1]},fa=function(){var a,b,c,d,e,f,g,h,i;return g=va(arguments),f=g[0],c=g[1],a=g[2],e=Math.min(f,c,a),W=Math.max(f,c,a),b=W-e,i=W/255,0===W?(d=Number.NaN,h=0):(h=b/W,f===W&&(d=(c-a)/b),c===W&&(d=2+(a-f)/b),a===W&&(d=4+(f-c)/b),d*=60,d<0&&(d+=360)),[d,h,i]},s.hsv=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hsv"]),function(){})},j.hsv=G,a.prototype.hsv=function(){return fa(this._rgb)},Z=function(a){var b,c,d;return"number"===ua(a)&&a>=0&&a<=16777215?(d=a>>16,c=a>>8&255,b=255&a,[d,c,b,1]):(console.warn("unknown num color: "+a),[0,0,0,1])},ja=function(){var a,b,c,d;return d=va(arguments),c=d[0],b=d[1],a=d[2],(c<<16)+(b<<8)+a},s.num=function(b){return new a(b,"num")},a.prototype.num=function(a){return null==a&&(a="rgb"),ja(this._rgb,a)},j.num=Z,h.push({p:10,test:function(a){if(1===arguments.length&&"number"===ua(a)&&a>=0&&a<=16777215)return"num"}}),x=function(a){var b,c,d,e,f,g,h,i;if(a=a.toLowerCase(),null!=s.colors&&s.colors[a])return C(s.colors[a]);if(f=a.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(h=f.slice(1,4),e=g=0;g<=2;e=++g)h[e]=+h[e];h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(h=f.slice(1,5),e=i=0;i<=3;e=++i)h[e]=+h[e];else if(f=a.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(h=f.slice(1,4),e=b=0;b<=2;e=++b)h[e]=pa(2.55*h[e]);h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(h=f.slice(1,5),e=c=0;c<=2;e=++c)h[e]=pa(2.55*h[e]);h[3]=+h[3]}else(f=a.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=F(d),h[3]=1):(f=a.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=F(d),h[3]=+f[4]);return h},ba=function(a){var b;return b=a[3]<1?"rgba":"rgb","rgb"===b?b+"("+a.slice(0,3).map(pa).join(",")+")":"rgba"===b?b+"("+a.slice(0,3).map(pa).join(",")+","+a[3]+")":void 0},na=function(a){return pa(100*a)/100},E=function(a,b){var c;return c=b<1?"hsla":"hsl",a[0]=na(a[0]||0),a[1]=na(100*a[1])+"%",a[2]=na(100*a[2])+"%","hsla"===c&&(a[3]=b),c+"("+a.join(",")+")"},j.css=function(a){return x(a)},s.css=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["css"]),function(){})},a.prototype.css=function(a){return null==a&&(a="rgb"),"rgb"===a.slice(0,3)?ba(this._rgb):"hsl"===a.slice(0,3)?E(this.hsl(),this.alpha()):void 0},j.named=function(a){return C(wa[a])},h.push({p:20,test:function(a){if(1===arguments.length&&null!=wa[a])return"named"}}),a.prototype.name=function(a){var b,c;arguments.length&&(wa[a]&&(this._rgb=C(wa[a])),this._rgb[3]=1),b=this.hex();for(c in wa)if(b===wa[c])return c;return b},P=function(){var a,c,d,e;return e=va(arguments),d=e[0],a=e[1],c=e[2],c*=b,[d,w(c)*a,ra(c)*a]},Q=function(){var a,b,c,d,e,f,g,h,i,j,k;return c=va(arguments),h=c[0],e=c[1],g=c[2],j=P(h,e,g),a=j[0],b=j[1],d=j[2],k=N(a,b,d),i=k[0],f=k[1],d=k[2],[S(i,0,255),S(f,0,255),S(d,0,255),c.length>3?c[3]:1]},M=function(){var a,b,c,d,e,g;return g=va(arguments),e=g[0],a=g[1],b=g[2],c=sa(a*a+b*b),d=(m(b,a)*f+360)%360,0===pa(1e4*c)&&(d=Number.NaN),[e,c,d]},ha=function(){var a,b,c,d,e,f,g;return f=va(arguments),e=f[0],c=f[1],b=f[2],g=ga(e,c,b),d=g[0],a=g[1],b=g[2],M(d,a,b)},s.lch=function(){var b;return b=va(arguments),new a(b,"lch")},s.hcl=function(){var b;return b=va(arguments),new a(b,"hcl")},j.lch=Q,j.hcl=function(){var a,b,c,d;return d=va(arguments),b=d[0],a=d[1],c=d[2],Q([c,a,b])},a.prototype.lch=function(){return ha(this._rgb)},a.prototype.hcl=function(){return ha(this._rgb).reverse()},aa=function(a){var b,c,d,e,f,g,h,i,j;return null==a&&(a="rgb"),i=va(arguments),h=i[0],e=i[1],b=i[2],h/=255,e/=255,b/=255,f=1-Math.max(h,Math.max(e,b)),d=f<1?1/(1-f):0,c=(1-h-f)*d,g=(1-e-f)*d,j=(1-b-f)*d,[c,g,j,f]},u=function(){var a,b,c,d,e,f,g,h,i;return b=va(arguments),d=b[0],g=b[1],i=b[2],f=b[3],a=b.length>4?b[4]:1,1===f?[0,0,0,a]:(h=d>=1?0:pa(255*(1-d)*(1-f)),e=g>=1?0:pa(255*(1-g)*(1-f)),c=i>=1?0:pa(255*(1-i)*(1-f)),[h,e,c,a])},j.cmyk=function(){return u(va(arguments))},s.cmyk=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["cmyk"]),function(){})},a.prototype.cmyk=function(){return aa(this._rgb)},j.gl=function(){var a,b,c,d,e;for(d=function(){var a,c;a=va(arguments),c=[];for(b in a)e=a[b],c.push(e);return c}.apply(this,arguments),a=c=0;c<=2;a=++c)d[a]*=255;return d},s.gl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["gl"]),function(){})},a.prototype.gl=function(){var a;return a=this._rgb,[a[0]/255,a[1]/255,a[2]/255,a[3]]},ia=function(a,b,c){var d;return d=va(arguments),a=d[0],b=d[1],c=d[2],a=U(a),b=U(b),c=U(c),.2126*a+.7152*b+.0722*c},U=function(a){return a/=255,a<=.03928?a/12.92:_((a+.055)/1.055,2.4)},k=[],H=function(a,b,c,d){var e,f,g,h;for(null==c&&(c=.5),null==d&&(d="rgb"),"object"!==ua(a)&&(a=s(a)),"object"!==ua(b)&&(b=s(b)),g=0,f=k.length;ga?f(c,i):f(i,g)},c=ia(this._rgb),this._rgb=(c>a?f(s("black"),this):f(this,s("white"))).rgba()),this):ia(this._rgb)},ta=function(a){var b,c,d,e;return e=a/100,e<66?(d=255,c=-155.25485562709179-.44596950469579133*(c=e-2)+104.49216199393888*T(c),b=e<20?0:-254.76935184120902+.8274096064007395*(b=e-10)+115.67994401066147*T(b)):(d=351.97690566805693+.114206453784165*(d=e-55)-40.25366309332127*T(d),c=325.4494125711974+.07943456536662342*(c=e-50)-28.0852963507957*T(c),b=255),t([d,c,b])},ka=function(){var a,b,c,d,e,f,g,h,i;for(g=va(arguments),f=g[0],c=g[1],a=g[2],e=1e3,d=4e4,b=.4;d-e>b;)i=.5*(d+e),h=ta(i),h[2]/h[0]>=a/f?d=i:e=i;return pa(i)},s.temperature=s.kelvin=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["temperature"]),function(){})},j.temperature=j.kelvin=j.K=ta,a.prototype.temperature=function(){return ka(this._rgb)},a.prototype.kelvin=a.prototype.temperature,s.contrast=function(b,c){var d,e,f,g;return"string"!==(f=ua(b))&&"number"!==f||(b=new a(b)),"string"!==(g=ua(c))&&"number"!==g||(c=new a(c)),d=b.luminance(),e=c.luminance(),d>e?(d+.05)/(e+.05):(e+.05)/(d+.05)},a.prototype.get=function(a){var b,c,d,e,f,g;return d=this,f=a.split("."),e=f[0],b=f[1],g=d[e](),b?(c=e.indexOf(b),c>-1?g[c]:console.warn("unknown channel "+b+" in mode "+e)):g},a.prototype.set=function(a,b){var c,d,e,f,g,h;if(e=this,g=a.split("."),f=g[0],c=g[1],c)if(h=e[f](),d=f.indexOf(c),d>-1)if("string"===ua(b))switch(b.charAt(0)){case"+":h[d]+=+b;break;case"-":h[d]+=+b;break;case"*":h[d]*=+b.substr(1);break;case"/":h[d]/=+b.substr(1);break;default:h[d]=+b}else h[d]=b;else console.warn("unknown channel "+c+" in mode "+f);else h=b;return e._rgb=s(h,f).alpha(e.alpha())._rgb,e},a.prototype.darken=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lab(),b[0]-=c.Kn*a,s.lab(b).alpha(d.alpha())},a.prototype.brighten=function(a){return null==a&&(a=1),this.darken(-a)},a.prototype.darker=a.prototype.darken,a.prototype.brighter=a.prototype.brighten,a.prototype.saturate=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lch(),b[1]+=a*c.Kn,b[1]<0&&(b[1]=0),s.lch(b).alpha(d.alpha())},a.prototype.desaturate=function(a){return null==a&&(a=1),this.saturate(-a)},a.prototype.premultiply=function(){var a,b;return b=this.rgb(),a=this.alpha(),s(b[0]*a,b[1]*a,b[2]*a,a)},o=function(a,b,c){if(!o[c])throw"unknown blend mode "+c;return o[c](a,b)},p=function(a){return function(b,c){var d,e;return d=s(c).rgb(),e=s(b).rgb(),s(a(d,e),"rgb")}},A=function(a){return function(b,c){var d,e,f;for(f=[],d=e=0;e<=3;d=++e)f[d]=a(b[d],c[d]);return f}},Y=function(a,b){return a},X=function(a,b){return a*b/255},y=function(a,b){return a>b?b:a},R=function(a,b){return a>b?a:b},qa=function(a,b){return 255*(1-(1-a/255)*(1-b/255))},$=function(a,b){return b<128?2*a*b/255:255*(1-2*(1-a/255)*(1-b/255))},r=function(a,b){return 255*(1-(1-b/255)/(a/255))},z=function(a,b){return 255===a?255:(a=255*(b/255)/(1-a/255),a>255?255:a)},o.normal=p(A(Y)),o.multiply=p(A(X)),o.screen=p(A(qa)),o.overlay=p(A($)),o.darken=p(A(y)),o.lighten=p(A(R)),o.dodge=p(A(z)),o.burn=p(A(r)),s.blend=o,s.analyze=function(a){var b,c,d,e;for(d={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0},c=0,b=a.length;cd.max&&(d.max=e),d.count+=1);return d.domain=[d.min,d.max],d.limits=function(a,b){return s.limits(d,a,b)},d},s.scale=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,t,u,v,w,x;return k="rgb",l=s("#ccc"),p=0,h=!1,g=[0,1],o=[],n=[0,0],c=!1,e=[],m=!1,j=0,i=1,f=!1,d={},w=function(a){var b,c,d,f,g,h,i;if(null==a&&(a=["#fff","#000"]),null!=a&&"string"===ua(a)&&null!=(null!=(f=s.brewer)?f[a]:void 0)&&(a=s.brewer[a]),"array"===ua(a)){for(a=a.slice(0),b=d=0,g=a.length-1;0<=g?d<=g:d>=g;b=0<=g?++d:--d)c=a[b],"string"===ua(c)&&(a[b]=s(c));for(o.length=0,b=i=0,h=a.length-1;0<=h?i<=h:i>=h;b=0<=h?++i:--i)o.push(b/(a.length-1))}return v(),e=a},t=function(a){var b,d;if(null!=c){for(d=c.length-1,b=0;b=c[b];)b++;return b-1}return 0},x=function(a){return a},q=function(a){var b,d,e,f,g;return g=a,c.length>2&&(f=c.length-1,b=t(a),e=c[0]+(c[1]-c[0])*(0+.5*p),d=c[f-1]+(c[f]-c[f-1])*(1-.5*p),g=j+(c[b]+.5*(c[b+1]-c[b])-e)/(d-e)*(i-j)),g},u=function(a,b){var f,g,h,m,p,q,r,u;if(null==b&&(b=!1),isNaN(a))return l;if(b?u=a:c&&c.length>2?(f=t(a),u=f/(c.length-2),u=n[0]+u*(1-n[0]-n[1])):i!==j?(u=(a-j)/(i-j),u=n[0]+u*(1-n[0]-n[1]),u=Math.min(1,Math.max(0,u))):u=1,b||(u=x(u)),m=Math.floor(1e4*u),d[m])g=d[m];else{if("array"===ua(e))for(h=p=0,r=o.length-1;0<=r?p<=r:p>=r;h=0<=r?++p:--p){if(q=o[h],u<=q){g=e[h];break}if(u>=q&&h===o.length-1){g=e[h];break}if(u>q&&u=k;b=0<=k?++l:--l)o.push(b/(d-1));return g=[j,i],r},r.mode=function(a){return arguments.length?(k=a,v(),r):k},r.range=function(a,b){return w(a,b),r},r.out=function(a){return m=a,r},r.spread=function(a){return arguments.length?(p=a,r):p},r.correctLightness=function(a){return null==a&&(a=!0),f=a,v(),x=f?function(a){var b,c,d,e,f,g,h,i,j;for(b=u(0,!0).lab()[0],c=u(1,!0).lab()[0],h=b>c,d=u(a,!0).lab()[0],f=b+(c-b)*a,e=d-f,i=0,j=1,g=20;Math.abs(e)>.01&&g-- >0;)!function(){return h&&(e*=-1),e<0?(i=a,a+=.5*(j-a)):(j=a,a+=.5*(i-a)),d=u(a,!0).lab()[0],e=d-f}();return a}:function(a){return a},r},r.padding=function(a){return null!=a?("number"===ua(a)&&(a=[a,a]),n=a,r):n},r.colors=function(){var b,d,e,f,h,i,j,k,l;if(f=0,h="hex",1===arguments.length&&("string"===ua(arguments[0])?h=arguments[0]:f=arguments[0]),2===arguments.length&&(f=arguments[0],h=arguments[1]),f)return d=g[0],b=g[1]-d,function(){j=[];for(var a=0;0<=f?af;0<=f?a++:a--)j.push(a);return j}.apply(this).map(function(a){return r(d+a/(f-1)*b)[h]()});if(a=[],k=[],c&&c.length>2)for(e=l=1,i=c.length;1<=i?li;e=1<=i?++l:--l)k.push(.5*(c[e-1]+c[e]));else k=g;return k.map(function(a){return r(a)[h]()})},r},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(a,b,c){var d,e,f,g,h,i,j;if(h={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0},null==c&&(c=function(){return!0}),d=function(a){null==a||isNaN(a)||(h.values.push(a),h.sum+=a,ah.max&&(h.max=a),h.count+=1)},j=function(a,e){if(c(a,e))return d(null!=b&&"function"===ua(b)?b(a):null!=b&&"string"===ua(b)||"number"===ua(b)?a[b]:a)},"array"===ua(a))for(g=0,f=a.length;g=O;y=1<=O?++K:--K)C.push(E+y/c*(W-E));C.push(W)}else if("l"===b.substr(0,1)){if(E<=0)throw"Logarithmic scales are only possible for values > 0";for(F=Math.LOG10E*T(E),D=Math.LOG10E*T(W),C.push(E),y=ja=1,P=c-1;1<=P?ja<=P:ja>=P;y=1<=P?++ja:--ja)C.push(_(10,F+y/c*(D-F)));C.push(W)}else if("q"===b.substr(0,1)){for(C.push(E),y=d=1,X=c-1;1<=X?d<=X:d>=X;y=1<=X?++d:--d)L=ia.length*y/c,M=B(L),M===L?C.push(ia[M]):(N=L-M,C.push(ia[M]*N+ia[M+1]*(1-N)));C.push(W)}else if("k"===b.substr(0,1)){for(H=ia.length,r=new Array(H),w=new Array(c),ea=!0,I=0,u=null,u=[],u.push(E),y=e=1,Y=c-1;1<=Y?e<=Y:e>=Y;y=1<=Y?++e:--e)u.push(E+y/c*(W-E));for(u.push(W);ea;){for(z=f=0,Z=c-1;0<=Z?f<=Z:f>=Z;z=0<=Z?++f:--f)w[z]=0;for(y=g=0,$=H-1;0<=$?g<=$:g>=$;y=0<=$?++g:--g){for(ha=ia[y],G=Number.MAX_VALUE,z=h=0,aa=c-1;0<=aa?h<=aa:h>=aa;z=0<=aa?++h:--h)x=l(u[z]-ha),x=ba;z=0<=ba?++i:--i)J[z]=null;for(y=j=0,ca=H-1;0<=ca?j<=ca:j>=ca;y=0<=ca?++j:--j)v=r[y],null===J[v]?J[v]=ia[y]:J[v]+=ia[y];for(z=k=0,da=c-1;0<=da?k<=da:k>=da;z=0<=da?++k:--k)J[z]*=1/w[z];for(ea=!1,z=m=0,Q=c-1;0<=Q?m<=Q:m>=Q;z=0<=Q?++m:--m)if(J[z]!==u[y]){ea=!0;break}u=J,I++,I>200&&(ea=!1)}for(A={},z=n=0,R=c-1;0<=R?n<=R:n>=R;z=0<=R?++n:--n)A[z]=[];for(y=o=0,S=H-1;0<=S?o<=S:o>=S;y=0<=S?++o:--o)v=r[y],A[v].push(ia[y]);for(ga=[],z=p=0,U=c-1;0<=U?p<=U:p>=U;z=0<=U?++p:--p)ga.push(A[z][0]),ga.push(A[z][A[z].length-1]);for(ga=ga.sort(function(a,b){return a-b}),C.push(ga[0]),y=q=1,V=ga.length-1;q<=V;y=q+=2)isNaN(ga[y])||C.push(ga[y])}return C},D=function(a,b,c){var d,f,h,i;return d=va(arguments),a=d[0],b=d[1],c=d[2],a/=360,a<1/3?(f=(1-b)/3,i=(1+b*w(g*a)/w(e-g*a))/3,h=1-(f+i)):a<2/3?(a-=1/3,i=(1-b)/3,h=(1+b*w(g*a)/w(e-g*a))/3,f=1-(i+h)):(a-=2/3,h=(1-b)/3,f=(1+b*w(g*a)/w(e-g*a))/3,i=1-(h+f)),i=S(c*i*3),h=S(c*h*3),f=S(c*f*3),[255*i,255*h,255*f,d.length>3?d[3]:1]},da=function(){var a,b,c,d,e,f,h,i;return h=va(arguments),f=h[0],b=h[1],a=h[2],g=2*Math.PI,f/=255,b/=255,a/=255,e=Math.min(f,b,a),d=(f+b+a)/3,i=1-e/d,0===i?c=0:(c=(f-b+(f-a))/2,c/=Math.sqrt((f-b)*(f-b)+(f-a)*(b-a)),c=Math.acos(c),a>b&&(c=g-c),c/=g),[360*c,i,d]},s.hsi=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hsi"]),function(){})},j.hsi=D,a.prototype.hsi=function(){return da(this._rgb)},I=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q;return"hsl"===d?(p=a.hsl(),q=b.hsl()):"hsv"===d?(p=a.hsv(),q=b.hsv()):"hsi"===d?(p=a.hsi(),q=b.hsi()):"lch"!==d&&"hcl"!==d||(d="hcl",p=a.hcl(),q=b.hcl()),"h"===d.substr(0,1)&&(g=p[0],n=p[1],j=p[2],h=q[0],o=q[1],k=q[2]),isNaN(g)||isNaN(h)?isNaN(g)?isNaN(h)?f=Number.NaN:(f=h,1!==j&&0!==j||"hsv"===d||(m=o)):(f=g,1!==k&&0!==k||"hsv"===d||(m=n)):(e=h>g&&h-g>180?h-(g+360):h180?h+360-g:h-g,f=g+c*e),null==m&&(m=n+c*(o-n)),i=j+c*(k-j),l=s[d](f,m,i)},k=k.concat(function(){var a,b,c,d;for(c=["hsv","hsl","hsi","hcl","lch"],d=[],b=0,a=c.length;b=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R), -a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)), -void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" \ No newline at end of file diff --git a/src/lasso/plotting/resources/three.min.js b/src/lasso/plotting/resources/three.min.js deleted file mode 100644 index de0aac0..0000000 --- a/src/lasso/plotting/resources/three.min.js +++ /dev/null @@ -1,861 +0,0 @@ -// threejs.org/license -(function(l,oa){"object"===typeof exports&&"undefined"!==typeof module?oa(exports):"function"===typeof define&&define.amd?define(["exports"],oa):oa(l.THREE=l.THREE||{})})(this,function(l){function oa(){}function C(a,b){this.x=a||0;this.y=b||0}function ea(a,b,c,d,e,f,g,h,k,m){Object.defineProperty(this,"id",{value:Oe++});this.uuid=Q.generateUUID();this.name="";this.image=void 0!==a?a:ea.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:ea.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:1001;this.wrapT= -void 0!==d?d:1001;this.magFilter=void 0!==e?e:1006;this.minFilter=void 0!==f?f:1008;this.anisotropy=void 0!==k?k:1;this.format=void 0!==g?g:1023;this.type=void 0!==h?h:1009;this.offset=new C(0,0);this.repeat=new C(1,1);this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==m?m:3E3;this.version=0;this.onUpdate=null}function ga(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}function Db(a,b,c){this.uuid=Q.generateUUID();this.width= -a;this.height=b;this.scissor=new ga(0,0,a,b);this.scissorTest=!1;this.viewport=new ga(0,0,a,b);c=c||{};void 0===c.minFilter&&(c.minFilter=1006);this.texture=new ea(void 0,void 0,c.wrapS,c.wrapT,c.magFilter,c.minFilter,c.format,c.type,c.anisotropy,c.encoding);this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.depthTexture=void 0!==c.depthTexture?c.depthTexture:null}function Eb(a,b,c){Db.call(this,a,b,c);this.activeMipMapLevel= -this.activeCubeFace=0}function da(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function q(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}function H(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0= -d||0 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); -z.compileShader(P);z.compileShader(R);z.attachShader(O,P);z.attachShader(O,R);z.linkProgram(O);K=O;t=z.getAttribLocation(K,"position");v=z.getAttribLocation(K,"uv");c=z.getUniformLocation(K,"uvOffset");d=z.getUniformLocation(K,"uvScale");e=z.getUniformLocation(K,"rotation");f=z.getUniformLocation(K,"scale");g=z.getUniformLocation(K,"color");h=z.getUniformLocation(K,"map");k=z.getUniformLocation(K,"opacity");m=z.getUniformLocation(K,"modelViewMatrix");x=z.getUniformLocation(K,"projectionMatrix");p= -z.getUniformLocation(K,"fogType");n=z.getUniformLocation(K,"fogDensity");r=z.getUniformLocation(K,"fogNear");w=z.getUniformLocation(K,"fogFar");l=z.getUniformLocation(K,"fogColor");F=z.getUniformLocation(K,"alphaTest");O=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");O.width=8;O.height=8;P=O.getContext("2d");P.fillStyle="white";P.fillRect(0,0,8,8);la=new ea(O);la.needsUpdate=!0}z.useProgram(K);A.initAttributes();A.enableAttribute(t);A.enableAttribute(v);A.disableUnusedAttributes(); -A.disable(z.CULL_FACE);A.enable(z.BLEND);z.bindBuffer(z.ARRAY_BUFFER,I);z.vertexAttribPointer(t,2,z.FLOAT,!1,16,0);z.vertexAttribPointer(v,2,z.FLOAT,!1,16,8);z.bindBuffer(z.ELEMENT_ARRAY_BUFFER,E);z.uniformMatrix4fv(x,!1,Na.projectionMatrix.elements);A.activeTexture(z.TEXTURE0);z.uniform1i(h,0);P=O=0;(R=q.fog)?(z.uniform3f(l,R.color.r,R.color.g,R.color.b),R.isFog?(z.uniform1f(r,R.near),z.uniform1f(w,R.far),z.uniform1i(p,1),P=O=1):R.isFogExp2&&(z.uniform1f(n,R.density),z.uniform1i(p,2),P=O=2)):(z.uniform1i(p, -0),P=O=0);for(var R=0,T=b.length;R/g,function(a,c){var d=Z[c];if(void 0===d)throw Error("Can not resolve #include <"+c+">");return Md(d)})}function De(a){return a.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(a,c,d,e){a="";for(c=parseInt(c);c< -parseInt(d);c++)a+=e.replace(/\[ i \]/g,"[ "+c+" ]");return a})}function zf(a,b,c,d){var e=a.context,f=c.extensions,g=c.defines,h=c.__webglShader.vertexShader,k=c.__webglShader.fragmentShader,m="SHADOWMAP_TYPE_BASIC";1===d.shadowMapType?m="SHADOWMAP_TYPE_PCF":2===d.shadowMapType&&(m="SHADOWMAP_TYPE_PCF_SOFT");var x="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",n="ENVMAP_BLENDING_MULTIPLY";if(d.envMap){switch(c.envMap.mapping){case 301:case 302:x="ENVMAP_TYPE_CUBE";break;case 306:case 307:x="ENVMAP_TYPE_CUBE_UV"; -break;case 303:case 304:x="ENVMAP_TYPE_EQUIREC";break;case 305:x="ENVMAP_TYPE_SPHERE"}switch(c.envMap.mapping){case 302:case 304:p="ENVMAP_MODE_REFRACTION"}switch(c.combine){case 0:n="ENVMAP_BLENDING_MULTIPLY";break;case 1:n="ENVMAP_BLENDING_MIX";break;case 2:n="ENVMAP_BLENDING_ADD"}}var r=0b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+ -a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function k(a){return Q.isPowerOfTwo(a.width)&&Q.isPowerOfTwo(a.height)}function m(b){return 1003===b||1004===b||1005===b?a.NEAREST:a.LINEAR}function x(b){b=b.target;b.removeEventListener("dispose",x);a:{var c=d.get(b);if(b.image&&c.__image__webglTextureCube)a.deleteTexture(c.__image__webglTextureCube);else{if(void 0===c.__webglInit)break a;a.deleteTexture(c.__webglTexture)}d["delete"](b)}q.textures--}function p(b){b=b.target; -b.removeEventListener("dispose",p);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d["delete"](b.texture);d["delete"](b)}q.textures--}function n(b, -g){var m=d.get(b);if(0w;w++)l[w]=n||p?p?b.image[w].image:b.image[w]:h(b.image[w],e.maxCubemapSize);var u=k(l[0]),t=f(b.format),ca=f(b.type);r(a.TEXTURE_CUBE_MAP,b,u);for(w=0;6>w;w++)if(n)for(var y,C=l[w].mipmaps,D=0,O=C.length;Dm;m++)e.__webglFramebuffer[m]=a.createFramebuffer()}else e.__webglFramebuffer= -a.createFramebuffer();if(g){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);r(a.TEXTURE_CUBE_MAP,b.texture,h);for(m=0;6>m;m++)l(e.__webglFramebuffer[m],b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+m);b.texture.generateMipmaps&&h&&a.generateMipmap(a.TEXTURE_CUBE_MAP);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),r(a.TEXTURE_2D,b.texture,h),l(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),b.texture.generateMipmaps&&h&&a.generateMipmap(a.TEXTURE_2D), -c.bindTexture(a.TEXTURE_2D,null);if(b.depthBuffer){e=d.get(b);f=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(f)throw Error("target.depthTexture not supported in Cube render targets");if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported!");a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&& -b.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);n(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,e,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,e,0);else throw Error("Unknown depthTexture format"); -}else if(f)for(e.__webglDepthbuffer=[],f=0;6>f;f++)a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[f]),e.__webglDepthbuffer[f]=a.createRenderbuffer(),u(e.__webglDepthbuffer[f],b);else a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),u(e.__webglDepthbuffer,b);a.bindFramebuffer(a.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(b){var e=b.texture;e.generateMipmaps&&k(b)&&1003!==e.minFilter&&1006!==e.minFilter&&(b=b&&b.isWebGLRenderTargetCube? -a.TEXTURE_CUBE_MAP:a.TEXTURE_2D,e=d.get(e).__webglTexture,c.bindTexture(b,e),a.generateMipmap(b),c.bindTexture(b,null))}}function Ff(){var a={};return{get:function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c},"delete":function(b){delete a[b.uuid]},clear:function(){a={}}}}function Gf(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(b=0;b=ma.maxTextures&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ma.maxTextures);ea+=1;return a};this.setTexture2D=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTarget&& -(a||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);va.setTexture2D(b,c)}}();this.setTexture=function(){var a=!1;return function(b,c){a||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),a=!0);va.setTexture2D(b,c)}}();this.setTextureCube=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTargetCube&&(a||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."), -a=!0),b=b.texture);b&&b.isCubeTexture||Array.isArray(b.image)&&6===b.image.length?va.setTextureCube(b,c):va.setTextureCubeDynamic(b,c)}}();this.getCurrentRenderTarget=function(){return V};this.setRenderTarget=function(a){(V=a)&&void 0===ha.get(a).__webglFramebuffer&&va.setupRenderTarget(a);var b=a&&a.isWebGLRenderTargetCube,c;a?(c=ha.get(a),c=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,X.copy(a.scissor),Ta=a.scissorTest,Z.copy(a.viewport)):(c=null,X.copy(fa).multiplyScalar(Sa),Ta= -ka,Z.copy(ia).multiplyScalar(Sa));S!==c&&(B.bindFramebuffer(B.FRAMEBUFFER,c),S=c);Y.scissor(X);Y.setScissorTest(Ta);Y.viewport(Z);b&&(b=ha.get(a.texture),B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,b.__webglTexture,a.activeMipMapLevel))};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!1===(a&&a.isWebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var g=ha.get(a).__webglFramebuffer; -if(g){var h=!1;g!==S&&(B.bindFramebuffer(B.FRAMEBUFFER,g),h=!0);try{var k=a.texture,m=k.format,n=k.type;1023!==m&&t(m)!==B.getParameter(B.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===n||t(n)===B.getParameter(B.IMPLEMENTATION_COLOR_READ_TYPE)||1015===n&&(ja.get("OES_texture_float")||ja.get("WEBGL_color_buffer_float"))||1016===n&&ja.get("EXT_color_buffer_half_float")?B.checkFramebufferStatus(B.FRAMEBUFFER)=== -B.FRAMEBUFFER_COMPLETE?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&B.readPixels(b,c,d,e,t(m),t(n),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&B.bindFramebuffer(B.FRAMEBUFFER,S)}}}}}function Ib(a,b){this.name="";this.color=new N(a);this.density=void 0!==b?b:2.5E-4}function Jb(a, -b,c){this.name="";this.color=new N(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3}function jb(){G.call(this);this.type="Scene";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function Od(a,b,c,d,e){G.call(this);this.lensFlares=[];this.positionScreen=new q;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)}function kb(a){W.call(this);this.type="SpriteMaterial";this.color=new N(16777215);this.map=null;this.rotation=0;this.lights=this.fog=!1;this.setValues(a)} -function zc(a){G.call(this);this.type="Sprite";this.material=void 0!==a?a:new kb}function Ac(){G.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function hd(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new H;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=Q.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth* -this.boneTextureHeight*4),this.boneTexture=new db(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,1023,1015)):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b=a.HAVE_CURRENT_DATA&&(x.needsUpdate=!0)}ea.call(this,a,b,c,d,e,f,g,h,k);this.generateMipmaps=!1;var x=this;m()}function Lb(a,b,c,d,e,f,g,h,k,m,x,p){ea.call(this,null,f,g,h,k,m,d,e,x,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function ld(a,b,c,d,e,f,g,h,k){ea.call(this,a,b,c,d,e,f,g,h,k);this.needsUpdate=!0}function Cc(a,b,c,d,e,f,g,h,k,m){m=void 0!==m?m:1026;if(1026!==m&&1027!== -m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);ea.call(this,null,d,e,f,g,h,m,c,k);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=this.flipY=!1}function Mb(a){function b(a,b){return a-b}D.call(this);var c=[0,0],d={},e=["a","b","c"];if(a&&a.isGeometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var m= -g.length;ap;p++){c[0]=x[e[p]];c[1]=x[e[(p+1)%3]];c.sort(b);var n=c.toString();void 0===d[n]&&(k[2*h]=c[0],k[2*h+1]=c[1],d[n]=!0,h++)}c=new Float32Array(6*h);a=0;for(m=h;ap;p++)d=f[k[2*a+p]],h=6*a+3*p,c[h+0]=d.x,c[h+1]=d.y,c[h+2]=d.z;this.addAttribute("position",new y(c,3))}else if(a&&a.isBufferGeometry){if(null!==a.index){m=a.index.array;f=a.attributes.position;e=a.groups;h=0;0===e.length&&a.addGroup(0,m.length);k=new Uint32Array(2*m.length);g=0;for(x= -e.length;gp;p++)c[0]=m[a+p],c[1]=m[a+(p+1)%3],c.sort(b),n=c.toString(),void 0===d[n]&&(k[2*h]=c[0],k[2*h+1]=c[1],d[n]=!0,h++)}c=new Float32Array(6*h);a=0;for(m=h;ap;p++)h=6*a+3*p,d=k[2*a+p],c[h+0]=f.getX(d),c[h+1]=f.getY(d),c[h+2]=f.getZ(d)}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,c=new Float32Array(6*h),a=0,m=k;ap;p++)h=18*a+6*p,k=9*a+3*p,c[h+0]=f[k],c[h+1]=f[k+1],c[h+2]=f[k+ -2],d=9*a+(p+1)%3*3,c[h+3]=f[d],c[h+4]=f[d+1],c[h+5]=f[d+2];this.addAttribute("position",new y(c,3))}}function Nb(a,b,c){D.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f,g,h,k,m,x=b+1;for(f=0;f<=c;f++)for(m=f/c,g=0;g<=b;g++)k=g/b,h=a(k,m),d.push(h.x,h.y,h.z),e.push(k,m);a=[];var p;for(f=0;fd&&1===a.x&&(k[b]=a.x-1);0===c.x&&0===c.z&&(k[b]=d/2/Math.PI+.5)}D.call(this);this.type="PolyhedronBufferGeometry";this.parameters= -{vertices:a,indices:b,radius:c,detail:d};c=c||1;var h=[],k=[];(function(a){for(var c=new q,d=new q,g=new q,h=0;he&&(.2>b&&(k[a+0]+=1),.2>c&&(k[a+2]+=1),.2>d&&(k[a+4]+=1))})();this.addAttribute("position",new X(h,3));this.addAttribute("normal",new X(h.slice(),3));this.addAttribute("uv",new X(k,2));this.normalizeNormals();this.boundingSphere= -new Fa(new q,c)}function Ob(a,b){xa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Ec(a,b){S.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Ob(a,b));this.mergeVertices()}function lb(a,b){xa.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry"; -this.parameters={radius:a,detail:b}}function Fc(a,b){S.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new lb(a,b));this.mergeVertices()}function Pb(a,b){var c=(1+Math.sqrt(5))/2;xa.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry"; -this.parameters={radius:a,detail:b}}function Gc(a,b){S.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Pb(a,b));this.mergeVertices()}function Qb(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;xa.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18, -0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Hc(a,b){S.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Qb(a,b));this.mergeVertices()}function Ic(a,b,c,d){S.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b, -radius:c,detail:d};this.fromBufferGeometry(new xa(a,b,c,d));this.mergeVertices()}function Rb(a,b,c,d,e){function f(e){var f=a.getPointAt(e/b),m=g.normals[e];e=g.binormals[e];for(p=0;p<=d;p++){var x=p/d*Math.PI*2,l=Math.sin(x),x=-Math.cos(x);k.x=x*m.x+l*e.x;k.y=x*m.y+l*e.y;k.z=x*m.z+l*e.z;k.normalize();r.push(k.x,k.y,k.z);h.x=f.x+c*k.x;h.y=f.y+c*k.y;h.z=f.z+c*k.z;n.push(h.x,h.y,h.z)}}D.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e}; -b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new q,k=new q,m=new C,x,p,n=[],r=[],l=[],u=[];for(x=0;xn;n++){e[0]=p[g[n]];e[1]=p[g[(n+1)%3]];e.sort(c);var r=e.toString();void 0===f[r]?f[r]={vert1:e[0],vert2:e[1],face1:m,face2:void 0}:f[r].face2=m}e=[];for(r in f)if(g=f[r],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=d)m=k[g.vert1],e.push(m.x),e.push(m.y),e.push(m.z),m=k[g.vert2],e.push(m.x),e.push(m.y),e.push(m.z);this.addAttribute("position",new X(e,3))}function Wa(a,b,c,d,e,f,g,h){function k(c){var e,f,k,n=new C,p=new q,l=0,x=!0=== -c?a:b,M=!0===c?1:-1;f=t;for(e=1;e<=d;e++)w.setXYZ(t,0,z*M,0),u.setXYZ(t,0,M,0),n.x=.5,n.y=.5,F.setXY(t,n.x,n.y),t++;k=t;for(e=0;e<=d;e++){var y=e/d*h+g,D=Math.cos(y),y=Math.sin(y);p.x=x*y;p.y=z*M;p.z=x*D;w.setXYZ(t,p.x,p.y,p.z);u.setXYZ(t,0,M,0);n.x=.5*D+.5;n.y=.5*y*M+.5;F.setXY(t,n.x,n.y);t++}for(e=0;ethis.duration&&this.resetDuration();this.optimize()}function Ad(a){this.manager= -void 0!==a?a:va;this.textures={}}function Sd(a){this.manager=void 0!==a?a:va}function wb(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}}function Td(a){"boolean"===typeof a&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),a=void 0);this.manager=void 0!==a?a:va;this.withCredentials=!1}function Fe(a){this.manager=void 0!==a?a:va;this.texturePath=""}function wa(){}function Qa(a,b){this.v1=a;this.v2=b}function Yc(){this.curves= -[];this.autoClose=!1}function Xa(a,b,c,d,e,f,g,h){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g;this.aRotation=h||0}function xb(a){this.points=void 0===a?[]:a}function yb(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d}function zb(a,b,c){this.v0=a;this.v1=b;this.v2=c}function Ab(){Zc.apply(this,arguments);this.holes=[]}function Zc(a){Yc.call(this);this.currentPoint=new C;a&&this.fromPoints(a)}function Ud(){this.subPaths=[];this.currentPath= -null}function Vd(a){this.data=a}function Ge(a){this.manager=void 0!==a?a:va}function Wd(a){this.manager=void 0!==a?a:va}function Xd(a,b,c,d){na.call(this,a,b);this.type="RectAreaLight";this.position.set(0,1,0);this.updateMatrix();this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function He(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new Ha;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new Ha;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate= -!1}function Bd(a,b,c){G.call(this);this.type="CubeCamera";var d=new Ha(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new q(1,0,0));this.add(d);var e=new Ha(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new q(-1,0,0));this.add(e);var f=new Ha(90,1,a,b);f.up.set(0,0,1);f.lookAt(new q(0,1,0));this.add(f);var g=new Ha(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new q(0,-1,0));this.add(g);var h=new Ha(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new q(0,0,1));this.add(h);var k=new Ha(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new q(0,0,-1));this.add(k); -this.renderTarget=new Eb(c,c,{format:1022,magFilter:1006,minFilter:1006});this.updateCubeMap=function(a,b){null===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,n=c.texture.generateMipmaps;c.texture.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.texture.generateMipmaps=n;c.activeCubeFace=5;a.render(b,k,c);a.setRenderTarget(null)}}function Yd(){G.call(this); -this.type="AudioListener";this.context=Zd.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null}function ec(a){G.call(this);this.type="Audio";this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.loop=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function $d(a){ec.call(this,a);this.panner= -this.context.createPanner();this.panner.connect(this.gain)}function ae(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Cd(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b=this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount= -this.useCount=this.cumulativeWeight=0}function ka(a,b,c){this.path=b;this.parsedPath=c||ka.parseTrackName(b);this.node=ka.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function be(a){this.uuid=Q.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;var b={};this._indicesByUUID=b;for(var c=0,d=arguments.length;c!==d;++c)b[arguments[c].uuid]=c;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var e=this;this.stats={objects:{get total(){return e._objects.length}, -get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}function ce(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400,endingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop= -2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function de(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Dd(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Bb(){D.call(this); -this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function ee(a,b,c,d){this.uuid=Q.generateUUID();this.data=a;this.itemSize=b;this.offset=c;this.normalized=!0===d}function fc(a,b){this.uuid=Q.generateUUID();this.array=a;this.stride=b;this.count=void 0!==a?a.length/b:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.onUploadCallback=function(){};this.version=0}function gc(a,b,c){fc.call(this,a,b);this.meshPerAttribute=c||1}function hc(a,b,c){y.call(this,a,b);this.meshPerAttribute= -c||1}function fe(a,b,c,d){this.ray=new bb(a,b);this.near=c||0;this.far=d||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})}function Ie(a,b){return a.distance-b.distance}function ge(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e=a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute("position",new X(b,3));b=new ia({fog:!1});this.cone=new fa(a,b);this.add(this.cone);this.update()}function jc(a){this.bones=this.getBoneList(a);for(var b=new D,c=[],d=[],e=new N(0,0,1),f=new N(0,1,0),g=0;ga?-1:0e;e++)8===e||13===e||18===e||23===e?b[e]="-":14===e?b[e]="4": -(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19===e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+ -10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*Q.DEG2RAD},radToDeg:function(a){return a*Q.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nearestPowerOfTwo:function(a){return Math.pow(2,Math.round(Math.log(a)/Math.LN2))},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};C.prototype={constructor:C, -isVector2:!0,get width(){return this.x},set width(a){this.x=a},get height(){return this.y},set height(a){this.y=a},set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y; -default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a, -b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){isFinite(a)?(this.x*=a,this.y*=a):this.y=this.x=0; -return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new C,b=new C);a.set(c, -c);b.set(d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.multiplyScalar(Math.max(a,Math.min(b,c))/c)},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y); -return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))}, -distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},distanceToManhattan:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.multiplyScalar(a/this.length())},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+ -1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute().");this.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=this.x-a.x,f=this.y-a.y;this.x=e*c-f*d+a.x;this.y=e*d+f*c+a.y;return this}};var Oe=0;ea.DEFAULT_IMAGE=void 0;ea.DEFAULT_MAPPING=300;ea.prototype={constructor:ea,isTexture:!0, -set needsUpdate(a){!0===a&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.image=a.image;this.mipmaps=a.mipmaps.slice(0);this.mapping=a.mapping;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.format=a.format;this.type=a.type;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.generateMipmaps=a.generateMipmaps;this.premultiplyAlpha=a.premultiplyAlpha;this.flipY=a.flipY; -this.unpackAlignment=a.unpackAlignment;this.encoding=a.encoding;return this},toJSON:function(a){if(void 0!==a.textures[this.uuid])return a.textures[this.uuid];var b={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var c= -this.image;void 0===c.uuid&&(c.uuid=Q.generateUUID());if(void 0===a.images[c.uuid]){var d=a.images,e=c.uuid,f=c.uuid,g;void 0!==c.toDataURL?g=c:(g=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),g.width=c.width,g.height=c.height,g.getContext("2d").drawImage(c,0,0,c.width,c.height));g=2048a.x||1a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y)}}};Object.assign(ea.prototype, -oa.prototype);ga.prototype={constructor:ga,isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+ -a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a, -b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-= -a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){isFinite(a)?(this.x*=a,this.y*=a,this.z*=a,this.w*=a):this.w=this.z=this.y=this.x=0;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z= -a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var m=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01> -Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+m-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;m=(m+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>m?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>m?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),b=d/c,d=k/c):.01>m?(c=b=.707106781,d=0):(d=Math.sqrt(m),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/ -a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+m-1)/2);return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z)); -this.w=Math.max(a.w,Math.min(b.w,this.w));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new ga,b=new ga);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x); -this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x* -this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.multiplyScalar(a/this.length())},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a, -b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector4: offset has been removed from .fromAttribute().");this.x=a.getX(b); -this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}};Object.assign(Db.prototype,oa.prototype,{isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer= -a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Eb.prototype=Object.create(Db.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isWebGLRenderTargetCube=!0;da.prototype={constructor:da,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get w(){return this._w},set w(a){this._w= -a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!1===(a&&a.isEuler))throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=Math.cos(a._x/2),d=Math.cos(a._y/ -2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2),k=a.order;"XYZ"===k?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"YXZ"===k?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"ZXY"===k?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"ZYX"===k?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"YZX"===k?(this._x=f*d*e+c*g*h,this._y=c*g*e+ -f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):"XZY"===k&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],m=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new q);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y, -c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;return this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+ -this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a, -b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,m=b._w;this._x=c*m+f*g+d*k-e*h;this._y=d*m+f*h+e*g-c*k;this._z=e*m+f*k+c*h-d*g;this._w=f*m-c*g-d*h-e*k;this.onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.sqrt(1-g*g); -if(.001>Math.abs(h))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;var k=Math.atan2(h,g),g=Math.sin((1-b)*k)/h,h=Math.sin(b*k)/h;this._w=f*g+this._w*h;this._x=c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3]; -this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}};Object.assign(da,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],k=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var l=e[f+1],p=e[f+2];e=e[f+3];if(c!==e||h!==d||k!==l||m!==p){f=1-g;var n=h*d+k*l+m*p+c*e,r=0<= -n?1:-1,w=1-n*n;w>Number.EPSILON&&(w=Math.sqrt(w),n=Math.atan2(w,n*r),f=Math.sin(f*n)/w,g=Math.sin(g*n)/w);r*=g;h=h*f+d*r;k=k*f+l*r;m=m*f+p*r;c=c*f+e*r;f===1-g&&(g=1/Math.sqrt(h*h+k*k+m*m+c*c),h*=g,k*=g,m*=g,c*=g)}a[b]=h;a[b+1]=k;a[b+2]=m;a[b+3]=c}});q.prototype={constructor:q,isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setScalar:function(a){this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z= -a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), -this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z; -return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){isFinite(a)?(this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},multiplyVectors:function(a, -b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===(b&&b.isEuler)&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new da);return this.applyQuaternion(a.setFromEuler(b))}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new da);return this.applyQuaternion(a.setFromAxisAngle(b,c))}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z; -a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]* -c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,m=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-m*-f;this.y=k*a+b*-f+m*-e-h*-g;this.z=m*a+b*-g+h*-f-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new H);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0===a&&(a=new H); -a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z, -a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new q,b=new q);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.multiplyScalar(Math.max(a, -Math.min(b,c))/c)},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z): -Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.multiplyScalar(a/ -this.length())},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c= -a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this},projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new q);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0===a&&(a=new q);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()* -a.lengthSq());return Math.acos(Q.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},distanceToManhattan:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)},setFromSpherical:function(a){var b=Math.sin(a.phi)*a.radius;this.x=b*Math.sin(a.theta);this.y=Math.cos(a.phi)*a.radius;this.z=b*Math.cos(a.theta);return this},setFromCylindrical:function(a){this.x= -a.radius*Math.sin(a.theta);this.y=a.y;this.z=a.radius*Math.cos(a.theta);return this},setFromMatrixPosition:function(a){return this.setFromMatrixColumn(a,3)},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a,0).length(),c=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){if("number"===typeof a){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var c= -a;a=b;b=c}return this.fromArray(a.elements,4*b)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}}; -H.prototype={constructor:H,isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,k,m,l,p,n,r,w,u){var q=this.elements;q[0]=a;q[4]=b;q[8]=c;q[12]=d;q[1]=e;q[5]=f;q[9]=g;q[13]=h;q[2]=k;q[6]=m;q[10]=l;q[14]=p;q[3]=n;q[7]=r;q[11]=w;q[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new H).fromArray(this.elements)},copy:function(a){this.elements.set(a.elements);return this},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]= -a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a;return function(b){void 0===a&&(a=new q);var c=this.elements,d=b.elements,e=1/a.setFromMatrixColumn(b,0).length(),f=1/a.setFromMatrixColumn(b,1).length();b=1/a.setFromMatrixColumn(b,2).length();c[0]=d[0]*e; -c[1]=d[1]*e;c[2]=d[2]*e;c[4]=d[4]*f;c[5]=d[5]*f;c[6]=d[6]*f;c[8]=d[8]*b;c[9]=d[9]*b;c[10]=d[10]*b;return this}}(),makeRotationFromEuler:function(a){!1===(a&&a.isEuler)&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=f*h;var k=f*e,m=c*h,l=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+m*d;b[5]=a- -l*d;b[9]=-c*g;b[2]=l-a*d;b[6]=m+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,m=d*h,l=d*e,b[0]=a+l*c,b[4]=m*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-m,b[6]=l+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,m=d*h,l=d*e,b[0]=a-l*c,b[4]=-f*e,b[8]=m+k*c,b[1]=k+m*c,b[5]=f*h,b[9]=l-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,m=c*h,l=c*e,b[0]=g*h,b[4]=m*d-k,b[8]=a*d+l,b[1]=g*e,b[5]=l*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,m=c*g,l=c*d,b[0]=g*h,b[4]=l- -a*e,b[8]=m*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-l*e):"XZY"===a.order&&(a=f*g,k=f*d,m=c*g,l=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+l,b[5]=f*h,b[9]=k*e-m,b[2]=m*e-k,b[6]=c*h,b[10]=l*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var m=c*h,c=c*k,l=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(l+e);b[4]=m-f;b[8]=c+h;b[1]=m+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c- -h;b[6]=d+g;b[10]=1-(a+l);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,f){void 0===a&&(a=new q,b=new q,c=new q);var g=this.elements;c.subVectors(d,e).normalize();0===c.lengthSq()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.lengthSq()&&(c.z+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!== -b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],m=c[1],l=c[5],p=c[9],n=c[13],r=c[2],w=c[6],u=c[10],q=c[14],t=c[3],v=c[7],M=c[11],c=c[15],z=d[0],A=d[4],I=d[8],E=d[12],K=d[1],y=d[5],J=d[9],C=d[13],D=d[2],G=d[6], -H=d[10],O=d[14],P=d[3],R=d[7],T=d[11],d=d[15];e[0]=f*z+g*K+h*D+k*P;e[4]=f*A+g*y+h*G+k*R;e[8]=f*I+g*J+h*H+k*T;e[12]=f*E+g*C+h*O+k*d;e[1]=m*z+l*K+p*D+n*P;e[5]=m*A+l*y+p*G+n*R;e[9]=m*I+l*J+p*H+n*T;e[13]=m*E+l*C+p*O+n*d;e[2]=r*z+w*K+u*D+q*P;e[6]=r*A+w*y+u*G+q*R;e[10]=r*I+w*J+u*H+q*T;e[14]=r*E+w*C+u*O+q*d;e[3]=t*z+v*K+M*D+c*P;e[7]=t*A+v*y+M*G+c*R;e[11]=t*I+v*J+M*H+c*T;e[15]=t*E+v*C+M*O+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]= -d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new q);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;ethis.determinant()&&(g=-g);c.x= -f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,m=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]= -0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(Q.DEG2RAD*a*.5);var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),k=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*k;g[9]=0;g[13]=-((c+d)*k);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0}, -fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}};Za.prototype=Object.create(ea.prototype);Za.prototype.constructor=Za;Za.prototype.isCubeTexture=!0;Object.defineProperty(Za.prototype, -"images",{get:function(){return this.image},set:function(a){this.image=a}});var se=new ea,te=new Za,pe=[],re=[];xe.prototype.setValue=function(a,b){for(var c=this.seq,d=0,e=c.length;d!==e;++d){var f=c[d];f.setValue(a,b[f.id])}};var Id=/([\w\d_]+)(\])?(\[|\.)?/g;$a.prototype.setValue=function(a,b,c){b=this.map[b];void 0!==b&&b.setValue(a,c,this.renderer)};$a.prototype.set=function(a,b,c){var d=this.map[c];void 0!==d&&d.setValue(a,b[c],this.renderer)};$a.prototype.setOptional=function(a,b,c){b=b[c]; -void 0!==b&&this.setValue(a,c,b)};$a.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};$a.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in b&&c.push(f)}return c};var Ja={merge:function(a){for(var b={},c=0;c 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 ltcTextureCoords( const in GeometricContext geometry, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = (LUT_SIZE - 1.0)/LUT_SIZE;\n\tconst float LUT_BIAS = 0.5/LUT_SIZE;\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nvoid clipQuadToHorizon( inout vec3 L[5], out int n ) {\n\tint config = 0;\n\tif ( L[0].z > 0.0 ) config += 1;\n\tif ( L[1].z > 0.0 ) config += 2;\n\tif ( L[2].z > 0.0 ) config += 4;\n\tif ( L[3].z > 0.0 ) config += 8;\n\tn = 0;\n\tif ( config == 0 ) {\n\t} else if ( config == 1 ) {\n\t\tn = 3;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 2 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 3 ) {\n\t\tn = 4;\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t\tL[3] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 4 ) {\n\t\tn = 3;\n\t\tL[0] = -L[3].z * L[2] + L[2].z * L[3];\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t} else if ( config == 5 ) {\n\t\tn = 0;\n\t} else if ( config == 6 ) {\n\t\tn = 4;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 7 ) {\n\t\tn = 5;\n\t\tL[4] = -L[3].z * L[0] + L[0].z * L[3];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 8 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[1] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = L[3];\n\t} else if ( config == 9 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[2].z * L[3] + L[3].z * L[2];\n\t} else if ( config == 10 ) {\n\t\tn = 0;\n\t} else if ( config == 11 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 12 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t} else if ( config == 13 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = L[2];\n\t\tL[2] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t} else if ( config == 14 ) {\n\t\tn = 5;\n\t\tL[4] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t} else if ( config == 15 ) {\n\t\tn = 4;\n\t}\n\tif ( n == 3 )\n\t\tL[3] = L[0];\n\tif ( n == 4 )\n\t\tL[4] = L[0];\n}\nfloat integrateLtcBrdfOverRectEdge( vec3 v1, vec3 v2 ) {\n\tfloat cosTheta = dot( v1, v2 );\n\tfloat theta = acos( cosTheta );\n\tfloat res = cross( v1, v2 ).z * ( ( theta > 0.001 ) ? theta / sin( theta ) : 1.0 );\n\treturn res;\n}\nvoid initRectPoints( const in vec3 pos, const in vec3 halfWidth, const in vec3 halfHeight, out vec3 rectPoints[4] ) {\n\trectPoints[0] = pos - halfWidth - halfHeight;\n\trectPoints[1] = pos + halfWidth - halfHeight;\n\trectPoints[2] = pos + halfWidth + halfHeight;\n\trectPoints[3] = pos - halfWidth + halfHeight;\n}\nvec3 integrateLtcBrdfOverRect( const in GeometricContext geometry, const in mat3 brdfMat, const in vec3 rectPoints[4] ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot( V, N ));\n\tT2 = - cross( N, T1 );\n\tmat3 brdfWrtSurface = brdfMat * transpose( mat3( T1, T2, N ) );\n\tvec3 clippedRect[5];\n\tclippedRect[0] = brdfWrtSurface * ( rectPoints[0] - P );\n\tclippedRect[1] = brdfWrtSurface * ( rectPoints[1] - P );\n\tclippedRect[2] = brdfWrtSurface * ( rectPoints[2] - P );\n\tclippedRect[3] = brdfWrtSurface * ( rectPoints[3] - P );\n\tint n;\n\tclipQuadToHorizon(clippedRect, n);\n\tif ( n == 0 )\n\t\treturn vec3( 0, 0, 0 );\n\tclippedRect[0] = normalize( clippedRect[0] );\n\tclippedRect[1] = normalize( clippedRect[1] );\n\tclippedRect[2] = normalize( clippedRect[2] );\n\tclippedRect[3] = normalize( clippedRect[3] );\n\tclippedRect[4] = normalize( clippedRect[4] );\n\tfloat sum = 0.0;\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[0], clippedRect[1] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[1], clippedRect[2] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[2], clippedRect[3] );\n\tif (n >= 4)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[3], clippedRect[4] );\n\tif (n == 5)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[4], clippedRect[0] );\n\tsum = max( 0.0, sum );\n\tvec3 Lo_i = vec3( sum, sum, sum );\n\treturn Lo_i;\n}\nvec3 Rect_Area_Light_Specular_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight,\n\t\tconst in float roughness,\n\t\tconst in sampler2D ltcMat, const in sampler2D ltcMag ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tvec2 uv = ltcTextureCoords( geometry, roughness );\n\tvec4 brdfLtcApproxParams, t;\n\tbrdfLtcApproxParams = texture2D( ltcMat, uv );\n\tt = texture2D( ltcMat, uv );\n\tfloat brdfLtcScalar = texture2D( ltcMag, uv ).a;\n\tmat3 brdfLtcApproxMat = mat3(\n\t\tvec3( 1, 0, t.y ),\n\t\tvec3( 0, t.z, 0 ),\n\t\tvec3( t.w, 0, t.x )\n\t);\n\tvec3 specularReflectance = integrateLtcBrdfOverRect( geometry, brdfLtcApproxMat, rectPoints );\n\tspecularReflectance *= brdfLtcScalar;\n\treturn specularReflectance;\n}\nvec3 Rect_Area_Light_Diffuse_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tmat3 diffuseBrdfMat = mat3(1);\n\tvec3 diffuseReflectance = integrateLtcBrdfOverRect( geometry, diffuseBrdfMat, rectPoints );\n\treturn diffuseReflectance;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n", -bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n", -clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n", -clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n", -color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n", -cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n", -defaultnormal_vertex:"#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n", -emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n", -envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n", -envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n", -envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n", -fog_fragment:"#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif", -gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n", -lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n", -lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n", -lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 matDiffColor = material.diffuseColor;\n vec3 matSpecColor = material.specularColor;\n vec3 lightColor = rectAreaLight.color;\n float roughness = BlinnExponentToGGXRoughness( material.specularShininess );\n vec3 spec = Rect_Area_Light_Specular_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n roughness,\n ltcMat, ltcMag );\n vec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n reflectedLight.directSpecular += lightColor * matSpecColor * spec / PI2;\n reflectedLight.directDiffuse += lightColor * matDiffColor * diff / PI2;\n }\n#endif\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n", -lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n", -lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 matDiffColor = material.diffuseColor;\n vec3 matSpecColor = material.specularColor;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.specularRoughness;\n vec3 spec = Rect_Area_Light_Specular_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n roughness,\n ltcMat, ltcMag );\n vec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n reflectedLight.directSpecular += lightColor * matSpecColor * spec;\n reflectedLight.directDiffuse += lightColor * matDiffColor * diff;\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n", -lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\t\t\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n", -logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n", -map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n", -metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n", -morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n", -normal_flip:"#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n", -normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n", -packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n", -premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n", -roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n #if NUM_RECT_AREA_LIGHTS > 0\n #endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n", -shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n #if NUM_RECT_AREA_LIGHTS > 0\n #endif\n#endif\n", -shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n #if NUM_RECT_AREA_LIGHTS > 0\n #endif\n#endif\n", -shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\t#endif\n\t#endif\n\treturn shadow;\n}\n", -skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n", -skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n", -specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n", -uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n", -uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif", -uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n", -cube_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n", -depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -distanceRGBA_frag:"uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include \n#include \n#include \nvoid main () {\n\t#include \n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",distanceRGBA_vert:"varying vec4 vWorldPosition;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition;\n}\n", -equirect_frag:"uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n", -linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}\n", -meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n}\n", -normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#include \n\t#include \n}\n", -normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n", -points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}\n", -shadow_frag:"uniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n",shadow_vert:"#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"};N.prototype={constructor:N, -isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(){function a(a,c,d){0>d&&(d+=1);1d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b, -c,d){b=Q.euclideanModulo(b,1);c=Q.clamp(c,0,1);d=Q.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r= -Math.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2],10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){var d=parseFloat(c[1])/ -360,e=parseInt(c[2],10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^\#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===d)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}a&&0=h?k/(e+f): -k/(2-e-f);switch(e){case b:g=(c-d)/k+(cthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getParameter:function(a,b){return(b||new C).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y- -this.min.y))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){return(b||new C).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new C;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a); -this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}};var pf=0;W.prototype={constructor:W,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update();this._needsUpdate=a},setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else{var d=this[b];void 0===d?console.warn("THREE."+this.type+": '"+b+"' is not a property of this material."): -d&&d.isColor?d.set(c):d&&d.isVector3&&c&&c.isVector3?d.copy(c):this[b]="overdraw"===b?Number(c):c}}},toJSON:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a;c&&(a={textures:{},images:{}});var d={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};d.uuid=this.uuid;d.type=this.type;""!==this.name&&(d.name=this.name);this.color&&this.color.isColor&&(d.color=this.color.getHex());void 0!==this.roughness&&(d.roughness=this.roughness); -void 0!==this.metalness&&(d.metalness=this.metalness);this.emissive&&this.emissive.isColor&&(d.emissive=this.emissive.getHex());this.specular&&this.specular.isColor&&(d.specular=this.specular.getHex());void 0!==this.shininess&&(d.shininess=this.shininess);void 0!==this.clearCoat&&(d.clearCoat=this.clearCoat);void 0!==this.clearCoatRoughness&&(d.clearCoatRoughness=this.clearCoatRoughness);this.map&&this.map.isTexture&&(d.map=this.map.toJSON(a).uuid);this.alphaMap&&this.alphaMap.isTexture&&(d.alphaMap= -this.alphaMap.toJSON(a).uuid);this.lightMap&&this.lightMap.isTexture&&(d.lightMap=this.lightMap.toJSON(a).uuid);this.bumpMap&&this.bumpMap.isTexture&&(d.bumpMap=this.bumpMap.toJSON(a).uuid,d.bumpScale=this.bumpScale);this.normalMap&&this.normalMap.isTexture&&(d.normalMap=this.normalMap.toJSON(a).uuid,d.normalScale=this.normalScale.toArray());this.displacementMap&&this.displacementMap.isTexture&&(d.displacementMap=this.displacementMap.toJSON(a).uuid,d.displacementScale=this.displacementScale,d.displacementBias= -this.displacementBias);this.roughnessMap&&this.roughnessMap.isTexture&&(d.roughnessMap=this.roughnessMap.toJSON(a).uuid);this.metalnessMap&&this.metalnessMap.isTexture&&(d.metalnessMap=this.metalnessMap.toJSON(a).uuid);this.emissiveMap&&this.emissiveMap.isTexture&&(d.emissiveMap=this.emissiveMap.toJSON(a).uuid);this.specularMap&&this.specularMap.isTexture&&(d.specularMap=this.specularMap.toJSON(a).uuid);this.envMap&&this.envMap.isTexture&&(d.envMap=this.envMap.toJSON(a).uuid,d.reflectivity=this.reflectivity); -this.gradientMap&&this.gradientMap.isTexture&&(d.gradientMap=this.gradientMap.toJSON(a).uuid);void 0!==this.size&&(d.size=this.size);void 0!==this.sizeAttenuation&&(d.sizeAttenuation=this.sizeAttenuation);1!==this.blending&&(d.blending=this.blending);2!==this.shading&&(d.shading=this.shading);0!==this.side&&(d.side=this.side);0!==this.vertexColors&&(d.vertexColors=this.vertexColors);1>this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc; -d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;0e&&(e=m);l>f&&(f=l);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e,f,g)},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,k=a.count;he&&(e=m);l>f&&(f=l);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e,f,g)},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){return(b||new q).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/ -(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectsSphere:function(){var a;return function(b){void 0===a&&(a=new q);this.clampPoint(b.center,a);return a.distanceToSquared(b.center)<=b.radius*b.radius}}(),intersectsPlane:function(a){var b,c;0=a.constant},clampPoint:function(a,b){return(b||new q).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new q;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(), -getBoundingSphere:function(){var a=new q;return function(b){b=b||new Fa;this.getCenter(b.center);b.radius=.5*this.getSize(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new q,new q,new q,new q,new q,new q,new q,new q];return function(b){if(this.isEmpty())return this;a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b); -a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a); -return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}};Fa.prototype={constructor:Fa,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new ya;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).getCenter(d);for(var e=0,f=0,g=b.length;f=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(this.center.dot(a.normal)-a.constant)<=this.radius}, -clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new q;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new ya;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&& -a.radius===this.radius}};za.prototype={constructor:za,isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,k){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9], -a[2],a[6],a[10]);return this},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new q);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;ec;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}};ma.prototype={constructor:ma,set:function(a,b){this.normal.copy(a); -this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new q,b=new q;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal); -this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,b){var c=this.distanceToPoint(a);return(b|| -new q).copy(this.normal).multiplyScalar(c)},intersectLine:function(){var a=new q;return function(b,c){var d=c||new q,e=b.delta(a),f=this.normal.dot(e);if(0===f){if(0===this.distanceToPoint(b.start))return d.copy(b.start)}else return f=-(b.start.dot(this.normal)+this.constant)/f,0>f||1b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],m=c[7],l=c[8],p=c[9],n=c[10],r=c[11],q=c[12],u=c[13],F=c[14],c=c[15]; -b[0].setComponents(f-a,m-g,r-l,c-q).normalize();b[1].setComponents(f+a,m+g,r+l,c+q).normalize();b[2].setComponents(f+d,m+h,r+p,c+u).normalize();b[3].setComponents(f-d,m-h,r-p,c-u).normalize();b[4].setComponents(f-e,m-k,r-n,c-F).normalize();b[5].setComponents(f+e,m+k,r+n,c+F).normalize();return this},intersectsObject:function(){var a=new Fa;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(), -intersectsSprite:function(){var a=new Fa;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}};bb.prototype={constructor:bb,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin); -this.direction.copy(a.direction);return this},at:function(a,b){return(b||new q).copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(){var a=new q;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new q;c.subVectors(a,this.origin);var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)}, -distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new q;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a=new q,b=new q,c=new q;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a); -var h=.5*d.distanceTo(e),k=-this.direction.dot(b),m=c.dot(this.direction),l=-c.dot(b),p=c.lengthSq(),n=Math.abs(1-k*k),r;0=-r?e<=r?(h=1/n,d*=h,e*=h,k=d*(d+k*e+2*m)+e*(k*d+e+2*l)+p):(e=h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+p):(e=-h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+p):e<=-r?(d=Math.max(0,-(-k*h+m)),e=0f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectsSphere:function(a){return this.distanceToPoint(a.center)<= -a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z; -var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!==c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectsBox:function(){var a=new q;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a= -new q,b=new q,c=new q,d=new q;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a); -this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}};cb.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");cb.DefaultOrder="XYZ";cb.prototype={constructor:cb,isEuler:!0,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order}, -set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=Q.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],m=e[9],l=e[2],p=e[6],e=e[10];b=b|| -this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,k)):(this._y=Math.atan2(-l,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-l,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(l,-1,1)),.99999> -Math.abs(l)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-m,k),this._y=Math.atan2(-l,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(p,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-m,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback(); -return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new H);a.makeRotationFromQuaternion(b);return this.setFromRotationMatrix(a,c,d)}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new da;return function(b){a.setFromEuler(this);return this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1]; -this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new q(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}};gd.prototype={constructor:gd,set:function(a){this.mask=1<=b.x+b.y}}();Aa.prototype={constructor:Aa,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)}, -copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new q,b=new q;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a||new q).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return Aa.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new ma).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return Aa.barycoordFromPoint(a, -this.a,this.b,this.c,b)},containsPoint:function(a){return Aa.containsPoint(a,this.a,this.b,this.c)},closestPointToPoint:function(){var a,b,c,d;return function(e,f){void 0===a&&(a=new ma,b=[new gb,new gb,new gb],c=new q,d=new q);var g=f||new q,h=Infinity;a.setFromCoplanarPoints(this.a,this.b,this.c);a.projectPoint(e,c);if(!0===this.containsPoint(c))g.copy(c);else{b[0].set(this.a,this.b);b[1].set(this.b,this.c);b[2].set(this.c,this.a);for(var k=0;kd;d++)if(e[d]===e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;cb.far?null:{distance:c,point:t.clone(),object:a}}function c(c,d,e,f,m,l,p,q){g.fromArray(f,3*l);h.fromArray(f,3*p);k.fromArray(f,3*q);if(c=b(c,d,e,g,h,k,F))m&&(n.fromArray(m,2*l),r.fromArray(m,2*p),w.fromArray(m,2*q),c.uv=a(F,g,h,k,n,r,w)),c.face= -new ha(l,p,q,Aa.normal(g,h,k)),c.faceIndex=l;return c}var d=new H,e=new bb,f=new Fa,g=new q,h=new q,k=new q,m=new q,l=new q,p=new q,n=new C,r=new C,w=new C,u=new q,F=new q,t=new q;return function(q,u){var t=this.geometry,A=this.material,I=this.matrixWorld;if(void 0!==A&&(null===t.boundingSphere&&t.computeBoundingSphere(),f.copy(t.boundingSphere),f.applyMatrix4(I),!1!==q.ray.intersectsSphere(f)&&(d.getInverse(I),e.copy(q.ray).applyMatrix4(d),null===t.boundingBox||!1!==e.intersectsBox(t.boundingBox)))){var E, -K;if(t.isBufferGeometry){var y,J,A=t.index,I=t.attributes,t=I.position.array;void 0!==I.uv&&(E=I.uv.array);if(null!==A)for(var I=A.array,C=0,D=I.length;Cthis.scale.x*this.scale.y/4||c.push({distance:Math.sqrt(d),point:this.position,face:null,object:this})}}(),clone:function(){return(new this.constructor(this.material)).copy(this)}}); -Ac.prototype=Object.assign(Object.create(G.prototype),{constructor:Ac,copy:function(a){G.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break; -for(;ef||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else for(g=0,w=r.length/3-1;gf||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(k=g.vertices,m=k.length,g=0;gf||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});fa.prototype=Object.assign(Object.create(Va.prototype),{constructor:fa,isLineSegments:!0});Oa.prototype=Object.create(W.prototype);Oa.prototype.constructor=Oa;Oa.prototype.isPointsMaterial=!0;Oa.prototype.copy= -function(a){W.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeAttenuation=a.sizeAttenuation;return this};Kb.prototype=Object.assign(Object.create(G.prototype),{constructor:Kb,isPoints:!0,raycast:function(){var a=new H,b=new bb,c=new Fa;return function(d,e){function f(a,c){var f=b.distanceSqToPoint(a);if(fd.far||e.push({distance:m,distanceToRay:Math.sqrt(f), -point:h.clone(),index:c,face:null,object:g})}}var g=this,h=this.geometry,k=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(k);if(!1!==d.ray.intersectsSphere(c)){a.getInverse(k);b.copy(d.ray).applyMatrix4(a);var m=m/((this.scale.x+this.scale.y+this.scale.z)/3),l=m*m,m=new q;if(h.isBufferGeometry){var p=h.index,h=h.attributes.position.array;if(null!==p)for(var n=p.array,p=0,r=n.length;pc)return null;var d=[],e=[],f=[],g,h,k;if(0=m--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}g=h;c<=g&&(g=0);h=g+1;c<=h&&(h=0);k=h+1;c<=k&&(k=0);var l;a:{var p,n,r,q,u,F,t,v;p=a[e[g]].x;n=a[e[g]].y;r=a[e[h]].x;q=a[e[h]].y;u=a[e[k]].x;F=a[e[k]].y;if(0>=(r-p)*(F-n)-(q-n)*(u-p))l= -!1;else{var M,z,A,I,E,K,y,C,D,G;M=u-r;z=F-q;A=p-u;I=n-F;E=r-p;K=q-n;for(l=0;l=-Number.EPSILON&&C>=-Number.EPSILON&&y>=-Number.EPSILON)){l=!1;break a}l=!0}}if(l){d.push([a[e[g]],a[e[h]],a[e[k]]]);f.push([e[g],e[h],e[k]]);g=h;for(k=h+1;kNumber.EPSILON){if(0q||q>p)return[];k=m*l-k*n;if(0>k||k>p)return[]}else{if(0c?[]:k===c?f?[]:[g]:a<=c?[g,h]:[g,m]} -function f(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return Math.abs(a)>Number.EPSILON?(b=g*c-d*b,0e&&(e=d);var g=a+1;g>d&&(g= -0);d=f(h[a],h[e],h[g],k[b]);if(!d)return!1;d=k.length-1;e=b-1;0>e&&(e=d);g=b+1;g>d&&(g=0);return(d=f(k[b],k[e],k[g],h[a]))?!0:!1}function d(a,b){var c,f;for(c=0;cO){console.log("Infinite Loop! Holes left:"+m.length+", Probably Hole outside Shape!");break}for(n=C;nk;k++)l=m[k].x+":"+m[k].y,l=p[l],void 0!==l&&(m[k]=l);return n.concat()},isClockWise:function(a){return 0>pa.area(a)},b2:function(){return function(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}}(),b3:function(){return function(a,b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}}()};La.prototype=Object.create(S.prototype);La.prototype.constructor=La;La.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;dNumber.EPSILON){var k=Math.sqrt(h),m=Math.sqrt(d*d+g*g),h=b.x-f/k;b=b.y+e/k;g=((c.x-g/m-h)*g-(c.y+d/m-b)*d)/(e*g-f*d);d=h+e*g-a.x;e=b+f*g-a.y;f=d*d+e*e;if(2>=f)return new C(d,e);f=Math.sqrt(f/2)}else a=!1,e>Number.EPSILON?d>Number.EPSILON&& -(a=!0):e<-Number.EPSILON?d<-Number.EPSILON&&(a=!0):Math.sign(f)===Math.sign(g)&&(a=!0),a?(d=-f,f=Math.sqrt(h)):(d=e,e=f,f=Math.sqrt(h/2));return new C(d/f,e/f)}function e(a,b){var c,d;for(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);var e,f=r+2*l;for(e=0;eMath.abs(b.y-c.y)?[new C(b.x,1-b.z),new C(c.x,1-c.z),new C(d.x,1-d.z),new C(e.x,1-e.z)]:[new C(b.y,1-b.z),new C(c.y,1-c.z),new C(d.y,1-d.z),new C(e.y,1-e.z)]}};Mc.prototype=Object.create(La.prototype);Mc.prototype.constructor= -Mc;mb.prototype=Object.create(D.prototype);mb.prototype.constructor=mb;Nc.prototype=Object.create(S.prototype);Nc.prototype.constructor=Nc;Ub.prototype=Object.create(D.prototype);Ub.prototype.constructor=Ub;Oc.prototype=Object.create(S.prototype);Oc.prototype.constructor=Oc;Pc.prototype=Object.create(S.prototype);Pc.prototype.constructor=Pc;Vb.prototype=Object.create(D.prototype);Vb.prototype.constructor=Vb;Qc.prototype=Object.create(S.prototype);Qc.prototype.constructor=Qc;Wb.prototype=Object.create(D.prototype); -Wb.prototype.constructor=Wb;Xb.prototype=Object.create(S.prototype);Xb.prototype.constructor=Xb;Yb.prototype=Object.create(D.prototype);Yb.prototype.constructor=Yb;Wa.prototype=Object.create(D.prototype);Wa.prototype.constructor=Wa;nb.prototype=Object.create(S.prototype);nb.prototype.constructor=nb;Rc.prototype=Object.create(nb.prototype);Rc.prototype.constructor=Rc;Sc.prototype=Object.create(Wa.prototype);Sc.prototype.constructor=Sc;Zb.prototype=Object.create(D.prototype);Zb.prototype.constructor= -Zb;Tc.prototype=Object.create(S.prototype);Tc.prototype.constructor=Tc;$b.prototype=Object.create(S.prototype);$b.prototype.constructor=$b;var Ea=Object.freeze({WireframeGeometry:Mb,ParametricGeometry:Dc,ParametricBufferGeometry:Nb,TetrahedronGeometry:Ec,TetrahedronBufferGeometry:Ob,OctahedronGeometry:Fc,OctahedronBufferGeometry:lb,IcosahedronGeometry:Gc,IcosahedronBufferGeometry:Pb,DodecahedronGeometry:Hc,DodecahedronBufferGeometry:Qb,PolyhedronGeometry:Ic,PolyhedronBufferGeometry:xa,TubeGeometry:Jc, -TubeBufferGeometry:Rb,TorusKnotGeometry:Kc,TorusKnotBufferGeometry:Sb,TorusGeometry:Lc,TorusBufferGeometry:Tb,TextGeometry:Mc,SphereBufferGeometry:mb,SphereGeometry:Nc,RingGeometry:Oc,RingBufferGeometry:Ub,PlaneBufferGeometry:ib,PlaneGeometry:Pc,LatheGeometry:Qc,LatheBufferGeometry:Vb,ShapeGeometry:Xb,ShapeBufferGeometry:Wb,ExtrudeGeometry:La,EdgesGeometry:Yb,ConeGeometry:Rc,ConeBufferGeometry:Sc,CylinderGeometry:nb,CylinderBufferGeometry:Wa,CircleBufferGeometry:Zb,CircleGeometry:Tc,BoxBufferGeometry:hb, -BoxGeometry:$b});ac.prototype=Object.create(Ia.prototype);ac.prototype.constructor=ac;ac.prototype.isShadowMaterial=!0;bc.prototype=Object.create(Ia.prototype);bc.prototype.constructor=bc;bc.prototype.isRawShaderMaterial=!0;Uc.prototype={constructor:Uc,isMultiMaterial:!0,toJSON:function(a){for(var b={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},c=this.materials,d=0,e=c.length;d=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),d=this.getValueSize(),this.times=ba.arraySlice(c,e,f),this.values=ba.arraySlice(this.values,e*d,f*d);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("invalid value size in track",this),a=!1);var c=this.times,b=this.values,d=c.length;0===d&&(console.error("track is empty", -this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("time is not a valid number",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("out of order keys",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&ba.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("value is not a valid number",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,c=this.getValueSize(),d=2302===this.getInterpolation(),e=1, -f=a.length-1,g=1;gk.opacity&&(k.transparent=!0);c.setTextures(h);return c.parse(k)}}()};wb.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;cg;g++)n=v[k++],t=F[2*n],n=F[2*n+1],t=new C(t,n),2!==g&&c.faceVertexUvs[d][h].push(t),0!==g&&c.faceVertexUvs[d][h+1].push(t);p&&(p=3*v[k++],r.normal.set(y[p++],y[p++],y[p]),u.normal.copy(r.normal));if(w)for(d=0;4>d;d++)p=3*v[k++],w=new q(y[p++],y[p++],y[p]),2!==d&&r.vertexNormals.push(w),0!==d&&u.vertexNormals.push(w);l&&(l=v[k++], -l=z[l],r.color.setHex(l),u.color.setHex(l));if(b)for(d=0;4>d;d++)l=v[k++],l=z[l],2!==d&&r.vertexColors.push(new N(l)),0!==d&&u.vertexColors.push(new N(l));c.faces.push(r);c.faces.push(u)}else{r=new ha;r.a=v[k++];r.b=v[k++];r.c=v[k++];h&&(h=v[k++],r.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)n=v[k++],t=F[2*n],n=F[2*n+1],t=new C(t,n),c.faceVertexUvs[d][h].push(t);p&&(p=3*v[k++],r.normal.set(y[p++],y[p++],y[p]));if(w)for(d=0;3>d;d++)p=3* -v[k++],w=new q(y[p++],y[p++],y[p]),r.vertexNormals.push(w);l&&(l=v[k++],r.color.setHex(z[l]));if(b)for(d=0;3>d;d++)l=v[k++],r.vertexColors.push(new N(z[l]));c.faces.push(r)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;dk)g=d+1;else if(0b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(Q.clamp(d[k-1].dot(d[k]),-1,1)),e[k].applyMatrix4(h.makeRotationAxis(g,c))),f[k].crossVectors(d[k],e[k]);if(!0===b)for(c=Math.acos(Q.clamp(e[0].dot(e[a]),-1,1)),c/=a,0=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate= -!0;this.cacheLengths=null;this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,c=0,d=this.curves.length;cc;)c+=b;for(;c>b;)c-=b;cb.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=ed.interpolate;return new C(c(d.x,e.x,f.x,b.x,a),c(d.y,e.y,f.y,b.y,a))};yb.prototype=Object.create(wa.prototype);yb.prototype.constructor=yb;yb.prototype.getPoint=function(a){var b=pa.b3;return new C(b(a,this.v0.x, -this.v1.x,this.v2.x,this.v3.x),b(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y))};yb.prototype.getTangent=function(a){var b=ed.tangentCubicBezier;return(new C(b(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y))).normalize()};zb.prototype=Object.create(wa.prototype);zb.prototype.constructor=zb;zb.prototype.getPoint=function(a){var b=pa.b2;return new C(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y))};zb.prototype.getTangent=function(a){var b= -ed.tangentQuadraticBezier;return(new C(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y))).normalize()};var oe=Object.assign(Object.create(Yc.prototype),{fromPoints:function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;bNumber.EPSILON){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<= -a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=pa.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);var g,h,k,m=[];if(1===f.length)return h=f[0],k=new Ab,k.curves=h.curves,m.push(k),m;var l=!e(f[0].getPoints()),l=a?!l:l;k=[];var p=[],n=[],q=0,w;p[q]=void 0;n[q]=[];for(var u=0,y=f.length;ud&& -this._mixBufferRegion(c,a,3*b,1-d,b);for(var d=b,f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a,b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d,e){da.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f= -1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}};ka.prototype={constructor:ka,getValue:function(a,b){this.bind();this.getValue(a,b)},setValue:function(a,b){this.bind();this.setValue(a,b)},bind:function(){var a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;a||(this.node=a=ka.findNode(this.rootNode,b.nodeName)||this.rootNode);this.getValue=this._getValue_unavailable;this.setValue=this._setValue_unavailable;if(a){if(c){var f=b.objectIndex;switch(c){case "materials":if(!a.material){console.error(" can not bind to material as node does not have a material", -this);return}if(!a.material.materials){console.error(" can not bind to material.materials as node.material does not have a materials array",this);return}a=a.material.materials;break;case "bones":if(!a.skeleton){console.error(" can not bind to bones as node does not have a skeleton",this);return}a=a.skeleton.bones;for(c=0;c=c){var p=c++,n=b[p];d[n.uuid]=q;b[q]=n;d[l]=p;b[p]= -k;k=0;for(l=f;k!==l;++k){var n=e[k],r=n[q];n[q]=n[p];n[p]=r}}}this.nCachedObjects_=c},uncache:function(a){for(var b=this._objects,c=b.length,d=this.nCachedObjects_,e=this._indicesByUUID,f=this._bindings,g=f.length,h=0,k=arguments.length;h!==k;++h){var l=arguments[h].uuid,q=e[l];if(void 0!==q)if(delete e[l],qb||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b},_updateTimeScale:function(a){var b=0;if(!this.paused){var b=this.timeScale,c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0],b=b*d;a>c.parameterPositions[1]&&(this.stopWarping(),0=== -b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a;if(0===a)return b;var c=this._clip.duration,d=this.loop,e=this._loopCount;if(2200===d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>a?-1:1})}else{d=2202===d;-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions, -d)):this._setEndings(0===this.repetitions,!0,d));if(b>=c||0>b){var f=Math.floor(b/c),b=b-c*f,e=e+Math.abs(f),g=this.repetitions-e;0>g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=0a,this._setEndings(a,!a,d)):this._setEndings(!1,!1,d),this._loopCount=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:f}))}if(d&&1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a, -b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}};Object.assign(de.prototype,oa.prototype,{clipAction:function(a,b){var c=b||this._root, -d=c.uuid,e="string"===typeof a?ta.findByName(c,a):a,c=null!==e?e.uuid:a,f=this._actionsByClip[c],g=null;if(void 0!==f){g=f.actionByRoot[d];if(void 0!==g)return g;g=f.knownActions[0];null===e&&(e=g._clip)}if(null===e)return null;e=new ce(this,e,b);this._bindAction(e,g);this._addInactiveAction(e,c,d);return e},existingAction:function(a,b){var c=b||this._root,d=c.uuid,c="string"===typeof a?ta.findByName(c,a):a,c=this._actionsByClip[c?c.uuid:a];return void 0!==c?c.actionByRoot[d]||null:null},stopAllAction:function(){for(var a= -this._actions,b=this._nActiveActions,c=this._bindings,d=this._nActiveBindings,e=this._nActiveBindings=this._nActiveActions=0;e!==b;++e)a[e].reset();for(e=0;e!==d;++e)c[e].useCount=0;return this},update:function(a){a*=this.timeScale;for(var b=this._actions,c=this._nActiveActions,d=this.time+=a,e=Math.sign(a),f=this._accuIndex^=1,g=0;g!==c;++g){var h=b[g];h.enabled&&h._update(d,a,e,f)}a=this._bindings;b=this._nActiveBindings;for(g=0;g!==b;++g)a[g].apply(f);return this},getRoot:function(){return this._root}, -uncacheClip:function(a){var b=this._actions;a=a.uuid;var c=this._actionsByClip,d=c[a];if(void 0!==d){for(var d=d.knownActions,e=0,f=d.length;e!==f;++e){var g=d[e];this._deactivateAction(g);var h=g._cacheIndex,k=b[b.length-1];g._cacheIndex=null;g._byClipCacheIndex=null;k._cacheIndex=h;b[h]=k;b.pop();this._removeInactiveBindingsForAction(g)}delete c[a]}},uncacheRoot:function(a){a=a.uuid;var b=this._actionsByClip,c;for(c in b){var d=b[c].actionByRoot[a];void 0!==d&&(this._deactivateAction(d),this._removeInactiveAction(d))}c= -this._bindingsByRootAndName[a];if(void 0!==c)for(var e in c)a=c[e],a.restoreOriginalState(),this._removeInactiveBinding(a)},uncacheAction:function(a,b){var c=this.existingAction(a,b);null!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}});Object.assign(de.prototype,{_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings,g=a._interpolants,h=c.uuid,k=this._bindingsByRootAndName,l=k[h];void 0===l&&(l={},k[h]=l);for(k=0;k!==e;++k){var q= -d[k],p=q.name,n=l[p];if(void 0===n){n=f[k];if(void 0!==n){null===n._cacheIndex&&(++n.referenceCount,this._addInactiveBinding(n,h,p));continue}n=new Cd(ka.create(c,p,b&&b._propertyBindings[k].binding.parsedPath),q.ValueTypeName,q.getValueSize());++n.referenceCount;this._addInactiveBinding(n,h,p)}f[k]=n;g[k].resultBuffer=n.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a, -d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip= -{};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex; -return null!==a&&ah.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end, -a);this.firstAnimation=c};ua.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};ua.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};ua.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)};ua.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/ -c.duration)};ua.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};ua.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};ua.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};ua.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};ua.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("THREE.MorphBlendMesh: animation["+ -a+"] undefined in .playAnimation()")};ua.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};ua.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+= -d.duration);var f=d.start+Q.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);d.currentFrame!==d.lastFrame?(this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g):this.morphTargetInfluences[d.currentFrame]=g}}};$c.prototype=Object.create(G.prototype); -$c.prototype.constructor=$c;$c.prototype.isImmediateRenderObject=!0;ad.prototype=Object.create(fa.prototype);ad.prototype.constructor=ad;ad.prototype.update=function(){var a=new q,b=new q,c=new za;return function(){var d=["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var h=g.vertices,k=g.faces,l=g=0,q=k.length;lc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(), -b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();Cb.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};Cb.prototype.setColor=function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};Fd.prototype=Object.create(fa.prototype);Fd.prototype.constructor=Fd;var ke=function(){function a(){}var b=new q,c=new a, -d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,l,p){this.init(b,c,((b-a)/e-(c-a)/(e+l)+(c-b)/l)*l,((c-b)/l-(d-b)/(l+p)+(d-c)/p)*l)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3*b*a};return wa.create(function(a){this.points=a||[];this.closed=!1},function(a){var g= -this.points,h,k;k=g.length;2>k&&console.log("duh, you need at least 2 points");a*=k-(this.closed?0:1);h=Math.floor(a);a-=h;this.closed?h+=0h&&(h=1);1E-4>k&&(k=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(l.x,x.x,p.x,g.x,k,h,n);d.initNonuniformCatmullRom(l.y,x.y,p.y,g.y,k,h,n);e.initNonuniformCatmullRom(l.z,x.z,p.z,g.z,k,h,n)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,x.x,p.x,g.x,k),d.initCatmullRom(l.y,x.y,p.y,g.y,k),e.initCatmullRom(l.z,x.z,p.z,g.z,k));return new q(c.calc(a), -d.calc(a),e.calc(a))})}(),Nf=wa.create(function(a){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3");this.points=void 0===a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=ed.interpolate;return new q(c(d.x,e.x,f.x,b.x,a),c(d.y,e.y,f.y,b.y,a),c(d.z,e.z,f.z,b.z,a))}),Of=wa.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b= -pa.b3;return new q(b(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),Pf=wa.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b=pa.b2;return new q(b(a,this.v0.x,this.v1.x,this.v2.x),b(a,this.v0.y,this.v1.y,this.v2.y),b(a,this.v0.z,this.v1.z,this.v2.z))}),Qf=wa.create(function(a,b){this.v1=a;this.v2=b},function(a){if(1===a)return this.v2.clone();var b=new q;b.subVectors(this.v2,this.v1);b.multiplyScalar(a); -b.add(this.v1);return b});Gd.prototype=Object.create(Xa.prototype);Gd.prototype.constructor=Gd;Le.prototype=Object.create(ke.prototype);bd.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};Object.assign(pc.prototype,{center:function(a){console.warn("THREE.Box2: .center() has been renamed to .getCenter().");return this.getCenter(a)},empty:function(){console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."); -return this.isEmpty()},isIntersectionBox:function(a){console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)},size:function(a){console.warn("THREE.Box2: .size() has been renamed to .getSize().");return this.getSize(a)}});Object.assign(ya.prototype,{center:function(a){console.warn("THREE.Box3: .center() has been renamed to .getCenter().");return this.getCenter(a)},empty:function(){console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."); -return this.isEmpty()},isIntersectionBox:function(a){console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)},isIntersectionSphere:function(a){console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().");return this.intersectsSphere(a)},size:function(a){console.warn("THREE.Box3: .size() has been renamed to .getSize().");return this.getSize(a)}});gb.prototype.center=function(a){console.warn("THREE.Line3: .center() has been renamed to .getCenter()."); -return this.getCenter(a)};Q.random16=function(){console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead.");return Math.random()};Object.assign(za.prototype,{flattenToArrayOffset:function(a,b){console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");return this.toArray(a,b)},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)}, -multiplyVector3Array:function(a){console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToBuffer:function(a,b,c){console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.");return this.applyToBufferAttribute(a)}});Object.assign(H.prototype,{extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."); -return this.copyPosition(a)},flattenToArrayOffset:function(a,b){console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");return this.toArray(a,b)},getPosition:function(){var a;return function(){void 0===a&&(a=new q);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");return a.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."); -return this.makeRotationFromQuaternion(a)},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."); -return this.applyToVector3Array(a)},rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")}, -rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(a,b,c){console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.");return this.applyToBufferAttribute(a)}});ma.prototype.isIntersectionLine=function(a){console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."); -return this.intersectsLine(a)};da.prototype.multiplyVector3=function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");return a.applyQuaternion(this)};Object.assign(bb.prototype,{isIntersectionBox:function(a){console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)},isIntersectionPlane:function(a){console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."); -return this.intersectsPlane(a)},isIntersectionSphere:function(a){console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().");return this.intersectsSphere(a)}});Object.assign(Ab.prototype,{extrude:function(a){console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.");return new La(this,a)},makeGeometry:function(a){console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.");return new Xb(this,a)}});Object.assign(q.prototype, -{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."); -return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(b,a)}});S.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")};Object.assign(G.prototype,{getChildByName:function(a){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")}, -translate:function(a,b){console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.");return this.translateOnAxis(b,a)}});Object.defineProperties(G.prototype,{eulerOrder:{get:function(){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");return this.rotation.order},set:function(a){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");this.rotation.order=a}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}, -set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});Object.defineProperties(Ac.prototype,{objects:{get:function(){console.warn("THREE.LOD: .objects has been renamed to .levels.");return this.levels}}});Ha.prototype.setLens=function(a,b){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.");void 0!==b&&(this.filmGauge=b);this.setFocalLength(a)};Object.defineProperties(na.prototype, -{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(a){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov.");this.shadow.camera.fov=a}},shadowCameraLeft:{set:function(a){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left.");this.shadow.camera.left=a}},shadowCameraRight:{set:function(a){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right.");this.shadow.camera.right=a}},shadowCameraTop:{set:function(a){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."); -this.shadow.camera.top=a}},shadowCameraBottom:{set:function(a){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.");this.shadow.camera.bottom=a}},shadowCameraNear:{set:function(a){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near.");this.shadow.camera.near=a}},shadowCameraFar:{set:function(a){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far.");this.shadow.camera.far=a}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}}, -shadowBias:{set:function(a){console.warn("THREE.Light: .shadowBias is now .shadow.bias.");this.shadow.bias=a}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(a){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.");this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.");this.shadow.mapSize.height=a}}});Object.defineProperties(y.prototype, -{length:{get:function(){console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead.");return this.array.length}}});Object.assign(D.prototype,{addIndex:function(a){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");this.setIndex(a)},addDrawCall:function(a,b,c){void 0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");this.addGroup(a, -b)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().");this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}});Object.defineProperties(D.prototype,{drawcalls:{get:function(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");return this.groups}},offsets:{get:function(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."); -return this.groups}}});Object.defineProperties(Dd.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.");return this}}});Object.defineProperties(W.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(){console.warn("THREE."+this.type+ -": .wrapAround has been removed.")}},wrapRGB:{get:function(){console.warn("THREE."+this.type+": .wrapRGB has been removed.");return new N}}});Object.defineProperties(Ca.prototype,{metal:{get:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.");return!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}});Object.defineProperties(Ia.prototype,{derivatives:{get:function(){console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."); -return this.extensions.derivatives},set:function(a){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");this.extensions.derivatives=a}}});oa.prototype=Object.assign(Object.create({constructor:oa,apply:function(a){console.warn("THREE.EventDispatcher: .apply is deprecated, just inherit or Object.assign the prototype to mix-in.");Object.assign(a,this)}}),oa.prototype);Object.assign(Nd.prototype,{supportsFloatTextures:function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."); -return this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."); -return this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."); -return this.capabilities.vertexTextures},supportsInstancedArrays:function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(a){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().");this.setScissorTest(a)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")}, -addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}});Object.defineProperties(Nd.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");this.shadowMap.enabled=a}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."); -this.shadowMap.type=a}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");this.shadowMap.cullFace=a}}});Object.defineProperties(ye.prototype,{cullFace:{get:function(){return this.renderReverseSided?2:1},set:function(a){a=1!==a;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+a+".");this.renderReverseSided=a}}});Object.defineProperties(Db.prototype, -{wrapS:{get:function(){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");return this.texture.wrapS},set:function(a){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");this.texture.wrapS=a}},wrapT:{get:function(){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");return this.texture.wrapT},set:function(a){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=a}},magFilter:{get:function(){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."); -return this.texture.magFilter},set:function(a){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=a}},minFilter:{get:function(){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");return this.texture.minFilter},set:function(a){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=a}},anisotropy:{get:function(){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."); -return this.texture.anisotropy},set:function(a){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=a}},offset:{get:function(){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");return this.texture.offset},set:function(a){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=a}},repeat:{get:function(){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");return this.texture.repeat}, -set:function(a){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");this.texture.repeat=a}},format:{get:function(){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");return this.texture.format},set:function(a){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=a}},type:{get:function(){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");return this.texture.type},set:function(a){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."); -this.texture.type=a}},generateMipmaps:{get:function(){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");return this.texture.generateMipmaps},set:function(a){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=a}}});ec.prototype.load=function(a){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var b=this;(new Wd).load(a,function(a){b.setBuffer(a)});return this}; -ae.prototype.getData=function(){console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData().");return this.getFrequencyData()};l.WebGLRenderTargetCube=Eb;l.WebGLRenderTarget=Db;l.WebGLRenderer=Nd;l.ShaderLib=Gb;l.UniformsLib=U;l.UniformsUtils=Ja;l.ShaderChunk=Z;l.FogExp2=Ib;l.Fog=Jb;l.Scene=jb;l.LensFlare=Od;l.Sprite=zc;l.LOD=Ac;l.SkinnedMesh=jd;l.Skeleton=hd;l.Bone=id;l.Mesh=Ba;l.LineSegments=fa;l.Line=Va;l.Points=Kb;l.Group=Bc;l.VideoTexture=kd;l.DataTexture=db;l.CompressedTexture= -Lb;l.CubeTexture=Za;l.CanvasTexture=ld;l.DepthTexture=Cc;l.Texture=ea;l.CompressedTextureLoader=Ee;l.BinaryTextureLoader=Qd;l.DataTextureLoader=Qd;l.CubeTextureLoader=Rd;l.TextureLoader=md;l.ObjectLoader=Fe;l.MaterialLoader=Ad;l.BufferGeometryLoader=Sd;l.DefaultLoadingManager=va;l.LoadingManager=Pd;l.JSONLoader=Td;l.ImageLoader=Vc;l.FontLoader=Ge;l.FileLoader=Ma;l.Loader=wb;l.Cache=ne;l.AudioLoader=Wd;l.SpotLightShadow=od;l.SpotLight=pd;l.PointLight=qd;l.RectAreaLight=Xd;l.HemisphereLight=nd;l.DirectionalLightShadow= -rd;l.DirectionalLight=sd;l.AmbientLight=td;l.LightShadow=tb;l.Light=na;l.StereoCamera=He;l.PerspectiveCamera=Ha;l.OrthographicCamera=Hb;l.CubeCamera=Bd;l.Camera=sa;l.AudioListener=Yd;l.PositionalAudio=$d;l.AudioContext=Zd;l.AudioAnalyser=ae;l.Audio=ec;l.VectorKeyframeTrack=cc;l.StringKeyframeTrack=xd;l.QuaternionKeyframeTrack=Xc;l.NumberKeyframeTrack=dc;l.ColorKeyframeTrack=zd;l.BooleanKeyframeTrack=yd;l.PropertyMixer=Cd;l.PropertyBinding=ka;l.KeyframeTrack=vb;l.AnimationUtils=ba;l.AnimationObjectGroup= -be;l.AnimationMixer=de;l.AnimationClip=ta;l.Uniform=Dd;l.InstancedBufferGeometry=Bb;l.BufferGeometry=D;l.GeometryIdCount=function(){return Kd++};l.Geometry=S;l.InterleavedBufferAttribute=ee;l.InstancedInterleavedBuffer=gc;l.InterleavedBuffer=fc;l.InstancedBufferAttribute=hc;l.Face3=ha;l.Object3D=G;l.Raycaster=fe;l.Layers=gd;l.EventDispatcher=oa;l.Clock=he;l.QuaternionLinearInterpolant=wd;l.LinearInterpolant=Wc;l.DiscreteInterpolant=vd;l.CubicInterpolant=ud;l.Interpolant=qa;l.Triangle=Aa;l.Spline= -function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,x,p,n;this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+2;l=this.points[c[0]]; -x=this.points[c[1]];p=this.points[c[2]];n=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,x.x,p.x,n.x,g,h,k);d.y=b(l.y,x.y,p.y,n.y,g,h,k);d.z=b(l.z,x.z,p.z,n.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:R(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),m}},t}("object"==typeof module?module.exports:{});try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}var n=0,i=1,r=2,a=1,o=2,s=3,c=0,l=1,u=2,h=0,d=1,p=2,f=3,m=4,v=5,g=100,y=101,x=102,_=103,b=104,w=200,M=201,S=202,T=203,E=204,A=205,L=206,R=207,C=208,P=209,O=210,I=0,D=1,N=2,B=3,z=4,F=5,H=6,G=7,U=0,k=1,V=2,W=0,j=1,q=2,X=3,Y=4,Z=5,J=301,Q=302,K=303,$=304,tt=306,et=307,nt=1e3,it=1001,rt=1002,at=1003,ot=1004,st=1005,ct=1006,lt=1007,ut=1008,ht=1009,dt=1010,pt=1011,ft=1012,mt=1013,vt=1014,gt=1015,yt=1016,xt=1017,_t=1018,bt=1019,wt=1020,Mt=1021,St=1022,Tt=1023,Et=1024,At=1025,Lt=Tt,Rt=1026,Ct=1027,Pt=1028,Ot=1029,It=1030,Dt=1031,Nt=1032,Bt=1033,zt=33776,Ft=33777,Ht=33778,Gt=33779,Ut=35840,kt=35841,Vt=35842,Wt=35843,jt=36196,qt=37492,Xt=37496,Yt=37808,Zt=37809,Jt=37810,Qt=37811,Kt=37812,$t=37813,te=37814,ee=37815,ne=37816,ie=37817,re=37818,ae=37819,oe=37820,se=37821,ce=36492,le=37840,ue=37841,he=37842,de=37843,pe=37844,fe=37845,me=37846,ve=37847,ge=37848,ye=37849,xe=37850,_e=37851,be=37852,we=37853,Me=2201,Se=2400,Te=2500,Ee=3e3,Ae=3001,Le=3007,Re=3002,Ce=3003,Pe=3004,Oe=3005,Ie=3006,De=3200,Ne=3201,Be=0,ze=1,Fe=7680,He=519,Ge=35044,Ue=35048,ke="300 es";function Ve(t,e,n,i,r,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(i,r)}function We(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function Je(){}Object.assign(Je.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i>8&255]+Qe[t>>16&255]+Qe[t>>24&255]+"-"+Qe[255&e]+Qe[e>>8&255]+"-"+Qe[e>>16&15|64]+Qe[e>>24&255]+"-"+Qe[63&n|128]+Qe[n>>8&255]+"-"+Qe[n>>16&255]+Qe[n>>24&255]+Qe[255&i]+Qe[i>>8&255]+Qe[i>>16&255]+Qe[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},damp:function(t,e,n,i){return en.lerp(t,e,1-Math.exp(-n*i))},pingpong:function(t,e){return void 0===e&&(e=1),e-Math.abs(en.euclideanModulo(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(tn=t%2147483647),((tn=16807*tn%2147483647)-1)/2147483646},degToRad:function(t){return t*en.DEG2RAD},radToDeg:function(t){return t*en.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((e+i)/2),u=o((e+i)/2),h=a((e-i)/2),d=o((e-i)/2),p=a((i-e)/2),f=o((i-e)/2);switch(r){case"XYX":t.set(s*u,c*h,c*d,s*l);break;case"YZY":t.set(c*d,s*u,c*h,s*l);break;case"ZXZ":t.set(c*h,c*d,s*u,s*l);break;case"XZX":t.set(s*u,c*f,c*p,s*l);break;case"YXY":t.set(c*p,s*u,c*f,s*l);break;case"ZYZ":t.set(c*f,c*p,s*u,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}},nn=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=e}var e=t.prototype;return e.set=function(t,e){return this.x=t,this.y=e,this},e.setScalar=function(t){return this.x=t,this.y=t,this},e.setX=function(t){return this.x=t,this},e.setY=function(t){return this.y=t,this},e.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},e.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},e.clone=function(){return new this.constructor(this.x,this.y)},e.copy=function(t){return this.x=t.x,this.y=t.y,this},e.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},e.addScalar=function(t){return this.x+=t,this.y+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},e.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},e.subScalar=function(t){return this.x-=t,this.y-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},e.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this},e.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.applyMatrix3=function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.dot=function(t){return this.x*t.x+this.y*t.y},e.cross=function(t){return this.x*t.y-this.y*t.x},e.lengthSq=function(){return this.x*this.x+this.y*this.y},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.angle=function(){var t=Math.atan2(-this.y,-this.x)+Math.PI;return t},e.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},e.distanceToSquared=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},e.manhattanDistanceTo=function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this},e.equals=function(t){return t.x===this.x&&t.y===this.y},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},e.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},e.rotateAround=function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this},je(t,[{key:"width",get:function(){return this.x},set:function(t){this.x=t}},{key:"height",get:function(){return this.y},set:function(t){this.y=t}}]),t}(),rn=function(){function t(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}var e=t.prototype;return e.set=function(t,e,n,i,r,a,o,s,c){var l=this.elements;return l[0]=t,l[1]=i,l[2]=o,l[3]=e,l[4]=r,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},e.identity=function(){return this.set(1,0,0,0,1,0,0,0,1),this},e.clone=function(){return(new this.constructor).fromArray(this.elements)},e.copy=function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},e.extractBasis=function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},e.setFromMatrix4=function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},e.multiply=function(t){return this.multiplyMatrices(this,t)},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],v=i[6],g=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=a*f+o*g+s*_,r[3]=a*m+o*y+s*b,r[6]=a*v+o*x+s*w,r[1]=c*f+l*g+u*_,r[4]=c*m+l*y+u*b,r[7]=c*v+l*x+u*w,r[2]=h*f+d*g+p*_,r[5]=h*m+d*y+p*b,r[8]=h*v+d*x+p*w,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8];return e*a*l-e*o*c-n*r*l+n*o*s+i*r*c-i*a*s},e.invert=function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=l*a-o*c,h=o*s-l*r,d=c*r-a*s,p=e*u+n*h+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);var f=1/p;return t[0]=u*f,t[1]=(i*c-l*n)*f,t[2]=(o*n-i*a)*f,t[3]=h*f,t[4]=(l*e-i*s)*f,t[5]=(i*r-o*e)*f,t[6]=d*f,t[7]=(n*s-c*e)*f,t[8]=(a*e-n*r)*f,this},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},e.getNormalMatrix=function(t){return this.setFromMatrix4(t).copy(this).invert().transpose()},e.transposeIntoArray=function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},e.setUvTransform=function(t,e,n,i,r,a,o){var s=Math.cos(r),c=Math.sin(r);return this.set(n*s,n*c,-n*(s*a+c*o)+a+t,-i*c,i*s,-i*(-c*a+s*o)+o+e,0,0,1),this},e.scale=function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},e.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],c=i[4],l=i[7];return i[0]=e*r+n*s,i[3]=e*a+n*c,i[6]=e*o+n*l,i[1]=-n*r+e*s,i[4]=-n*a+e*c,i[7]=-n*o+e*l,this},e.translate=function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},e.equals=function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},e.fromArray=function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},e.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t},t}(),an={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;var e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===$e&&($e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),$e.width=t.width,$e.height=t.height;var n=$e.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=$e}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},on=0;function sn(t,e,n,i,r,a,o,s,c,l){void 0===t&&(t=sn.DEFAULT_IMAGE),void 0===e&&(e=sn.DEFAULT_MAPPING),void 0===n&&(n=it),void 0===i&&(i=it),void 0===r&&(r=ct),void 0===a&&(a=ut),void 0===o&&(o=Tt),void 0===s&&(s=ht),void 0===c&&(c=1),void 0===l&&(l=Ee),Object.defineProperty(this,"id",{value:on++}),this.uuid=en.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=s,this.offset=new nn(0,0),this.repeat=new nn(1,1),this.center=new nn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new rn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l,this.version=0,this.onUpdate=null}function cn(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?an.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}sn.DEFAULT_IMAGE=void 0,sn.DEFAULT_MAPPING=300,sn.prototype=Object.assign(Object.create(Je.prototype),{constructor:sn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=en.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a1)switch(this.wrapS){case nt:t.x=t.x-Math.floor(t.x);break;case it:t.x=t.x<0?0:1;break;case rt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case nt:t.y=t.y-Math.floor(t.y);break;case it:t.y=t.y<0?0:1;break;case rt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(sn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});var ln=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=e,this.z=n,this.w=i}var e=t.prototype;return e.set=function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},e.setScalar=function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},e.setX=function(t){return this.x=t,this},e.setY=function(t){return this.y=t,this},e.setZ=function(t){return this.z=t,this},e.setW=function(t){return this.w=t,this},e.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},e.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},e.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},e.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},e.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},e.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.applyMatrix4=function(t){var e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.setAxisAngleFromQuaternion=function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},e.setAxisAngleFromRotationMatrix=function(t){var e,n,i,r,a=t.elements,o=a[0],s=a[4],c=a[8],l=a[1],u=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+p)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,v=(u+1)/2,g=(f+1)/2,y=(s+l)/4,x=(c+d)/4,_=(h+p)/4;return m>v&&m>g?m<.01?(n=0,i=.707106781,r=.707106781):(i=y/(n=Math.sqrt(m)),r=x/n):v>g?v<.01?(n=.707106781,i=0,r=.707106781):(n=y/(i=Math.sqrt(v)),r=_/i):g<.01?(n=.707106781,i=.707106781,r=0):(n=x/(r=Math.sqrt(g)),i=_/r),this.set(n,i,r,e),this}var b=Math.sqrt((p-h)*(p-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(b)<.001&&(b=1),this.x=(p-h)/b,this.y=(c-d)/b,this.z=(l-s)/b,this.w=Math.acos((o+u+f-1)/2),this},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},e.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},e.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this},je(t,[{key:"width",get:function(){return this.z},set:function(t){this.z=t}},{key:"height",get:function(){return this.w},set:function(t){this.w=t}}]),t}(),un=function(t){function e(e,n,i){var r;return r=t.call(this)||this,Object.defineProperty(Xe(r),"isWebGLRenderTarget",{value:!0}),r.width=e,r.height=n,r.scissor=new ln(0,0,e,n),r.scissorTest=!1,r.viewport=new ln(0,0,e,n),i=i||{},r.texture=new sn(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),r.texture.image={},r.texture.image.width=e,r.texture.image.height=n,r.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,r.texture.minFilter=void 0!==i.minFilter?i.minFilter:ct,r.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,r.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,r.depthTexture=void 0!==i.depthTexture?i.depthTexture:null,r}qe(e,t);var n=e.prototype;return n.setSize=function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},n.clone=function(){return(new this.constructor).copy(this)},n.copy=function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},n.dispose=function(){this.dispatchEvent({type:"dispose"})},e}(Je),hn=function(t){function e(e,n,i){var r;return r=t.call(this,e,n,i)||this,Object.defineProperty(Xe(r),"isWebGLMultisampleRenderTarget",{value:!0}),r.samples=4,r}return qe(e,t),e.prototype.copy=function(e){return t.prototype.copy.call(this,e),this.samples=e.samples,this},e}(un),dn=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=e,this._z=n,this._w=i}t.slerp=function(t,e,n,i){return n.copy(t).slerp(e,i)},t.slerpFlat=function(t,e,n,i,r,a,o){var s=n[i+0],c=n[i+1],l=n[i+2],u=n[i+3],h=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(u!==f||s!==h||c!==d||l!==p){var m=1-o,v=s*h+c*d+l*p+u*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,v*g);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*g;if(s=s*m+h*b,c=c*m+d*b,l=l*m+p*b,u=u*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=w,c*=w,l*=w,u*=w}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=u},t.multiplyQuaternionsFlat=function(t,e,n,i,r,a){var o=n[i],s=n[i+1],c=n[i+2],l=n[i+3],u=r[a],h=r[a+1],d=r[a+2],p=r[a+3];return t[e]=o*p+l*u+s*d-c*h,t[e+1]=s*p+l*h+c*u-o*d,t[e+2]=c*p+l*d+o*h-s*u,t[e+3]=l*p-o*u-s*h-c*d,t};var e=t.prototype;return e.set=function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this},e.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},e.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},e.setFromEuler=function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,a=t._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(i/2),u=o(r/2),h=s(n/2),d=s(i/2),p=s(r/2);switch(a){case"XYZ":this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p;break;case"YXZ":this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p;break;case"ZXY":this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p;break;case"ZYX":this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p;break;case"YZX":this._x=h*l*u+c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u-h*d*p;break;case"XZY":this._x=h*l*u-c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==e&&this._onChangeCallback(),this},e.setFromAxisAngle=function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},e.setFromRotationMatrix=function(t){var e=t.elements,n=e[0],i=e[4],r=e[8],a=e[1],o=e[5],s=e[9],c=e[2],l=e[6],u=e[10],h=n+o+u;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(l-s)*d,this._y=(r-c)*d,this._z=(a-i)*d}else if(n>o&&n>u){var p=2*Math.sqrt(1+n-o-u);this._w=(l-s)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(r+c)/p}else if(o>u){var f=2*Math.sqrt(1+o-n-u);this._w=(r-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(s+l)/f}else{var m=2*Math.sqrt(1+u-n-o);this._w=(a-i)/m,this._x=(r+c)/m,this._y=(s+l)/m,this._z=.25*m}return this._onChangeCallback(),this},e.setFromUnitVectors=function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},e.angleTo=function(t){return 2*Math.acos(Math.abs(en.clamp(this.dot(t),-1,1)))},e.rotateTowards=function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},e.identity=function(){return this.set(0,0,0,1)},e.invert=function(){return this.conjugate()},e.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},e.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},e.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},e.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},e.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},e.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},e.premultiply=function(t){return this.multiplyQuaternions(t,this)},e.multiplyQuaternions=function(t,e){var n=t._x,i=t._y,r=t._z,a=t._w,o=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+a*o+i*c-r*s,this._y=i*l+a*s+r*o-n*c,this._z=r*l+a*c+n*s-i*o,this._w=a*l-n*o-i*s-r*c,this._onChangeCallback(),this},e.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*t._w+n*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-e;return this._w=c*a+e*this._w,this._x=c*n+e*this._x,this._y=c*i+e*this._y,this._z=c*r+e*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),u=Math.atan2(l,o),h=Math.sin((1-e)*u)/l,d=Math.sin(e*u)/l;return this._w=a*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this},e.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},e.fromArray=function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},e.fromBufferAttribute=function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},e._onChange=function(t){return this._onChangeCallback=t,this},e._onChangeCallback=function(){},je(t,[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}]),t}(),pn=function(){function t(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=n}var e=t.prototype;return e.set=function(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this},e.setScalar=function(t){return this.x=t,this.y=t,this.z=t,this},e.setX=function(t){return this.x=t,this},e.setY=function(t){return this.y=t,this},e.setZ=function(t){return this.z=t,this},e.setComponent=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},e.getComponent=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},e.clone=function(){return new this.constructor(this.x,this.y,this.z)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.add=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.sub=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.applyEuler=function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(mn.setFromEuler(t))},e.applyAxisAngle=function(t,e){return this.applyQuaternion(mn.setFromAxisAngle(t,e))},e.applyMatrix3=function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},e.applyNormalMatrix=function(t){return this.applyMatrix3(t).normalize()},e.applyMatrix4=function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this},e.applyQuaternion=function(t){var e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*i-o*n,l=s*n+o*e-r*i,u=s*i+r*n-a*e,h=-r*e-a*n-o*i;return this.x=c*s+h*-r+l*-o-u*-a,this.y=l*s+h*-a+u*-r-c*-o,this.z=u*s+h*-o+c*-a-l*-r,this},e.project=function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},e.unproject=function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},e.transformDirection=function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},e.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},e.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},e.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},e.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},e.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},e.cross=function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},e.crossVectors=function(t,e){var n=t.x,i=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},e.projectOnVector=function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},e.projectOnPlane=function(t){return fn.copy(this).projectOnVector(t),this.sub(fn)},e.reflect=function(t){return this.sub(fn.copy(t).multiplyScalar(2*this.dot(t)))},e.angleTo=function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(en.clamp(n,-1,1))},e.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},e.distanceToSquared=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},e.manhattanDistanceTo=function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},e.setFromSpherical=function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},e.setFromSphericalCoords=function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},e.setFromCylindrical=function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},e.setFromCylindricalCoords=function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},e.setFromMatrixPosition=function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},e.setFromMatrixScale=function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},e.setFromMatrixColumn=function(t,e){return this.fromArray(t.elements,4*e)},e.setFromMatrix3Column=function(t,e){return this.fromArray(t.elements,3*e)},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},e.fromBufferAttribute=function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}(),fn=new pn,mn=new dn,vn=function(){function t(t,e){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new pn(1/0,1/0,1/0),this.max=void 0!==e?e:new pn(-1/0,-1/0,-1/0)}var e=t.prototype;return e.set=function(t,e){return this.min.copy(t),this.max.copy(e),this},e.setFromArray=function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.length;sr&&(r=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},e.setFromBufferAttribute=function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.count;sr&&(r=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},e.setFromPoints=function(t){this.makeEmpty();for(var e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},e.containsBox=function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},e.getParameter=function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new pn),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},e.intersectsBox=function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},e.intersectsSphere=function(t){return this.clampPoint(t.center,xn),xn.distanceToSquared(t.center)<=t.radius*t.radius},e.intersectsPlane=function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},e.intersectsTriangle=function(t){if(this.isEmpty())return!1;this.getCenter(An),Ln.subVectors(this.max,An),bn.subVectors(t.a,An),wn.subVectors(t.b,An),Mn.subVectors(t.c,An),Sn.subVectors(wn,bn),Tn.subVectors(Mn,wn),En.subVectors(bn,Mn);var e=[0,-Sn.z,Sn.y,0,-Tn.z,Tn.y,0,-En.z,En.y,Sn.z,0,-Sn.x,Tn.z,0,-Tn.x,En.z,0,-En.x,-Sn.y,Sn.x,0,-Tn.y,Tn.x,0,-En.y,En.x,0];return!!gn(e,bn,wn,Mn,Ln)&&(!!gn(e=[1,0,0,0,1,0,0,0,1],bn,wn,Mn,Ln)&&(Rn.crossVectors(Sn,Tn),gn(e=[Rn.x,Rn.y,Rn.z],bn,wn,Mn,Ln)))},e.clampPoint=function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new pn),e.copy(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return xn.copy(t).clamp(this.min,this.max).sub(t).length()},e.getBoundingSphere=function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(xn).length(),t},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.applyMatrix4=function(t){return this.isEmpty()?this:(yn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),yn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),yn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),yn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),yn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),yn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),yn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),yn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(yn),this)},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}();function gn(t,e,n,i,r){for(var a=0,o=t.length-3;a<=o;a+=3){Cn.fromArray(t,a);var s=r.x*Math.abs(Cn.x)+r.y*Math.abs(Cn.y)+r.z*Math.abs(Cn.z),c=e.dot(Cn),l=n.dot(Cn),u=i.dot(Cn);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return!1}return!0}var yn=[new pn,new pn,new pn,new pn,new pn,new pn,new pn,new pn],xn=new pn,_n=new vn,bn=new pn,wn=new pn,Mn=new pn,Sn=new pn,Tn=new pn,En=new pn,An=new pn,Ln=new pn,Rn=new pn,Cn=new pn,Pn=new vn,On=function(){function t(t,e){this.center=void 0!==t?t:new pn,this.radius=void 0!==e?e:-1}var e=t.prototype;return e.set=function(t,e){return this.center.copy(t),this.radius=e,this},e.setFromPoints=function(t,e){var n=this.center;void 0!==e?n.copy(e):Pn.setFromPoints(t).getCenter(n);for(var i=0,r=0,a=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},e.getBoundingBox=function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new vn),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},e.applyMatrix4=function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},e.translate=function(t){return this.center.add(t),this},e.equals=function(t){return t.center.equals(this.center)&&t.radius===this.radius},t}(),In=new pn,Dn=new pn,Nn=new pn,Bn=new pn,zn=new pn,Fn=new pn,Hn=new pn,Gn=function(){function t(t,e){this.origin=void 0!==t?t:new pn,this.direction=void 0!==e?e:new pn(0,0,-1)}var e=t.prototype;return e.set=function(t,e){return this.origin.copy(t),this.direction.copy(e),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},e.at=function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new pn),e.copy(this.direction).multiplyScalar(t).add(this.origin)},e.lookAt=function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},e.recast=function(t){return this.origin.copy(this.at(t,In)),this},e.closestPointToPoint=function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new pn),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},e.distanceToPoint=function(t){return Math.sqrt(this.distanceSqToPoint(t))},e.distanceSqToPoint=function(t){var e=In.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(In.copy(this.direction).multiplyScalar(e).add(this.origin),In.distanceToSquared(t))},e.distanceSqToSegment=function(t,e,n,i){Dn.copy(t).add(e).multiplyScalar(.5),Nn.copy(e).sub(t).normalize(),Bn.copy(this.origin).sub(Dn);var r,a,o,s,c=.5*t.distanceTo(e),l=-this.direction.dot(Nn),u=Bn.dot(this.direction),h=-Bn.dot(Nn),d=Bn.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(a=l*u-h,s=c*p,(r=l*h-u)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(r*=f)*(r+l*(a*=f)+2*u)+a*(l*r+a+2*h)+d}else a=c,o=-(r=Math.max(0,-(l*a+u)))*r+a*(a+2*h)+d;else a=-c,o=-(r=Math.max(0,-(l*a+u)))*r+a*(a+2*h)+d;else a<=-s?o=-(r=Math.max(0,-(-l*c+u)))*r+(a=r>0?-c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d:a<=s?(r=0,o=(a=Math.min(Math.max(-c,-h),c))*(a+2*h)+d):o=-(r=Math.max(0,-(l*c+u)))*r+(a=r>0?c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d;else a=l>0?-c:c,o=-(r=Math.max(0,-(l*a+u)))*r+a*(a+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(Nn).multiplyScalar(a).add(Dn),o},e.intersectSphere=function(t,e){In.subVectors(t.center,this.origin);var n=In.dot(this.direction),i=In.dot(In)-n*n,r=t.radius*t.radius;if(i>r)return null;var a=Math.sqrt(r-i),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)},e.intersectsSphere=function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},e.distanceToPlane=function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},e.intersectPlane=function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},e.intersectsPlane=function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},e.intersectBox=function(t,e){var n,i,r,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,i=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,i=(t.min.x-h.x)*c),l>=0?(r=(t.min.y-h.y)*l,a=(t.max.y-h.y)*l):(r=(t.max.y-h.y)*l,a=(t.min.y-h.y)*l),n>a||r>i?null:((r>n||n!=n)&&(n=r),(a=0?(o=(t.min.z-h.z)*u,s=(t.max.z-h.z)*u):(o=(t.max.z-h.z)*u,s=(t.min.z-h.z)*u),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s=0?n:i,e)))},e.intersectsBox=function(t){return null!==this.intersectBox(t,In)},e.intersectTriangle=function(t,e,n,i,r){zn.subVectors(e,t),Fn.subVectors(n,t),Hn.crossVectors(zn,Fn);var a,o=this.direction.dot(Hn);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Bn.subVectors(this.origin,t);var s=a*this.direction.dot(Fn.crossVectors(Bn,Fn));if(s<0)return null;var c=a*this.direction.dot(zn.cross(Bn));if(c<0)return null;if(s+c>o)return null;var l=-a*Bn.dot(Hn);return l<0?null:this.at(l/o,r)},e.applyMatrix4=function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},e.equals=function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)},t}(),Un=function(){function t(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}var e=t.prototype;return e.set=function(t,e,n,i,r,a,o,s,c,l,u,h,d,p,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=i,v[1]=r,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=l,v[10]=u,v[14]=h,v[3]=d,v[7]=p,v[11]=f,v[15]=m,this},e.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},e.clone=function(){return(new t).fromArray(this.elements)},e.copy=function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},e.copyPosition=function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},e.setFromMatrix3=function(t){var e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this},e.extractBasis=function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},e.makeBasis=function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},e.extractRotation=function(t){var e=this.elements,n=t.elements,i=1/kn.setFromMatrixColumn(t,0).length(),r=1/kn.setFromMatrixColumn(t,1).length(),a=1/kn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},e.makeRotationFromEuler=function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var h=a*l,d=a*u,p=o*l,f=o*u;e[0]=s*l,e[4]=-s*u,e[8]=c,e[1]=d+p*c,e[5]=h-f*c,e[9]=-o*s,e[2]=f-h*c,e[6]=p+d*c,e[10]=a*s}else if("YXZ"===t.order){var m=s*l,v=s*u,g=c*l,y=c*u;e[0]=m+y*o,e[4]=g*o-v,e[8]=a*c,e[1]=a*u,e[5]=a*l,e[9]=-o,e[2]=v*o-g,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){var x=s*l,_=s*u,b=c*l,w=c*u;e[0]=x-w*o,e[4]=-a*u,e[8]=b+_*o,e[1]=_+b*o,e[5]=a*l,e[9]=w-x*o,e[2]=-a*c,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){var M=a*l,S=a*u,T=o*l,E=o*u;e[0]=s*l,e[4]=T*c-S,e[8]=M*c+E,e[1]=s*u,e[5]=E*c+M,e[9]=S*c-T,e[2]=-c,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var A=a*s,L=a*c,R=o*s,C=o*c;e[0]=s*l,e[4]=C-A*u,e[8]=R*u+L,e[1]=u,e[5]=a*l,e[9]=-o*l,e[2]=-c*l,e[6]=L*u+R,e[10]=A-C*u}else if("XZY"===t.order){var P=a*s,O=a*c,I=o*s,D=o*c;e[0]=s*l,e[4]=-u,e[8]=c*l,e[1]=P*u+D,e[5]=a*l,e[9]=O*u-I,e[2]=I*u-O,e[6]=o*l,e[10]=D*u+P}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},e.makeRotationFromQuaternion=function(t){return this.compose(Wn,t,jn)},e.lookAt=function(t,e,n){var i=this.elements;return Yn.subVectors(t,e),0===Yn.lengthSq()&&(Yn.z=1),Yn.normalize(),qn.crossVectors(n,Yn),0===qn.lengthSq()&&(1===Math.abs(n.z)?Yn.x+=1e-4:Yn.z+=1e-4,Yn.normalize(),qn.crossVectors(n,Yn)),qn.normalize(),Xn.crossVectors(Yn,qn),i[0]=qn.x,i[4]=Xn.x,i[8]=Yn.x,i[1]=qn.y,i[5]=Xn.y,i[9]=Yn.y,i[2]=qn.z,i[6]=Xn.z,i[10]=Yn.z,this},e.multiply=function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},e.premultiply=function(t){return this.multiplyMatrices(t,this)},e.multiplyMatrices=function(t,e){var n=t.elements,i=e.elements,r=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],L=i[13],R=i[2],C=i[6],P=i[10],O=i[14],I=i[3],D=i[7],N=i[11],B=i[15];return r[0]=a*b+o*T+s*R+c*I,r[4]=a*w+o*E+s*C+c*D,r[8]=a*M+o*A+s*P+c*N,r[12]=a*S+o*L+s*O+c*B,r[1]=l*b+u*T+h*R+d*I,r[5]=l*w+u*E+h*C+d*D,r[9]=l*M+u*A+h*P+d*N,r[13]=l*S+u*L+h*O+d*B,r[2]=p*b+f*T+m*R+v*I,r[6]=p*w+f*E+m*C+v*D,r[10]=p*M+f*A+m*P+v*N,r[14]=p*S+f*L+m*O+v*B,r[3]=g*b+y*T+x*R+_*I,r[7]=g*w+y*E+x*C+_*D,r[11]=g*M+y*A+x*P+_*N,r[15]=g*S+y*L+x*O+_*B,this},e.multiplyScalar=function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},e.determinant=function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],o=t[5],s=t[9],c=t[13],l=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(+r*s*u-i*c*u-r*o*h+n*c*h+i*o*d-n*s*d)+t[7]*(+e*s*d-e*c*h+r*a*h-i*a*d+i*c*l-r*s*l)+t[11]*(+e*c*u-e*o*d-r*a*u+n*a*d+r*o*l-n*c*l)+t[15]*(-i*o*l-e*s*u+e*o*h+i*a*u-n*a*h+n*s*l)},e.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},e.setPosition=function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},e.invert=function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11],p=t[12],f=t[13],m=t[14],v=t[15],g=u*m*c-f*h*c+f*s*d-o*m*d-u*s*v+o*h*v,y=p*h*c-l*m*c-p*s*d+a*m*d+l*s*v-a*h*v,x=l*f*c-p*u*c+p*o*d-a*f*d-l*o*v+a*u*v,_=p*u*s-l*f*s-p*o*h+a*f*h+l*o*m-a*u*m,b=e*g+n*y+i*x+r*_;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var w=1/b;return t[0]=g*w,t[1]=(f*h*r-u*m*r-f*i*d+n*m*d+u*i*v-n*h*v)*w,t[2]=(o*m*r-f*s*r+f*i*c-n*m*c-o*i*v+n*s*v)*w,t[3]=(u*s*r-o*h*r-u*i*c+n*h*c+o*i*d-n*s*d)*w,t[4]=y*w,t[5]=(l*m*r-p*h*r+p*i*d-e*m*d-l*i*v+e*h*v)*w,t[6]=(p*s*r-a*m*r-p*i*c+e*m*c+a*i*v-e*s*v)*w,t[7]=(a*h*r-l*s*r+l*i*c-e*h*c-a*i*d+e*s*d)*w,t[8]=x*w,t[9]=(p*u*r-l*f*r-p*n*d+e*f*d+l*n*v-e*u*v)*w,t[10]=(a*f*r-p*o*r+p*n*c-e*f*c-a*n*v+e*o*v)*w,t[11]=(l*o*r-a*u*r-l*n*c+e*u*c+a*n*d-e*o*d)*w,t[12]=_*w,t[13]=(l*f*i-p*u*i+p*n*h-e*f*h-l*n*m+e*u*m)*w,t[14]=(p*o*i-a*f*i-p*n*s+e*f*s+a*n*m-e*o*m)*w,t[15]=(a*u*i-l*o*i+l*n*s-e*u*s-a*n*h+e*o*h)*w,this},e.scale=function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},e.getMaxScaleOnAxis=function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},e.makeTranslation=function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},e.makeRotationX=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},e.makeRotationY=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},e.makeRotationZ=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},e.makeRotationAxis=function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,o=t.y,s=t.z,c=r*a,l=r*o;return this.set(c*a+n,c*o-i*s,c*s+i*o,0,c*o+i*s,l*o+n,l*s-i*a,0,c*s-i*o,l*s+i*a,r*s*s+n,0,0,0,0,1),this},e.makeScale=function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},e.makeShear=function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},e.compose=function(t,e,n){var i=this.elements,r=e._x,a=e._y,o=e._z,s=e._w,c=r+r,l=a+a,u=o+o,h=r*c,d=r*l,p=r*u,f=a*l,m=a*u,v=o*u,g=s*c,y=s*l,x=s*u,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+v))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(h+v))*b,i[6]=(m+g)*b,i[7]=0,i[8]=(p+y)*w,i[9]=(m-g)*w,i[10]=(1-(h+f))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},e.decompose=function(t,e,n){var i=this.elements,r=kn.set(i[0],i[1],i[2]).length(),a=kn.set(i[4],i[5],i[6]).length(),o=kn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Vn.copy(this);var s=1/r,c=1/a,l=1/o;return Vn.elements[0]*=s,Vn.elements[1]*=s,Vn.elements[2]*=s,Vn.elements[4]*=c,Vn.elements[5]*=c,Vn.elements[6]*=c,Vn.elements[8]*=l,Vn.elements[9]*=l,Vn.elements[10]*=l,e.setFromRotationMatrix(Vn),n.x=r,n.y=a,n.z=o,this},e.makePerspective=function(t,e,n,i,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*r/(e-t),c=2*r/(n-i),l=(e+t)/(e-t),u=(n+i)/(n-i),h=-(a+r)/(a-r),d=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},e.makeOrthographic=function(t,e,n,i,r,a){var o=this.elements,s=1/(e-t),c=1/(n-i),l=1/(a-r),u=(e+t)*s,h=(n+i)*c,d=(a+r)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},e.equals=function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},e.fromArray=function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},e.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t},t}(),kn=new pn,Vn=new Un,Wn=new pn(0,0,0),jn=new pn(1,1,1),qn=new pn,Xn=new pn,Yn=new pn,Zn=function(){function t(e,n,i,r){void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===r&&(r=t.DefaultOrder),Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=n,this._z=i,this._order=r}var e=t.prototype;return e.set=function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},e.clone=function(){return new this.constructor(this._x,this._y,this._z,this._order)},e.copy=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},e.setFromRotationMatrix=function(t,e,n){var i=en.clamp,r=t.elements,a=r[0],o=r[4],s=r[8],c=r[1],l=r[5],u=r[9],h=r[2],d=r[6],p=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,a),this._z=0);break;case"ZXY":this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this},e.setFromQuaternion=function(t,e,n){return Jn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Jn,e,n)},e.setFromVector3=function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},e.reorder=function(t){return Qn.setFromEuler(this),this.setFromQuaternion(Qn,t)},e.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},e.fromArray=function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},e.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},e.toVector3=function(t){return t?t.set(this._x,this._y,this._z):new pn(this._x,this._y,this._z)},e._onChange=function(t){return this._onChangeCallback=t,this},e._onChangeCallback=function(){},je(t,[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}]),t}();Zn.DefaultOrder="XYZ",Zn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Jn=new Un,Qn=new dn,Kn=function(){function t(){this.mask=1}var e=t.prototype;return e.set=function(t){this.mask=1<1){for(var e=0;e1){for(var e=0;e0){i.children=[];for(var p=0;p0){i.animations=[];for(var f=0;f0&&(n.geometries=v),g.length>0&&(n.materials=g),y.length>0&&(n.textures=y),x.length>0&&(n.images=x),_.length>0&&(n.shapes=_),b.length>0&&(n.skeletons=b),w.length>0&&(n.animations=w)}return n.object=i,n;function M(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n1?void 0:e.copy(n).multiplyScalar(r).add(t.start)},e.intersectsLine=function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},e.intersectsBox=function(t){return t.intersectsPlane(this)},e.intersectsSphere=function(t){return t.intersectsPlane(this)},e.coplanarPoint=function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new pn),t.copy(this.normal).multiplyScalar(-this.constant)},e.applyMatrix4=function(t,e){var n=e||mi.getNormalMatrix(t),i=this.coplanarPoint(pi).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},e.translate=function(t){return this.constant-=t.dot(this.normal),this},e.equals=function(t){return t.normal.equals(this.normal)&&t.constant===this.constant},t}(),gi=new pn,yi=new pn,xi=new pn,_i=new pn,bi=new pn,wi=new pn,Mi=new pn,Si=new pn,Ti=new pn,Ei=new pn,Ai=function(){function t(t,e,n){this.a=void 0!==t?t:new pn,this.b=void 0!==e?e:new pn,this.c=void 0!==n?n:new pn}t.getNormal=function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new pn),i.subVectors(n,e),gi.subVectors(t,e),i.cross(gi);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},t.getBarycoord=function(t,e,n,i,r){gi.subVectors(i,e),yi.subVectors(n,e),xi.subVectors(t,e);var a=gi.dot(gi),o=gi.dot(yi),s=gi.dot(xi),c=yi.dot(yi),l=yi.dot(xi),u=a*c-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new pn),0===u)return r.set(-2,-1,-1);var h=1/u,d=(c*s-o*l)*h,p=(a*l-o*s)*h;return r.set(1-d-p,p,d)},t.containsPoint=function(t,e,n,i){return this.getBarycoord(t,e,n,i,_i),_i.x>=0&&_i.y>=0&&_i.x+_i.y<=1},t.getUV=function(t,e,n,i,r,a,o,s){return this.getBarycoord(t,e,n,i,_i),s.set(0,0),s.addScaledVector(r,_i.x),s.addScaledVector(a,_i.y),s.addScaledVector(o,_i.z),s},t.isFrontFacing=function(t,e,n,i){return gi.subVectors(n,e),yi.subVectors(t,e),gi.cross(yi).dot(i)<0};var e=t.prototype;return e.set=function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},e.setFromPointsAndIndices=function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},e.getArea=function(){return gi.subVectors(this.c,this.b),yi.subVectors(this.a,this.b),.5*gi.cross(yi).length()},e.getMidpoint=function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new pn),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},e.getNormal=function(e){return t.getNormal(this.a,this.b,this.c,e)},e.getPlane=function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new vi),t.setFromCoplanarPoints(this.a,this.b,this.c)},e.getBarycoord=function(e,n){return t.getBarycoord(e,this.a,this.b,this.c,n)},e.getUV=function(e,n,i,r,a){return t.getUV(e,this.a,this.b,this.c,n,i,r,a)},e.containsPoint=function(e){return t.containsPoint(e,this.a,this.b,this.c)},e.isFrontFacing=function(e){return t.isFrontFacing(this.a,this.b,this.c,e)},e.intersectsBox=function(t){return t.intersectsTriangle(this)},e.closestPointToPoint=function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new pn);var n,i,r=this.a,a=this.b,o=this.c;bi.subVectors(a,r),wi.subVectors(o,r),Si.subVectors(t,r);var s=bi.dot(Si),c=wi.dot(Si);if(s<=0&&c<=0)return e.copy(r);Ti.subVectors(t,a);var l=bi.dot(Ti),u=wi.dot(Ti);if(l>=0&&u<=l)return e.copy(a);var h=s*u-l*c;if(h<=0&&s>=0&&l<=0)return n=s/(s-l),e.copy(r).addScaledVector(bi,n);Ei.subVectors(t,o);var d=bi.dot(Ei),p=wi.dot(Ei);if(p>=0&&d<=p)return e.copy(o);var f=d*c-s*p;if(f<=0&&c>=0&&p<=0)return i=c/(c-p),e.copy(r).addScaledVector(wi,i);var m=l*p-d*u;if(m<=0&&u-l>=0&&d-p>=0)return Mi.subVectors(o,a),i=(u-l)/(u-l+(d-p)),e.copy(a).addScaledVector(Mi,i);var v=1/(m+f+h);return n=f*v,i=h*v,e.copy(r).addScaledVector(bi,n).addScaledVector(wi,i)},e.equals=function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)},t}(),Li={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},Ri={h:0,s:0,l:0},Ci={h:0,s:0,l:0};function Pi(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Oi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ii(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var Di=function(){function t(t,e,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}var e=t.prototype;return e.set=function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},e.setScalar=function(t){return this.r=t,this.g=t,this.b=t,this},e.setHex=function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},e.setRGB=function(t,e,n){return this.r=t,this.g=e,this.b=n,this},e.setHSL=function(t,e,n){if(t=en.euclideanModulo(t,1),e=en.clamp(e,0,1),n=en.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Pi(r,i,t+1/3),this.g=Pi(r,i,t),this.b=Pi(r,i,t-1/3)}return this},e.setStyle=function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[4]),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[4]),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return e(i[4]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){var l=n[1],u=l.length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},e.setColorName=function(t){var e=Li[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},e.clone=function(){return new this.constructor(this.r,this.g,this.b)},e.copy=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},e.copyGammaToLinear=function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},e.copyLinearToGamma=function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},e.convertGammaToLinear=function(t){return this.copyGammaToLinear(this,t),this},e.convertLinearToGamma=function(t){return this.copyLinearToGamma(this,t),this},e.copySRGBToLinear=function(t){return this.r=Oi(t.r),this.g=Oi(t.g),this.b=Oi(t.b),this},e.copyLinearToSRGB=function(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this},e.convertSRGBToLinear=function(){return this.copySRGBToLinear(this),this},e.convertLinearToSRGB=function(){return this.copyLinearToSRGB(this),this},e.getHex=function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},e.getHexString=function(){return("000000"+this.getHex().toString(16)).slice(-6)},e.getHSL=function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),c=(s+o)/2;if(s===o)e=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case i:e=(r-a)/l+(r0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),a=i(t.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(zi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Fi.prototype=Object.create(zi.prototype),Fi.prototype.constructor=Fi,Fi.prototype.isMeshBasicMaterial=!0,Fi.prototype.copy=function(t){return zi.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Hi=new pn,Gi=new nn;function Ui(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=Ge,this.updateRange={offset:0,count:-1},this.version=0}function ki(t,e,n){Ui.call(this,new Int8Array(t),e,n)}function Vi(t,e,n){Ui.call(this,new Uint8Array(t),e,n)}function Wi(t,e,n){Ui.call(this,new Uint8ClampedArray(t),e,n)}function ji(t,e,n){Ui.call(this,new Int16Array(t),e,n)}function qi(t,e,n){Ui.call(this,new Uint16Array(t),e,n)}function Xi(t,e,n){Ui.call(this,new Int32Array(t),e,n)}function Yi(t,e,n){Ui.call(this,new Uint32Array(t),e,n)}function Zi(t,e,n){Ui.call(this,new Uint16Array(t),e,n)}function Ji(t,e,n){Ui.call(this,new Float32Array(t),e,n)}function Qi(t,e,n){Ui.call(this,new Float64Array(t),e,n)}function Ki(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;ne&&(e=t[n]);return e}Object.defineProperty(Ui.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ui.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i65535?Yi:qi)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,n){void 0===n&&(n=0),this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new rn).getNormalMatrix(t);n.applyNormalMatrix(i),n.needsUpdate=!0}var r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return nr.makeRotationX(t),this.applyMatrix4(nr),this},rotateY:function(t){return nr.makeRotationY(t),this.applyMatrix4(nr),this},rotateZ:function(t){return nr.makeRotationZ(t),this.applyMatrix4(nr),this},translate:function(t,e,n){return nr.makeTranslation(t,e,n),this.applyMatrix4(nr),this},scale:function(t,e,n){return nr.makeScale(t,e,n),this.applyMatrix4(nr),this},lookAt:function(t){return ir.lookAt(t),ir.updateMatrix(),this.applyMatrix4(ir.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(rr).negate(),this.translate(rr.x,rr.y,rr.z),this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var a in r){var o=r[a],s=o.toJSON(t.data);""!==o.name&&(s.name=o.name),t.data.attributes[a]=s}var c={},l=!1;for(var u in this.morphAttributes){for(var h=this.morphAttributes[u],d=[],p=0,f=h.length;p0&&(c[u]=d,l=!0)}l&&(t.data.morphAttributes=c,t.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(t.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(t.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),t},clone:function(){return(new cr).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var e={};this.name=t.name;var n=t.index;null!==n&&this.setIndex(n.clone(e));var i=t.attributes;for(var r in i){var a=i[r];this.setAttribute(r,a.clone(e))}var o=t.morphAttributes;for(var s in o){for(var c=[],l=o[s],u=0,h=l.length;un.far?null:{distance:c,point:Tr.clone(),object:t}}(t,e,n,i,dr,pr,fr,Sr);if(x){s&&(br.fromBufferAttribute(s,h),wr.fromBufferAttribute(s,d),Mr.fromBufferAttribute(s,p),x.uv=Ai.getUV(Sr,dr,pr,fr,br,wr,Mr,new nn)),c&&(br.fromBufferAttribute(c,h),wr.fromBufferAttribute(c,d),Mr.fromBufferAttribute(c,p),x.uv2=Ai.getUV(Sr,dr,pr,fr,br,wr,Mr,new nn));var _=new Ni(h,d,p);Ai.getNormal(dr,pr,fr,_.normal),x.face=_}return x}Er.prototype=Object.assign(Object.create(di.prototype),{constructor:Er,isMesh:!0,copy:function(t){return di.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var i=e[n[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var r=0,a=i.length;r0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),hr.copy(i.boundingSphere),hr.applyMatrix4(a),!1!==t.ray.intersectsSphere(hr)&&(lr.copy(a).invert(),ur.copy(t.ray).applyMatrix4(lr),null===i.boundingBox||!1!==ur.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var o=i.index,s=i.attributes.position,c=i.morphAttributes.position,l=i.morphTargetsRelative,u=i.attributes.uv,h=i.attributes.uv2,d=i.groups,p=i.drawRange;if(null!==o)if(Array.isArray(r))for(var f=0,m=d.length;f0?1:-1,h.push(A.x,A.y,A.z),d.push(C/m),d.push(1-L/v),T+=1}for(var O=0;O0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)!0===this.extensions[a]&&(r[a]=!0);return Object.keys(r).length>0&&(e.extensions=r),e},Nr.prototype=Object.assign(Object.create(di.prototype),{constructor:Nr,isCamera:!0,copy:function(t,e){return di.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new pn),this.updateWorldMatrix(!0,!1);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){di.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){di.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Br.prototype=Object.assign(Object.create(Nr.prototype),{constructor:Br,isPerspectiveCamera:!0,copy:function(t,e){return Nr.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*en.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*en.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*en.RAD2DEG*Math.atan(Math.tan(.5*en.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*en.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,e-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(r+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){var e=di.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});var zr=90,Fr=1;function Hr(t,e,n){if(di.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var i=new Br(zr,Fr,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new pn(1,0,0)),this.add(i);var r=new Br(zr,Fr,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new pn(-1,0,0)),this.add(r);var a=new Br(zr,Fr,t,e);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new pn(0,1,0)),this.add(a);var o=new Br(zr,Fr,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new pn(0,-1,0)),this.add(o);var s=new Br(zr,Fr,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new pn(0,0,1)),this.add(s);var c=new Br(zr,Fr,t,e);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new pn(0,0,-1)),this.add(c),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var l=t.xr.enabled,u=t.getRenderTarget();t.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,a),t.setRenderTarget(n,3),t.render(e,o),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=h,t.setRenderTarget(n,5),t.render(e,c),t.setRenderTarget(u),t.xr.enabled=l}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function Gr(t,e,n,i,r,a,o,s,c,l){t=void 0!==t?t:[],e=void 0!==e?e:J,o=void 0!==o?o:St,sn.call(this,t,e,n,i,r,a,o,s,c,l),this.flipY=!1,this._needsFlipEnvMap=!0}Hr.prototype=Object.create(di.prototype),Hr.prototype.constructor=Hr,Gr.prototype=Object.create(sn.prototype),Gr.prototype.constructor=Gr,Gr.prototype.isCubeTexture=!0,Object.defineProperty(Gr.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var Ur=function(t){function e(e,n,i){var r;return Number.isInteger(n)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),n=i),r=t.call(this,e,e,n)||this,Object.defineProperty(Xe(r),"isWebGLCubeRenderTarget",{value:!0}),n=n||{},r.texture=new Gr(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),r.texture._needsFlipEnvMap=!1,r}qe(e,t);var n=e.prototype;return n.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=Tt,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;var n={tEquirect:{value:null}},i="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",r="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",a=new Lr(5,5,5),o=new Dr({name:"CubemapFromEquirect",uniforms:Rr(n),vertexShader:i,fragmentShader:r,side:l,blending:h});o.uniforms.tEquirect.value=e;var s=new Er(a,o),c=e.minFilter;return e.minFilter===ut&&(e.minFilter=ct),new Hr(1,10,this).update(t,s),e.minFilter=c,s.geometry.dispose(),s.material.dispose(),this},n.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,n,i);t.setRenderTarget(r)},e}(un);function kr(t,e,n,i,r,a,o,s,c,l,u,h){sn.call(this,null,a,o,s,c,l,i,r,u,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==c?c:at,this.minFilter=void 0!==l?l:at,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}kr.prototype=Object.create(sn.prototype),kr.prototype.constructor=kr,kr.prototype.isDataTexture=!0;var Vr=new On,Wr=new pn,jr=function(){function t(t,e,n,i,r,a){this.planes=[void 0!==t?t:new vi,void 0!==e?e:new vi,void 0!==n?n:new vi,void 0!==i?i:new vi,void 0!==r?r:new vi,void 0!==a?a:new vi]}var e=t.prototype;return e.set=function(t,e,n,i,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},e.setFromProjectionMatrix=function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return e[0].setComponents(o-i,u-s,f-h,y-m).normalize(),e[1].setComponents(o+i,u+s,f+h,y+m).normalize(),e[2].setComponents(o+r,u+c,f+d,y+v).normalize(),e[3].setComponents(o-r,u-c,f-d,y-v).normalize(),e[4].setComponents(o-a,u-l,f-p,y-g).normalize(),e[5].setComponents(o+a,u+l,f+p,y+g).normalize(),this},e.intersectsObject=function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Vr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Vr)},e.intersectsSprite=function(t){return Vr.center.set(0,0,0),Vr.radius=.7071067811865476,Vr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Vr)},e.intersectsSphere=function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,Wr.y=i.normal.y>0?t.max.y:t.min.y,Wr.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Wr)<0)return!1}return!0},e.containsPoint=function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0},t}();function qr(){var t=null,e=!1,n=null,i=null;function r(e,a){n(e,a),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Xr(t,e){var n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){var a=i.get(e);(!a||a.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(\t\t0, 1,\t\t0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(\t1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,\t1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,\t1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},Jr={common:{diffuse:{value:new Di(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new rn},uv2Transform:{value:new rn},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new nn(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Di(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Di(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new rn}},sprite:{diffuse:{value:new Di(15658734)},opacity:{value:1},center:{value:new nn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new rn}}},Qr={basic:{uniforms:Cr([Jr.common,Jr.specularmap,Jr.envmap,Jr.aomap,Jr.lightmap,Jr.fog]),vertexShader:Zr.meshbasic_vert,fragmentShader:Zr.meshbasic_frag},lambert:{uniforms:Cr([Jr.common,Jr.specularmap,Jr.envmap,Jr.aomap,Jr.lightmap,Jr.emissivemap,Jr.fog,Jr.lights,{emissive:{value:new Di(0)}}]),vertexShader:Zr.meshlambert_vert,fragmentShader:Zr.meshlambert_frag},phong:{uniforms:Cr([Jr.common,Jr.specularmap,Jr.envmap,Jr.aomap,Jr.lightmap,Jr.emissivemap,Jr.bumpmap,Jr.normalmap,Jr.displacementmap,Jr.fog,Jr.lights,{emissive:{value:new Di(0)},specular:{value:new Di(1118481)},shininess:{value:30}}]),vertexShader:Zr.meshphong_vert,fragmentShader:Zr.meshphong_frag},standard:{uniforms:Cr([Jr.common,Jr.envmap,Jr.aomap,Jr.lightmap,Jr.emissivemap,Jr.bumpmap,Jr.normalmap,Jr.displacementmap,Jr.roughnessmap,Jr.metalnessmap,Jr.fog,Jr.lights,{emissive:{value:new Di(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Zr.meshphysical_vert,fragmentShader:Zr.meshphysical_frag},toon:{uniforms:Cr([Jr.common,Jr.aomap,Jr.lightmap,Jr.emissivemap,Jr.bumpmap,Jr.normalmap,Jr.displacementmap,Jr.gradientmap,Jr.fog,Jr.lights,{emissive:{value:new Di(0)}}]),vertexShader:Zr.meshtoon_vert,fragmentShader:Zr.meshtoon_frag},matcap:{uniforms:Cr([Jr.common,Jr.bumpmap,Jr.normalmap,Jr.displacementmap,Jr.fog,{matcap:{value:null}}]),vertexShader:Zr.meshmatcap_vert,fragmentShader:Zr.meshmatcap_frag},points:{uniforms:Cr([Jr.points,Jr.fog]),vertexShader:Zr.points_vert,fragmentShader:Zr.points_frag},dashed:{uniforms:Cr([Jr.common,Jr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Zr.linedashed_vert,fragmentShader:Zr.linedashed_frag},depth:{uniforms:Cr([Jr.common,Jr.displacementmap]),vertexShader:Zr.depth_vert,fragmentShader:Zr.depth_frag},normal:{uniforms:Cr([Jr.common,Jr.bumpmap,Jr.normalmap,Jr.displacementmap,{opacity:{value:1}}]),vertexShader:Zr.normal_vert,fragmentShader:Zr.normal_frag},sprite:{uniforms:Cr([Jr.sprite,Jr.fog]),vertexShader:Zr.sprite_vert,fragmentShader:Zr.sprite_frag},background:{uniforms:{uvTransform:{value:new rn},t2D:{value:null}},vertexShader:Zr.background_vert,fragmentShader:Zr.background_frag},cube:{uniforms:Cr([Jr.envmap,{opacity:{value:1}}]),vertexShader:Zr.cube_vert,fragmentShader:Zr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Zr.equirect_vert,fragmentShader:Zr.equirect_frag},distanceRGBA:{uniforms:Cr([Jr.common,Jr.displacementmap,{referencePosition:{value:new pn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Zr.distanceRGBA_vert,fragmentShader:Zr.distanceRGBA_frag},shadow:{uniforms:Cr([Jr.lights,Jr.fog,{color:{value:new Di(0)},opacity:{value:1}}]),vertexShader:Zr.shadow_vert,fragmentShader:Zr.shadow_frag}};function Kr(t,e,n,i,r){var a,o,s=new Di(0),u=0,h=null,d=0,p=null;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return s},setClearColor:function(t,e){void 0===e&&(e=1),s.set(t),f(s,u=e)},getClearAlpha:function(){return u},setClearAlpha:function(t){f(s,u=t)},render:function(n,r,m,v){var g=!0===r.isScene?r.background:null;g&&g.isTexture&&(g=e.get(g));var y=t.xr,x=y.getSession&&y.getSession();x&&"additive"===x.environmentBlendMode&&(g=null),null===g?f(s,u):g&&g.isColor&&(f(g,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.isWebGLCubeRenderTarget||g.mapping===tt)?(void 0===o&&((o=new Er(new Lr(1,1,1),new Dr({name:"BackgroundCubeMaterial",uniforms:Rr(Qr.cube.uniforms),vertexShader:Qr.cube.vertexShader,fragmentShader:Qr.cube.fragmentShader,side:l,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(o)),g.isWebGLCubeRenderTarget&&(g=g.texture),o.material.uniforms.envMap.value=g,o.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g._needsFlipEnvMap?-1:1,h===g&&d===g.version&&p===t.toneMapping||(o.material.needsUpdate=!0,h=g,d=g.version,p=t.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null)):g&&g.isTexture&&(void 0===a&&((a=new Er(new Yr(2,2),new Dr({name:"BackgroundMaterial",uniforms:Rr(Qr.background.uniforms),vertexShader:Qr.background.vertexShader,fragmentShader:Qr.background.fragmentShader,side:c,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(a)),a.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),h===g&&d===g.version&&p===t.toneMapping||(a.material.needsUpdate=!0,h=g,d=g.version,p=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function $r(t,e,n,i){var r=t.getParameter(34921),a=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||null!==a,s={},c=d(null),l=c;function u(e){return i.isWebGL2?t.bindVertexArray(e):a.bindVertexArrayOES(e)}function h(e){return i.isWebGL2?t.deleteVertexArray(e):a.deleteVertexArrayOES(e)}function d(t){for(var e=[],n=[],i=[],a=0;a=0){var y=c[h];if(void 0!==y){var x=y.normalized,_=y.itemSize,b=n.get(y);if(void 0===b)continue;var w=b.buffer,M=b.type,S=b.bytesPerElement;if(y.isInterleavedBufferAttribute){var T=y.data,E=T.stride,A=y.offset;T&&T.isInstancedInterleavedBuffer?(m(d,T.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=T.meshPerAttribute*T.count)):f(d),t.bindBuffer(34962,w),g(d,_,M,x,E*S,A*S)}else y.isInstancedBufferAttribute?(m(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):f(d),t.bindBuffer(34962,w),g(d,_,M,x,0,0)}else if("instanceMatrix"===h){var L=n.get(r.instanceMatrix);if(void 0===L)continue;var R=L.buffer,C=L.type;m(d+0,1),m(d+1,1),m(d+2,1),m(d+3,1),t.bindBuffer(34962,R),t.vertexAttribPointer(d+0,4,C,!1,64,0),t.vertexAttribPointer(d+1,4,C,!1,64,16),t.vertexAttribPointer(d+2,4,C,!1,64,32),t.vertexAttribPointer(d+3,4,C,!1,64,48)}else if("instanceColor"===h){var P=n.get(r.instanceColor);if(void 0===P)continue;var O=P.buffer,I=P.type;m(d,1),t.bindBuffer(34962,O),t.vertexAttribPointer(d,3,I,!1,12,0)}else if(void 0!==u){var D=u[h];if(void 0!==D)switch(D.length){case 2:t.vertexAttrib2fv(d,D);break;case 3:t.vertexAttrib3fv(d,D);break;case 4:t.vertexAttrib4fv(d,D);break;default:t.vertexAttrib1fv(d,D)}}}}v()}}(r,c,h,y),null!==x&&t.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){for(var t in y(),s){var e=s[t];for(var n in e){var i=e[n];for(var r in i)h(i[r].object),delete i[r];delete e[n]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0!==s[t.id]){var e=s[t.id];for(var n in e){var i=e[n];for(var r in i)h(i[r].object),delete i[r];delete e[n]}delete s[t.id]}},releaseStatesOfProgram:function(t){for(var e in s){var n=s[e];if(void 0!==n[t.id]){var i=n[t.id];for(var r in i)h(i[r].object),delete i[r];delete n[t.id]}}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:v}}function ta(t,e,n,i){var r,a=i.isWebGL2;this.setMode=function(t){r=t},this.render=function(e,i){t.drawArrays(r,e,i),n.update(i,r,1)},this.renderInstances=function(i,o,s){if(0!==s){var c,l;if(a)c=t,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[l](r,i,o,s),n.update(o,r,s)}}}function ea(t,e,n){var i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===n.logarithmicDepthBuffer,l=t.getParameter(34930),u=t.getParameter(35660),h=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),v=t.getParameter(36349),g=u>0,y=a||!!e.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:a?t.getParameter(36183):0}}function na(t){var e=this,n=null,i=0,r=!1,a=!1,o=new vi,s=new rn,c={value:null,needsUpdate:!1};function l(){c.value!==n&&(c.value=n,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(t,n,i,r){var a=null!==t?t.length:0,l=null;if(0!==a){if(l=c.value,!0!==r||null===l){var u=i+4*a,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===l||l.length0){var s=t.getRenderList(),c=t.getRenderTarget(),l=new Ur(o.height/2);return l.fromEquirectangularTexture(t,r),e.set(r,l),t.setRenderTarget(c),t.setRenderList(s),r.addEventListener("dispose",i),n(l.texture,r.mapping)}return null}}return r},dispose:function(){e=new WeakMap}}}function ra(t){var e={};function n(n){if(void 0!==e[n])return e[n];var i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(t){var e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function aa(t,e,n,i){var r={},a=new WeakMap;function o(t){var s=t.target;for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);s.removeEventListener("dispose",o),delete r[s.id];var l=a.get(s);l&&(e.remove(l),a.delete(s)),i.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){var n=[],i=t.index,r=t.attributes.position,o=0;if(null!==i){var s=i.array;o=i.version;for(var c=0,l=s.length;c65535?Yi:qi)(n,1);x.version=o;var _=a.get(t);_&&e.remove(_),a.set(t,x)}return{get:function(t,e){return!0===r[e.id]?e:(e.addEventListener("dispose",o),r[e.id]=!0,n.memory.geometries++,e)},update:function(t){var n=t.attributes;for(var i in n)e.update(n[i],34962);var r=t.morphAttributes;for(var a in r)for(var o=r[a],s=0,c=o.length;s0)return t;var r=e*n,a=ya[r];if(void 0===a&&(a=new Float32Array(r),ya[r]=a),0!==e){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function Sa(t,e){if(t.length!==e.length)return!1;for(var n=0,i=t.length;n/gm;function _o(t){return t.replace(xo,bo)}function bo(t,e){var n=Zr[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return _o(n)}var wo=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Mo=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function So(t){return t.replace(Mo,Eo).replace(wo,To)}function To(t,e,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Eo(t,e,n,i)}function Eo(t,e,n,i){for(var r="",a=parseInt(e);a0?t.gammaFactor:1,b=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(vo).join("\n")}(n),w=function(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(p),M=d.createProgram(),S=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((r=[w].filter(vo).join("\n")).length>0&&(r+="\n"),(c=[b,w].filter(vo).join("\n")).length>0&&(c+="\n")):(r=[Ao(n),"#define SHADER_NAME "+n.shaderName,w,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+_,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+y:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+v:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(vo).join("\n"),c=[b,Ao(n),"#define SHADER_NAME "+n.shaderName,w,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+_,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.envMap?"#define "+y:"",n.envMap?"#define "+x:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+v:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==W?"#define TONE_MAPPING":"",n.toneMapping!==W?Zr.tonemapping_pars_fragment:"",n.toneMapping!==W?mo("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Zr.encodings_pars_fragment,n.map?fo("mapTexelToLinear",n.mapEncoding):"",n.matcap?fo("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?fo("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?fo("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?fo("lightMapTexelToLinear",n.lightMapEncoding):"",(l="linearToOutputTexel",u=n.outputEncoding,h=ho(u),"vec4 "+l+"( vec4 value ) { return LinearTo"+h[0]+h[1]+"; }"),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(vo).join("\n")),f=yo(f=go(f=_o(f),n),n),m=yo(m=go(m=_o(m),n),n),f=So(f),m=So(m),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",r=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,c=["#define varying in",n.glslVersion===ke?"":"out highp vec4 pc_fragColor;",n.glslVersion===ke?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+c);var T,E,A=S+c+m,L=lo(d,35633,S+r+f),R=lo(d,35632,A);if(d.attachShader(M,L),d.attachShader(M,R),void 0!==n.index0AttributeName?d.bindAttribLocation(M,0,n.index0AttributeName):!0===n.morphTargets&&d.bindAttribLocation(M,0,"position"),d.linkProgram(M),t.debug.checkShaderErrors){var C=d.getProgramInfoLog(M).trim(),P=d.getShaderInfoLog(L).trim(),O=d.getShaderInfoLog(R).trim(),I=!0,D=!0;if(!1===d.getProgramParameter(M,35714)){I=!1;var N=po(d,L,"vertex"),B=po(d,R,"fragment");console.error("THREE.WebGLProgram: shader error: ",d.getError(),"35715",d.getProgramParameter(M,35715),"gl.getProgramInfoLog",C,N,B)}else""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==P&&""!==O||(D=!1);D&&(this.diagnostics={runnable:I,programLog:C,vertexShader:{log:P,prefix:r},fragmentShader:{log:O,prefix:c}})}return d.deleteShader(L),d.deleteShader(R),this.getUniforms=function(){return void 0===T&&(T=new co(d,M)),T},this.getAttributes=function(){return void 0===E&&(E=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r0,maxBones:E,useVertexTexture:h,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&v.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:W,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===u,flipSided:r.side===l,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)n.push(i),n.push(e.defines[i]);if(!1===e.isRawShaderMaterial){for(var r=0;r1&&i.sort(t||Po),r.length>1&&r.sort(e||Oo)}}}function Do(t){var e=new WeakMap;return{get:function(n,i){var r,a=e.get(n);return void 0===a?(r=new Io(t),e.set(n,new WeakMap),e.get(n).set(i,r)):void 0===(r=a.get(i))&&(r=new Io(t),a.set(i,r)),r},dispose:function(){e=new WeakMap}}}function No(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new pn,color:new Di};break;case"SpotLight":n={position:new pn,direction:new pn,color:new Di,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new pn,color:new Di,distance:0,decay:0};break;case"HemisphereLight":n={direction:new pn,skyColor:new Di,groundColor:new Di};break;case"RectAreaLight":n={color:new Di,position:new pn,halfWidth:new pn,halfHeight:new pn}}return t[e.id]=n,n}}}var Bo=0;function zo(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Fo(t,e){for(var n,i=new No,r=(n={},{get:function(t){if(void 0!==n[t.id])return n[t.id];var e;switch(t.type){case"DirectionalLight":case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nn};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nn,shadowCameraNear:1,shadowCameraFar:1e3}}return n[t.id]=e,e}}),a={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)a.probe.push(new pn);var s=new pn,c=new Un,l=new Un;return{setup:function(n){for(var o=0,s=0,c=0,l=0;l<9;l++)a.probe[l].set(0,0,0);var u=0,h=0,d=0,p=0,f=0,m=0,v=0,g=0;n.sort(zo);for(var y=0,x=n.length;y0&&(e.isWebGL2?(a.rectAreaLTC1=Jr.LTC_FLOAT_1,a.rectAreaLTC2=Jr.LTC_FLOAT_2):!0===t.has("OES_texture_float_linear")?(a.rectAreaLTC1=Jr.LTC_FLOAT_1,a.rectAreaLTC2=Jr.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(a.rectAreaLTC1=Jr.LTC_HALF_1,a.rectAreaLTC2=Jr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),a.ambient[0]=o,a.ambient[1]=s,a.ambient[2]=c;var z=a.hash;z.directionalLength===u&&z.pointLength===h&&z.spotLength===d&&z.rectAreaLength===p&&z.hemiLength===f&&z.numDirectionalShadows===m&&z.numPointShadows===v&&z.numSpotShadows===g||(a.directional.length=u,a.spot.length=d,a.rectArea.length=p,a.point.length=h,a.hemi.length=f,a.directionalShadow.length=m,a.directionalShadowMap.length=m,a.pointShadow.length=v,a.pointShadowMap.length=v,a.spotShadow.length=g,a.spotShadowMap.length=g,a.directionalShadowMatrix.length=m,a.pointShadowMatrix.length=v,a.spotShadowMatrix.length=g,z.directionalLength=u,z.pointLength=h,z.spotLength=d,z.rectAreaLength=p,z.hemiLength=f,z.numDirectionalShadows=m,z.numPointShadows=v,z.numSpotShadows=g,a.version=Bo++)},setupView:function(t,e){for(var n=0,i=0,r=0,o=0,u=0,h=e.matrixWorldInverse,d=0,p=t.length;d=n.get(i).length?(a=new Ho(t,e),n.get(i).push(a)):a=n.get(i)[r],a},dispose:function(){n=new WeakMap}}}function Uo(t){zi.call(this),this.type="MeshDepthMaterial",this.depthPacking=De,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function ko(t){zi.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new pn,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Uo.prototype=Object.create(zi.prototype),Uo.prototype.constructor=Uo,Uo.prototype.isMeshDepthMaterial=!0,Uo.prototype.copy=function(t){return zi.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},ko.prototype=Object.create(zi.prototype),ko.prototype.constructor=ko,ko.prototype.isMeshDistanceMaterial=!0,ko.prototype.copy=function(t){return zi.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};var Vo="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",Wo="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function jo(t,e,n){var i=new jr,r=new nn,o=new nn,d=new ln,p=[],f=[],m={},v={0:l,1:c,2:u},g=new Dr({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new nn},radius:{value:4}},vertexShader:Wo,fragmentShader:Vo}),y=g.clone();y.defines.HORIZONTAL_PASS=1;var x=new cr;x.setAttribute("position",new Ui(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var _=new Er(x,g),b=this;function w(n,i){var r=e.update(_);g.uniforms.shadow_pass.value=n.map.texture,g.uniforms.resolution.value=n.mapSize,g.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,g,_,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,y,_,null)}function M(t,e,n){var i=t<<0|e<<1|n<<2,r=p[i];return void 0===r&&(r=new Uo({depthPacking:Ne,morphTargets:t,skinning:e}),p[i]=r),r}function S(t,e,n){var i=t<<0|e<<1|n<<2,r=f[i];return void 0===r&&(r=new ko({morphTargets:t,skinning:e}),f[i]=r),r}function T(e,n,i,r,a,o,c){var l=null,u=M,h=e.customDepthMaterial;if(!0===r.isPointLight&&(u=S,h=e.customDistanceMaterial),void 0===h){var d=!1;!0===i.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var p=!1;!0===e.isSkinnedMesh&&(!0===i.skinning?p=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),l=u(d,p,!0===e.isInstancedMesh)}else l=h;if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){var f=l.uuid,g=i.uuid,y=m[f];void 0===y&&(y={},m[f]=y);var x=y[g];void 0===x&&(x=l.clone(),y[g]=x),l=x}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=c===s?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:v[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=a,l.farDistance=o),l}function E(n,r,a,o,c){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&c===s)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var l=e.update(n),u=n.material;if(Array.isArray(u))for(var h=l.groups,d=0,p=h.length;dn||r.y>n)&&(r.x>n&&(o.x=Math.floor(n/x.x),r.x=o.x*x.x,y.mapSize.x=o.x),r.y>n&&(o.y=Math.floor(n/x.y),r.y=o.y*x.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&this.type===s){var _={minFilter:ct,magFilter:ct,format:Tt};y.map=new un(r.x,r.y,_),y.map.texture.name=g.name+".shadowMap",y.mapPass=new un(r.x,r.y,_),y.camera.updateProjectionMatrix()}if(null===y.map){var M={minFilter:at,magFilter:at,format:Tt};y.map=new un(r.x,r.y,M),y.map.texture.name=g.name+".shadowMap",y.camera.updateProjectionMatrix()}t.setRenderTarget(y.map),t.clear();for(var S=y.getViewportCount(),T=0;T=1):-1!==lt.indexOf("OpenGL ES")&&(ct=parseFloat(/^OpenGL ES (\d)/.exec(lt)[1]),st=ct>=2);var ut=null,ht={},dt=new ln,pt=new ln;function ft(e,n,i){var r=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var o=0;oi||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?en.floorPowerOfTwo:Math.floor,o=a(r*t.width),s=a(r*t.height);void 0===l&&(l=g(o,s));var c=n?g(o,s):l;return c.width=o,c.height=s,c.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+s+")."),c}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return en.isPowerOfTwo(t.width)&&en.isPowerOfTwo(t.height)}function _(t,e){return t.generateMipmaps&&e&&t.minFilter!==at&&t.minFilter!==ct}function b(e,n,r,a){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function w(n,i,r){if(!1===u)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=i;return 6403===i&&(5126===r&&(a=33326),5131===r&&(a=33325),5121===r&&(a=33321)),6407===i&&(5126===r&&(a=34837),5131===r&&(a=34843),5121===r&&(a=32849)),6408===i&&(5126===r&&(a=34836),5131===r&&(a=34842),5121===r&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||e.get("EXT_color_buffer_float"),a}function M(t){return t===at||t===ot||t===st?9728:9729}function S(e){var n=e.target;n.removeEventListener("dispose",S),function(e){var n=i.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),i.remove(e)}(n),n.isVideoTexture&&m.delete(n),o.memory.textures--}function T(e){var n=e.target;n.removeEventListener("dispose",T),function(e){var n=i.get(e),r=i.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)t.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[a]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);i.remove(e.texture),i.remove(e)}(n),o.memory.textures--}var E=0;function A(t,e){var r=i.get(t);if(t.isVideoTexture&&function(t){var e=o.render.frame;m.get(t)!==e&&(m.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){var a=t.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void I(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function L(e,r){var o=i.get(e);e.version>0&&o.__version!==e.version?function(e,i,r){if(6!==i.image.length)return;O(e,i),n.activeTexture(33984+r),n.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);for(var o=i&&(i.isCompressedTexture||i.image[0].isCompressedTexture),s=i.image[0]&&i.image[0].isDataTexture,c=[],l=0;l<6;l++)c[l]=o||s?s?i.image[l].image:i.image[l]:y(i.image[l],!1,!0,d);var h,p=c[0],f=x(p)||u,m=a.convert(i.format),v=a.convert(i.type),g=w(i.internalFormat,m,v);if(P(34067,i,f),o){for(var M=0;M<6;M++){h=c[M].mipmaps;for(var S=0;S1||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function O(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",S),e.__webglTexture=t.createTexture(),o.memory.textures++)}function I(e,i,r){var o=3553;i.isDataTexture2DArray&&(o=35866),i.isDataTexture3D&&(o=32879),O(e,i),n.activeTexture(33984+r),n.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);var s,c=function(t){return!u&&(t.wrapS!==it||t.wrapT!==it||t.minFilter!==at&&t.minFilter!==ct)}(i)&&!1===x(i.image),l=y(i.image,c,!1,p),h=x(l)||u,d=a.convert(i.format),f=a.convert(i.type),m=w(i.internalFormat,d,f);P(o,i,h);var v=i.mipmaps;if(i.isDepthTexture)m=6402,u?m=i.type===gt?36012:i.type===vt?33190:i.type===wt?35056:33189:i.type===gt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===Rt&&6402===m&&i.type!==ft&&i.type!==vt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=ft,f=a.convert(i.type)),i.format===Ct&&6402===m&&(m=34041,i.type!==wt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=wt,f=a.convert(i.type))),n.texImage2D(3553,0,m,l.width,l.height,0,d,f,null);else if(i.isDataTexture)if(v.length>0&&h){for(var g=0,M=v.length;g0&&h){for(var E=0,A=v.length;E=h&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+h),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=A,this.setTexture2DArray=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?I(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?I(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=L,this.setupRenderTarget=function(e){var r=i.get(e),s=i.get(e.texture);e.addEventListener("dispose",T),s.__webglTexture=t.createTexture(),o.memory.textures++;var c=!0===e.isWebGLCubeRenderTarget,l=!0===e.isWebGLMultisampleRenderTarget,h=x(e)||u;if(!u||e.texture.format!==St||e.texture.type!==gt&&e.texture.type!==yt||(e.texture.format=Tt,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){r.__webglFramebuffer=[];for(var d=0;d<6;d++)r.__webglFramebuffer[d]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),l)if(u){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);var p=a.convert(e.texture.format),f=a.convert(e.texture.type),m=w(e.texture.internalFormat,p,f),v=z(e);t.renderbufferStorageMultisample(36161,v,m,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),N(r.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,s.__webglTexture),P(34067,e.texture,h);for(var g=0;g<6;g++)D(r.__webglFramebuffer[g],e,36064,34069+g);_(e.texture,h)&&b(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),P(3553,e.texture,h),D(r.__webglFramebuffer,e,36064,3553),_(e.texture,h)&&b(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&B(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(_(e,x(t)||u)){var r=t.isWebGLCubeRenderTarget?34067:3553,a=i.get(e).__webglTexture;n.bindTexture(r,a),b(r,e,t.width,t.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(u){var n=i.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var r=e.width,a=e.height,o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),A(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===H&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),H=!0),t=t.texture),L(t,e)}}function Yo(t,e,n){var i=n.isWebGL2;return{convert:function(t){var n;if(t===ht)return 5121;if(t===xt)return 32819;if(t===_t)return 32820;if(t===bt)return 33635;if(t===dt)return 5120;if(t===pt)return 5122;if(t===ft)return 5123;if(t===mt)return 5124;if(t===vt)return 5125;if(t===gt)return 5126;if(t===yt)return i?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===Mt)return 6406;if(t===St)return 6407;if(t===Tt)return 6408;if(t===Et)return 6409;if(t===At)return 6410;if(t===Rt)return 6402;if(t===Ct)return 34041;if(t===Pt)return 6403;if(t===Ot)return 36244;if(t===It)return 33319;if(t===Dt)return 33320;if(t===Nt)return 36248;if(t===Bt)return 36249;if(t===zt||t===Ft||t===Ht||t===Gt){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(t===zt)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Ft)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Ht)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Gt)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===Ut||t===kt||t===Vt||t===Wt){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===Ut)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===kt)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Vt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Wt)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===jt)return null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===qt||t===Xt)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(t===qt)return n.COMPRESSED_RGB8_ETC2;if(t===Xt)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===Yt||t===Zt||t===Jt||t===Qt||t===Kt||t===$t||t===te||t===ee||t===ne||t===ie||t===re||t===ae||t===oe||t===se||t===le||t===ue||t===he||t===de||t===pe||t===fe||t===me||t===ve||t===ge||t===ye||t===xe||t===_e||t===be||t===we?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:t===ce?null!==(n=e.get("EXT_texture_compression_bptc"))?t:null:t===wt?i?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Zo(t){void 0===t&&(t=[]),Br.call(this),this.cameras=t}function Jo(){di.call(this),this.type="Group"}function Qo(){this._targetRay=null,this._grip=null,this._hand=null}function Ko(t,e){var n=this,i=null,r=1,a=null,o="local-floor",s=null,c=[],l=new Map,u=new Br;u.layers.enable(1),u.viewport=new ln;var h=new Br;h.layers.enable(2),h.viewport=new ln;var d=[u,h],p=new Zo;p.layers.enable(1),p.layers.enable(2);var f=null,m=null;function v(t){var e=l.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function g(){l.forEach(function(t,e){t.disconnect(e)}),l.clear(),f=null,m=null,t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),M.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(t){for(var e=i.inputSources,n=0;n0&&At(a,t,e),o.length>0&&At(o,t,e),!0===t.isScene&&t.onAfterRender(m,t,e),null!==_&&(Y.updateRenderTargetMipmap(_),Y.updateMultisampleRenderTarget(_)),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),f.pop(),p=f.length>0?f[f.length-1]:null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){g!==t&&null===_&&ut.bindFramebuffer(36160,t),g=t},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return x},this.getRenderList=function(){return d},this.setRenderList=function(t){d=t},this.getRenderTarget=function(){return _},this.setRenderTarget=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),_=t,y=e,x=n,t&&void 0===X.get(t).__webglFramebuffer&&Y.setupRenderTarget(t);var i=g,r=!1;if(t){var a=X.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=a[e],r=!0):i=t.isWebGLMultisampleRenderTarget?X.get(t).__webglMultisampledFramebuffer:a,S.copy(t.viewport),T.copy(t.scissor),E=t.scissorTest}else S.copy(O).multiplyScalar(R).floor(),T.copy(I).multiplyScalar(R).floor(),E=D;if(b!==i&&(ut.bindFramebuffer(36160,i),b=i),j.viewport(S),j.scissor(T),j.setScissorTest(E),r){var o=X.get(t.texture);ut.framebufferTexture2D(36160,36064,34069+e,o.__webglTexture,n)}},this.readRenderTargetPixels=function(t,e,n,i,r,a,o){if(t&&t.isWebGLRenderTarget){var s=X.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var c=!1;s!==b&&(ut.bindFramebuffer(36160,s),c=!0);try{var l=t.texture,u=l.format,h=l.type;if(u!==Tt&&ct.convert(u)!==ut.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");var d=h===yt&&(k.has("EXT_color_buffer_half_float")||V.isWebGL2&&k.has("EXT_color_buffer_float"));if(!(h===ht||ct.convert(h)===ut.getParameter(35738)||h===gt&&(V.isWebGL2||k.has("OES_texture_float")||k.has("WEBGL_color_buffer_float"))||d))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ut.checkFramebufferStatus(36160)?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&ut.readPixels(e,n,i,r,ct.convert(u),ct.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&ut.bindFramebuffer(36160,b)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),o=ct.convert(e.format);Y.setTexture2D(e,0),ut.copyTexImage2D(3553,n,o,t.x,t.y,r,a,0),j.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i){void 0===i&&(i=0);var r=e.image.width,a=e.image.height,o=ct.convert(n.format),s=ct.convert(n.type);Y.setTexture2D(n,0),ut.pixelStorei(37440,n.flipY),ut.pixelStorei(37441,n.premultiplyAlpha),ut.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?ut.texSubImage2D(3553,i,t.x,t.y,r,a,o,s,e.image.data):e.isCompressedTexture?ut.compressedTexSubImage2D(3553,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):ut.texSubImage2D(3553,i,t.x,t.y,o,s,e.image),0===i&&n.generateMipmaps&&ut.generateMipmap(3553),j.unbindTexture()},this.initTexture=function(t){Y.setTexture2D(t,0),j.unbindTexture()},this.resetState=function(){j.reset(),lt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function es(t){ts.call(this,t)}Zo.prototype=Object.assign(Object.create(Br.prototype),{constructor:Zo,isArrayCamera:!0}),Jo.prototype=Object.assign(Object.create(di.prototype),{constructor:Jo,isGroup:!0}),Object.assign(Qo.prototype,{constructor:Qo,getHandSpace:function(){return null===this._hand&&(this._hand=new Jo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Jo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Jo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){var i=null,r=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(c&&t.hand){a=!0;for(var l,u=Ze(t.hand.values());!(l=u()).done;){var h=l.value,d=e.getJointPose(h,n);if(void 0===c.joints[h.jointName]){var p=new Jo;p.matrixAutoUpdate=!1,p.visible=!1,c.joints[h.jointName]=p,c.add(p)}var f=c.joints[h.jointName];null!==d&&(f.matrix.fromArray(d.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.jointRadius=d.radius),f.visible=null!==d}var m=c.joints["index-finger-tip"],v=c.joints["thumb-tip"],g=m.position.distanceTo(v.position);c.inputState.pinching&&g>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&g<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&null!==(i=e.getPose(t.targetRaySpace,n))&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==s&&t.gripSpace&&null!==(r=e.getPose(t.gripSpace,n))&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==o&&(o.visible=null!==i),null!==s&&(s.visible=null!==r),null!==c&&(c.visible=null!==a),this}}),Object.assign(Ko.prototype,Je.prototype),es.prototype=Object.assign(Object.create(ts.prototype),{constructor:es,isWebGL1Renderer:!0});var ns=function(){function t(t,e){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new Di(t),this.density=void 0!==e?e:25e-5}var e=t.prototype;return e.clone=function(){return new t(this.color,this.density)},e.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},t}(),is=function(){function t(t,e,n){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new Di(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}var e=t.prototype;return e.clone=function(){return new t(this.color,this.near,this.far)},e.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},t}(),rs=function(t){function e(){var e;return e=t.call(this)||this,Object.defineProperty(Xe(e),"isScene",{value:!0}),e.type="Scene",e.background=null,e.environment=null,e.fog=null,e.overrideMaterial=null,e.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:Xe(e)})),e}qe(e,t);var n=e.prototype;return n.copy=function(e,n){return t.prototype.copy.call(this,e,n),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},n.toJSON=function(e){var n=t.prototype.toJSON.call(this,e);return null!==this.background&&(n.object.background=this.background.toJSON(e)),null!==this.environment&&(n.object.environment=this.environment.toJSON(e)),null!==this.fog&&(n.object.fog=this.fog.toJSON()),n},e}(di);function as(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ge,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=en.generateUUID()}Object.defineProperty(as.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(as.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;it.far||e.push({distance:s,point:us.clone(),uv:Ai.getUV(us,vs,gs,ys,xs,_s,bs,new nn),face:null,object:this})}},copy:function(t){return di.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});var Ss=new pn,Ts=new pn;function Es(){di.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Es.prototype=Object.assign(Object.create(di.prototype),{constructor:Es,isLOD:!0,copy:function(t){di.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n0){var n,i;for(n=1,i=e.length;n0){Ss.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Ss);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){Ss.setFromMatrixPosition(t.matrixWorld),Ts.setFromMatrixPosition(this.matrixWorld);var n,i,r=Ss.distanceTo(Ts)/t.zoom;for(e[0].object.visible=!0,n=1,i=e.length;n=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;no)){u.applyMatrix4(this.matrixWorld);var x=t.ray.origin.distanceTo(u);xt.far||e.push({distance:x,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else for(var _=0,b=p.count-1;_o)){u.applyMatrix4(this.matrixWorld);var w=t.ray.origin.distanceTo(u);wt.far||e.push({distance:w,point:l.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},updateMorphTargets:function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var i=e[n[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var r=0,a=i.length;r0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var Zs=new pn,Js=new pn;function Qs(t,e){Ys.call(this,t,e),this.type="LineSegments"}function Ks(t,e){Ys.call(this,t,e),this.type="LineLoop"}function $s(t){zi.call(this),this.type="PointsMaterial",this.color=new Di(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Qs.prototype=Object.assign(Object.create(Ys.prototype),{constructor:Qs,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;ir.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:c,index:e,face:null,object:o})}}function oc(t,e,n,i,r,a,o,s,c){sn.call(this,t,e,n,i,r,a,o,s,c),this.format=void 0!==o?o:St,this.minFilter=void 0!==a?a:ct,this.magFilter=void 0!==r?r:ct,this.generateMipmaps=!1;var l=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){l.needsUpdate=!0,t.requestVideoFrameCallback(e)})}function sc(t,e,n,i,r,a,o,s,c,l,u,h){sn.call(this,null,a,o,s,c,l,i,r,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function cc(t,e,n,i,r,a,o,s,c){sn.call(this,t,e,n,i,r,a,o,s,c),this.needsUpdate=!0}function lc(t,e,n,i,r,a,o,s,c,l){if((l=void 0!==l?l:Rt)!==Rt&&l!==Ct)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Rt&&(n=ft),void 0===n&&l===Ct&&(n=wt),sn.call(this,null,i,r,a,o,s,l,n,c),this.image={width:t,height:e},this.magFilter=void 0!==o?o:at,this.minFilter=void 0!==s?s:at,this.flipY=!1,this.generateMipmaps=!1}rc.prototype=Object.assign(Object.create(di.prototype),{constructor:rc,isPoints:!0,copy:function(t){return di.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){var n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),nc.copy(n.boundingSphere),nc.applyMatrix4(i),nc.radius+=r,!1!==t.ray.intersectsSphere(nc)){tc.copy(i).invert(),ec.copy(t.ray).applyMatrix4(tc);var a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes.position;if(null!==s)for(var l=s.array,u=0,h=l.length;u0){var i=e[n[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var r=0,a=i.length;r0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),oc.prototype=Object.assign(Object.create(sn.prototype),{constructor:oc,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){var t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),sc.prototype=Object.create(sn.prototype),sc.prototype.constructor=sc,sc.prototype.isCompressedTexture=!0,cc.prototype=Object.create(sn.prototype),cc.prototype.constructor=cc,cc.prototype.isCanvasTexture=!0,lc.prototype=Object.create(sn.prototype),lc.prototype.constructor=lc,lc.prototype.isDepthTexture=!0;var uc=function(t){function e(e,n,i,r){var a;void 0===e&&(e=1),void 0===n&&(n=8),void 0===i&&(i=0),void 0===r&&(r=2*Math.PI),(a=t.call(this)||this).type="CircleGeometry",a.parameters={radius:e,segments:n,thetaStart:i,thetaLength:r},n=Math.max(3,n);var o=[],s=[],c=[],l=[],u=new pn,h=new nn;s.push(0,0,0),c.push(0,0,1),l.push(.5,.5);for(var d=0,p=3;d<=n;d++,p+=3){var f=i+d/n*r;u.x=e*Math.cos(f),u.y=e*Math.sin(f),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[p]/e+1)/2,h.y=(s[p+1]/e+1)/2,l.push(h.x,h.y)}for(var m=1;m<=n;m++)o.push(m,m+1,0);return a.setIndex(o),a.setAttribute("position",new Ji(s,3)),a.setAttribute("normal",new Ji(c,3)),a.setAttribute("uv",new Ji(l,2)),a}return qe(e,t),e}(cr),hc=function(t){function e(e,n,i,r,a,o,s,c){var l;void 0===e&&(e=1),void 0===n&&(n=1),void 0===i&&(i=1),void 0===r&&(r=8),void 0===a&&(a=1),void 0===o&&(o=!1),void 0===s&&(s=0),void 0===c&&(c=2*Math.PI),(l=t.call(this)||this).type="CylinderGeometry",l.parameters={radiusTop:e,radiusBottom:n,height:i,radialSegments:r,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:c};var u=Xe(l);r=Math.floor(r),a=Math.floor(a);var h=[],d=[],p=[],f=[],m=0,v=[],g=i/2,y=0;function x(t){for(var i=m,a=new nn,o=new pn,l=0,v=!0===t?e:n,x=!0===t?1:-1,_=1;_<=r;_++)d.push(0,g*x,0),p.push(0,x,0),f.push(.5,.5),m++;for(var b=m,w=0;w<=r;w++){var M=w/r*c+s,S=Math.cos(M),T=Math.sin(M);o.x=v*T,o.y=g*x,o.z=v*S,d.push(o.x,o.y,o.z),p.push(0,x,0),a.x=.5*S+.5,a.y=.5*T*x+.5,f.push(a.x,a.y),m++}for(var E=0;E0&&x(!0),n>0&&x(!1)),l.setIndex(h),l.setAttribute("position",new Ji(d,3)),l.setAttribute("normal",new Ji(p,3)),l.setAttribute("uv",new Ji(f,2)),l}return qe(e,t),e}(cr),dc=function(t){function e(e,n,i,r,a,o,s){var c;return void 0===e&&(e=1),void 0===n&&(n=1),void 0===i&&(i=8),void 0===r&&(r=1),void 0===a&&(a=!1),void 0===o&&(o=0),void 0===s&&(s=2*Math.PI),(c=t.call(this,0,e,n,i,r,a,o,s)||this).type="ConeGeometry",c.parameters={radius:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},c}return qe(e,t),e}(hc),pc=function(t){function e(e,n,i,r){var a;void 0===i&&(i=1),void 0===r&&(r=0),(a=t.call(this)||this).type="PolyhedronGeometry",a.parameters={vertices:e,indices:n,radius:i,detail:r};var o=[],s=[];function c(t,e,n,i){for(var r=i+1,a=[],o=0;o<=r;o++){a[o]=[];for(var s=t.clone().lerp(n,o/r),c=e.clone().lerp(n,o/r),u=r-o,h=0;h<=u;h++)a[o][h]=0===h&&o===r?s:s.clone().lerp(c,h/u)}for(var d=0;d.9&&a<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),a.setAttribute("position",new Ji(o,3)),a.setAttribute("normal",new Ji(o.slice(),3)),a.setAttribute("uv",new Ji(s,2)),0===r?a.computeVertexNormals():a.normalizeNormals(),a}return qe(e,t),e}(cr),fc=function(t){function e(e,n){var i;void 0===e&&(e=1),void 0===n&&(n=0);var r=(1+Math.sqrt(5))/2,a=1/r,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-a,-r,0,-a,r,0,a,-r,0,a,r,-a,-r,0,-a,r,0,a,-r,0,a,r,0,-r,0,-a,r,0,-a,-r,0,a,r,0,a];return(i=t.call(this,o,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,n)||this).type="DodecahedronGeometry",i.parameters={radius:e,detail:n},i}return qe(e,t),e}(pc),mc=new pn,vc=new pn,gc=new pn,yc=new Ai,xc=function(t){function e(e,n){var i;if((i=t.call(this)||this).type="EdgesGeometry",i.parameters={thresholdAngle:n},n=void 0!==n?n:1,!0===e.isGeometry)return console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Xe(i);for(var r=Math.pow(10,4),a=Math.cos(en.DEG2RAD*n),o=e.getIndex(),s=e.getAttribute("position"),c=o?o.count:s.count,l=[0,0,0],u=["a","b","c"],h=new Array(3),d={},p=[],f=0;f80*n){i=a=t[0],r=o=t[1];for(var f=n;fa&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-i,o-r))?1/l:0}return Mc(d,p,n,i,r,l),p};function bc(t,e,n,i,r){var a,o;if(r===function(t,e,n,i){for(var r=0,a=e,o=n-i;a0)for(a=e;a=e;a-=i)o=kc(a,t[a],t[a+1],o);return o&&Bc(o,o.next)&&(Vc(o),o=o.next),o}function wc(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!Bc(i,i.next)&&0!==Nc(i.prev,i,i.next))i=i.next;else{if(Vc(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function Mc(t,e,n,i,r,a,o){if(t){!o&&a&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=Pc(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,a,o,s,c,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,i=n,s=0,e=0;e0||c>0&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;n=i}a.nextZ=null,l*=2}while(o>1)}(r)}(t,i,r,a);for(var s,c,l=t;t.prev!==t.next;)if(s=t.prev,c=t.next,a?Tc(t,i,r,a):Sc(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),Vc(t),t=c.next,l=c.next;else if((t=c)===l){o?1===o?Mc(t=Ec(wc(t),e,n),e,n,i,r,a,2):2===o&&Ac(t,e,n,i,r,a):Mc(wc(t),e,n,i,r,a,1);break}}}function Sc(t){var e=t.prev,n=t,i=t.next;if(Nc(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Ic(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&Nc(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Tc(t,e,n,i){var r=t.prev,a=t,o=t.next;if(Nc(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,u=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=Pc(s,c,e,n,i),d=Pc(l,u,e,n,i),p=t.prevZ,f=t.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&Ic(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Nc(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Ic(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Nc(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&Ic(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Nc(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&Ic(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Nc(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ec(t,e,n){var i=t;do{var r=i.prev,a=i.next.next;!Bc(r,a)&&zc(r,i,i.next,a)&&Gc(r,a)&&Gc(a,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(a.i/n),Vc(i),Vc(i.next),i=t=a),i=i.next}while(i!==t);return wc(i)}function Ac(t,e,n,i,r,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Dc(o,s)){var c=Uc(o,s);return o=wc(o,o.next),c=wc(c,c.next),Mc(o,e,n,i,r,a),void Mc(c,e,n,i,r,a)}s=s.next}o=o.next}while(o!==t)}function Lc(t,e){return t.x-e.x}function Rc(t,e){if(e=function(t,e){var n,i=e,r=t.x,a=t.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=u&&r!==i.x&&Ic(an.x||i.x===n.x&&Cc(n,i)))&&(n=i,d=c)),i=i.next}while(i!==l);return n}(t,e)){var n=Uc(e,t);wc(e,e.next),wc(n,n.next)}}function Cc(t,e){return Nc(t.prev,t,e.prev)<0&&Nc(e.next,t,t.next)<0}function Pc(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Oc(t){var e=t,n=t;do{(e.x=0&&(t-o)*(i-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function Dc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&zc(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Gc(t,e)&&Gc(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(Nc(t.prev,t,e.prev)||Nc(t,e.prev,e))||Bc(t,e)&&Nc(t.prev,t,t.next)>0&&Nc(e.prev,e,e.next)>0)}function Nc(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Bc(t,e){return t.x===e.x&&t.y===e.y}function zc(t,e,n,i){var r=Hc(Nc(t,e,n)),a=Hc(Nc(t,e,i)),o=Hc(Nc(n,i,t)),s=Hc(Nc(n,i,e));return r!==a&&o!==s||(!(0!==r||!Fc(t,n,e))||(!(0!==a||!Fc(t,i,e))||(!(0!==o||!Fc(n,t,i))||!(0!==s||!Fc(n,e,i)))))}function Fc(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Hc(t){return t>0?1:t<0?-1:0}function Gc(t,e){return Nc(t.prev,t,t.next)<0?Nc(t,e,t.next)>=0&&Nc(t,t.prev,e)>=0:Nc(t,e,t.prev)<0||Nc(t,t.next,e)<0}function Uc(t,e){var n=new Wc(t.i,t.x,t.y),i=new Wc(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function kc(t,e,n,i){var r=new Wc(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Vc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Wc(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var jc={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function Xc(t,e){for(var n=0;nNumber.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(c*c+l*l),f=e.x-s/d,m=e.y+o/d,v=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(o*l-s*c),g=(i=f+o*v-t.x)*i+(r=m+s*v-t.y)*r;if(g<=2)return new nn(i,r);a=Math.sqrt(g/2)}else{var y=!1;o>Number.EPSILON?c>Number.EPSILON&&(y=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(i=-s,r=o,a=Math.sqrt(u)):(i=o,r=s,a=Math.sqrt(u/2))}return new nn(i/a,r/a)}for(var z=[],F=0,H=R.length,G=H-1,U=F+1;F=0;gt--){for(var yt=gt/p,xt=u*Math.cos(yt*Math.PI/2),_t=h*Math.sin(yt*Math.PI/2)+d,bt=0,wt=R.length;bt=0;){var i=n,r=n-1;r<0&&(r=t.length-1);for(var a=0,o=s+2*p;a=0?(t(v-1e-5,f,l),u.subVectors(c,l)):(t(v+1e-5,f,l),u.subVectors(l,c)),f-1e-5>=0?(t(v,f-1e-5,l),h.subVectors(c,l)):(t(v,f+1e-5,l),h.subVectors(l,c)),s.crossVectors(u,h).normalize(),a.push(s.x,s.y,s.z),o.push(v,f)}for(var g=0;g0)&&f.push(E,A,R),(S!==i-1||l=i)){u.push(c.times[d]);for(var f=0;fa.tracks[v].times[0]&&(m=a.tracks[v].times[0]);for(var g=0;g=i.times[h]){var m=h*c+s,v=m+c-s;d=bl.arraySlice(i.values,m,v)}else{var g=i.createInterpolant(),y=s,x=c-s;g.evaluate(a),d=bl.arraySlice(g.resultBuffer,y,x)}"quaternion"===r&&(new dn).fromArray(d).normalize().conjugate().toArray(d);for(var _=o.times.length,b=0;b<_;++b){var w=b*u+l;if("quaternion"===r)dn.multiplyQuaternionsFlat(o.values,w,d,0,o.values,w);else for(var M=u-2*l,S=0;S=r)break t;var s=e[1];t=(r=e[--n-1]))break e}a=n,n=0}for(;n>>1;te;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=bl.arraySlice(n,r,a),this.values=bl.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==r;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==i&&bl.isTypedArray(i))for(var c=0,l=i.length;c!==l;++c){var u=i[c];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,u),t=!1;break}}return t},optimize:function(){for(var t=bl.arraySlice(this.times),e=bl.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=t.length-1,a=1,o=1;o0){t[a]=t[r];for(var g=r*n,y=a*n,x=0;x!==n;++x)e[y+x]=e[g+x];++a}return a!==t.length?(this.times=bl.arraySlice(t,0,a),this.values=bl.arraySlice(e,0,a*n)):(this.times=t,this.values=e),this},clone:function(){var t=bl.arraySlice(this.times,0),e=bl.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Al.prototype=Object.assign(Object.create(El.prototype),{constructor:Al,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ll.prototype=Object.assign(Object.create(El.prototype),{constructor:Ll,ValueTypeName:"color"}),Rl.prototype=Object.assign(Object.create(El.prototype),{constructor:Rl,ValueTypeName:"number"}),Cl.prototype=Object.assign(Object.create(wl.prototype),{constructor:Cl,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-e)/(i-e),c=t*o,l=c+o;c!==l;c+=4)dn.slerpFlat(r,0,a,c-o,a,c,s);return r}}),Pl.prototype=Object.assign(Object.create(El.prototype),{constructor:Pl,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new Cl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ol.prototype=Object.assign(Object.create(El.prototype),{constructor:Ol,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Il.prototype=Object.assign(Object.create(El.prototype),{constructor:Il,ValueTypeName:"vector"}),Object.assign(Dl,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,a=n.length;r!==a;++r)e.push(Nl(n[r]).scale(i));var o=new Dl(t.name,t.duration,e,t.blendMode);return o.uuid=t.uuid,o},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},r=0,a=n.length;r!==a;++r)e.push(El.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,a=[],o=0;o1){var l=c[1],u=i[l];u||(i[l]=u=[]),u.push(s)}}var h=[];for(var d in i)h.push(Dl.CreateFromMorphTargetSequence(d,i[d],e,n));return h},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var a=[],o=[];bl.flattenJSON(n,a,o,i),0!==a.length&&r.push(new t(e,a,o))}},i=[],r=t.name||"default",a=t.fps||30,o=t.blendMode,s=t.length||-1,c=t.hierarchy||[],l=0;l0||0===t.search(/^data\:image\/jpeg/);r.format=i?St:Tt,r.needsUpdate=!0,void 0!==e&&e(r)},n,i),r}}),Object.assign(Yl.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n=[],i=this.getPoint(0),r=0;n.push(0);for(var a=1;a<=t;a++)r+=(e=this.getPoint(a/t)).distanceTo(i),n.push(r),i=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,a=i.length;n=e||t*i[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=i[r=Math.floor(s+(c-s)/2)]-n)<0)s=r+1;else{if(!(o>0)){c=r;break}c=r-1}if(i[r=c]===n)return r/(a-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(a-1)},getTangent:function(t,e){var n=t-1e-4,i=t+1e-4;n<0&&(n=0),i>1&&(i=1);var r=this.getPoint(n),a=this.getPoint(i),o=e||(r.isVector2?new nn:new pn);return o.copy(a).sub(r).normalize(),o},getTangentAt:function(t,e){var n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){for(var n=new pn,i=[],r=[],a=[],o=new pn,s=new Un,c=0;c<=t;c++){var l=c/t;i[c]=this.getTangentAt(l,new pn),i[c].normalize()}r[0]=new pn,a[0]=new pn;var u=Number.MAX_VALUE,h=Math.abs(i[0].x),d=Math.abs(i[0].y),p=Math.abs(i[0].z);h<=u&&(u=h,n.set(1,0,0)),d<=u&&(u=d,n.set(0,1,0)),p<=u&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]);for(var f=1;f<=t;f++){if(r[f]=r[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(i[f-1],i[f]),o.length()>Number.EPSILON){o.normalize();var m=Math.acos(en.clamp(i[f-1].dot(i[f]),-1,1));r[f].applyMatrix4(s.makeRotationAxis(o,m))}a[f].crossVectors(i[f],r[f])}if(!0===e){var v=Math.acos(en.clamp(r[0].dot(r[t]),-1,1));v/=t,i[0].dot(o.crossVectors(r[0],r[t]))>0&&(v=-v);for(var g=1;g<=t;g++)r[g].applyMatrix4(s.makeRotationAxis(i[g],v*g)),a[g].crossVectors(i[g],r[g])}return{tangents:i,normals:r,binormals:a}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Zl.prototype=Object.create(Yl.prototype),Zl.prototype.constructor=Zl,Zl.prototype.isEllipseCurve=!0,Zl.prototype.getPoint=function(t,e){for(var n=e||new nn,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(c)/o)+1)*o:0===l&&c===o-1&&(c=o-2,l=1),this.closed||c>0?n=a[(c-1)%o]:(Kl.subVectors(a[0],a[1]).add(a[0]),n=Kl);var u=a[c%o],h=a[(c+1)%o];if(this.closed||c+2i.length-2?i.length-1:a+1],u=i[a>i.length-3?i.length-1:a+2];return n.set(iu(o,s.x,c.x,l.x,u.x),iu(o,s.y,c.y,l.y,u.y)),n},du.prototype.copy=function(t){Yl.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e=e){var r=n[i]-e,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,i=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Yl.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);return this.currentPoint.copy(u),this},copy:function(t){return fu.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=fu.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return fu.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),vu.prototype=Object.assign(Object.create(mu.prototype),{constructor:vu,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var r in t.uniforms){var a=t.uniforms[r];switch(i.uniforms[r]={},a.type){case"t":i.uniforms[r].value=n(a.value);break;case"c":i.uniforms[r].value=(new Di).setHex(a.value);break;case"v2":i.uniforms[r].value=(new nn).fromArray(a.value);break;case"v3":i.uniforms[r].value=(new pn).fromArray(a.value);break;case"v4":i.uniforms[r].value=(new ln).fromArray(a.value);break;case"m3":i.uniforms[r].value=(new rn).fromArray(a.value);break;case"m4":i.uniforms[r].value=(new Un).fromArray(a.value);break;default:i.uniforms[r].value=a.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)i.extensions[o]=t.extensions[o];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new nn).fromArray(s)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new nn).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),i},setTextures:function(t){return this.textures=t,this}});var Ou={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n0){var o=new zl(e);(n=new Wl(o)).setCrossOrigin(this.crossOrigin);for(var s=0,c=t.length;sNumber.EPSILON){if(l<0&&(o=e[a],c=-c,s=e[r],l=-l),t.ys.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var u=l*(t.x-o.x)-c*(t.y-o.y);if(0===u)return!0;if(u<0)continue;i=!i}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return i}var r,a,o,s=jc.isClockWise,c=this.subPaths;if(0===c.length)return[];if(!0===e)return n(c);var l=[];if(1===c.length)return a=c[0],(o=new vu).curves=a.curves,l.push(o),l;var u=!s(c[0].getPoints());u=t?!u:u;var h,d,p=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=c.length;g1){for(var x=!1,_=[],b=0,w=f.length;b0&&(x||(m=p))}for(var C=0,P=f.length;C0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(var c=e,l=e+e;c!==l;++c)if(n[c]!==n[c+e]){o.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(var r=n,a=i;r!==a;++r)e[r]=e[i+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,n=t;n=.5)for(var a=0;a!==r;++a)t[e+a]=t[n+a]},_slerp:function(t,e,n,i){dn.slerpFlat(t,e,t,e,t,n,i)},_slerpAdditive:function(t,e,n,i,r){var a=this._workIndex*r;dn.multiplyQuaternionsFlat(t,a,t,e,t,n),dn.slerpFlat(t,e,t,e,t,a,i)},_lerp:function(t,e,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*i}},_lerpAdditive:function(t,e,n,i,r){for(var a=0;a!==r;++a){var o=e+a;t[o]=t[o]+t[n+a]*i}}});var fh=new RegExp("[\\[\\]\\.:\\/]","g"),mh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",vh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),gh=/(WCOD+)?/.source.replace("WCOD",mh),yh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),xh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),_h=new RegExp("^"+vh+gh+yh+xh+"$"),bh=["material","materials","bones"];function wh(t,e,n){var i=n||Mh.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function Mh(t,e,n){this.path=e,this.parsedPath=n||Mh.parseTrackName(e),this.node=Mh.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Sh(){this.uuid=en.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}Object.assign(wh.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Mh,{Composite:wh,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Mh.Composite(t,e,n):new Mh(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(fh,"")},parseTrackName:function(t){var e=_h.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==bh.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var i=function t(n){for(var i=0;i=r){var u=r++,h=t[u];e[h.uuid]=l,t[l]=h,e[c]=u,t[u]=s;for(var d=0,p=i;d!==p;++d){var f=n[d],m=f[u],v=f[l];f[l]=m,f[u]=v}}}this.nCachedObjects_=r},uncache:function(){for(var t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length,r=this.nCachedObjects_,a=t.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o].uuid,l=e[c];if(void 0!==l)if(delete e[c],l0&&(e[_.uuid]=l),t[l]=_,t.pop();for(var b=0,w=i;b!==w;++b){var M=n[b];M[l]=M[x],M.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);i=r.length,n[t]=i,a.push(t),o.push(e),r.push(u);for(var h=l,d=s.length;h!==d;++h){var p=s[h];u[h]=new Mh(p,t,e)}return u},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];e[t[o]]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}});var Th=function(){function t(t,e,n,i){void 0===n&&(n=null),void 0===i&&(i=e.blendMode),this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;for(var r=e.tracks,a=r.length,o=new Array(a),s={endingStart:Se,endingEnd:Se},c=0;c!==a;++c){var l=r[c].createInterpolant(null);o[c]=l,l.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Me,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}var e=t.prototype;return e.play=function(){return this._mixer._activateAction(this),this},e.stop=function(){return this._mixer._deactivateAction(this),this.reset()},e.reset=function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},e.isRunning=function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},e.isScheduled=function(){return this._mixer._isActiveAction(this)},e.startAt=function(t){return this._startTime=t,this},e.setLoop=function(t,e){return this.loop=t,this.repetitions=e,this},e.setEffectiveWeight=function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},e.getEffectiveWeight=function(){return this._effectiveWeight},e.fadeIn=function(t){return this._scheduleFading(t,0,1)},e.fadeOut=function(t){return this._scheduleFading(t,1,0)},e.crossFadeFrom=function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,a=r/i,o=i/r;t.warp(1,a,e),this.warp(o,1,e)}return this},e.crossFadeTo=function(t,e,n){return t.crossFadeFrom(this,e,n)},e.stopFading=function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},e.setEffectiveTimeScale=function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},e.getEffectiveTimeScale=function(){return this._effectiveTimeScale},e.setDuration=function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},e.syncWith=function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},e.halt=function(t){return this.warp(this._effectiveTimeScale,0,t)},e.warp=function(t,e,n){var i=this._mixer,r=i.time,a=this.timeScale,o=this._timeScaleInterpolant;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=r,s[1]=r+n,c[0]=t/a,c[1]=e/a,this},e.stopWarping=function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},e.getMixer=function(){return this._mixer},e.getClip=function(){return this._clip},e.getRoot=function(){return this._localRoot||this._mixer._root},e._update=function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(t-r)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(s>0){var c=this._interpolants,l=this._propertyBindings;switch(this.blendMode){case 2501:for(var u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulateAdditive(s);break;case Te:default:for(var d=0,p=c.length;d!==p;++d)c[d].evaluate(o),l[d].accumulate(i,s)}}}else this._updateWeight(t)},e._updateWeight=function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},e._updateTimeScale=function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},e._updateTime=function(t){var e=this._clip.duration,n=this.loop,i=this.time+t,r=this._loopCount,a=2202===n;if(0===t)return-1===r?i:a&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),i>=e||i<0){var o=Math.floor(i/e);i-=e*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=i;if(a&&1==(1&r))return e-i}return i},e._setEndings=function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=t?this.zeroSlopeAtStart?2401:Se:2402,i.endingEnd=e?this.zeroSlopeAtEnd?2401:Se:2402)},e._scheduleFading=function(t,e,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=e,o[1]=r+t,s[1]=n,this},t}();function Eh(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Eh.prototype=Object.assign(Object.create(Je.prototype),{constructor:Eh,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==r;++u){var h=i[u],d=h.name,p=l[d];if(void 0!==p)a[u]=p;else{if(void 0!==(p=a[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[u].binding.parsedPath;++(p=new ph(Mh.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),a[u]=p}o[u].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o){e[o]._update(i,t,r,a)}for(var s=this._bindings,c=this._nActiveBindings,l=0;l!==c;++l)s[l].apply(a);return this},setTime:function(t){this.time=0;for(var e=0;ethis.max.x||t.ythis.max.y)},e.containsBox=function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},e.getParameter=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new nn),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},e.intersectsBox=function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},e.clampPoint=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new nn),e.copy(t).clamp(this.min,this.max)},e.distanceToPoint=function(t){return Nh.copy(t).clamp(this.min,this.max).sub(t).length()},e.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this},e.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},e.translate=function(t){return this.min.add(t),this.max.add(t),this},e.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},t}(),zh=new pn,Fh=new pn,Hh=function(){function t(t,e){this.start=void 0!==t?t:new pn,this.end=void 0!==e?e:new pn}var e=t.prototype;return e.set=function(t,e){return this.start.copy(t),this.end.copy(e),this},e.clone=function(){return(new this.constructor).copy(this)},e.copy=function(t){return this.start.copy(t.start),this.end.copy(t.end),this},e.getCenter=function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new pn),t.addVectors(this.start,this.end).multiplyScalar(.5)},e.delta=function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new pn),t.subVectors(this.end,this.start)},e.distanceSq=function(){return this.start.distanceToSquared(this.end)},e.distance=function(){return this.start.distanceTo(this.end)},e.at=function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new pn),this.delta(e).multiplyScalar(t).add(this.start)},e.closestPointToPointParameter=function(t,e){zh.subVectors(t,this.start),Fh.subVectors(this.end,this.start);var n=Fh.dot(Fh),i=Fh.dot(zh)/n;return e&&(i=en.clamp(i,0,1)),i},e.closestPointToPoint=function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new pn),this.delta(n).multiplyScalar(i).add(this.start)},e.applyMatrix4=function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},e.equals=function(t){return t.start.equals(this.start)&&t.end.equals(this.end)},t}();function Gh(t){di.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Gh.prototype=Object.create(di.prototype),Gh.prototype.constructor=Gh,Gh.prototype.isImmediateRenderObject=!0;var Uh=new pn,kh=function(t){function e(e,n){var i;(i=t.call(this)||this).light=e,i.light.updateMatrixWorld(),i.matrix=e.matrixWorld,i.matrixAutoUpdate=!1,i.color=n;for(var r=new cr,a=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],o=0,s=1;o<32;o++,s++){var c=o/32*Math.PI*2,l=s/32*Math.PI*2;a.push(Math.cos(c),Math.sin(c),1,Math.cos(l),Math.sin(l),1)}r.setAttribute("position",new Ji(a,3));var u=new ks({fog:!1,toneMapped:!1});return i.cone=new Qs(r,u),i.add(i.cone),i.update(),i}qe(e,t);var n=e.prototype;return n.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},n.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Uh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Uh),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)},e}(di),Vh=new pn,Wh=new Un,jh=new Un,qh=function(t){function e(e){for(var n,i=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{md.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(md,e)}},n.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},n.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},n.copy=function(e){return t.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},e}(di),gd=function(t){function e(e){var n;void 0===e&&(e=1);var i=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=new cr;r.setAttribute("position",new Ji(i,3)),r.setAttribute("color",new Ji([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var a=new ks({vertexColors:!0,toneMapped:!1});return(n=t.call(this,r,a)||this).type="AxesHelper",n}return qe(e,t),e}(Qs),yd=new Float32Array(1),xd=new Int32Array(yd.buffer),_d={toHalfFloat:function(t){yd[0]=t;var e=xd[0],n=e>>16&32768,i=e>>12&2047,r=e>>23&255;return r<103?n:r>142?(n|=31744,n|=(255==r?0:1)&&8388607&e):r<113?n|=((i|=2048)>>114-r)+(i>>113-r&1):(n|=r-112<<10|i>>1,n+=1&i)}},bd=4,wd=8,Md=Math.pow(2,wd),Sd=[.125,.215,.35,.446,.526,.582],Td=wd-bd+1+Sd.length,Ed=20,Ad=((ud={})[Ee]=0,ud[Ae]=1,ud[Re]=2,ud[Pe]=3,ud[Oe]=4,ud[Ie]=5,ud[Le]=6,ud),Ld=new Fi({side:l,depthWrite:!1,depthTest:!1}),Rd=new Er(new Lr,Ld),Cd=new Su,Pd=Vd(),Od=Pd._lodPlanes,Id=Pd._sizeLods,Dd=Pd._sigmas,Nd=new Di,Bd=null,zd=(1+Math.sqrt(5))/2,Fd=1/zd,Hd=[new pn(1,1,1),new pn(-1,1,1),new pn(1,1,-1),new pn(-1,1,-1),new pn(0,zd,Fd),new pn(0,zd,-Fd),new pn(Fd,0,zd),new pn(-Fd,0,zd),new pn(zd,Fd,0),new pn(-zd,Fd,0)];function Gd(t){var e=Math.max(t.r,t.g,t.b),n=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return t.multiplyScalar(Math.pow(2,-n)),(n+128)/255}var Ud=function(){function t(t){var e,n,i;this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=(e=Ed,n=new Float32Array(e),i=new pn(0,1,0),new hl({name:"SphericalGaussianBlur",defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:Ad[Ee]},outputEncoding:{value:Ad[Ee]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:h,depthTest:!1,depthWrite:!1})),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}var e=t.prototype;return e.fromScene=function(t,e,n,i){void 0===e&&(e=0),void 0===n&&(n=.1),void 0===i&&(i=100),Bd=this._renderer.getRenderTarget();var r=this._allocateTargets();return this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r},e.fromEquirectangular=function(t){return this._fromTexture(t)},e.fromCubemap=function(t){return this._fromTexture(t)},e.compileCubemapShader=function(){null===this._cubemapShader&&(this._cubemapShader=Xd(),this._compileMaterial(this._cubemapShader))},e.compileEquirectangularShader=function(){null===this._equirectShader&&(this._equirectShader=qd(),this._compileMaterial(this._equirectShader))},e.dispose=function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t2?Md:0,Md,Md),s.setRenderTarget(i),h&&s.render(Rd,r),s.render(t,r)}s.toneMapping=u,s.outputEncoding=l,s.autoClear=c},e._textureToCubeUV=function(t,e){var n=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Xd()):null==this._equirectShader&&(this._equirectShader=qd());var i=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new Er(Od[0],i),a=i.uniforms;a.envMap.value=t,t.isCubeTexture||a.texelSize.value.set(1/t.image.width,1/t.image.height),a.inputEncoding.value=Ad[t.encoding],a.outputEncoding.value=Ad[e.texture.encoding],jd(e,0,0,3*Md,2*Md),n.setRenderTarget(e),n.render(r,Cd)},e._applyPMREM=function(t){var e=this._renderer,n=e.autoClear;e.autoClear=!1;for(var i=1;iEd&&console.warn("sigmaRadians, "+r+", is too large and will clip, as it requested "+f+" samples when the maximum is set to "+Ed);for(var m=[],v=0,g=0;gwd-bd?i-wd+bd:0),3*b,2*b),s.setRenderTarget(e),s.render(l,Cd)},t}();function kd(t){return void 0!==t&&t.type===ht&&(t.encoding===Ee||t.encoding===Ae||t.encoding===Le)}function Vd(){for(var t=[],e=[],n=[],i=wd,r=0;rwd-bd?o=Sd[r-wd+bd-1]:0==r&&(o=0),n.push(o);for(var s=1/(a-1),c=-s/2,l=1+s/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*f),d.set(u,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var x=new cr;x.setAttribute("position",new Ui(h,3)),x.setAttribute("uv",new Ui(d,2)),x.setAttribute("faceIndex",new Ui(p,1)),t.push(x),i>bd&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}function Wd(t){var e=new un(3*Md,3*Md,t);return e.texture.mapping=tt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function jd(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function qd(){return new hl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new nn(1,1)},inputEncoding:{value:Ad[Ee]},outputEncoding:{value:Ad[Ee]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:h,depthTest:!1,depthWrite:!1})}function Xd(){return new hl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Ad[Ee]},outputEncoding:{value:Ad[Ee]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:h,depthTest:!1,depthWrite:!1})}function Yd(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),nu.call(this,t),this.type="catmullrom",this.closed=!0}function Zd(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),nu.call(this,t),this.type="catmullrom"}function Jd(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),nu.call(this,t),this.type="catmullrom"}Yl.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Yl.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(mu.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Yd.prototype=Object.create(nu.prototype),Zd.prototype=Object.create(nu.prototype),Jd.prototype=Object.create(nu.prototype),Object.assign(Jd.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Kh.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},qh.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Hl.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Ou.extractUrlBase(t)}}),Hl.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(Bh.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(vn.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(On.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),jr.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Hh.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(en,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),en.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),en.ceilPowerOfTwo(t)}}),Object.assign(rn.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),Object.assign(Un.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new pn).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,a)},getInverse:function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),vi.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Object.assign(dn.prototype,{multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(Gn.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Ai.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Ai,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ai.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ai.getNormal(t,e,n,i)}}),Object.assign(vu.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Yc(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new el(this,t)}}),Object.assign(nn.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(pn.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ln.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(di.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(di.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Er.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Er.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Es.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Bs.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Os.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Yl.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Br.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(gu.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Ui.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Ue},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Ue)}}}),Object.assign(Ui.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Ue:Ge),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(cr.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Ui(arguments[1],arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(cr.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Iu.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Ch.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(as.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Ue},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(as.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Ue:Ge),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Yc.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(rs.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Ah.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(zi.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Di}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(fl.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(pl.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(Dr.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(ts.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ts.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Ae:Ee}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(jo.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(un.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(oh.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Xu).load(t,function(t){e.setBuffer(t)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),dh.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Hr.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},Hr.prototype.clear=function(t,e,n,i){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,n,i)};var Qd={merge:function(t,e,n){var i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};an.crossOrigin=void 0,an.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Xl;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},an.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new jl;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},an.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},an.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var Kd={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"125"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="125"),t.ACESFilmicToneMapping=Y,t.AddEquation=g,t.AddOperation=V,t.AdditiveAnimationBlendMode=2501,t.AdditiveBlending=p,t.AlphaFormat=Mt,t.AlwaysDepth=D,t.AlwaysStencilFunc=He,t.AmbientLight=Au,t.AmbientLightProbe=Zu,t.AnimationClip=Dl,t.AnimationLoader=kl,t.AnimationMixer=Eh,t.AnimationObjectGroup=Sh,t.AnimationUtils=bl,t.ArcCurve=Jl,t.ArrayCamera=Zo,t.ArrowHelper=vd,t.Audio=oh,t.AudioAnalyser=dh,t.AudioContext=qu,t.AudioListener=ah,t.AudioLoader=Xu,t.AxesHelper=gd,t.AxisHelper=function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new gd(t)},t.BackSide=l,t.BasicDepthPacking=De,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ql(t)},t.Bone=Is,t.BooleanKeyframeTrack=Al,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new dd(t,e)},t.Box2=Bh,t.Box3=vn,t.Box3Helper=pd,t.BoxBufferGeometry=Lr,t.BoxGeometry=Lr,t.BoxHelper=dd,t.BufferAttribute=Ui,t.BufferGeometry=cr,t.BufferGeometryLoader=Nu,t.ByteType=dt,t.Cache=Bl,t.Camera=Nr,t.CameraHelper=od,t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},t.CanvasTexture=cc,t.CatmullRomCurve3=nu,t.CineonToneMapping=X,t.CircleBufferGeometry=uc,t.CircleGeometry=uc,t.ClampToEdgeWrapping=it,t.Clock=$u,t.ClosedSplineCurve3=Yd,t.Color=Di,t.ColorKeyframeTrack=Ll,t.CompressedTexture=sc,t.CompressedTextureLoader=Vl,t.ConeBufferGeometry=dc,t.ConeGeometry=dc,t.CubeCamera=Hr,t.CubeReflectionMapping=J,t.CubeRefractionMapping=Q,t.CubeTexture=Gr,t.CubeTextureLoader=jl,t.CubeUVReflectionMapping=tt,t.CubeUVRefractionMapping=et,t.CubicBezierCurve=ou,t.CubicBezierCurve3=su,t.CubicInterpolant=Ml,t.CullFaceBack=i,t.CullFaceFront=r,t.CullFaceFrontBack=3,t.CullFaceNone=n,t.Curve=Yl,t.CurvePath=fu,t.CustomBlending=v,t.CustomToneMapping=Z,t.CylinderBufferGeometry=hc,t.CylinderGeometry=hc,t.Cylindrical=Dh,t.DataTexture=kr,t.DataTexture2DArray=da,t.DataTexture3D=pa,t.DataTextureLoader=ql,t.DataUtils=_d,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=Fl,t.DepthFormat=Rt,t.DepthStencilFormat=Ct,t.DepthTexture=lc,t.DirectionalLight=Eu,t.DirectionalLightHelper=id,t.DiscreteInterpolant=Tl,t.DodecahedronBufferGeometry=fc,t.DodecahedronGeometry=fc,t.DoubleSide=u,t.DstAlphaFactor=L,t.DstColorFactor=C,t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Ui(t,e).setUsage(Ue)},t.DynamicCopyUsage=35050,t.DynamicDrawUsage=Ue,t.DynamicReadUsage=35049,t.EdgesGeometry=xc,t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Qs(new xc(t.geometry),new ks({color:void 0!==e?e:16777215}))},t.EllipseCurve=Zl,t.EqualDepth=z,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=K,t.EquirectangularRefractionMapping=$,t.Euler=Zn,t.EventDispatcher=Je,t.ExtrudeBufferGeometry=Yc,t.ExtrudeGeometry=Yc,t.Face3=Ni,t.Face4=function(t,e,n,i,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Ni(t,e,n,r,a,o)},t.FaceColors=1,t.FileLoader=Ul,t.FlatShading=1,t.Float16BufferAttribute=Zi,t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Ji(t,e)},t.Float32BufferAttribute=Ji,t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Qi(t,e)},t.Float64BufferAttribute=Qi,t.FloatType=gt,t.Fog=is,t.FogExp2=ns,t.Font=Vu,t.FontLoader=ju,t.FrontSide=c,t.Frustum=jr,t.GLBufferAttribute=Rh,t.GLSL1="100",t.GLSL3=ke,t.GammaEncoding=Le,t.GeometryUtils=Qd,t.GreaterDepth=H,t.GreaterEqualDepth=F,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=Kh,t.Group=Jo,t.HalfFloatType=yt,t.HemisphereLight=yu,t.HemisphereLightHelper=Qh,t.HemisphereLightProbe=Yu,t.IcosahedronBufferGeometry=Jc,t.IcosahedronGeometry=Jc,t.ImageBitmapLoader=Gu,t.ImageLoader=Wl,t.ImageUtils=an,t.ImmediateRenderObject=Gh,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=Du,t.InstancedBufferGeometry=Iu,t.InstancedInterleavedBuffer=Lh,t.InstancedMesh=Us,t.Int16Attribute=function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new ji(t,e)},t.Int16BufferAttribute=ji,t.Int32Attribute=function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Xi(t,e)},t.Int32BufferAttribute=Xi,t.Int8Attribute=function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new ki(t,e)},t.Int8BufferAttribute=ki,t.IntType=mt,t.InterleavedBuffer=as,t.InterleavedBufferAttribute=cs,t.Interpolant=wl,t.InterpolateDiscrete=2300,t.InterpolateLinear=2301,t.InterpolateSmooth=2302,t.InvertStencilOp=5386,t.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},t.KeepStencilOp=Fe,t.KeyframeTrack=El,t.LOD=Es,t.LatheBufferGeometry=Qc,t.LatheGeometry=Qc,t.Layers=Kn,t.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")},t.LessDepth=N,t.LessEqualDepth=B,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=gu,t.LightProbe=Cu,t.Line=Ys,t.Line3=Hh,t.LineBasicMaterial=ks,t.LineCurve=cu,t.LineCurve3=lu,t.LineDashedMaterial=xl,t.LineLoop=Ks,t.LinePieces=1,t.LineSegments=Qs,t.LineStrip=0,t.LinearEncoding=Ee,t.LinearFilter=ct,t.LinearInterpolant=Sl,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=ut,t.LinearMipmapNearestFilter=lt,t.LinearToneMapping=j,t.Loader=Hl,t.LoaderUtils=Ou,t.LoadingManager=zl,t.LogLuvEncoding=Ce,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=Me,t.LuminanceAlphaFormat=At,t.LuminanceFormat=Et,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},t.Material=zi,t.MaterialLoader=Pu,t.Math=en,t.MathUtils=en,t.Matrix3=rn,t.Matrix4=Un,t.MaxEquation=b,t.Mesh=Er,t.MeshBasicMaterial=Fi,t.MeshDepthMaterial=Uo,t.MeshDistanceMaterial=ko,t.MeshFaceMaterial=function(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t},t.MeshLambertMaterial=gl,t.MeshMatcapMaterial=yl,t.MeshNormalMaterial=vl,t.MeshPhongMaterial=fl,t.MeshPhysicalMaterial=pl,t.MeshStandardMaterial=dl,t.MeshToonMaterial=ml,t.MinEquation=_,t.MirroredRepeatWrapping=rt,t.MixOperation=k,t.MultiMaterial=function(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t},t.MultiplyBlending=m,t.MultiplyOperation=U,t.NearestFilter=at,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=st,t.NearestMipmapNearestFilter=ot,t.NeverDepth=I,t.NeverStencilFunc=512,t.NoBlending=h,t.NoColors=0,t.NoToneMapping=W,t.NormalAnimationBlendMode=Te,t.NormalBlending=d,t.NotEqualDepth=G,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=Rl,t.Object3D=di,t.ObjectLoader=Bu,t.ObjectSpaceNormalMap=ze,t.OctahedronBufferGeometry=Kc,t.OctahedronGeometry=Kc,t.OneFactor=M,t.OneMinusDstAlphaFactor=R,t.OneMinusDstColorFactor=P,t.OneMinusSrcAlphaFactor=A,t.OneMinusSrcColorFactor=T,t.OrthographicCamera=Su,t.PCFShadowMap=a,t.PCFSoftShadowMap=o,t.PMREMGenerator=Ud,t.ParametricBufferGeometry=$c,t.ParametricGeometry=$c,t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new ws(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new $s(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new rc(t,e)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new $s(t)},t.Path=mu,t.PerspectiveCamera=Br,t.Plane=vi,t.PlaneBufferGeometry=Yr,t.PlaneGeometry=Yr,t.PlaneHelper=fd,t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new rc(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new $s(t)},t.PointLight=Mu,t.PointLightHelper=Xh,t.Points=rc,t.PointsMaterial=$s,t.PolarGridHelper=$h,t.PolyhedronBufferGeometry=pc,t.PolyhedronGeometry=pc,t.PositionalAudio=hh,t.PropertyBinding=Mh,t.PropertyMixer=ph,t.QuadraticBezierCurve=uu,t.QuadraticBezierCurve3=hu,t.Quaternion=dn,t.QuaternionKeyframeTrack=Pl,t.QuaternionLinearInterpolant=Cl,t.REVISION="125",t.RGBADepthPacking=Ne,t.RGBAFormat=Tt,t.RGBAIntegerFormat=Bt,t.RGBA_ASTC_10x10_Format=ae,t.RGBA_ASTC_10x5_Format=ne,t.RGBA_ASTC_10x6_Format=ie,t.RGBA_ASTC_10x8_Format=re,t.RGBA_ASTC_12x10_Format=oe,t.RGBA_ASTC_12x12_Format=se,t.RGBA_ASTC_4x4_Format=Yt,t.RGBA_ASTC_5x4_Format=Zt,t.RGBA_ASTC_5x5_Format=Jt,t.RGBA_ASTC_6x5_Format=Qt,t.RGBA_ASTC_6x6_Format=Kt,t.RGBA_ASTC_8x5_Format=$t,t.RGBA_ASTC_8x6_Format=te,t.RGBA_ASTC_8x8_Format=ee,t.RGBA_BPTC_Format=ce,t.RGBA_ETC2_EAC_Format=Xt,t.RGBA_PVRTC_2BPPV1_Format=Wt,t.RGBA_PVRTC_4BPPV1_Format=Vt,t.RGBA_S3TC_DXT1_Format=Ft,t.RGBA_S3TC_DXT3_Format=Ht,t.RGBA_S3TC_DXT5_Format=Gt,t.RGBDEncoding=Ie,t.RGBEEncoding=Re,t.RGBEFormat=Lt,t.RGBFormat=St,t.RGBIntegerFormat=Nt,t.RGBM16Encoding=Oe,t.RGBM7Encoding=Pe,t.RGB_ETC1_Format=jt,t.RGB_ETC2_Format=qt,t.RGB_PVRTC_2BPPV1_Format=kt,t.RGB_PVRTC_4BPPV1_Format=Ut,t.RGB_S3TC_DXT1_Format=zt,t.RGFormat=It,t.RGIntegerFormat=Dt,t.RawShaderMaterial=hl,t.Ray=Gn,t.Raycaster=Ch,t.RectAreaLight=Lu,t.RedFormat=Pt,t.RedIntegerFormat=Ot,t.ReinhardToneMapping=q,t.RepeatWrapping=nt,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=x,t.RingBufferGeometry=tl,t.RingGeometry=tl,t.SRGB8_ALPHA8_ASTC_10x10_Format=_e,t.SRGB8_ALPHA8_ASTC_10x5_Format=ge,t.SRGB8_ALPHA8_ASTC_10x6_Format=ye,t.SRGB8_ALPHA8_ASTC_10x8_Format=xe,t.SRGB8_ALPHA8_ASTC_12x10_Format=be,t.SRGB8_ALPHA8_ASTC_12x12_Format=we,t.SRGB8_ALPHA8_ASTC_4x4_Format=le,t.SRGB8_ALPHA8_ASTC_5x4_Format=ue,t.SRGB8_ALPHA8_ASTC_5x5_Format=he,t.SRGB8_ALPHA8_ASTC_6x5_Format=de,t.SRGB8_ALPHA8_ASTC_6x6_Format=pe,t.SRGB8_ALPHA8_ASTC_8x5_Format=fe,t.SRGB8_ALPHA8_ASTC_8x6_Format=me,t.SRGB8_ALPHA8_ASTC_8x8_Format=ve,t.Scene=rs,t.SceneUtils=Kd,t.ShaderChunk=Zr,t.ShaderLib=Qr,t.ShaderMaterial=Dr,t.ShadowMaterial=ul,t.Shape=vu,t.ShapeBufferGeometry=el,t.ShapeGeometry=el,t.ShapePath=Uu,t.ShapeUtils=jc,t.ShortType=pt,t.Skeleton=Bs,t.SkeletonHelper=qh,t.SkinnedMesh=Os,t.SmoothShading=2,t.Sphere=On,t.SphereBufferGeometry=nl,t.SphereGeometry=nl,t.Spherical=Ih,t.SphericalHarmonics3=Ru,t.Spline=Jd,t.SplineCurve=du,t.SplineCurve3=Zd,t.SpotLight=bu,t.SpotLightHelper=kh,t.Sprite=ws,t.SpriteMaterial=ls,t.SrcAlphaFactor=E,t.SrcAlphaSaturateFactor=O,t.SrcColorFactor=S,t.StaticCopyUsage=35046,t.StaticDrawUsage=Ge,t.StaticReadUsage=35045,t.StereoCamera=Ku,t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=Ol,t.SubtractEquation=y,t.SubtractiveBlending=f,t.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},t.TangentSpaceNormalMap=Be,t.TetrahedronBufferGeometry=il,t.TetrahedronGeometry=il,t.TextBufferGeometry=rl,t.TextGeometry=rl,t.Texture=sn,t.TextureLoader=Xl,t.TorusBufferGeometry=al,t.TorusGeometry=al,t.TorusKnotBufferGeometry=ol,t.TorusKnotGeometry=ol,t.Triangle=Ai,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=sl,t.TubeGeometry=sl,t.UVMapping=300,t.Uint16Attribute=function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new qi(t,e)},t.Uint16BufferAttribute=qi,t.Uint32Attribute=function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Yi(t,e)},t.Uint32BufferAttribute=Yi,t.Uint8Attribute=function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Vi(t,e)},t.Uint8BufferAttribute=Vi,t.Uint8ClampedAttribute=function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Wi(t,e)},t.Uint8ClampedBufferAttribute=Wi,t.Uniform=Ah,t.UniformsLib=Jr,t.UniformsUtils=Pr,t.UnsignedByteType=ht,t.UnsignedInt248Type=wt,t.UnsignedIntType=vt,t.UnsignedShort4444Type=xt,t.UnsignedShort5551Type=_t,t.UnsignedShort565Type=bt,t.UnsignedShortType=ft,t.VSMShadowMap=s,t.Vector2=nn,t.Vector3=pn,t.Vector4=ln,t.VectorKeyframeTrack=Il,t.Vertex=function(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new pn(t,e,n)},t.VertexColors=2,t.VideoTexture=oc,t.WebGL1Renderer=es,t.WebGLCubeRenderTarget=Ur,t.WebGLMultisampleRenderTarget=hn,t.WebGLRenderTarget=un,t.WebGLRenderTargetCube=function(t,e,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Ur(t,n)},t.WebGLRenderer=ts,t.WebGLUtils=Yo,t.WireframeGeometry=cl,t.WireframeHelper=function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Qs(new cl(t.geometry),new ks({color:void 0!==e?e:16777215}))},t.WrapAroundEnding=2402,t.XHRLoader=function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Ul(t)},t.ZeroCurvatureEnding=Se,t.ZeroFactor=w,t.ZeroSlopeEnding=2401,t.ZeroStencilOp=0,t.sRGBEncoding=Ae,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/src/lasso/utils/__init__.py b/src/lasso/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/lasso/utils/console_coloring.py b/src/lasso/utils/console_coloring.py deleted file mode 100644 index 9a0cedf..0000000 --- a/src/lasso/utils/console_coloring.py +++ /dev/null @@ -1,137 +0,0 @@ -class ConsoleColoring: - """Holds coloring escape sequences for command line shells""" - - # text coloring - LIGHT_GREEN = "\033[92m" - LIGHT_RED = "\033[91m" - LIGHT_CYAN = "\033[96m" - LIGHT_BLUE = "\033[94m" - LIGHT_PURPLE = "\033[95m" - LIGHT_YELLOW = "\033[93m" - - PURPLE = "\033[95m" - RED = "\033[91m" - GREEN = "\u001b[32m" - CYAN = "\u001b[36m" - WHITE = "\u001b[37m" - BLACK = "\u001b[30m" - BLUE = "\u001b[34m" - ORANGE = "\u001b[33m" - - # special stuff - BOLD = "\033[1m" - UNDERLINE = "\033[4m" - REVERSED = "\u001b[7m" - - # ends coloring - RESET = "\033[0m" - - @staticmethod - def purple(msg, light=False): - """Format a string in purple - - Parameters - ---------- - msg : `str` - string to format - light : `bool` - whether to use light coloring - - Returns - ------- - formatted_msg : `str` - string colored for console output - """ - return ( - ConsoleColoring.LIGHT_PURPLE + msg + ConsoleColoring.RESET - if light - else ConsoleColoring.PURPLE + msg + ConsoleColoring.RESET - ) - - @staticmethod - def yellow(msg, light=False): - """Format a string in yellow - - Parameters - ---------- - msg : `str` - string to format - light : `bool` - whether to use light coloring - - Returns - ------- - formatted_msg : `str` - string colored for console output - """ - return ( - ConsoleColoring.LIGHT_YELLOW + msg + ConsoleColoring.RESET - if light - else ConsoleColoring.ORANGE + msg + ConsoleColoring.RESET - ) - - @staticmethod - def red(msg, light=False): - """Format a string in red - - Parameters - ---------- - msg : `str` - string to format - light : `bool` - whether to use light coloring - - Returns - ------- - formatted_msg : `str` - string colored for console output - """ - return ( - ConsoleColoring.LIGHT_RED + msg + ConsoleColoring.RESET - if light - else ConsoleColoring.RED + msg + ConsoleColoring.RESET - ) - - @staticmethod - def green(msg, light=False): - """Format a string in green - - Parameters - ---------- - msg : `str` - string to format - light : `bool` - whether to use light coloring - - Returns - ------- - formatted_msg : `str` - string colored for console output - """ - return ( - ConsoleColoring.LIGHT_GREEN + msg + ConsoleColoring.RESET - if light - else ConsoleColoring.GREEN + msg + ConsoleColoring.RESET - ) - - @staticmethod - def blue(msg, light=False): - """Format a string in green - - Parameters - ---------- - msg : `str` - string to format - light : `bool` - whether to use light coloring - - Returns - ------- - formatted_msg : `str` - string colored for console output - """ - return ( - ConsoleColoring.LIGHT_BLUE + msg + ConsoleColoring.RESET - if light - else ConsoleColoring.BLUE + msg + ConsoleColoring.RESET - ) diff --git a/src/lasso/utils/decorators.py b/src/lasso/utils/decorators.py deleted file mode 100644 index 65089a9..0000000 --- a/src/lasso/utils/decorators.py +++ /dev/null @@ -1,53 +0,0 @@ -import inspect - - -# Source: https://www.fast.ai/2019/08/06/delegation/ - - -def delegates(to_function=None, keep=False): - """Decorator: replace `**kwargs` in signature with params from `to`""" - - def _f(f_att): - if to_function is None: - to_f, from_f = f_att.__base__.__init__, f_att.__init__ - else: - to_f, from_f = to_function, f_att - sig = inspect.signature(from_f) - sig_dict = dict(sig.parameters) - k = sig_dict.pop("kwargs") - s2_dict = { - k: v - for k, v in inspect.signature(to_f).parameters.items() - if v.default != inspect.Parameter.empty and k not in sig_dict - } - sig_dict.update(s2_dict) - if keep: - sig_dict["kwargs"] = k - # noinspection PyTypeChecker - from_f.__signature__ = sig.replace(parameters=sig_dict.values()) - return f_att - - return _f - - -def custom_dir(custom_c, add): - """Custom dir *add description?""" - return dir(type(custom_c)) + list(custom_c.__dict__.keys()) + add - - -class GetAttr: - """ - Base class for attr accesses in `self._xtra` passed down to `self.default - """ - - @property - def _xtra(self): - return [o for o in dir(self.default) if not o.startswith("_")] - - def __getattr__(self, k): - if k in self._xtra: - return getattr(self.default, k) - raise AttributeError(k) - - def __dir__(self): - return custom_dir(self, self._xtra) diff --git a/src/lasso/utils/language.py b/src/lasso/utils/language.py deleted file mode 100644 index 588dc54..0000000 --- a/src/lasso/utils/language.py +++ /dev/null @@ -1,55 +0,0 @@ -def get_var(name, context, default=None): - """Get a variable from a dict context - - Parameters - ---------- - name : str or list(str) - variable name - context : dict - variable dict - default: - default value or function which creates the default - value if failed to find var in context - """ - if not isinstance(name, (list, tuple)): - name = (name,) - - current_context = context - for current_name in name: - if current_name in current_context: - current_context = current_context[current_name] - else: - return default() if callable(default) else default - - return current_context - - -def set_var(name, value, context): - """ - Set a variable in a dict context - - Parameters - ---------- - name : str or list(str) - variable name or path as list - value : object - anything to set - context : dict - variable dict - """ - - if not isinstance(name, (list, tuple)): - name = (name,) - - current_context = context - for i_name, current_name in enumerate(name): - # at last level set var - if i_name == len(name) - 1: - current_context[current_name] = value - # otherwise iterate into next level - elif current_name in current_context: - current_context = current_context[current_name] - else: - new_level = {} - current_context[current_name] = new_level - current_context = new_level diff --git a/src/lasso/utils/rich_progress_bars.py b/src/lasso/utils/rich_progress_bars.py deleted file mode 100644 index f5608ab..0000000 --- a/src/lasso/utils/rich_progress_bars.py +++ /dev/null @@ -1,125 +0,0 @@ -import math -import time -from typing import Any - -from rich.progress import ProgressColumn - - -class PlaceHolderBar: - """This bar is simply a placeholder bar""" - - finished: bool - tasks: list = [] - - # noinspection PyUnusedLocal - # pylint: disable = unused-argument - def __init__(self, **kwargs): - """This is a placeholder to not clutter console during testing""" - self.finished: False - - # noinspection PyUnusedLocal - # pylint: disable = unused-argument - def render(self, task: Any) -> str: - """returns the planned output: empty string""" - return "" - - def add_task(self, description: str, total: int) -> int: - """Adds a new task""" - self.tasks.append([description, total, 0]) - # entry in list is tuple of description, total tasks, remaining tasks - return len(self.tasks) - 1 - - def advance(self, task_id): - """advances the given task""" - prog = self.tasks[task_id][2] - prog += 1 - self.tasks[task_id][2] = prog - if prog == self.tasks[task_id][1]: - self.finished = True - - def __enter__(self): - self.finished = False - - def __exit__(self, exception_type, exception_value, traceback): - self.finished = True - - -class WorkingDots(ProgressColumn): - """TODO: add description""" - - max_refresh = 0.5 - is_silenced: bool = False - - def __init__(self, output=True): - self.counter = 0 - if not output: - self.is_silenced = True - super().__init__() - - def render(self, task: Any) -> str: - self.counter += 1 - if self.is_silenced: - return "" - if task.completed == task.total: - msg = "..." - elif self.counter % 3 == 0: - msg = ". " - elif self.counter % 3 == 1: - msg = ".. " - else: - msg = "..." - self.counter = 2 - return msg - - -class SubsamplingWaitTime(ProgressColumn): - """TODO: add description""" - - max_refresh = 0.5 - - def __init__(self, n_proc: int): - super().__init__() - - # Last time we updated - self.last_time = time.time() - # Cumulative time of all completed sub-sampling processes - self.cum_time = 0 - # Number of parallel running processes - self.n_proc = n_proc - self.t_rem = -1 - - def render(self, task: Any) -> str: - """TODO: add description?""" - - if task.completed == task.total: - return "Time remaining: 00:00" - - if self.cum_time > 0: - avrg_time = self.cum_time / max(1, task.completed) - rem_tasks = task.total - task.completed - gr_tasks = math.floor(rem_tasks / self.n_proc) - if (rem_tasks % self.n_proc) != 0: - gr_tasks += 1 - - total_time = gr_tasks * avrg_time - if self.t_rem < 0 or self.t_rem > total_time: - self.t_rem = total_time - - t_out = self.t_rem - (time.time() - self.last_time) - mins = str(math.floor(t_out / 60)) - secs = str(math.trunc(t_out % 60)) - - if len(mins) == 1: - mins = "0" + mins - if len(secs) == 1: - secs = "0" + secs - out_str = "Time remaining: " + mins + ":" + secs - return out_str - - return "Time remaining: --:--" - - def update_avrg(self, new_time: float): - """TODO: add description""" - - self.cum_time += new_time - self.last_time = time.time() diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/plot_creator_helper.py b/test/plot_creator_helper.py deleted file mode 100644 index e685e71..0000000 --- a/test/plot_creator_helper.py +++ /dev/null @@ -1,163 +0,0 @@ -import math -import os -import random - -import numpy as np -import plotly.graph_objects as go - -from lasso.dyna.d3plot import ArrayType, D3plot - - -# FIXME: there are no tests in this file. probably dead code. -def create_fake_d3plots( - path: str, - element_shell_node_indexes: np.ndarray, - bend_multiplicator: float, - n_nodes_x: int = 500, - n_nodes_y: int = 10, - n_timesteps: int = 5, -): - """ - Creates a number of artificial D3plots to be used in testing - """ - - # if bend_multiplicator > 0: - # bend_loc_x = int(n_nodes_x/10) - # bend_start = bend_loc_x - int(bend_loc_x/2) - # bend_end = bend_loc_x + int(bend_loc_x/2) - # else: - # bend_loc_x = n_nodes_x - int(n_nodes_x/10) - # bend_start = bend_loc_x - int(n_nodes_x/20) - # bend_end = bend_loc_x + int(n_nodes_x/20) - - x_coords = np.arange(n_nodes_x) - y_coords = np.arange(n_nodes_y) - # z_bend_mat = np.stack( - # [np.array([1+math.sin(x*2*math.pi/(bend_end - bend_start)) - # for x in range(bend_end - bend_start)] - # ) - # for _ in range(n_nodes_y)]).reshape(((bend_end - bend_start)*n_nodes_y)) - - z_bend_mat = np.stack([ - np.array([1 + math.sin(x * math.pi / n_nodes_x) for x in range(n_nodes_x)]) - for _ in range(n_nodes_y) - ]).reshape((n_nodes_x * n_nodes_y,)) - node_coordinates = np.zeros((n_nodes_x * n_nodes_y, 3)) - - # fill in y coords - for n in range(n_nodes_y): - node_coordinates[n * n_nodes_x : n_nodes_x + n * n_nodes_x, 1] = y_coords[n] - node_coordinates[n * n_nodes_x : n_nodes_x + n * n_nodes_x, 0] = x_coords - # fill in x coords - # for n in range(n_nodes_x): - # node_coordinates[n*n_nodes_y:n_nodes_y+n*n_nodes_y, 0] = x_coords[n] - - node_displacement = np.zeros((n_timesteps, n_nodes_x * n_nodes_y, 3)) - - for t in range(n_timesteps): - node_displacement[t] = node_coordinates - # node_displacement[t, bend_start*n_nodes_y:bend_end*n_nodes_y, 2] = \ - # z_bend_mat * bend_multiplicator * t - node_displacement[t, :, 2] = z_bend_mat * bend_multiplicator * t - - # print(node_displacement.shape) - - plot = D3plot() - plot.arrays[ArrayType.node_displacement] = node_displacement - plot.arrays[ArrayType.node_coordinates] = node_coordinates - plot.arrays[ArrayType.element_shell_node_indexes] = element_shell_node_indexes - plot.arrays[ArrayType.element_shell_part_indexes] = np.full( - (element_shell_node_indexes.shape[0]), 0 - ) - - # we could create an artificial array element_shell_is_alive to test the - # correct part extraction process not necessary currently - - os.makedirs(path, exist_ok=True) - plot.write_d3plot(os.path.join(path, "plot")) - # plotUtilFunc(node_displacement) - - -def plot_util_func(xyz_array: np.array): - trace = go.Scatter3d( - x=xyz_array[-1, :, 0], - y=xyz_array[-1, :, 1], - z=xyz_array[-1, :, 2], - mode="markers", - text=np.arange(xyz_array.shape[1]), - ) - fig = go.Figure([trace]) - fig.show() - - -def create_element_shell_node_indexes(n_nodes_x: int = 500, n_nodes_y: int = 10) -> np.ndarray: - """ - returns a element_shell_node_indexes array - """ - - new_shell_node_indexes = np.full( - ((n_nodes_x - 1) * (n_nodes_y - 1), 4), np.array([0, 1, n_nodes_x + 1, n_nodes_x]) - ) - mod = np.full((4, n_nodes_x - 1), np.arange(n_nodes_x - 1)) - for i in range(n_nodes_y - 1): - new_shell_node_indexes[(n_nodes_x - 1) * i : (n_nodes_x - 1) + ((n_nodes_x - 1) * i)] += ( - mod + i * n_nodes_x - ).T - - return new_shell_node_indexes - - -def create_n_fake_plots(folder: str, n_nodes_x: int, n_nodes_y: int, n_timesteps=5, n=50): - """ - creates `n` fake plots, `n/2` bending up, `n/2` bending down - - Parameters - ---------- - folder: str - folder path - n_nodes_x: int - how many nodes in x - n_nodes_y: int - how many nodes in y - n_timesteps: int, default: 5 - how many timesteps - n: int, default: 50 - how many plots - """ - - # init random - randy_random = random.Random("The_Seed") - - plot_name = "SVDTestPlot{i}" - - # doesn't change for each plot with same dimensions, so only created once - element_shell_node_indexes = create_element_shell_node_indexes( - n_nodes_x=n_nodes_x, n_nodes_y=n_nodes_y - ) - - # n plots bending up - for i in range(int(n / 2)): - create_fake_d3plots( - path=os.path.join(folder, plot_name.format(i=f"{i:02d}")), - element_shell_node_indexes=element_shell_node_indexes, - bend_multiplicator=5 * (1 + randy_random.random()), - n_nodes_x=n_nodes_x, - n_nodes_y=n_nodes_y, - n_timesteps=n_timesteps, - ) - - # n plots bending down - for i in range(int(n / 2)): - create_fake_d3plots( - path=os.path.join(folder, plot_name.format(i=f"{i + int(n / 2):02d}")), - element_shell_node_indexes=element_shell_node_indexes, - bend_multiplicator=-5 * (1 + randy_random.random()), - n_nodes_x=n_nodes_x, - n_nodes_y=n_nodes_y, - n_timesteps=n_timesteps, - ) - - -# TODO: Remove after fixing D3plot writing two files issue -# if __name__ == "__main__": -# create_2_fake_plots("../delteThisPlease/", 200, 10) diff --git a/test/test_data/DimredRunTest/verificationFile.hdf5 b/test/test_data/DimredRunTest/verificationFile.hdf5 deleted file mode 100644 index 3f4e6cd..0000000 Binary files a/test/test_data/DimredRunTest/verificationFile.hdf5 and /dev/null differ diff --git a/test/test_data/d3plot_beamip/d3plot b/test/test_data/d3plot_beamip/d3plot deleted file mode 100644 index 2a8b0da..0000000 Binary files a/test/test_data/d3plot_beamip/d3plot and /dev/null differ diff --git a/test/test_data/d3plot_beamip/d3plot01 b/test/test_data/d3plot_beamip/d3plot01 deleted file mode 100644 index b8f83b8..0000000 Binary files a/test/test_data/d3plot_beamip/d3plot01 and /dev/null differ diff --git a/test/test_data/d3plot_node_temperature/d3plot b/test/test_data/d3plot_node_temperature/d3plot deleted file mode 100644 index dcbd9c0..0000000 Binary files a/test/test_data/d3plot_node_temperature/d3plot and /dev/null differ diff --git a/test/test_data/d3plot_node_temperature/d3plot01 b/test/test_data/d3plot_node_temperature/d3plot01 deleted file mode 100644 index 3fe41ea..0000000 Binary files a/test/test_data/d3plot_node_temperature/d3plot01 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot b/test/test_data/d3plot_solid_int/d3plot deleted file mode 100644 index 8b140ab..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot01 b/test/test_data/d3plot_solid_int/d3plot01 deleted file mode 100644 index 03a7322..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot01 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot02 b/test/test_data/d3plot_solid_int/d3plot02 deleted file mode 100644 index 4b4c3ec..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot02 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot03 b/test/test_data/d3plot_solid_int/d3plot03 deleted file mode 100644 index bef12dc..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot03 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot04 b/test/test_data/d3plot_solid_int/d3plot04 deleted file mode 100644 index 1be0180..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot04 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot05 b/test/test_data/d3plot_solid_int/d3plot05 deleted file mode 100644 index 227b665..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot05 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot06 b/test/test_data/d3plot_solid_int/d3plot06 deleted file mode 100644 index 901fd1c..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot06 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot07 b/test/test_data/d3plot_solid_int/d3plot07 deleted file mode 100644 index b79e737..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot07 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot08 b/test/test_data/d3plot_solid_int/d3plot08 deleted file mode 100644 index b7ec3e8..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot08 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot09 b/test/test_data/d3plot_solid_int/d3plot09 deleted file mode 100644 index 39cf776..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot09 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot10 b/test/test_data/d3plot_solid_int/d3plot10 deleted file mode 100644 index fb8ab7d..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot10 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot11 b/test/test_data/d3plot_solid_int/d3plot11 deleted file mode 100644 index 6732e36..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot11 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot12 b/test/test_data/d3plot_solid_int/d3plot12 deleted file mode 100644 index bdb8737..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot12 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot13 b/test/test_data/d3plot_solid_int/d3plot13 deleted file mode 100644 index e6b9ea8..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot13 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot14 b/test/test_data/d3plot_solid_int/d3plot14 deleted file mode 100644 index 5cb0232..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot14 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot15 b/test/test_data/d3plot_solid_int/d3plot15 deleted file mode 100644 index d8ae054..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot15 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot16 b/test/test_data/d3plot_solid_int/d3plot16 deleted file mode 100644 index e00fb00..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot16 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot17 b/test/test_data/d3plot_solid_int/d3plot17 deleted file mode 100644 index eabf5e4..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot17 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot18 b/test/test_data/d3plot_solid_int/d3plot18 deleted file mode 100644 index 29357cf..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot18 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot19 b/test/test_data/d3plot_solid_int/d3plot19 deleted file mode 100644 index 76040af..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot19 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot20 b/test/test_data/d3plot_solid_int/d3plot20 deleted file mode 100644 index 3f8bd83..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot20 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot21 b/test/test_data/d3plot_solid_int/d3plot21 deleted file mode 100644 index 949f69c..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot21 and /dev/null differ diff --git a/test/test_data/d3plot_solid_int/d3plot22 b/test/test_data/d3plot_solid_int/d3plot22 deleted file mode 100644 index 8854bd1..0000000 Binary files a/test/test_data/d3plot_solid_int/d3plot22 and /dev/null differ diff --git a/test/test_data/femzip/d3plot b/test/test_data/femzip/d3plot deleted file mode 100644 index 6f16b31..0000000 Binary files a/test/test_data/femzip/d3plot and /dev/null differ diff --git a/test/test_data/femzip/d3plot.fz b/test/test_data/femzip/d3plot.fz deleted file mode 100644 index af0b8b6..0000000 Binary files a/test/test_data/femzip/d3plot.fz and /dev/null differ diff --git a/test/test_data/femzip/d3plot01 b/test/test_data/femzip/d3plot01 deleted file mode 100644 index 5754646..0000000 Binary files a/test/test_data/femzip/d3plot01 and /dev/null differ diff --git a/test/test_data/io_test/file1.txt b/test/test_data/io_test/file1.txt deleted file mode 100644 index 56f3b36..0000000 --- a/test/test_data/io_test/file1.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/test_data/io_test/subfolder/file2.txt b/test/test_data/io_test/subfolder/file2.txt deleted file mode 100644 index 56f3b36..0000000 --- a/test/test_data/io_test/subfolder/file2.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/test_data/io_test/subfolder/file3.yay b/test/test_data/io_test/subfolder/file3.yay deleted file mode 100644 index 56f3b36..0000000 --- a/test/test_data/io_test/subfolder/file3.yay +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/test_data/order_d3plot/d3plot b/test/test_data/order_d3plot/d3plot deleted file mode 100644 index 8b140ab..0000000 Binary files a/test/test_data/order_d3plot/d3plot and /dev/null differ diff --git a/test/test_data/order_d3plot/d3plot01 b/test/test_data/order_d3plot/d3plot01 deleted file mode 100644 index fab5a4c..0000000 Binary files a/test/test_data/order_d3plot/d3plot01 and /dev/null differ diff --git a/test/test_data/order_d3plot/d3plot02 b/test/test_data/order_d3plot/d3plot02 deleted file mode 100644 index 7665e96..0000000 Binary files a/test/test_data/order_d3plot/d3plot02 and /dev/null differ diff --git a/test/test_data/order_d3plot/d3plot10 b/test/test_data/order_d3plot/d3plot10 deleted file mode 100644 index 8c0e2c8..0000000 Binary files a/test/test_data/order_d3plot/d3plot10 and /dev/null differ diff --git a/test/test_data/order_d3plot/d3plot100 b/test/test_data/order_d3plot/d3plot100 deleted file mode 100644 index a9db6f7..0000000 Binary files a/test/test_data/order_d3plot/d3plot100 and /dev/null differ diff --git a/test/test_data/order_d3plot/d3plot11 b/test/test_data/order_d3plot/d3plot11 deleted file mode 100644 index 084c6c1..0000000 Binary files a/test/test_data/order_d3plot/d3plot11 and /dev/null differ diff --git a/test/test_data/order_d3plot/d3plot12 b/test/test_data/order_d3plot/d3plot12 deleted file mode 100644 index e55fd8b..0000000 Binary files a/test/test_data/order_d3plot/d3plot12 and /dev/null differ diff --git a/test/test_data/order_d3plot/d3plot22 b/test/test_data/order_d3plot/d3plot22 deleted file mode 100644 index c33ce8f..0000000 Binary files a/test/test_data/order_d3plot/d3plot22 and /dev/null differ diff --git a/test/test_data/simple_d3plot/d3plot b/test/test_data/simple_d3plot/d3plot deleted file mode 100644 index 6f16b31..0000000 Binary files a/test/test_data/simple_d3plot/d3plot and /dev/null differ diff --git a/test/test_data/simple_d3plot/d3plot01 b/test/test_data/simple_d3plot/d3plot01 deleted file mode 100644 index 5754646..0000000 Binary files a/test/test_data/simple_d3plot/d3plot01 and /dev/null differ diff --git a/test/unit_tests/__init__.py b/test/unit_tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/unit_tests/dimred/__init__.py b/test/unit_tests/dimred/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/unit_tests/dimred/svd/__init__.py b/test/unit_tests/dimred/svd/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/unit_tests/dimred/svd/test_clustering_betas.py b/test/unit_tests/dimred/svd/test_clustering_betas.py deleted file mode 100644 index a95cd8d..0000000 --- a/test/unit_tests/dimred/svd/test_clustering_betas.py +++ /dev/null @@ -1,57 +0,0 @@ -from unittest import TestCase - -import numpy as np - -from lasso.dimred.svd.clustering_betas import group_betas -from lasso.dimred.svd.keyword_types import ClusterType, DetectorType - - -class TestClustering(TestCase): - def test_group_betas(self): - """tests correct function of the group_betas function - in clustering_betas.py""" - - fake_names = np.array([f"betas_{i}" for i in range(25)]) - fake_cluster_0 = np.random.rand(12, 3) + 5 - fake_cluster_1 = np.random.rand(12, 3) - 5 - fake_betas = np.stack([*fake_cluster_0, *fake_cluster_1, np.array([0, 0, 0])]) - expected_clusters = 2 - expected_outliers = 1 - - # test with recommended settings - beta_clusters, name_clusters = group_betas( - fake_names, - fake_betas, - cluster=ClusterType.KMeans, - detector=DetectorType.LocalOutlierFactor, - cluster_params={"n_clusters": expected_clusters}, - ) - - # verify correct type of output - self.assertIsInstance(beta_clusters, list) - self.assertIsInstance(name_clusters, list) - - # verify that beta_clusters and name_clusters correspond to each other - self.assertEqual(len(beta_clusters), len(name_clusters)) - # verify that beta_clusters contains as many clusters as searched for - # inkluding one outlier - self.assertEqual(len(beta_clusters), expected_clusters + expected_outliers) - - # verify that entries correspond to each other - for c, cluster in enumerate(name_clusters): - for e, entry in enumerate(cluster): - index = np.where(fake_names == entry)[0] - self.assertTrue((fake_betas[index] - beta_clusters[c][e]).max() == 0) - - # verify different keyword combinations - - for cluster_type in ClusterType.get_cluster_type_name(): - for detector_type in DetectorType.get_detector_type_name(): - beta_clusters, name_clusters = group_betas( - fake_names, fake_betas, cluster=cluster_type, detector=detector_type - ) - - # verify correct output - self.assertIsInstance(beta_clusters, list) - self.assertIsInstance(name_clusters, list) - self.assertEqual(len(beta_clusters), len(name_clusters)) diff --git a/test/unit_tests/dimred/svd/test_plot_betas_clusters.py b/test/unit_tests/dimred/svd/test_plot_betas_clusters.py deleted file mode 100644 index 6bf5c05..0000000 --- a/test/unit_tests/dimred/svd/test_plot_betas_clusters.py +++ /dev/null @@ -1,33 +0,0 @@ -import hashlib -from unittest import TestCase - -import numpy as np - -from lasso.dimred.svd.plot_beta_clusters import plot_clusters_js - - -def hash_str(data: str) -> str: - """hashes a string""" - - hasher1 = hashlib.sha256() - hasher1.update(data.encode("utf-8")) - return hasher1.hexdigest() - - -class TestBetaViz(TestCase): - def test_plot_clusters_js(self): - """Veryfies correct output .html file""" - - betas = [np.array([[1, 1, 1], [1, 2, 3]])] - ids = np.array([["sample0", "sample1"]]) - - html_page_str = plot_clusters_js( - betas, ids, "", mark_timestamp=False, filename="testpage", write=False, show_res=False - ) - - self.assertIsInstance(html_page_str, str) - if isinstance(html_page_str, str): - html_page_hash = hash_str(html_page_str) - - desired_hash = "53f32e658079dfe8b9f24d7b8ff05a1d253abab77185203e408bfd942c837eeb" - self.assertEqual(html_page_hash, desired_hash) diff --git a/test/unit_tests/dimred/svd/test_pod_functions.py b/test/unit_tests/dimred/svd/test_pod_functions.py deleted file mode 100644 index 233070e..0000000 --- a/test/unit_tests/dimred/svd/test_pod_functions.py +++ /dev/null @@ -1,55 +0,0 @@ -from unittest import TestCase - -import numpy as np - -from lasso.dimred.svd.pod_functions import calculate_v_and_betas - - -class PodFunctionsTest(TestCase): - def test_calculate_v_and_betas(self): - """Verify svd works - Test for: - - returns V and B of correct shape - - failes if dataset to small (1 sample)""" - - # random input for 1 sample, 5 timesteps, 100 nodes, 3 dimensions - rand_samples = np.random.rand(1, 5, 100, 3) - - # should return error message string - err_msg = calculate_v_and_betas(rand_samples) - self.assertTrue(isinstance(err_msg, str)) - - # random input for 5 samples, 5 timesteps, 100 nodes, 3 dimensions - test_shape = (5, 5, 100, 3) - samples, timesteps, nodes, dimensions = test_shape - rand_samples = np.random.rand(samples, timesteps, nodes, dimensions) - result = calculate_v_and_betas(rand_samples) - - # returns Tuple containing v_rob and betas - self.assertTrue(isinstance(result, tuple)) - - v_rob, betas = result - - # v_rob and betas should both be numpy arrays - self.assertTrue(isinstance(v_rob, np.ndarray)) - self.assertTrue(isinstance(betas, np.ndarray)) - - # v_rob should be of shape (k_eigen, timesteps, nodes*dimensions) - # k_eigen should be min(10, samples-1), so in this case k_eigen = samples-1 = 4 - k_eigen = min(10, samples - 1) - self.assertEqual(v_rob.shape, (k_eigen, timesteps, nodes * dimensions)) - - # betas should be of shape (samples, timesteps, k_eigen) - self.assertEqual(betas.shape, (samples, timesteps, k_eigen)) - - # v_rob and betas should result in difference in displacements of original result - reshaped_samples = rand_samples.reshape(samples, timesteps, nodes * dimensions) - - delta_displ = reshaped_samples[:, :] - np.stack([ - reshaped_samples[0, :] for _ in range(timesteps) - ]) - - recacl_displ = np.einsum("ktn, stk -> stn", v_rob, betas) - - # check if both original and recalc have the same shape - self.assertEqual(delta_displ.shape, recacl_displ.shape) diff --git a/test/unit_tests/dimred/svd/test_subsampling_methods.py b/test/unit_tests/dimred/svd/test_subsampling_methods.py deleted file mode 100644 index 9307925..0000000 --- a/test/unit_tests/dimred/svd/test_subsampling_methods.py +++ /dev/null @@ -1,93 +0,0 @@ -import os -import tempfile -from unittest import TestCase - -import numpy as np - -from lasso.dimred.svd.subsampling_methods import create_reference_subsample, remap_random_subsample -from test.plot_creator_helper import create_n_fake_plots - - -class TestSubsampling(TestCase): - def test_create_reference_sample(self): - """Tests the creation of reference sample""" - - with tempfile.TemporaryDirectory() as tmp_dir: - create_n_fake_plots(tmp_dir, 500, 10, n=2) - load_path = os.path.join(tmp_dir, "SVDTestPlot00/plot") - n_nodes = 200 - - result = create_reference_subsample(load_path, parts=[], nr_samples=n_nodes) - - # result should be tuple containing subsample, load time and total process time - self.assertTrue(isinstance(result, tuple)) - - ref_sample, t_total, t_load = result - - # check for correct types - self.assertTrue(isinstance(ref_sample, np.ndarray)) - self.assertTrue(isinstance(t_total, float)) - self.assertTrue(isinstance(t_load, float)) - - # t_total should be greater than t_load - self.assertTrue(t_total - t_load >= 0) - - # check for correct dimensions of ref_sample - self.assertEqual(ref_sample.shape, (n_nodes, 3)) - - # should return string error message if desired samplesize is greater - # than available nodes - n_nodes = 5500 - result = create_reference_subsample(load_path, parts=[], nr_samples=n_nodes) - - self.assertTrue(isinstance(result, str)) - - # should return string error message for nonexitant parts: - n_nodes = 200 - result = create_reference_subsample(load_path, parts=[1], nr_samples=n_nodes) - - self.assertTrue(isinstance(result, str)) - - def test_remap_random_subsample(self): - """Verifies correct subsampling""" - - with tempfile.TemporaryDirectory() as tmp_dir: - create_n_fake_plots(tmp_dir, 500, 10, n=2) - ref_path = os.path.join(tmp_dir, "SVDTestPlot00/plot") - sample_path = os.path.join(tmp_dir, "SVDTestPlot01/plot") - n_nodes = 200 - - ref_result = create_reference_subsample(ref_path, parts=[], nr_samples=n_nodes) - - ref_sample = ref_result[0] - - sub_result = remap_random_subsample( - sample_path, parts=[], reference_subsample=ref_sample - ) - - # sub_result should be Tuple containing subsample, total process time, - # and plot load time - self.assertTrue(isinstance(sub_result, tuple)) - - subsample, t_total, t_load = sub_result - - # confirm correct types - self.assertTrue(isinstance(subsample, np.ndarray)) - self.assertTrue(isinstance(t_total, float)) - self.assertTrue(isinstance(t_load, float)) - - # t_total should be greater t_load - self.assertTrue(t_total - t_load >= 0) - - # correct shape of subsample - self.assertEqual(subsample.shape, (5, n_nodes, 3)) - - # entries of subsmaple at timestep 0 should be the same as the reference sample - # this is only true for for the dimredTestPlots, this might not be the case - # with real plots we check if the difference is 0 - self.assertTrue((ref_sample - subsample[0]).max() == 0) - - # should return string error message for nonexistent parts: - err_msg = remap_random_subsample(sample_path, parts=[1], reference_subsample=ref_sample) - - self.assertTrue(isinstance(err_msg, str)) diff --git a/test/unit_tests/dimred/test_dimred_run.py b/test/unit_tests/dimred/test_dimred_run.py deleted file mode 100644 index 7747fec..0000000 --- a/test/unit_tests/dimred/test_dimred_run.py +++ /dev/null @@ -1,263 +0,0 @@ -import os -import tempfile -from unittest import TestCase - -import h5py -import numpy as np - -from lasso.dimred.dimred_run import DIMRED_STAGES, DimredRun, DimredRunError, HDF5FileNames -from test.plot_creator_helper import create_n_fake_plots - - -class TestDimredRun(TestCase): - def test_run(self): - """Verifies correct function of DimredRun.py""" - verification_hdf5_file = h5py.File( - "test/test_data/DimredRunTest/verificationFile.hdf5", "r" - ) - - with tempfile.TemporaryDirectory() as tmpdir: - # create simulation runs - create_n_fake_plots(folder=tmpdir, n_nodes_x=500, n_nodes_y=10) - - # collect all simulation runs - # sim_dir = "test/dimredTestPlots" - sim_files = os.listdir(tmpdir) - # sim_files.pop(sim_files.index("htmlTestPage.html")) - sim_runs = [] - for sim in sim_files: - sim_runs.append(os.path.join(tmpdir, sim, "plot")) - - test_run = DimredRun( - reference_run=os.path.join(tmpdir, "SVDTestPlot00/plot"), - simulation_runs=sim_runs, - start_stage=DIMRED_STAGES[0], - end_stage="CLUSTERING", - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - cluster_args=["kmeans"], - ) - - with test_run: - # verify creation of reference_subsample - # to be able to reproduce results, each DimredRun must return same results - test_run.process_reference_run() - - # check if reference subsamples match - test_refsample = test_run.h5file[HDF5FileNames.SUBSAMPLE_SAVE_NAME.value] - verification_refsample = verification_hdf5_file[ - HDF5FileNames.SUBSAMPLE_SAVE_NAME.value - ] - self.assertEqual(test_refsample.shape, verification_refsample.shape) - self.assertTrue((test_refsample[:] - verification_refsample[:]).max() == 0) - - # check if the expected reference run is chosen - self.assertEqual( - os.path.abspath(os.path.join(tmpdir, "SVDTestPlot00/plot")), - test_run.reference_run, - ) - - # check if subsampled samples match - test_run.subsample_to_reference_run() - - # get subsampled samples - test_sub_group = test_run.h5file[HDF5FileNames.SUBSAMPLED_GROUP_NAME.value] - test_subs = np.stack([test_sub_group[key][:] for key in test_sub_group.keys()]) - - # check if shape is equal to (n_samples, timesteps, subsampled nodes, dims) - # we have 50 sample, minus ref_run is 49 - # we have 5 timesteps - # we subsample to 2000 nodes - # we always have 3 spatial dimensions - self.assertEqual(test_subs.shape, (49, 5, 2000, 3)) - - # check if svd yields consistent results - test_run.dimension_reduction_svd() - - # get test betas - test_betas_group = test_run.h5file[HDF5FileNames.BETAS_GROUP_NAME.value] - test_ids = np.stack(list(test_betas_group.keys())) - test_betas = np.stack([test_betas_group[key][:] for key in test_betas_group.keys()]) - - # we check if test_ids and test_betas are of correct shape - # we have 44 samples, 5 timesteps and save the first 10 betas - self.assertEqual(test_ids.shape, (49,)) - self.assertEqual(test_betas.shape, (49, 5, 10)) - - test_v_rob = test_run.h5file[HDF5FileNames.V_ROB_SAVE_NAME.value][:] - # shape of v_rob must be (eigen, timesteps, nodes) - self.assertEqual(test_v_rob.shape, (10, 5, 2000 * 3)) - - # verify that calculated betas are reproducible as expected - # first, create displ mat containing difference in displ over time - verify_displ_stacked = test_subs.reshape(49, 5, 2000 * 3) - verify_diff_mat = np.stack([ - verify_displ_stacked[:, 0, :] for _ in range(5) - ]).reshape(49, 5, 2000 * 3) - verify_displ_stacked = verify_displ_stacked - verify_diff_mat - - # calculate betas and check if they are similar - verify_betas = np.einsum("stn, ktn -> stk", verify_displ_stacked, test_v_rob) - self.assertTrue(np.allclose(verify_betas, test_betas)) - - # recalculate displ - recalc_displ_stacked = np.einsum("stk, ktn -> stn", test_betas, test_v_rob) - - # Due to projection into eigenspace and back not using all available eigenvectors, - # a small error margin is inevitable - self.assertTrue((verify_displ_stacked - recalc_displ_stacked).max() <= 1e-5) - - # checking clustering and html output makes little sense here, - # but we know how the created plots are laid out: 25 bending up, 25 bending down - # this should be presented in the betas - # We will only look at the last timestep - # We only check the first beta - - # first 24 betas point one direction (reference run is run 0 and points up) - betas_up = test_betas[:24, -1] - # other 25 betas point down - betas_down = test_betas[24:, -1] - - # check that first beta has the same sign as others bending up - is_pos_up = betas_up[0, 0] > 0 - for b in betas_up: - self.assertEqual(is_pos_up, b[0] > 0) - - # check that 25th betas has same sign as other bending down - is_pos_down = betas_down[0, 0] > 0 - for b in betas_down: - self.assertEqual(is_pos_down, b[0] > 0) - - # verify that one group has negative and other group positive direction - self.assertFalse(is_pos_down and is_pos_up) - - test_run.clustering_results() - - # check if glob pattern works correctly - DimredRun( - simulation_runs=os.path.join(tmpdir, "SVDTestPlot*/plot"), - start_stage=DIMRED_STAGES[0], - end_stage=DIMRED_STAGES[0], - project_dir="test/test_data/DimredRunTest", - console=None, - ) - - def test_for_errors(self): - """Verifies correct error behaviour when facing incorrect parser arguments""" - - with tempfile.TemporaryDirectory() as tmpdir: - # collect all simulation runs - sim_files = os.listdir(tmpdir) - sim_runs = [] - for sim in sim_files: - sim_runs.append(os.path.join(tmpdir, sim, "plot")) - - # check invalid start_stage - self.assertRaises( - DimredRunError, - DimredRun, - reference_run="test/dimredTestPlots/SVDTestPlot0/plot", - simulation_runs=sim_runs, - start_stage="INVALID_START", - end_stage=DIMRED_STAGES[-1], - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - ) - - # check invalid end_stage - self.assertRaises( - DimredRunError, - DimredRun, - reference_run="test/dimredTestPlots/SVDTestPlot0/plot", - simulation_runs=sim_runs, - start_stage=DIMRED_STAGES[0], - end_stage="INVALID_END", - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - ) - - # check invalid start_stage after end_stage - self.assertRaises( - DimredRunError, - DimredRun, - reference_run="test/dimredTestPlots/SVDTestPlot0/plot", - simulation_runs=sim_runs, - start_stage=DIMRED_STAGES[-1], - end_stage=DIMRED_STAGES[0], - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - ) - - # check invalid simulation runs - self.assertRaises( - DimredRunError, - DimredRun, - simulation_runs="test/dimredTestPlots200/plot", - start_stage=DIMRED_STAGES[0], - end_stage=DIMRED_STAGES[-1], - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - ) - - # check invalid cluster_args - self.assertRaises( - DimredRunError, - DimredRun, - simulation_runs=sim_runs, - start_stage=DIMRED_STAGES[0], - end_stage=DIMRED_STAGES[-1], - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - cluster_args=["noMeans"], - ) - - # check invalid outlier-args - self.assertRaises( - DimredRunError, - DimredRun, - simulation_runs=sim_runs, - start_stage=DIMRED_STAGES[0], - end_stage=DIMRED_STAGES[-1], - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - cluster_args=["kmeans"], - outlier_args=["DoesNotExist"], - ) - - # check inexistent reference run - self.assertRaises( - DimredRunError, - DimredRun, - reference_run=os.path.join(tmpdir, "IDontExist"), - simulation_runs=sim_runs, - start_stage=DIMRED_STAGES[0], - end_stage=DIMRED_STAGES[-1], - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - ) - # check for empty simulation runs - self.assertRaises( - DimredRunError, - DimredRun, - simulation_runs="", - start_stage=DIMRED_STAGES[0], - end_stage=DIMRED_STAGES[-1], - console=None, - project_dir="test/test_data/DimredRunTest", - n_processes=5, - ) - - def tearDown(self): - # cleanup of created files - test_files = os.listdir("test/test_data/DimredRunTest") - test_files.pop(test_files.index("verificationFile.hdf5")) - for entry in test_files: - os.remove(os.path.join("test/test_data/DimredRunTest", entry)) diff --git a/test/unit_tests/dyna/__init__.py b/test/unit_tests/dyna/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/unit_tests/dyna/test_d3plot.py b/test/unit_tests/dyna/test_d3plot.py deleted file mode 100644 index 47d8ce8..0000000 --- a/test/unit_tests/dyna/test_d3plot.py +++ /dev/null @@ -1,456 +0,0 @@ -import os -import struct -import tempfile -from unittest import TestCase - -import numpy as np - -from lasso.dyna.array_type import ArrayType -from lasso.dyna.d3plot import D3plot, FilterType, _negative_to_positive_state_indexes -from lasso.femzip.femzip_api import FemzipAPI -from lasso.io.binary_buffer import BinaryBuffer - - -class D3plotTest(TestCase): - def test_init(self): - # settings - self.maxDiff = None - - filepath = "test/test_data/simple_d3plot/d3plot" - - geometry_array_shapes = { - "node_coordinates": (4915, 3), - "element_solid_part_indexes": (0,), - "element_solid_node_indexes": (0, 8), - "element_tshell_node_indexes": (0, 8), - "element_tshell_part_indexes": (0,), - "element_beam_part_indexes": (0,), - "element_beam_node_indexes": (0, 5), - "element_shell_node_indexes": (4696, 4), - "element_shell_part_indexes": (4696,), - "node_ids": (4915,), - "element_solid_ids": (0,), - "element_beam_ids": (0,), - "element_shell_ids": (4696,), - "element_tshell_ids": (0,), - "part_titles_ids": (1,), - "part_titles": (1,), - } - - state_array_shapes = { - "timesteps": (1,), - "global_kinetic_energy": (1,), - "global_internal_energy": (1,), - "global_total_energy": (1,), - "global_velocity": (1, 3), - "part_internal_energy": (1, 1), - "part_kinetic_energy": (1, 1), - "part_velocity": (1, 1, 3), - "part_mass": (1, 1), - "part_hourglass_energy": (1, 1), - "node_displacement": (1, 4915, 3), - "node_velocity": (1, 4915, 3), - "node_acceleration": (1, 4915, 3), - "element_shell_stress": (1, 4696, 3, 6), - "element_shell_effective_plastic_strain": (1, 4696, 3), - "element_shell_history_vars": (1, 4696, 3, 19), - "element_shell_bending_moment": (1, 4696, 3), - "element_shell_shear_force": (1, 4696, 2), - "element_shell_normal_force": (1, 4696, 3), - "element_shell_thickness": (1, 4696), - "element_shell_unknown_variables": (1, 4696, 2), - "element_shell_strain": (1, 4696, 2, 6), - "element_shell_internal_energy": (1, 4696), - "element_shell_is_alive": (1, 4696), - } - - all_array_shapes = {**geometry_array_shapes, **state_array_shapes} - - # empty constructor - D3plot() - - # file thing - d3plot = D3plot(filepath) - d3plot_shapes = {array_name: array.shape for array_name, array in d3plot.arrays.items()} - self.assertDictEqual(d3plot_shapes, all_array_shapes) - - # limited buffer files - d3plot = D3plot(filepath, buffered_reading=True) - d3plot_shapes = {array_name: array.shape for array_name, array in d3plot.arrays.items()} - self.assertDictEqual(d3plot_shapes, all_array_shapes) - - # test loading single state arrays - for array_name, array_shape in state_array_shapes.items(): - d3plot = D3plot(filepath, state_array_filter=[array_name]) - d3plot_shapes = {array_name: array.shape for array_name, array in d3plot.arrays.items()} - self.assertDictEqual(d3plot_shapes, {**geometry_array_shapes, array_name: array_shape}) - - # test loading individual states - d3plot = D3plot(filepath, state_filter={0}) - d3plot2 = D3plot(filepath) - hdr_diff, array_diff = d3plot.compare(d3plot2) - self.assertEqual(d3plot.n_timesteps, 1) - self.assertDictEqual(hdr_diff, {}) - self.assertDictEqual(array_diff, {}) - - def test_header(self): - test_header_data = { - "title": " ", - "runtime": 1472027823, - "filetype": 1, - "source_version": -971095103, - "release_version": "R712", - "version": 960.0, - "ndim": 4, - "numnp": 4915, - "it": 0, - "iu": 1, - "iv": 1, - "ia": 1, - "nel2": 0, - "nel4": 4696, - "nel8": 0, - "nelt": 0, - "nel20": 0, - "nel27": 0, - "nel48": 0, - "nv1d": 6, - "nv2d": 102, - "nv3d": 32, - "nv3dt": 90, - "nummat4": 1, - "nummat8": 0, - "nummat2": 0, - "nummatt": 0, - "icode": 6, - "nglbv": 13, - "numst": 0, - "numds": 0, - "neiph": 25, - "neips": 19, - "maxint": -10003, - "nmsph": 0, - "ngpsph": 0, - "narbs": 9624, - "ioshl1": 1000, - "ioshl2": 1000, - "ioshl3": 1000, - "ioshl4": 1000, - "ialemat": 0, - "ncfdv1": 0, - "ncfdv2": 0, - "nadapt": 0, - "nmmat": 1, - "numfluid": 0, - "inn": 1, - "npefg": 0, - "idtdt": 0, - "extra": 0, - "nt3d": 0, - "neipb": 0, - } - - d3plot = D3plot("test/test_data/simple_d3plot/d3plot") - header = d3plot.header - - for name, value in test_header_data.items(): - self.assertEqual(header.raw_header[name], value, f"Invalid var {name}") - - def test_beam_integration_points(self): - self.maxDiff = None - - filepath = "test/test_data/d3plot_beamip/d3plot" - maxmin_test_values = { - # "element_beam_shear_stress": (-0.007316963, 0.), - "element_beam_shear_stress": (0.0, 0.0056635854), - "element_beam_axial_stress": (-0.007316963, 0.0), - "element_beam_plastic_strain": (0.0, 0.0056297667), - "element_beam_axial_strain": (-0.0073745, 0.0), - } - - d3plot = D3plot(filepath) - - for array_name, minmax in maxmin_test_values.items(): - array = d3plot.arrays[array_name] - self.assertAlmostEqual( - array.min(), minmax[0], msg=f"{array_name}: {array.min()} != {minmax[0]}" - ) - self.assertAlmostEqual( - array.max(), minmax[1], msg=f"{array_name}: {array.max()} != {minmax[1]}" - ) - - def test_correct_sort_of_more_than_100_state_files(self): - filepath = "test/test_data/order_d3plot/d3plot" - - d3plot = D3plot(filepath) - - timesteps = d3plot.arrays[ArrayType.global_timesteps] - self.assertListEqual(timesteps.astype(int).tolist(), [1, 2, 10, 11, 12, 22, 100]) - - def test_femzip_basic(self): - self.maxDiff = None - - filepath1 = "test/test_data/femzip/d3plot.fz" - filepath2 = "test/test_data/femzip/d3plot" - - d3plot_kwargs_list = [{}, {"buffered_reading": True}, {"state_filter": [0]}] - - D3plot.use_advanced_femzip_api = False - - for d3plot_kwargs in d3plot_kwargs_list: - d3plot1 = D3plot(filepath1, **d3plot_kwargs) - d3plot2 = D3plot(filepath2, **d3plot_kwargs) - - hdr_diff, array_diff = d3plot1.compare(d3plot2, array_eps=1e-2) - - self.assertDictEqual(hdr_diff, {}) - self.assertDictEqual(array_diff, {}) - - def test_femzip_extended(self): - self.maxDiff = None - - filepath1 = "test/test_data/femzip/d3plot.fz" - filepath2 = "test/test_data/femzip/d3plot" - - d3plot_kwargs_list = [{}, {"buffered_reading": True}, {"state_filter": [0]}] - - api = FemzipAPI() - if not api.has_femunziplib_license(): - return - - D3plot.use_advanced_femzip_api = True - - for d3plot_kwargs in d3plot_kwargs_list: - d3plot1 = D3plot(filepath1, **d3plot_kwargs) - d3plot2 = D3plot(filepath2, **d3plot_kwargs) - - hdr_diff, array_diff = d3plot1.compare(d3plot2, array_eps=1e-2) - - self.assertDictEqual(hdr_diff, {}) - self.assertDictEqual(array_diff, {}) - - def test_part_filter(self): - self.maxDiff = None - - filepath = "test/test_data/simple_d3plot/d3plot" - part_ids = [1] - - d3plot = D3plot(filepath) - shell_filter = d3plot.get_part_filter(FilterType.SHELL, part_ids) - self.assertEqual(shell_filter.sum(), 4696) - - part_filter = d3plot.get_part_filter(FilterType.PART, part_ids) - self.assertEqual(part_filter.sum(), 1) - - node_filter = d3plot.get_part_filter(FilterType.NODE, part_ids) - self.assertEqual(len(node_filter), 4915) - - def test_read_solid_integration_points(self): - filepath = "test/test_data/d3plot_solid_int/d3plot" - - # data from META - stress_valid = np.array([ - 2.132084e02, - 1.792203e02, - 1.397527e02, - 2.307352e02, - 2.132105e02, - 1.792210e02, - 1.397558e02, - 2.307304e02, - ]) - pstrain_valid = np.array([ - 2.227418e-02, - 2.576126e-03, - 1.909884e-02, - 3.695280e-02, - 2.227416e-02, - 2.576110e-03, - 1.909888e-02, - 3.695256e-02, - ]) - last_timestep = -1 - first_element = 0 - stress_xx = 0 - - d3plot = D3plot(filepath) - - stress = d3plot.arrays[ArrayType.element_solid_stress] - np.array_equal(stress[last_timestep, first_element, :, stress_xx], stress_valid) - - pstrain = d3plot.arrays[ArrayType.element_solid_effective_plastic_strain] - np.array_equal(pstrain[last_timestep, first_element, :], pstrain_valid) - - def test_negative_to_positive_state_indexes(self) -> None: - indexes = set() - new_indexes = _negative_to_positive_state_indexes(indexes, len(indexes)) - self.assertSetEqual(indexes, new_indexes) - - indexes = {0, 1, 2} - with self.assertRaises(ValueError): - new_indexes = _negative_to_positive_state_indexes(indexes, 2) - - indexes = {0, -1} - new_indexes = _negative_to_positive_state_indexes(indexes, 8) - self.assertSetEqual(new_indexes, {0, 7}) - - def test_is_end_of_file_marker(self) -> None: - # -999999. in float32 - bb = BinaryBuffer() - bb.memoryview = memoryview(struct.pack(" None: - number = 1234567890 - - # the numbers are sorted from the lowest importance - # upwards - # 0 -> 0 - # 1 -> 9 - # ... - number_str = str(number)[::-1] - - for index in range(len(number_str)): - digit = get_digit(number, index) - self.assertEqual( - digit, - int(number_str[index]), - f"index {index} digit {digit} digit_str {number_str[index]}", - ) - - self.assertEqual(get_digit(number, 10), 0) - - def test_d3plot_filetype_from_integer(self) -> None: - self.assertEqual(d3plot_filetype_from_integer(1), D3plotFiletype.D3PLOT) - self.assertEqual(d3plot_filetype_from_integer(5), D3plotFiletype.D3PART) - self.assertEqual(d3plot_filetype_from_integer(11), D3plotFiletype.D3EIGV) - - # INFOR is forbidden - with self.assertRaises(ValueError): - d3plot_filetype_from_integer(4) - - with self.assertRaises(ValueError): - d3plot_filetype_from_integer(0) - - def test_determine_file_settings(self) -> None: - # the routine checks the "filetype" flag - # if it makes any sense under any circumstances - # we assume the corresponding file settings - - # 44 -> int32 - # 88 -> int64 - for position in (44, 88): - for filetype in (D3plotFiletype.D3PLOT, D3plotFiletype.D3PART, D3plotFiletype.D3EIGV): - bb = BinaryBuffer() - bb.memoryview = memoryview(bytearray(256)) - bb.write_number(position, filetype.value, np.int32) - - word_size, itype, ftype = D3plotHeader._determine_file_settings(bb) - - if position == 44: - self.assertEqual(word_size, 4) - self.assertEqual(itype, np.int32) - self.assertEqual(ftype, np.float32) - else: - self.assertEqual(word_size, 8) - self.assertEqual(itype, np.int64) - self.assertEqual(ftype, np.float64) - - # error - bb = BinaryBuffer() - bb.memoryview = memoryview(bytearray(256)) - - with self.assertRaises(RuntimeError): - D3plotHeader._determine_file_settings(bb) diff --git a/test/unit_tests/dyna/test_mapper.py b/test/unit_tests/dyna/test_mapper.py deleted file mode 100644 index 308c5cc..0000000 --- a/test/unit_tests/dyna/test_mapper.py +++ /dev/null @@ -1,479 +0,0 @@ -from typing import Union -from unittest import TestCase - -import numpy as np - -from lasso.dyna.array_type import ArrayType -from lasso.dyna.femzip_mapper import FemzipMapper -from lasso.femzip.fz_config import FemzipArrayType, FemzipVariableCategory - - -part_global_femzip_translations: dict[tuple[FemzipArrayType, FemzipVariableCategory], set[str]] = { - # GLOBAL - (FemzipArrayType.GLOBAL_DATA, FemzipVariableCategory.GLOBAL): { - # ArrayType.global_timesteps, - ArrayType.global_internal_energy, - ArrayType.global_kinetic_energy, - ArrayType.global_total_energy, - ArrayType.global_velocity, - }, - # PART - (FemzipArrayType.PART_RESULTS, FemzipVariableCategory.PART): { - ArrayType.part_hourglass_energy, - ArrayType.part_internal_energy, - ArrayType.part_kinetic_energy, - ArrayType.part_mass, - ArrayType.part_velocity, - }, -} - -element_nope_femzip_translations: dict[tuple[str, FemzipVariableCategory], str] = { - # NODE - ( - FemzipArrayType.NODE_DISPLACEMENT.value, - FemzipVariableCategory.NODE, - ): ArrayType.node_displacement, - ( - FemzipArrayType.NODE_ACCELERATIONS.value, - FemzipVariableCategory.NODE, - ): ArrayType.node_acceleration, - (FemzipArrayType.NODE_VELOCITIES.value, FemzipVariableCategory.NODE): ArrayType.node_velocity, - ( - FemzipArrayType.NODE_TEMPERATURES.value, - FemzipVariableCategory.NODE, - ): ArrayType.node_temperature, - (FemzipArrayType.NODE_HEAT_FLUX.value, FemzipVariableCategory.NODE): ArrayType.node_heat_flux, - ( - FemzipArrayType.NODE_MASS_SCALING.value, - FemzipVariableCategory.NODE, - ): ArrayType.node_mass_scaling, - ( - FemzipArrayType.NODE_TEMPERATURE_GRADIENT.value, - FemzipVariableCategory.NODE, - ): ArrayType.node_temperature_gradient, - # BEAM - ( - FemzipArrayType.BEAM_AXIAL_FORCE.value, - FemzipVariableCategory.BEAM, - ): ArrayType.element_beam_axial_force, - ( - FemzipArrayType.BEAM_S_BENDING_MOMENT.value, - FemzipVariableCategory.BEAM, - ): ArrayType.element_beam_bending_moment, - ( - FemzipArrayType.BEAM_T_BENDING_MOMENT.value, - FemzipVariableCategory.BEAM, - ): ArrayType.element_beam_bending_moment, - ( - FemzipArrayType.BEAM_S_SHEAR_RESULTANT.value, - FemzipVariableCategory.BEAM, - ): ArrayType.element_beam_shear_force, - ( - FemzipArrayType.BEAM_T_SHEAR_RESULTANT.value, - FemzipVariableCategory.BEAM, - ): ArrayType.element_beam_shear_force, - ( - FemzipArrayType.BEAM_TORSIONAL_MOMENT.value, - FemzipVariableCategory.BEAM, - ): ArrayType.element_beam_torsion_moment, - (FemzipArrayType.STRESS_X.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, - (FemzipArrayType.STRESS_Y.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, - (FemzipArrayType.STRESS_Z.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, - (FemzipArrayType.STRESS_XY.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, - (FemzipArrayType.STRESS_YZ.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, - (FemzipArrayType.STRESS_XZ.value, FemzipVariableCategory.SHELL): ArrayType.element_shell_stress, - ( - FemzipArrayType.EFF_PSTRAIN.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_effective_plastic_strain, - ( - FemzipArrayType.HISTORY_VARS.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_history_vars, - ( - FemzipArrayType.BENDING_MOMENT_MX.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_bending_moment, - ( - FemzipArrayType.BENDING_MOMENT_MY.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_bending_moment, - ( - FemzipArrayType.BENDING_MOMENT_MXY.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_bending_moment, - ( - FemzipArrayType.SHEAR_FORCE_X.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_shear_force, - ( - FemzipArrayType.SHEAR_FORCE_Y.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_shear_force, - ( - FemzipArrayType.NORMAL_FORCE_X.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_normal_force, - ( - FemzipArrayType.NORMAL_FORCE_Y.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_normal_force, - ( - FemzipArrayType.NORMAL_FORCE_XY.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_normal_force, - ( - FemzipArrayType.THICKNESS.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_thickness, - ( - FemzipArrayType.UNKNOWN_1.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_unknown_variables, - ( - FemzipArrayType.UNKNOWN_2.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_unknown_variables, - ( - FemzipArrayType.STRAIN_INNER_X.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_INNER_Y.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_INNER_Z.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_INNER_XY.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_INNER_YZ.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_INNER_XZ.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_OUTER_X.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_OUTER_Y.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_OUTER_Z.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_OUTER_XY.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_OUTER_YZ.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.STRAIN_OUTER_XZ.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_strain, - ( - FemzipArrayType.INTERNAL_ENERGY.value, - FemzipVariableCategory.SHELL, - ): ArrayType.element_shell_internal_energy, - # SOLID - (FemzipArrayType.STRESS_X.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, - (FemzipArrayType.STRESS_Y.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, - (FemzipArrayType.STRESS_Z.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, - (FemzipArrayType.STRESS_XY.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, - (FemzipArrayType.STRESS_YZ.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, - (FemzipArrayType.STRESS_XZ.value, FemzipVariableCategory.SOLID): ArrayType.element_solid_stress, - ( - FemzipArrayType.EFF_PSTRAIN.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_effective_plastic_strain, - ( - FemzipArrayType.STRAIN_INNER_X.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_INNER_Y.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_INNER_Z.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_INNER_XY.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.HISTORY_VARS.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_history_variables, - ( - FemzipArrayType.STRAIN_INNER_YZ.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_INNER_XZ.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_OUTER_X.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_OUTER_Y.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_OUTER_Z.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_OUTER_XY.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_OUTER_YZ.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, - ( - FemzipArrayType.STRAIN_OUTER_XZ.value, - FemzipVariableCategory.SOLID, - ): ArrayType.element_solid_strain, -} - - -class MapperTest(TestCase): - def validate( - self, - fz: dict[tuple[str, FemzipVariableCategory], np.ndarray], - d3plot_shape: tuple, - data_index_positions: Union[tuple, slice] = None, - ): - """Validate that the arrays have the same shape and that the - raw data has been allocated to the correct positions in the - d3plot arrays. - - Parameters - ---------- - fz: - femzip data following the same schema as in the api - d3plot_shape: - shape of the d3plot array - data_index_positions: - positions of the raw data in the d3plot array - """ - if data_index_positions is None: - data_index_positions = slice(None) - d3plot_name = [] - - m = FemzipMapper() - - # filter out parts and globals if they exist - for key in fz.keys(): - if key in element_nope_femzip_translations: - d3plot_name.append(element_nope_femzip_translations[key]) - - d3plot_name = set(d3plot_name).pop() - - m.map(fz) - - _ = m.d3plot_arrays[d3plot_name] - - def test_nodal_disp(self): - m = FemzipMapper() - - # NODE DISPLACEMENT - nd = np.random.randn(2, 10, 3) - - fz = {(1, FemzipArrayType.NODE_DISPLACEMENT.value, FemzipVariableCategory.NODE): nd} - - m.map(fz) - - result = m.d3plot_arrays - self.assertTrue(np.allclose(nd, result["node_displacement"])) - - def test_tshells(self): - d = np.random.randn(2, 2) - - fz = { - (1, "Sigma-z (IP 2)", FemzipVariableCategory.THICK_SHELL): d, - (2, "Epsilon-xy (inner)", FemzipVariableCategory.THICK_SHELL): d, - } - - m = FemzipMapper() - - m.map(fz) - - r = m.d3plot_arrays - - self.assertEqual(r[ArrayType.element_tshell_stress].shape, (2, 2, 2, 3)) - self.assertTrue(np.allclose(r[ArrayType.element_tshell_stress][:, :, 1, 2], d)) - - self.assertEqual(r[ArrayType.element_tshell_strain].shape, (2, 2, 1, 4)) - self.assertTrue(np.allclose(r[ArrayType.element_tshell_strain][:, :, 0, 3], d)) - - def test_internal_shell_energy(self): - interal_energy = np.array([[1, 1, 0.12, 2.121202, 2.1123, 7.213]]).reshape(2, 3) - - fz = {(1, "internal_energy", FemzipVariableCategory.SHELL): interal_energy} - m = FemzipMapper() - - m.map(fz) - - r = m.d3plot_arrays[ArrayType.element_shell_internal_energy] - self.assertTrue(np.allclose(r, interal_energy)) - - def test_dependent_variable(self): - d1 = np.random.randn(2, 1200) - d2 = np.random.randn(2, 1200) - - fz: dict[tuple[int, str, FemzipVariableCategory], np.ndarray] = { - (1, "element_dependent_variable_2", FemzipVariableCategory.SHELL): d2, - (2, "element_dependent_variable_1", FemzipVariableCategory.SHELL): d1, - } - m = FemzipMapper() - - m.map(fz) - - r = m.d3plot_arrays - - self.assertEqual(r[ArrayType.element_shell_unknown_variables].shape, (2, 1200, 2)) - - self.assertTrue(np.allclose(d1, r[ArrayType.element_shell_unknown_variables][:, :, 0])) - self.assertTrue(np.allclose(d2, r[ArrayType.element_shell_unknown_variables][:, :, 1])) - - def test_effective_p_strain(self): - m = FemzipMapper() - d1 = np.random.randn(2, 20000) - d2 = np.random.randn(2, 20000) - d3 = np.random.randn(2, 20000) - - fz: dict[tuple[int, str, FemzipVariableCategory], np.ndarray] = { - (1, "Effective plastic strain ( 1)", FemzipVariableCategory.SHELL): d1, - (2, "Effective plastic strain ( 2)", FemzipVariableCategory.SHELL): d2, - (3, "Effective plastic strain ( 3)", FemzipVariableCategory.SHELL): d3, - } - - m.map(fz) - - r = m.d3plot_arrays - - self.assertEqual(r[ArrayType.element_shell_effective_plastic_strain].shape, (2, 20000, 3)) - - self.assertTrue( - np.allclose(d1, r[ArrayType.element_shell_effective_plastic_strain][:, :, 0]) - ) - self.assertTrue( - np.allclose(d2, r[ArrayType.element_shell_effective_plastic_strain][:, :, 1]) - ) - self.assertTrue( - np.allclose(d3, r[ArrayType.element_shell_effective_plastic_strain][:, :, 2]) - ) - - def test_others(self): - stress_1 = np.random.randn(2, 2) - stress_2 = np.random.randn(2, 2) - stress_3 = np.random.randn(2, 2) - - strain1 = np.random.randn(1, 2) - strain2 = np.random.randn(1, 2) - - history_vars = np.array([[1, 2], [0, 3], [12, 2]], dtype=np.float32) - - history_vars1 = np.random.randn(3, 2) - history_vars2 = np.random.randn(3, 2) - - fz: dict[tuple[int, str, FemzipVariableCategory], np.ndarray] = { - # stress - (1, "Sigma-x (IP 6)", FemzipVariableCategory.SOLID): stress_1, - (2, "Sigma-y (IP 3)", FemzipVariableCategory.SOLID): stress_2, - (3, "Sigma-x (IP 3)", FemzipVariableCategory.SOLID): stress_3, - # history - (4, "extra_value_per_element 2 (IP 2)", FemzipVariableCategory.SOLID): history_vars, - (5, "extra_value_per_element 21 (IP 15)", FemzipVariableCategory.SOLID): history_vars1, - (6, "extra_value_per_element 4 (IP 3)", FemzipVariableCategory.SOLID): history_vars2, - # strain - (7, "Epsilon-xy (outer)", FemzipVariableCategory.SHELL): strain1, - (8, "Epsilon-z (outer)", FemzipVariableCategory.SHELL): strain2, - } - - m = FemzipMapper() - - m.map(fz) - - r = m.d3plot_arrays - - self.assertEqual(r[ArrayType.element_solid_stress].shape, (2, 2, 6, 2)) - - self.assertTrue(np.allclose(stress_1, r[ArrayType.element_solid_stress][:, :, 5, 0])) - self.assertTrue(np.allclose(stress_2, r[ArrayType.element_solid_stress][:, :, 2, 1])) - self.assertTrue(np.allclose(stress_3, r[ArrayType.element_solid_stress][:, :, 2, 0])) - - self.assertEqual(r[ArrayType.element_solid_history_variables].shape, (3, 2, 15, 21)) - - self.assertTrue( - np.allclose(history_vars, r[ArrayType.element_solid_history_variables][:, :, 1, 1]) - ) - - self.assertTrue( - np.allclose(history_vars1, r[ArrayType.element_solid_history_variables][:, :, 14, 20]) - ) - - self.assertTrue( - np.allclose(history_vars2, r[ArrayType.element_solid_history_variables][:, :, 2, 3]) - ) - - self.assertEqual(r[ArrayType.element_shell_strain].shape, (1, 2, 2, 4)) - - def test_beam(self): - axial_force = np.random.randn(5, 12) - shear = np.random.randn(2, 4) - - bending = np.random.randn(3, 123) - torsion = np.random.rand(2, 5) - - fz: dict[tuple[int, str, FemzipVariableCategory], np.ndarray] = { - (1, "axial_force", FemzipVariableCategory.BEAM): axial_force, - (2, "s_shear_resultant", FemzipVariableCategory.BEAM): shear, - (3, "t_bending_moment", FemzipVariableCategory.BEAM): bending, - (4, "torsional_resultant", FemzipVariableCategory.BEAM): torsion, - } - - m = FemzipMapper() - - m.map(fz) - - r = m.d3plot_arrays - - # axial force - self.assertTrue(np.allclose(r["element_beam_axial_force"], axial_force)) - - self.assertEqual(r[ArrayType.element_beam_shear_force].shape, (2, 4, 1)) - self.assertTrue(np.allclose(r[ArrayType.element_beam_shear_force][:, :, 0], shear)) - - # bending moment - self.assertEqual(r[ArrayType.element_beam_bending_moment].shape, (3, 123, 2)) - self.assertTrue(np.allclose(r[ArrayType.element_beam_bending_moment][:, :, 1], bending)) - - # torsion - self.assertEqual(r[ArrayType.element_beam_torsion_moment].shape, (2, 5)) - self.assertTrue(np.allclose(r[ArrayType.element_beam_torsion_moment], torsion)) - - # # TODO - # # unknown1 and unknown2 - - # # shp - - # # airbags - - # # rigids diff --git a/test/unit_tests/io/__init__.py b/test/unit_tests/io/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/unit_tests/io/test_binary_buffer.py b/test/unit_tests/io/test_binary_buffer.py deleted file mode 100644 index 5e01039..0000000 --- a/test/unit_tests/io/test_binary_buffer.py +++ /dev/null @@ -1,62 +0,0 @@ -import filecmp -import os -from unittest import TestCase - -import numpy as np - -from lasso.io.binary_buffer import BinaryBuffer - - -class BinaryBufferTest(TestCase): - def setUp(self): - # read file - self.bb = BinaryBuffer("test/test_data/simple_d3plot/d3plot") - - def test_init(self): - # test some stuff for fun - self.assertEqual(self.bb.mv_[40:42].tobytes(), b"\xaf\\") - self.assertEqual(len(self.bb), len(self.bb.mv_)) - self.assertEqual(len(self.bb), 192512) - - def test_memoryview(self): - self.assertEqual(self.bb.mv_, self.bb.memoryview) - with self.assertRaises(TypeError): - self.bb.memoryview = None - self.memoryview = memoryview(bytearray(b"")) - - def test_reading(self): - # numbers - self.assertEqual(self.bb.read_number(44, np.int32), 1) - self.assertEqual(self.bb.read_number(56, np.float32), 960.0) - - self.assertEqual(self.bb.read_text(0, 40), " " * 40) - self.assertEqual(self.bb.read_text(52, 4), "R712") - - self.assertListEqual(self.bb.read_ndarray(60, 12, 1, np.int32).tolist(), [4, 4915, 6]) - - def test_save(self): - self.bb.save("test/test_data/tmp") - eq = filecmp.cmp("test/test_data/simple_d3plot/d3plot", "test/test_data/tmp") - os.remove("test/test_data/tmp") - self.assertEqual(eq, True) - - def test_writing(self): - bb = BinaryBuffer("test/test_data/simple_d3plot/d3plot") - bb.write_number(44, 13, np.int32) - self.assertEqual(bb.read_number(44, np.int32), 13) - - array = np.array([1, 2, 3, 4], np.int32) - bb.write_ndarray(array, 44, 1) - self.assertListEqual(bb.read_ndarray(44, 16, 1, array.dtype).tolist(), array.tolist()) - - def test_size(self): - bb = BinaryBuffer("test/test_data/simple_d3plot/d3plot") - self.assertEqual(bb.size, 192512) - self.assertEqual(bb.size, len(bb)) - - bb.size = 192511 - self.assertEqual(bb.size, 192511) - - bb.size = 192512 - self.assertEqual(bb.size, 192512) - self.assertEqual(bb.mv_[-1 : len(bb)].tobytes(), b"0") diff --git a/test/unit_tests/io/test_files.py b/test/unit_tests/io/test_files.py deleted file mode 100644 index c674856..0000000 --- a/test/unit_tests/io/test_files.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest - -from lasso.io.files import collect_files - - -class Test(unittest.TestCase): - def test_collect_files(self): - files = collect_files("test/test_data/io_test", "*.txt") - self.assertEqual(len(files), 1) - - files = collect_files("test/test_data/io_test/", "*.txt", recursive=True) - self.assertEqual(len(files), 2) - - files1, files2 = collect_files( - "test/test_data/io_test/", ["*.txt", "*.yay"], recursive=True - ) - self.assertEqual(len(files1), 2) - self.assertEqual(len(files2), 1) - - files1, files2 = collect_files( - ["test/test_data/io_test/", "test/test_data/io_test/subfolder"], ["*.txt", "*.yay"] - ) - self.assertEqual(len(files1), 2) - self.assertEqual(len(files2), 1) diff --git a/test/unit_tests/math/__init__.py b/test/unit_tests/math/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/unit_tests/math/test_sampling.py b/test/unit_tests/math/test_sampling.py deleted file mode 100644 index a24f41e..0000000 --- a/test/unit_tests/math/test_sampling.py +++ /dev/null @@ -1,9 +0,0 @@ -import unittest - -from lasso.math.sampling import unique_subsamples - - -class Test(unittest.TestCase): - def test_unique_subsamples(self): - self.assertEqual(len(set(unique_subsamples(0, 20, 100))), 20) - self.assertEqual(len(set(unique_subsamples(0, 200, 100))), 100) diff --git a/test/unit_tests/math/test_stochastic.py b/test/unit_tests/math/test_stochastic.py deleted file mode 100644 index c2dd965..0000000 --- a/test/unit_tests/math/test_stochastic.py +++ /dev/null @@ -1,13 +0,0 @@ -import unittest - -from lasso.math.stochastic import jensen_shannon_entropy - - -class Test(unittest.TestCase): - def test_jensen_shannon_entropy(self): - p1 = [0.5, 0.5, 0.0] - p2 = [0, 0.1, 0.9] - - self.assertEqual(jensen_shannon_entropy(p1, p1), 0) - self.assertAlmostEqual(jensen_shannon_entropy(p1, p2), 0.55797881790005399) - self.assertAlmostEqual(jensen_shannon_entropy(p2, p1), 0.55797881790005399) diff --git a/uv.lock b/uv.lock deleted file mode 100644 index d93caa8..0000000 --- a/uv.lock +++ /dev/null @@ -1,1441 +0,0 @@ -version = 1 -revision = 3 -requires-python = ">=3.11" -resolution-markers = [ - "python_full_version >= '3.12'", - "python_full_version < '3.12'", -] - -[[package]] -name = "appdirs" -version = "1.4.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d7/d8/05696357e0311f5b5c316d7b95f46c669dd9c15aaeecbb48c7d0aeb88c40/appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", size = 13470, upload-time = "2020-05-11T07:59:51.037Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3b/00/2344469e2084fb287c2e0b57b72910309874c3245463acd6cf5e3db69324/appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128", size = 9566, upload-time = "2020-05-11T07:59:49.499Z" }, -] - -[[package]] -name = "babel" -version = "2.17.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7d/6b/d52e42361e1aa00709585ecc30b3f9684b3ab62530771402248b1b1d6240/babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d", size = 9951852, upload-time = "2025-02-01T15:17:41.026Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/b8/3fe70c75fe32afc4bb507f75563d39bc5642255d1d94f1f23604725780bf/babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2", size = 10182537, upload-time = "2025-02-01T15:17:37.39Z" }, -] - -[[package]] -name = "backports-tarfile" -version = "1.2.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/86/72/cd9b395f25e290e633655a100af28cb253e4393396264a98bd5f5951d50f/backports_tarfile-1.2.0.tar.gz", hash = "sha256:d75e02c268746e1b8144c278978b6e98e85de6ad16f8e4b0844a154557eca991", size = 86406, upload-time = "2024-05-28T17:01:54.731Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b9/fa/123043af240e49752f1c4bd24da5053b6bd00cad78c2be53c0d1e8b975bc/backports.tarfile-1.2.0-py3-none-any.whl", hash = "sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34", size = 30181, upload-time = "2024-05-28T17:01:53.112Z" }, -] - -[[package]] -name = "backrefs" -version = "5.8" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6c/46/caba1eb32fa5784428ab401a5487f73db4104590ecd939ed9daaf18b47e0/backrefs-5.8.tar.gz", hash = "sha256:2cab642a205ce966af3dd4b38ee36009b31fa9502a35fd61d59ccc116e40a6bd", size = 6773994, upload-time = "2025-02-25T18:15:32.003Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/bf/cb/d019ab87fe70e0fe3946196d50d6a4428623dc0c38a6669c8cae0320fbf3/backrefs-5.8-py310-none-any.whl", hash = "sha256:c67f6638a34a5b8730812f5101376f9d41dc38c43f1fdc35cb54700f6ed4465d", size = 380337, upload-time = "2025-02-25T16:53:14.607Z" }, - { url = "https://files.pythonhosted.org/packages/a9/86/abd17f50ee21b2248075cb6924c6e7f9d23b4925ca64ec660e869c2633f1/backrefs-5.8-py311-none-any.whl", hash = "sha256:2e1c15e4af0e12e45c8701bd5da0902d326b2e200cafcd25e49d9f06d44bb61b", size = 392142, upload-time = "2025-02-25T16:53:17.266Z" }, - { url = "https://files.pythonhosted.org/packages/b3/04/7b415bd75c8ab3268cc138c76fa648c19495fcc7d155508a0e62f3f82308/backrefs-5.8-py312-none-any.whl", hash = "sha256:bbef7169a33811080d67cdf1538c8289f76f0942ff971222a16034da88a73486", size = 398021, upload-time = "2025-02-25T16:53:26.378Z" }, - { url = "https://files.pythonhosted.org/packages/04/b8/60dcfb90eb03a06e883a92abbc2ab95c71f0d8c9dd0af76ab1d5ce0b1402/backrefs-5.8-py313-none-any.whl", hash = "sha256:e3a63b073867dbefd0536425f43db618578528e3896fb77be7141328642a1585", size = 399915, upload-time = "2025-02-25T16:53:28.167Z" }, - { url = "https://files.pythonhosted.org/packages/0c/37/fb6973edeb700f6e3d6ff222400602ab1830446c25c7b4676d8de93e65b8/backrefs-5.8-py39-none-any.whl", hash = "sha256:a66851e4533fb5b371aa0628e1fee1af05135616b86140c9d787a2ffdf4b8fdc", size = 380336, upload-time = "2025-02-25T16:53:29.858Z" }, -] - -[[package]] -name = "certifi" -version = "2025.1.31" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1c/ab/c9f1e32b7b1bf505bf26f0ef697775960db7932abeb7b516de930ba2705f/certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651", size = 167577, upload-time = "2025-01-31T02:16:47.166Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/38/fc/bce832fd4fd99766c04d1ee0eead6b0ec6486fb100ae5e74c1d91292b982/certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe", size = 166393, upload-time = "2025-01-31T02:16:45.015Z" }, -] - -[[package]] -name = "cffi" -version = "1.17.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pycparser" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824", size = 516621, upload-time = "2024-09-04T20:45:21.852Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/94/dd/a3f0118e688d1b1a57553da23b16bdade96d2f9bcda4d32e7d2838047ff7/cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4", size = 445259, upload-time = "2024-09-04T20:43:56.123Z" }, - { url = "https://files.pythonhosted.org/packages/2e/ea/70ce63780f096e16ce8588efe039d3c4f91deb1dc01e9c73a287939c79a6/cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41", size = 469200, upload-time = "2024-09-04T20:43:57.891Z" }, - { url = "https://files.pythonhosted.org/packages/1c/a0/a4fa9f4f781bda074c3ddd57a572b060fa0df7655d2a4247bbe277200146/cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1", size = 477235, upload-time = "2024-09-04T20:44:00.18Z" }, - { url = "https://files.pythonhosted.org/packages/62/12/ce8710b5b8affbcdd5c6e367217c242524ad17a02fe5beec3ee339f69f85/cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6", size = 459721, upload-time = "2024-09-04T20:44:01.585Z" }, - { url = "https://files.pythonhosted.org/packages/ff/6b/d45873c5e0242196f042d555526f92aa9e0c32355a1be1ff8c27f077fd37/cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d", size = 467242, upload-time = "2024-09-04T20:44:03.467Z" }, - { url = "https://files.pythonhosted.org/packages/1a/52/d9a0e523a572fbccf2955f5abe883cfa8bcc570d7faeee06336fbd50c9fc/cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6", size = 477999, upload-time = "2024-09-04T20:44:05.023Z" }, - { url = "https://files.pythonhosted.org/packages/44/74/f2a2460684a1a2d00ca799ad880d54652841a780c4c97b87754f660c7603/cffi-1.17.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f", size = 454242, upload-time = "2024-09-04T20:44:06.444Z" }, - { url = "https://files.pythonhosted.org/packages/f8/4a/34599cac7dfcd888ff54e801afe06a19c17787dfd94495ab0c8d35fe99fb/cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b", size = 478604, upload-time = "2024-09-04T20:44:08.206Z" }, - { url = "https://files.pythonhosted.org/packages/cc/b6/db007700f67d151abadf508cbfd6a1884f57eab90b1bb985c4c8c02b0f28/cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36", size = 454803, upload-time = "2024-09-04T20:44:15.231Z" }, - { url = "https://files.pythonhosted.org/packages/1a/df/f8d151540d8c200eb1c6fba8cd0dfd40904f1b0682ea705c36e6c2e97ab3/cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5", size = 478850, upload-time = "2024-09-04T20:44:17.188Z" }, - { url = "https://files.pythonhosted.org/packages/28/c0/b31116332a547fd2677ae5b78a2ef662dfc8023d67f41b2a83f7c2aa78b1/cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff", size = 485729, upload-time = "2024-09-04T20:44:18.688Z" }, - { url = "https://files.pythonhosted.org/packages/91/2b/9a1ddfa5c7f13cab007a2c9cc295b70fbbda7cb10a286aa6810338e60ea1/cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99", size = 471256, upload-time = "2024-09-04T20:44:20.248Z" }, - { url = "https://files.pythonhosted.org/packages/b2/d5/da47df7004cb17e4955df6a43d14b3b4ae77737dff8bf7f8f333196717bf/cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93", size = 479424, upload-time = "2024-09-04T20:44:21.673Z" }, - { url = "https://files.pythonhosted.org/packages/0b/ac/2a28bcf513e93a219c8a4e8e125534f4f6db03e3179ba1c45e949b76212c/cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3", size = 484568, upload-time = "2024-09-04T20:44:23.245Z" }, - { url = "https://files.pythonhosted.org/packages/d4/38/ca8a4f639065f14ae0f1d9751e70447a261f1a30fa7547a828ae08142465/cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8", size = 488736, upload-time = "2024-09-04T20:44:24.757Z" }, - { url = "https://files.pythonhosted.org/packages/0e/2d/eab2e858a91fdff70533cab61dcff4a1f55ec60425832ddfdc9cd36bc8af/cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3", size = 454792, upload-time = "2024-09-04T20:44:32.01Z" }, - { url = "https://files.pythonhosted.org/packages/75/b2/fbaec7c4455c604e29388d55599b99ebcc250a60050610fadde58932b7ee/cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683", size = 478893, upload-time = "2024-09-04T20:44:33.606Z" }, - { url = "https://files.pythonhosted.org/packages/4f/b7/6e4a2162178bf1935c336d4da8a9352cccab4d3a5d7914065490f08c0690/cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5", size = 485810, upload-time = "2024-09-04T20:44:35.191Z" }, - { url = "https://files.pythonhosted.org/packages/c7/8a/1d0e4a9c26e54746dc08c2c6c037889124d4f59dffd853a659fa545f1b40/cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4", size = 471200, upload-time = "2024-09-04T20:44:36.743Z" }, - { url = "https://files.pythonhosted.org/packages/26/9f/1aab65a6c0db35f43c4d1b4f580e8df53914310afc10ae0397d29d697af4/cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd", size = 479447, upload-time = "2024-09-04T20:44:38.492Z" }, - { url = "https://files.pythonhosted.org/packages/5f/e4/fb8b3dd8dc0e98edf1135ff067ae070bb32ef9d509d6cb0f538cd6f7483f/cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed", size = 484358, upload-time = "2024-09-04T20:44:40.046Z" }, - { url = "https://files.pythonhosted.org/packages/f1/47/d7145bf2dc04684935d57d67dff9d6d795b2ba2796806bb109864be3a151/cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9", size = 488469, upload-time = "2024-09-04T20:44:41.616Z" }, -] - -[[package]] -name = "charset-normalizer" -version = "3.4.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/16/b0/572805e227f01586461c80e0fd25d65a2115599cc9dad142fee4b747c357/charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3", size = 123188, upload-time = "2024-12-24T18:12:35.43Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/72/80/41ef5d5a7935d2d3a773e3eaebf0a9350542f2cab4eac59a7a4741fbbbbe/charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125", size = 194995, upload-time = "2024-12-24T18:10:12.838Z" }, - { url = "https://files.pythonhosted.org/packages/7a/28/0b9fefa7b8b080ec492110af6d88aa3dea91c464b17d53474b6e9ba5d2c5/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1", size = 139471, upload-time = "2024-12-24T18:10:14.101Z" }, - { url = "https://files.pythonhosted.org/packages/71/64/d24ab1a997efb06402e3fc07317e94da358e2585165930d9d59ad45fcae2/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3", size = 149831, upload-time = "2024-12-24T18:10:15.512Z" }, - { url = "https://files.pythonhosted.org/packages/37/ed/be39e5258e198655240db5e19e0b11379163ad7070962d6b0c87ed2c4d39/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd", size = 142335, upload-time = "2024-12-24T18:10:18.369Z" }, - { url = "https://files.pythonhosted.org/packages/88/83/489e9504711fa05d8dde1574996408026bdbdbd938f23be67deebb5eca92/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00", size = 143862, upload-time = "2024-12-24T18:10:19.743Z" }, - { url = "https://files.pythonhosted.org/packages/c6/c7/32da20821cf387b759ad24627a9aca289d2822de929b8a41b6241767b461/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12", size = 145673, upload-time = "2024-12-24T18:10:21.139Z" }, - { url = "https://files.pythonhosted.org/packages/68/85/f4288e96039abdd5aeb5c546fa20a37b50da71b5cf01e75e87f16cd43304/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77", size = 140211, upload-time = "2024-12-24T18:10:22.382Z" }, - { url = "https://files.pythonhosted.org/packages/28/a3/a42e70d03cbdabc18997baf4f0227c73591a08041c149e710045c281f97b/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146", size = 148039, upload-time = "2024-12-24T18:10:24.802Z" }, - { url = "https://files.pythonhosted.org/packages/85/e4/65699e8ab3014ecbe6f5c71d1a55d810fb716bbfd74f6283d5c2aa87febf/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd", size = 151939, upload-time = "2024-12-24T18:10:26.124Z" }, - { url = "https://files.pythonhosted.org/packages/b1/82/8e9fe624cc5374193de6860aba3ea8070f584c8565ee77c168ec13274bd2/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6", size = 149075, upload-time = "2024-12-24T18:10:30.027Z" }, - { url = "https://files.pythonhosted.org/packages/3d/7b/82865ba54c765560c8433f65e8acb9217cb839a9e32b42af4aa8e945870f/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8", size = 144340, upload-time = "2024-12-24T18:10:32.679Z" }, - { url = "https://files.pythonhosted.org/packages/b5/b6/9674a4b7d4d99a0d2df9b215da766ee682718f88055751e1e5e753c82db0/charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b", size = 95205, upload-time = "2024-12-24T18:10:34.724Z" }, - { url = "https://files.pythonhosted.org/packages/1e/ab/45b180e175de4402dcf7547e4fb617283bae54ce35c27930a6f35b6bef15/charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76", size = 102441, upload-time = "2024-12-24T18:10:37.574Z" }, - { url = "https://files.pythonhosted.org/packages/0a/9a/dd1e1cdceb841925b7798369a09279bd1cf183cef0f9ddf15a3a6502ee45/charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545", size = 196105, upload-time = "2024-12-24T18:10:38.83Z" }, - { url = "https://files.pythonhosted.org/packages/d3/8c/90bfabf8c4809ecb648f39794cf2a84ff2e7d2a6cf159fe68d9a26160467/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7", size = 140404, upload-time = "2024-12-24T18:10:44.272Z" }, - { url = "https://files.pythonhosted.org/packages/ad/8f/e410d57c721945ea3b4f1a04b74f70ce8fa800d393d72899f0a40526401f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757", size = 150423, upload-time = "2024-12-24T18:10:45.492Z" }, - { url = "https://files.pythonhosted.org/packages/f0/b8/e6825e25deb691ff98cf5c9072ee0605dc2acfca98af70c2d1b1bc75190d/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa", size = 143184, upload-time = "2024-12-24T18:10:47.898Z" }, - { url = "https://files.pythonhosted.org/packages/3e/a2/513f6cbe752421f16d969e32f3583762bfd583848b763913ddab8d9bfd4f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d", size = 145268, upload-time = "2024-12-24T18:10:50.589Z" }, - { url = "https://files.pythonhosted.org/packages/74/94/8a5277664f27c3c438546f3eb53b33f5b19568eb7424736bdc440a88a31f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616", size = 147601, upload-time = "2024-12-24T18:10:52.541Z" }, - { url = "https://files.pythonhosted.org/packages/7c/5f/6d352c51ee763623a98e31194823518e09bfa48be2a7e8383cf691bbb3d0/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b", size = 141098, upload-time = "2024-12-24T18:10:53.789Z" }, - { url = "https://files.pythonhosted.org/packages/78/d4/f5704cb629ba5ab16d1d3d741396aec6dc3ca2b67757c45b0599bb010478/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d", size = 149520, upload-time = "2024-12-24T18:10:55.048Z" }, - { url = "https://files.pythonhosted.org/packages/c5/96/64120b1d02b81785f222b976c0fb79a35875457fa9bb40827678e54d1bc8/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a", size = 152852, upload-time = "2024-12-24T18:10:57.647Z" }, - { url = "https://files.pythonhosted.org/packages/84/c9/98e3732278a99f47d487fd3468bc60b882920cef29d1fa6ca460a1fdf4e6/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9", size = 150488, upload-time = "2024-12-24T18:10:59.43Z" }, - { url = "https://files.pythonhosted.org/packages/13/0e/9c8d4cb99c98c1007cc11eda969ebfe837bbbd0acdb4736d228ccaabcd22/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1", size = 146192, upload-time = "2024-12-24T18:11:00.676Z" }, - { url = "https://files.pythonhosted.org/packages/b2/21/2b6b5b860781a0b49427309cb8670785aa543fb2178de875b87b9cc97746/charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35", size = 95550, upload-time = "2024-12-24T18:11:01.952Z" }, - { url = "https://files.pythonhosted.org/packages/21/5b/1b390b03b1d16c7e382b561c5329f83cc06623916aab983e8ab9239c7d5c/charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f", size = 102785, upload-time = "2024-12-24T18:11:03.142Z" }, - { url = "https://files.pythonhosted.org/packages/38/94/ce8e6f63d18049672c76d07d119304e1e2d7c6098f0841b51c666e9f44a0/charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda", size = 195698, upload-time = "2024-12-24T18:11:05.834Z" }, - { url = "https://files.pythonhosted.org/packages/24/2e/dfdd9770664aae179a96561cc6952ff08f9a8cd09a908f259a9dfa063568/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313", size = 140162, upload-time = "2024-12-24T18:11:07.064Z" }, - { url = "https://files.pythonhosted.org/packages/24/4e/f646b9093cff8fc86f2d60af2de4dc17c759de9d554f130b140ea4738ca6/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9", size = 150263, upload-time = "2024-12-24T18:11:08.374Z" }, - { url = "https://files.pythonhosted.org/packages/5e/67/2937f8d548c3ef6e2f9aab0f6e21001056f692d43282b165e7c56023e6dd/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b", size = 142966, upload-time = "2024-12-24T18:11:09.831Z" }, - { url = "https://files.pythonhosted.org/packages/52/ed/b7f4f07de100bdb95c1756d3a4d17b90c1a3c53715c1a476f8738058e0fa/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11", size = 144992, upload-time = "2024-12-24T18:11:12.03Z" }, - { url = "https://files.pythonhosted.org/packages/96/2c/d49710a6dbcd3776265f4c923bb73ebe83933dfbaa841c5da850fe0fd20b/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f", size = 147162, upload-time = "2024-12-24T18:11:13.372Z" }, - { url = "https://files.pythonhosted.org/packages/b4/41/35ff1f9a6bd380303dea55e44c4933b4cc3c4850988927d4082ada230273/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd", size = 140972, upload-time = "2024-12-24T18:11:14.628Z" }, - { url = "https://files.pythonhosted.org/packages/fb/43/c6a0b685fe6910d08ba971f62cd9c3e862a85770395ba5d9cad4fede33ab/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2", size = 149095, upload-time = "2024-12-24T18:11:17.672Z" }, - { url = "https://files.pythonhosted.org/packages/4c/ff/a9a504662452e2d2878512115638966e75633519ec11f25fca3d2049a94a/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886", size = 152668, upload-time = "2024-12-24T18:11:18.989Z" }, - { url = "https://files.pythonhosted.org/packages/6c/71/189996b6d9a4b932564701628af5cee6716733e9165af1d5e1b285c530ed/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601", size = 150073, upload-time = "2024-12-24T18:11:21.507Z" }, - { url = "https://files.pythonhosted.org/packages/e4/93/946a86ce20790e11312c87c75ba68d5f6ad2208cfb52b2d6a2c32840d922/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd", size = 145732, upload-time = "2024-12-24T18:11:22.774Z" }, - { url = "https://files.pythonhosted.org/packages/cd/e5/131d2fb1b0dddafc37be4f3a2fa79aa4c037368be9423061dccadfd90091/charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407", size = 95391, upload-time = "2024-12-24T18:11:24.139Z" }, - { url = "https://files.pythonhosted.org/packages/27/f2/4f9a69cc7712b9b5ad8fdb87039fd89abba997ad5cbe690d1835d40405b0/charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971", size = 102702, upload-time = "2024-12-24T18:11:26.535Z" }, - { url = "https://files.pythonhosted.org/packages/0e/f6/65ecc6878a89bb1c23a086ea335ad4bf21a588990c3f535a227b9eea9108/charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85", size = 49767, upload-time = "2024-12-24T18:12:32.852Z" }, -] - -[[package]] -name = "click" -version = "8.1.8" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593, upload-time = "2024-12-21T18:38:44.339Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/d4/7ebdbd03970677812aac39c869717059dbb71a4cfc033ca6e5221787892c/click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2", size = 98188, upload-time = "2024-12-21T18:38:41.666Z" }, -] - -[[package]] -name = "colorama" -version = "0.4.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, -] - -[[package]] -name = "coverage" -version = "7.8.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/19/4f/2251e65033ed2ce1e68f00f91a0294e0f80c80ae8c3ebbe2f12828c4cd53/coverage-7.8.0.tar.gz", hash = "sha256:7a3d62b3b03b4b6fd41a085f3574874cf946cb4604d2b4d3e8dca8cd570ca501", size = 811872, upload-time = "2025-03-30T20:36:45.376Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2b/77/074d201adb8383addae5784cb8e2dac60bb62bfdf28b2b10f3a3af2fda47/coverage-7.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7ac22a0bb2c7c49f441f7a6d46c9c80d96e56f5a8bc6972529ed43c8b694e27", size = 211493, upload-time = "2025-03-30T20:35:12.286Z" }, - { url = "https://files.pythonhosted.org/packages/a9/89/7a8efe585750fe59b48d09f871f0e0c028a7b10722b2172dfe021fa2fdd4/coverage-7.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf13d564d310c156d1c8e53877baf2993fb3073b2fc9f69790ca6a732eb4bfea", size = 211921, upload-time = "2025-03-30T20:35:14.18Z" }, - { url = "https://files.pythonhosted.org/packages/e9/ef/96a90c31d08a3f40c49dbe897df4f1fd51fb6583821a1a1c5ee30cc8f680/coverage-7.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5761c70c017c1b0d21b0815a920ffb94a670c8d5d409d9b38857874c21f70d7", size = 244556, upload-time = "2025-03-30T20:35:15.616Z" }, - { url = "https://files.pythonhosted.org/packages/89/97/dcd5c2ce72cee9d7b0ee8c89162c24972fb987a111b92d1a3d1d19100c61/coverage-7.8.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ff52d790c7e1628241ffbcaeb33e07d14b007b6eb00a19320c7b8a7024c040", size = 242245, upload-time = "2025-03-30T20:35:18.648Z" }, - { url = "https://files.pythonhosted.org/packages/b2/7b/b63cbb44096141ed435843bbb251558c8e05cc835c8da31ca6ffb26d44c0/coverage-7.8.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d39fc4817fd67b3915256af5dda75fd4ee10621a3d484524487e33416c6f3543", size = 244032, upload-time = "2025-03-30T20:35:20.131Z" }, - { url = "https://files.pythonhosted.org/packages/97/e3/7fa8c2c00a1ef530c2a42fa5df25a6971391f92739d83d67a4ee6dcf7a02/coverage-7.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b44674870709017e4b4036e3d0d6c17f06a0e6d4436422e0ad29b882c40697d2", size = 243679, upload-time = "2025-03-30T20:35:21.636Z" }, - { url = "https://files.pythonhosted.org/packages/4f/b3/e0a59d8df9150c8a0c0841d55d6568f0a9195692136c44f3d21f1842c8f6/coverage-7.8.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8f99eb72bf27cbb167b636eb1726f590c00e1ad375002230607a844d9e9a2318", size = 241852, upload-time = "2025-03-30T20:35:23.525Z" }, - { url = "https://files.pythonhosted.org/packages/9b/82/db347ccd57bcef150c173df2ade97976a8367a3be7160e303e43dd0c795f/coverage-7.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b571bf5341ba8c6bc02e0baeaf3b061ab993bf372d982ae509807e7f112554e9", size = 242389, upload-time = "2025-03-30T20:35:25.09Z" }, - { url = "https://files.pythonhosted.org/packages/21/f6/3f7d7879ceb03923195d9ff294456241ed05815281f5254bc16ef71d6a20/coverage-7.8.0-cp311-cp311-win32.whl", hash = "sha256:e75a2ad7b647fd8046d58c3132d7eaf31b12d8a53c0e4b21fa9c4d23d6ee6d3c", size = 213997, upload-time = "2025-03-30T20:35:26.914Z" }, - { url = "https://files.pythonhosted.org/packages/28/87/021189643e18ecf045dbe1e2071b2747901f229df302de01c998eeadf146/coverage-7.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:3043ba1c88b2139126fc72cb48574b90e2e0546d4c78b5299317f61b7f718b78", size = 214911, upload-time = "2025-03-30T20:35:28.498Z" }, - { url = "https://files.pythonhosted.org/packages/aa/12/4792669473297f7973518bec373a955e267deb4339286f882439b8535b39/coverage-7.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bbb5cc845a0292e0c520656d19d7ce40e18d0e19b22cb3e0409135a575bf79fc", size = 211684, upload-time = "2025-03-30T20:35:29.959Z" }, - { url = "https://files.pythonhosted.org/packages/be/e1/2a4ec273894000ebedd789e8f2fc3813fcaf486074f87fd1c5b2cb1c0a2b/coverage-7.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4dfd9a93db9e78666d178d4f08a5408aa3f2474ad4d0e0378ed5f2ef71640cb6", size = 211935, upload-time = "2025-03-30T20:35:31.912Z" }, - { url = "https://files.pythonhosted.org/packages/f8/3a/7b14f6e4372786709a361729164125f6b7caf4024ce02e596c4a69bccb89/coverage-7.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f017a61399f13aa6d1039f75cd467be388d157cd81f1a119b9d9a68ba6f2830d", size = 245994, upload-time = "2025-03-30T20:35:33.455Z" }, - { url = "https://files.pythonhosted.org/packages/54/80/039cc7f1f81dcbd01ea796d36d3797e60c106077e31fd1f526b85337d6a1/coverage-7.8.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0915742f4c82208ebf47a2b154a5334155ed9ef9fe6190674b8a46c2fb89cb05", size = 242885, upload-time = "2025-03-30T20:35:35.354Z" }, - { url = "https://files.pythonhosted.org/packages/10/e0/dc8355f992b6cc2f9dcd5ef6242b62a3f73264893bc09fbb08bfcab18eb4/coverage-7.8.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a40fcf208e021eb14b0fac6bdb045c0e0cab53105f93ba0d03fd934c956143a", size = 245142, upload-time = "2025-03-30T20:35:37.121Z" }, - { url = "https://files.pythonhosted.org/packages/43/1b/33e313b22cf50f652becb94c6e7dae25d8f02e52e44db37a82de9ac357e8/coverage-7.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a1f406a8e0995d654b2ad87c62caf6befa767885301f3b8f6f73e6f3c31ec3a6", size = 244906, upload-time = "2025-03-30T20:35:39.07Z" }, - { url = "https://files.pythonhosted.org/packages/05/08/c0a8048e942e7f918764ccc99503e2bccffba1c42568693ce6955860365e/coverage-7.8.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:77af0f6447a582fdc7de5e06fa3757a3ef87769fbb0fdbdeba78c23049140a47", size = 243124, upload-time = "2025-03-30T20:35:40.598Z" }, - { url = "https://files.pythonhosted.org/packages/5b/62/ea625b30623083c2aad645c9a6288ad9fc83d570f9adb913a2abdba562dd/coverage-7.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f2d32f95922927186c6dbc8bc60df0d186b6edb828d299ab10898ef3f40052fe", size = 244317, upload-time = "2025-03-30T20:35:42.204Z" }, - { url = "https://files.pythonhosted.org/packages/62/cb/3871f13ee1130a6c8f020e2f71d9ed269e1e2124aa3374d2180ee451cee9/coverage-7.8.0-cp312-cp312-win32.whl", hash = "sha256:769773614e676f9d8e8a0980dd7740f09a6ea386d0f383db6821df07d0f08545", size = 214170, upload-time = "2025-03-30T20:35:44.216Z" }, - { url = "https://files.pythonhosted.org/packages/88/26/69fe1193ab0bfa1eb7a7c0149a066123611baba029ebb448500abd8143f9/coverage-7.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:e5d2b9be5b0693cf21eb4ce0ec8d211efb43966f6657807f6859aab3814f946b", size = 214969, upload-time = "2025-03-30T20:35:45.797Z" }, - { url = "https://files.pythonhosted.org/packages/f3/21/87e9b97b568e223f3438d93072479c2f36cc9b3f6b9f7094b9d50232acc0/coverage-7.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5ac46d0c2dd5820ce93943a501ac5f6548ea81594777ca585bf002aa8854cacd", size = 211708, upload-time = "2025-03-30T20:35:47.417Z" }, - { url = "https://files.pythonhosted.org/packages/75/be/882d08b28a0d19c9c4c2e8a1c6ebe1f79c9c839eb46d4fca3bd3b34562b9/coverage-7.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:771eb7587a0563ca5bb6f622b9ed7f9d07bd08900f7589b4febff05f469bea00", size = 211981, upload-time = "2025-03-30T20:35:49.002Z" }, - { url = "https://files.pythonhosted.org/packages/7a/1d/ce99612ebd58082fbe3f8c66f6d8d5694976c76a0d474503fa70633ec77f/coverage-7.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42421e04069fb2cbcbca5a696c4050b84a43b05392679d4068acbe65449b5c64", size = 245495, upload-time = "2025-03-30T20:35:51.073Z" }, - { url = "https://files.pythonhosted.org/packages/dc/8d/6115abe97df98db6b2bd76aae395fcc941d039a7acd25f741312ced9a78f/coverage-7.8.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:554fec1199d93ab30adaa751db68acec2b41c5602ac944bb19187cb9a41a8067", size = 242538, upload-time = "2025-03-30T20:35:52.941Z" }, - { url = "https://files.pythonhosted.org/packages/cb/74/2f8cc196643b15bc096d60e073691dadb3dca48418f08bc78dd6e899383e/coverage-7.8.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aaeb00761f985007b38cf463b1d160a14a22c34eb3f6a39d9ad6fc27cb73008", size = 244561, upload-time = "2025-03-30T20:35:54.658Z" }, - { url = "https://files.pythonhosted.org/packages/22/70/c10c77cd77970ac965734fe3419f2c98665f6e982744a9bfb0e749d298f4/coverage-7.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:581a40c7b94921fffd6457ffe532259813fc68eb2bdda60fa8cc343414ce3733", size = 244633, upload-time = "2025-03-30T20:35:56.221Z" }, - { url = "https://files.pythonhosted.org/packages/38/5a/4f7569d946a07c952688debee18c2bb9ab24f88027e3d71fd25dbc2f9dca/coverage-7.8.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f319bae0321bc838e205bf9e5bc28f0a3165f30c203b610f17ab5552cff90323", size = 242712, upload-time = "2025-03-30T20:35:57.801Z" }, - { url = "https://files.pythonhosted.org/packages/bb/a1/03a43b33f50475a632a91ea8c127f7e35e53786dbe6781c25f19fd5a65f8/coverage-7.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04bfec25a8ef1c5f41f5e7e5c842f6b615599ca8ba8391ec33a9290d9d2db3a3", size = 244000, upload-time = "2025-03-30T20:35:59.378Z" }, - { url = "https://files.pythonhosted.org/packages/6a/89/ab6c43b1788a3128e4d1b7b54214548dcad75a621f9d277b14d16a80d8a1/coverage-7.8.0-cp313-cp313-win32.whl", hash = "sha256:dd19608788b50eed889e13a5d71d832edc34fc9dfce606f66e8f9f917eef910d", size = 214195, upload-time = "2025-03-30T20:36:01.005Z" }, - { url = "https://files.pythonhosted.org/packages/12/12/6bf5f9a8b063d116bac536a7fb594fc35cb04981654cccb4bbfea5dcdfa0/coverage-7.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:a9abbccd778d98e9c7e85038e35e91e67f5b520776781d9a1e2ee9d400869487", size = 214998, upload-time = "2025-03-30T20:36:03.006Z" }, - { url = "https://files.pythonhosted.org/packages/2a/e6/1e9df74ef7a1c983a9c7443dac8aac37a46f1939ae3499424622e72a6f78/coverage-7.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:18c5ae6d061ad5b3e7eef4363fb27a0576012a7447af48be6c75b88494c6cf25", size = 212541, upload-time = "2025-03-30T20:36:04.638Z" }, - { url = "https://files.pythonhosted.org/packages/04/51/c32174edb7ee49744e2e81c4b1414ac9df3dacfcb5b5f273b7f285ad43f6/coverage-7.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:95aa6ae391a22bbbce1b77ddac846c98c5473de0372ba5c463480043a07bff42", size = 212767, upload-time = "2025-03-30T20:36:06.503Z" }, - { url = "https://files.pythonhosted.org/packages/e9/8f/f454cbdb5212f13f29d4a7983db69169f1937e869a5142bce983ded52162/coverage-7.8.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e013b07ba1c748dacc2a80e69a46286ff145935f260eb8c72df7185bf048f502", size = 256997, upload-time = "2025-03-30T20:36:08.137Z" }, - { url = "https://files.pythonhosted.org/packages/e6/74/2bf9e78b321216d6ee90a81e5c22f912fc428442c830c4077b4a071db66f/coverage-7.8.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d766a4f0e5aa1ba056ec3496243150698dc0481902e2b8559314368717be82b1", size = 252708, upload-time = "2025-03-30T20:36:09.781Z" }, - { url = "https://files.pythonhosted.org/packages/92/4d/50d7eb1e9a6062bee6e2f92e78b0998848a972e9afad349b6cdde6fa9e32/coverage-7.8.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad80e6b4a0c3cb6f10f29ae4c60e991f424e6b14219d46f1e7d442b938ee68a4", size = 255046, upload-time = "2025-03-30T20:36:11.409Z" }, - { url = "https://files.pythonhosted.org/packages/40/9e/71fb4e7402a07c4198ab44fc564d09d7d0ffca46a9fb7b0a7b929e7641bd/coverage-7.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b87eb6fc9e1bb8f98892a2458781348fa37e6925f35bb6ceb9d4afd54ba36c73", size = 256139, upload-time = "2025-03-30T20:36:13.86Z" }, - { url = "https://files.pythonhosted.org/packages/49/1a/78d37f7a42b5beff027e807c2843185961fdae7fe23aad5a4837c93f9d25/coverage-7.8.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:d1ba00ae33be84066cfbe7361d4e04dec78445b2b88bdb734d0d1cbab916025a", size = 254307, upload-time = "2025-03-30T20:36:16.074Z" }, - { url = "https://files.pythonhosted.org/packages/58/e9/8fb8e0ff6bef5e170ee19d59ca694f9001b2ec085dc99b4f65c128bb3f9a/coverage-7.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f3c38e4e5ccbdc9198aecc766cedbb134b2d89bf64533973678dfcf07effd883", size = 255116, upload-time = "2025-03-30T20:36:18.033Z" }, - { url = "https://files.pythonhosted.org/packages/56/b0/d968ecdbe6fe0a863de7169bbe9e8a476868959f3af24981f6a10d2b6924/coverage-7.8.0-cp313-cp313t-win32.whl", hash = "sha256:379fe315e206b14e21db5240f89dc0774bdd3e25c3c58c2c733c99eca96f1ada", size = 214909, upload-time = "2025-03-30T20:36:19.644Z" }, - { url = "https://files.pythonhosted.org/packages/87/e9/d6b7ef9fecf42dfb418d93544af47c940aa83056c49e6021a564aafbc91f/coverage-7.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2e4b6b87bb0c846a9315e3ab4be2d52fac905100565f4b92f02c445c8799e257", size = 216068, upload-time = "2025-03-30T20:36:21.282Z" }, - { url = "https://files.pythonhosted.org/packages/c4/f1/1da77bb4c920aa30e82fa9b6ea065da3467977c2e5e032e38e66f1c57ffd/coverage-7.8.0-pp39.pp310.pp311-none-any.whl", hash = "sha256:b8194fb8e50d556d5849753de991d390c5a1edeeba50f68e3a9253fbd8bf8ccd", size = 203443, upload-time = "2025-03-30T20:36:41.959Z" }, - { url = "https://files.pythonhosted.org/packages/59/f1/4da7717f0063a222db253e7121bd6a56f6fb1ba439dcc36659088793347c/coverage-7.8.0-py3-none-any.whl", hash = "sha256:dbf364b4c5e7bae9250528167dfe40219b62e2d573c854d74be213e1e52069f7", size = 203435, upload-time = "2025-03-30T20:36:43.61Z" }, -] - -[package.optional-dependencies] -toml = [ - { name = "tomli", marker = "python_full_version <= '3.11'" }, -] - -[[package]] -name = "cryptography" -version = "44.0.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/cd/25/4ce80c78963834b8a9fd1cc1266be5ed8d1840785c0f2e1b73b8d128d505/cryptography-44.0.2.tar.gz", hash = "sha256:c63454aa261a0cf0c5b4718349629793e9e634993538db841165b3df74f37ec0", size = 710807, upload-time = "2025-03-02T00:01:37.692Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/30/ec/7ea7c1e4c8fc8329506b46c6c4a52e2f20318425d48e0fe597977c71dbce/cryptography-44.0.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29ecec49f3ba3f3849362854b7253a9f59799e3763b0c9d0826259a88efa02f1", size = 3952350, upload-time = "2025-03-02T00:00:09.537Z" }, - { url = "https://files.pythonhosted.org/packages/27/61/72e3afdb3c5ac510330feba4fc1faa0fe62e070592d6ad00c40bb69165e5/cryptography-44.0.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc821e161ae88bfe8088d11bb39caf2916562e0a2dc7b6d56714a48b784ef0bb", size = 4166572, upload-time = "2025-03-02T00:00:12.03Z" }, - { url = "https://files.pythonhosted.org/packages/26/e4/ba680f0b35ed4a07d87f9e98f3ebccb05091f3bf6b5a478b943253b3bbd5/cryptography-44.0.2-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3c00b6b757b32ce0f62c574b78b939afab9eecaf597c4d624caca4f9e71e7843", size = 3958124, upload-time = "2025-03-02T00:00:14.518Z" }, - { url = "https://files.pythonhosted.org/packages/9c/e8/44ae3e68c8b6d1cbc59040288056df2ad7f7f03bbcaca6b503c737ab8e73/cryptography-44.0.2-cp37-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7bdcd82189759aba3816d1f729ce42ffded1ac304c151d0a8e89b9996ab863d5", size = 3678122, upload-time = "2025-03-02T00:00:17.212Z" }, - { url = "https://files.pythonhosted.org/packages/27/7b/664ea5e0d1eab511a10e480baf1c5d3e681c7d91718f60e149cec09edf01/cryptography-44.0.2-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:4973da6ca3db4405c54cd0b26d328be54c7747e89e284fcff166132eb7bccc9c", size = 4191831, upload-time = "2025-03-02T00:00:19.696Z" }, - { url = "https://files.pythonhosted.org/packages/2a/07/79554a9c40eb11345e1861f46f845fa71c9e25bf66d132e123d9feb8e7f9/cryptography-44.0.2-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:4e389622b6927d8133f314949a9812972711a111d577a5d1f4bee5e58736b80a", size = 3960583, upload-time = "2025-03-02T00:00:22.488Z" }, - { url = "https://files.pythonhosted.org/packages/bb/6d/858e356a49a4f0b591bd6789d821427de18432212e137290b6d8a817e9bf/cryptography-44.0.2-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:f514ef4cd14bb6fb484b4a60203e912cfcb64f2ab139e88c2274511514bf7308", size = 4191753, upload-time = "2025-03-02T00:00:25.038Z" }, - { url = "https://files.pythonhosted.org/packages/b2/80/62df41ba4916067fa6b125aa8c14d7e9181773f0d5d0bd4dcef580d8b7c6/cryptography-44.0.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1bc312dfb7a6e5d66082c87c34c8a62176e684b6fe3d90fcfe1568de675e6688", size = 4079550, upload-time = "2025-03-02T00:00:26.929Z" }, - { url = "https://files.pythonhosted.org/packages/f3/cd/2558cc08f7b1bb40683f99ff4327f8dcfc7de3affc669e9065e14824511b/cryptography-44.0.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3b721b8b4d948b218c88cb8c45a01793483821e709afe5f622861fc6182b20a7", size = 4298367, upload-time = "2025-03-02T00:00:28.735Z" }, - { url = "https://files.pythonhosted.org/packages/06/88/638865be7198a84a7713950b1db7343391c6066a20e614f8fa286eb178ed/cryptography-44.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81276f0ea79a208d961c433a947029e1a15948966658cf6710bbabb60fcc2639", size = 3951919, upload-time = "2025-03-02T00:00:38.581Z" }, - { url = "https://files.pythonhosted.org/packages/d7/fc/99fe639bcdf58561dfad1faa8a7369d1dc13f20acd78371bb97a01613585/cryptography-44.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a1e657c0f4ea2a23304ee3f964db058c9e9e635cc7019c4aa21c330755ef6fd", size = 4167812, upload-time = "2025-03-02T00:00:42.934Z" }, - { url = "https://files.pythonhosted.org/packages/53/7b/aafe60210ec93d5d7f552592a28192e51d3c6b6be449e7fd0a91399b5d07/cryptography-44.0.2-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:6210c05941994290f3f7f175a4a57dbbb2afd9273657614c506d5976db061181", size = 3958571, upload-time = "2025-03-02T00:00:46.026Z" }, - { url = "https://files.pythonhosted.org/packages/16/32/051f7ce79ad5a6ef5e26a92b37f172ee2d6e1cce09931646eef8de1e9827/cryptography-44.0.2-cp39-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d1c3572526997b36f245a96a2b1713bf79ce99b271bbcf084beb6b9b075f29ea", size = 3679832, upload-time = "2025-03-02T00:00:48.647Z" }, - { url = "https://files.pythonhosted.org/packages/78/2b/999b2a1e1ba2206f2d3bca267d68f350beb2b048a41ea827e08ce7260098/cryptography-44.0.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:b042d2a275c8cee83a4b7ae30c45a15e6a4baa65a179a0ec2d78ebb90e4f6699", size = 4193719, upload-time = "2025-03-02T00:00:51.397Z" }, - { url = "https://files.pythonhosted.org/packages/72/97/430e56e39a1356e8e8f10f723211a0e256e11895ef1a135f30d7d40f2540/cryptography-44.0.2-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:d03806036b4f89e3b13b6218fefea8d5312e450935b1a2d55f0524e2ed7c59d9", size = 3960852, upload-time = "2025-03-02T00:00:53.317Z" }, - { url = "https://files.pythonhosted.org/packages/89/33/c1cf182c152e1d262cac56850939530c05ca6c8d149aa0dcee490b417e99/cryptography-44.0.2-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:c7362add18b416b69d58c910caa217f980c5ef39b23a38a0880dfd87bdf8cd23", size = 4193906, upload-time = "2025-03-02T00:00:56.49Z" }, - { url = "https://files.pythonhosted.org/packages/e1/99/87cf26d4f125380dc674233971069bc28d19b07f7755b29861570e513650/cryptography-44.0.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:8cadc6e3b5a1f144a039ea08a0bdb03a2a92e19c46be3285123d32029f40a922", size = 4081572, upload-time = "2025-03-02T00:00:59.995Z" }, - { url = "https://files.pythonhosted.org/packages/b3/9f/6a3e0391957cc0c5f84aef9fbdd763035f2b52e998a53f99345e3ac69312/cryptography-44.0.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6f101b1f780f7fc613d040ca4bdf835c6ef3b00e9bd7125a4255ec574c7916e4", size = 4298631, upload-time = "2025-03-02T00:01:01.623Z" }, - { url = "https://files.pythonhosted.org/packages/d6/d7/f30e75a6aa7d0f65031886fa4a1485c2fbfe25a1896953920f6a9cfe2d3b/cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:909c97ab43a9c0c0b0ada7a1281430e4e5ec0458e6d9244c0e821bbf152f061d", size = 3887513, upload-time = "2025-03-02T00:01:22.911Z" }, - { url = "https://files.pythonhosted.org/packages/9c/b4/7a494ce1032323ca9db9a3661894c66e0d7142ad2079a4249303402d8c71/cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:96e7a5e9d6e71f9f4fca8eebfd603f8e86c5225bb18eb621b2c1e50b290a9471", size = 4107432, upload-time = "2025-03-02T00:01:24.701Z" }, - { url = "https://files.pythonhosted.org/packages/45/f8/6b3ec0bc56123b344a8d2b3264a325646d2dcdbdd9848b5e6f3d37db90b3/cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:d1b3031093a366ac767b3feb8bcddb596671b3aaff82d4050f984da0c248b615", size = 3891421, upload-time = "2025-03-02T00:01:26.335Z" }, - { url = "https://files.pythonhosted.org/packages/57/ff/f3b4b2d007c2a646b0f69440ab06224f9cf37a977a72cdb7b50632174e8a/cryptography-44.0.2-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:04abd71114848aa25edb28e225ab5f268096f44cf0127f3d36975bdf1bdf3390", size = 4107081, upload-time = "2025-03-02T00:01:28.938Z" }, -] - -[[package]] -name = "docutils" -version = "0.21.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ae/ed/aefcc8cd0ba62a0560c3c18c33925362d46c6075480bfa4df87b28e169a9/docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f", size = 2204444, upload-time = "2024-04-23T18:57:18.24Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/8f/d7/9322c609343d929e75e7e5e6255e614fcc67572cfd083959cdef3b7aad79/docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2", size = 587408, upload-time = "2024-04-23T18:57:14.835Z" }, -] - -[[package]] -name = "ghp-import" -version = "2.1.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "python-dateutil" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/d9/29/d40217cbe2f6b1359e00c6c307bb3fc876ba74068cbab3dde77f03ca0dc4/ghp-import-2.1.0.tar.gz", hash = "sha256:9c535c4c61193c2df8871222567d7fd7e5014d835f97dc7b7439069e2413d343", size = 10943, upload-time = "2022-05-02T15:47:16.11Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f7/ec/67fbef5d497f86283db54c22eec6f6140243aae73265799baaaa19cd17fb/ghp_import-2.1.0-py3-none-any.whl", hash = "sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619", size = 11034, upload-time = "2022-05-02T15:47:14.552Z" }, -] - -[[package]] -name = "git-changelog" -version = "2.5.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "appdirs" }, - { name = "jinja2" }, - { name = "packaging" }, - { name = "semver" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ba/e0/82cc28b538b3a2f952d52fa512b59f0c8f6e6b0125ac3ffef34ffed9b50c/git_changelog-2.5.3.tar.gz", hash = "sha256:2d211a58213eaa97c73be895821c9d4c9242748eb56753f4759c0d24fe493b77", size = 75083, upload-time = "2024-11-26T00:14:17.549Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/77/7c/701dc05657d7a9310b8376585de3bf21df12ae317ab672b18428919c2c1b/git_changelog-2.5.3-py3-none-any.whl", hash = "sha256:11c12715a6f41dc36aa3219976492ef905b45a2fc39ad75e98be2895fd750440", size = 32847, upload-time = "2024-11-26T00:14:15.953Z" }, -] - -[[package]] -name = "go-task-bin" -version = "3.42.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8f/e3/9a4555c38b1204a31576d2638c032493b621f4bc6fc9a1fabd54c3d9409a/go_task_bin-3.42.1.tar.gz", hash = "sha256:9ac9c0f4b09a50be922c40f9de749e968eef0b2031eab4e3954c59113b7b42a4", size = 544826, upload-time = "2025-03-11T01:30:20.451Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/84/6b/8e8d5007455c14a5e118f6e9c044582e566aea7ea292af798856eadf0f93/go_task_bin-3.42.1-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:7a14ac852b3ba5a0021bf06421e57e1bd69e17e9ef5f084b85c2d3807ce8fc42", size = 6689381, upload-time = "2025-03-11T01:30:06.264Z" }, - { url = "https://files.pythonhosted.org/packages/c6/2c/81e9a76e5ed6723fc9dd80c95e6a0d2a3566f0ba0abbf8012be03f7cf0ba/go_task_bin-3.42.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:2687ae4f937499fe9025aadd8a5eb8dd4aa865cb07c7b50e38f88448152ead08", size = 6245105, upload-time = "2025-03-11T01:30:08.26Z" }, - { url = "https://files.pythonhosted.org/packages/58/f9/129c08462efd1a4c1a623c9692a1c0e786302efeedafaed7bf5beaaa8276/go_task_bin-3.42.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:6e6601ebf5fd5ec2f52906fe9c2ab5a49ffd55754b3bc3e6c3f064b5f68b6ded", size = 6012291, upload-time = "2025-03-11T01:30:10.226Z" }, - { url = "https://files.pythonhosted.org/packages/37/b8/77daa94b9d2225e63ec2d1d2725221e40841c9efefe5bbddcaf5e75badd8/go_task_bin-3.42.1-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:df4e1708623220a1ac6160677348127494552024850efcb8cf7b6466fe58f282", size = 5988876, upload-time = "2025-03-11T01:30:12.076Z" }, - { url = "https://files.pythonhosted.org/packages/4d/0e/4e977b0ed4e60cc115629ed3a981c30f05efbff3b3879945c7c6b4d20281/go_task_bin-3.42.1-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.musllinux_1_1_s390x.whl", hash = "sha256:72c2d9e7954403a910a994c89d2014710f77e0a630d1442e834fc1ebfe6b0513", size = 6456991, upload-time = "2025-03-11T01:30:13.653Z" }, - { url = "https://files.pythonhosted.org/packages/ed/5d/104b5a865d31a2fb2b5dd457ac6a8eb73b9228d9564d55fd219b03de6d4a/go_task_bin-3.42.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:b93b184564a508bb2591e8810cf177797cfd1c40765cd8e0c7fef9456ac83738", size = 6589494, upload-time = "2025-03-11T01:30:15.15Z" }, - { url = "https://files.pythonhosted.org/packages/e0/9d/9f33c379bbaf27889ad94a2edb3f587833743bbf504ee8093ab6f0e48b8c/go_task_bin-3.42.1-py3-none-win_amd64.whl", hash = "sha256:c511b203154ae27f44ac0d174e8327fe11670dbff774a4c30c151127104495e9", size = 6776876, upload-time = "2025-03-11T01:30:17.05Z" }, - { url = "https://files.pythonhosted.org/packages/06/a1/44cd1abc378dab68c07166e2ec23446ec32b3d9edcdfb4d274699a27fab0/go_task_bin-3.42.1-py3-none-win_arm64.whl", hash = "sha256:b60b11f48ef8999d9d4d7a499eb3fb7de48868e668b5ad43a1b61162621357d3", size = 6116001, upload-time = "2025-03-11T01:30:19.031Z" }, -] - -[[package]] -name = "griffe" -version = "1.7.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/59/08/7df7e90e34d08ad890bd71d7ba19451052f88dc3d2c483d228d1331a4736/griffe-1.7.2.tar.gz", hash = "sha256:98d396d803fab3b680c2608f300872fd57019ed82f0672f5b5323a9ad18c540c", size = 394919, upload-time = "2025-04-01T14:38:44.887Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b1/5e/38b408f41064c9fcdbb0ea27c1bd13a1c8657c4846e04dab9f5ea770602c/griffe-1.7.2-py3-none-any.whl", hash = "sha256:1ed9c2e338a75741fc82083fe5a1bc89cb6142efe126194cc313e34ee6af5423", size = 129187, upload-time = "2025-04-01T14:38:43.227Z" }, -] - -[[package]] -name = "h5py" -version = "3.13.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "numpy" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/03/2e/a22d6a8bfa6f8be33e7febd985680fba531562795f0a9077ed1eb047bfb0/h5py-3.13.0.tar.gz", hash = "sha256:1870e46518720023da85d0895a1960ff2ce398c5671eac3b1a41ec696b7105c3", size = 414876, upload-time = "2025-02-18T16:04:01.824Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/86/2b/50b15fdefb577d073b49699e6ea6a0a77a3a1016c2b67e2149fc50124a10/h5py-3.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8a8e38ef4ceb969f832cc230c0cf808c613cc47e31e768fd7b1106c55afa1cb8", size = 3422922, upload-time = "2025-02-18T16:02:36.376Z" }, - { url = "https://files.pythonhosted.org/packages/94/59/36d87a559cab9c59b59088d52e86008d27a9602ce3afc9d3b51823014bf3/h5py-3.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f35640e81b03c02a88b8bf99fb6a9d3023cc52f7c627694db2f379e0028f2868", size = 2921619, upload-time = "2025-02-18T16:02:40.722Z" }, - { url = "https://files.pythonhosted.org/packages/37/ef/6f80b19682c0b0835bbee7b253bec9c16af9004f2fd6427b1dd858100273/h5py-3.13.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:337af114616f3656da0c83b68fcf53ecd9ce9989a700b0883a6e7c483c3235d4", size = 4259366, upload-time = "2025-02-18T16:02:44.544Z" }, - { url = "https://files.pythonhosted.org/packages/03/71/c99f662d4832c8835453cf3476f95daa28372023bda4aa1fca9e97c24f09/h5py-3.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:782ff0ac39f455f21fd1c8ebc007328f65f43d56718a89327eec76677ebf238a", size = 4509058, upload-time = "2025-02-18T16:02:49.035Z" }, - { url = "https://files.pythonhosted.org/packages/56/89/e3ff23e07131ff73a72a349be9639e4de84e163af89c1c218b939459a98a/h5py-3.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:22ffe2a25770a2d67213a1b94f58006c14dce06933a42d2aaa0318c5868d1508", size = 2966428, upload-time = "2025-02-18T16:02:52.061Z" }, - { url = "https://files.pythonhosted.org/packages/d8/20/438f6366ba4ded80eadb38f8927f5e2cd6d2e087179552f20ae3dbcd5d5b/h5py-3.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:477c58307b6b9a2509c59c57811afb9f598aedede24a67da808262dfa0ee37b4", size = 3384442, upload-time = "2025-02-18T16:02:56.545Z" }, - { url = "https://files.pythonhosted.org/packages/10/13/cc1cb7231399617d9951233eb12fddd396ff5d4f7f057ee5d2b1ca0ee7e7/h5py-3.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:57c4c74f627c616f02b7aec608a8c706fe08cb5b0ba7c08555a4eb1dde20805a", size = 2917567, upload-time = "2025-02-18T16:03:00.079Z" }, - { url = "https://files.pythonhosted.org/packages/9e/d9/aed99e1c858dc698489f916eeb7c07513bc864885d28ab3689d572ba0ea0/h5py-3.13.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:357e6dc20b101a805ccfd0024731fbaf6e8718c18c09baf3b5e4e9d198d13fca", size = 4669544, upload-time = "2025-02-18T16:03:05.675Z" }, - { url = "https://files.pythonhosted.org/packages/a7/da/3c137006ff5f0433f0fb076b1ebe4a7bf7b5ee1e8811b5486af98b500dd5/h5py-3.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d6f13f9b5ce549448c01e4dfe08ea8d1772e6078799af2c1c8d09e941230a90d", size = 4932139, upload-time = "2025-02-18T16:03:10.129Z" }, - { url = "https://files.pythonhosted.org/packages/25/61/d897952629cae131c19d4c41b2521e7dd6382f2d7177c87615c2e6dced1a/h5py-3.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:21daf38171753899b5905f3d82c99b0b1ec2cbbe282a037cad431feb620e62ec", size = 2954179, upload-time = "2025-02-18T16:03:13.716Z" }, - { url = "https://files.pythonhosted.org/packages/60/43/f276f27921919a9144074320ce4ca40882fc67b3cfee81c3f5c7df083e97/h5py-3.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e520ec76de00943dd017c8ea3f354fa1d2f542eac994811943a8faedf2a7d5cb", size = 3358040, upload-time = "2025-02-18T16:03:20.579Z" }, - { url = "https://files.pythonhosted.org/packages/1b/86/ad4a4cf781b08d4572be8bbdd8f108bb97b266a14835c640dc43dafc0729/h5py-3.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e79d8368cd9295045956bfb436656bea3f915beaa11d342e9f79f129f5178763", size = 2892766, upload-time = "2025-02-18T16:03:26.831Z" }, - { url = "https://files.pythonhosted.org/packages/69/84/4c6367d6b58deaf0fa84999ec819e7578eee96cea6cbd613640d0625ed5e/h5py-3.13.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:56dd172d862e850823c4af02dc4ddbc308f042b85472ffdaca67f1598dff4a57", size = 4664255, upload-time = "2025-02-18T16:03:31.903Z" }, - { url = "https://files.pythonhosted.org/packages/fd/41/bc2df86b72965775f6d621e0ee269a5f3ac23e8f870abf519de9c7d93b4d/h5py-3.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be949b46b7388074c5acae017fbbe3e5ba303fd9daaa52157fdfef30bbdacadd", size = 4927580, upload-time = "2025-02-18T16:03:36.429Z" }, - { url = "https://files.pythonhosted.org/packages/97/34/165b87ea55184770a0c1fcdb7e017199974ad2e271451fd045cfe35f3add/h5py-3.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:4f97ecde7ac6513b21cd95efdfc38dc6d19f96f6ca6f2a30550e94e551458e0a", size = 2940890, upload-time = "2025-02-18T16:03:41.037Z" }, -] - -[[package]] -name = "idna" -version = "3.10" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490, upload-time = "2024-09-15T18:07:39.745Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, -] - -[[package]] -name = "importlib-metadata" -version = "8.6.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "zipp" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/33/08/c1395a292bb23fd03bdf572a1357c5a733d3eecbab877641ceacab23db6e/importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580", size = 55767, upload-time = "2025-01-20T22:21:30.429Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/79/9d/0fb148dc4d6fa4a7dd1d8378168d9b4cd8d4560a6fbf6f0121c5fc34eb68/importlib_metadata-8.6.1-py3-none-any.whl", hash = "sha256:02a89390c1e15fdfdc0d7c6b25cb3e62650d0494005c97d6f148bf5b9787525e", size = 26971, upload-time = "2025-01-20T22:21:29.177Z" }, -] - -[[package]] -name = "iniconfig" -version = "2.1.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" }, -] - -[[package]] -name = "jaraco-classes" -version = "3.4.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "more-itertools" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/06/c0/ed4a27bc5571b99e3cff68f8a9fa5b56ff7df1c2251cc715a652ddd26402/jaraco.classes-3.4.0.tar.gz", hash = "sha256:47a024b51d0239c0dd8c8540c6c7f484be3b8fcf0b2d85c13825780d3b3f3acd", size = 11780, upload-time = "2024-03-31T07:27:36.643Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/66/b15ce62552d84bbfcec9a4873ab79d993a1dd4edb922cbfccae192bd5b5f/jaraco.classes-3.4.0-py3-none-any.whl", hash = "sha256:f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790", size = 6777, upload-time = "2024-03-31T07:27:34.792Z" }, -] - -[[package]] -name = "jaraco-context" -version = "6.0.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "backports-tarfile", marker = "python_full_version < '3.12'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/df/ad/f3777b81bf0b6e7bc7514a1656d3e637b2e8e15fab2ce3235730b3e7a4e6/jaraco_context-6.0.1.tar.gz", hash = "sha256:9bae4ea555cf0b14938dc0aee7c9f32ed303aa20a3b73e7dc80111628792d1b3", size = 13912, upload-time = "2024-08-20T03:39:27.358Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ff/db/0c52c4cf5e4bd9f5d7135ec7669a3a767af21b3a308e1ed3674881e52b62/jaraco.context-6.0.1-py3-none-any.whl", hash = "sha256:f797fc481b490edb305122c9181830a3a5b76d84ef6d1aef2fb9b47ab956f9e4", size = 6825, upload-time = "2024-08-20T03:39:25.966Z" }, -] - -[[package]] -name = "jaraco-functools" -version = "4.1.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "more-itertools" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ab/23/9894b3df5d0a6eb44611c36aec777823fc2e07740dabbd0b810e19594013/jaraco_functools-4.1.0.tar.gz", hash = "sha256:70f7e0e2ae076498e212562325e805204fc092d7b4c17e0e86c959e249701a9d", size = 19159, upload-time = "2024-09-27T19:47:09.122Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/9f/4f/24b319316142c44283d7540e76c7b5a6dbd5db623abd86bb7b3491c21018/jaraco.functools-4.1.0-py3-none-any.whl", hash = "sha256:ad159f13428bc4acbf5541ad6dec511f91573b90fba04df61dafa2a1231cf649", size = 10187, upload-time = "2024-09-27T19:47:07.14Z" }, -] - -[[package]] -name = "jeepney" -version = "0.9.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7b/6f/357efd7602486741aa73ffc0617fb310a29b588ed0fd69c2399acbb85b0c/jeepney-0.9.0.tar.gz", hash = "sha256:cf0e9e845622b81e4a28df94c40345400256ec608d0e55bb8a3feaa9163f5732", size = 106758, upload-time = "2025-02-27T18:51:01.684Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b2/a3/e137168c9c44d18eff0376253da9f1e9234d0239e0ee230d2fee6cea8e55/jeepney-0.9.0-py3-none-any.whl", hash = "sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683", size = 49010, upload-time = "2025-02-27T18:51:00.104Z" }, -] - -[[package]] -name = "jinja2" -version = "3.1.6" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "markupsafe" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, -] - -[[package]] -name = "joblib" -version = "1.4.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/64/33/60135848598c076ce4b231e1b1895170f45fbcaeaa2c9d5e38b04db70c35/joblib-1.4.2.tar.gz", hash = "sha256:2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e", size = 2116621, upload-time = "2024-05-02T12:15:05.765Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/91/29/df4b9b42f2be0b623cbd5e2140cafcaa2bef0759a00b7b70104dcfe2fb51/joblib-1.4.2-py3-none-any.whl", hash = "sha256:06d478d5674cbc267e7496a410ee875abd68e4340feff4490bcb7afb88060ae6", size = 301817, upload-time = "2024-05-02T12:15:00.765Z" }, -] - -[[package]] -name = "keyring" -version = "25.6.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "importlib-metadata", marker = "python_full_version < '3.12'" }, - { name = "jaraco-classes" }, - { name = "jaraco-context" }, - { name = "jaraco-functools" }, - { name = "jeepney", marker = "sys_platform == 'linux'" }, - { name = "pywin32-ctypes", marker = "sys_platform == 'win32'" }, - { name = "secretstorage", marker = "sys_platform == 'linux'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/70/09/d904a6e96f76ff214be59e7aa6ef7190008f52a0ab6689760a98de0bf37d/keyring-25.6.0.tar.gz", hash = "sha256:0b39998aa941431eb3d9b0d4b2460bc773b9df6fed7621c2dfb291a7e0187a66", size = 62750, upload-time = "2024-12-25T15:26:45.782Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d3/32/da7f44bcb1105d3e88a0b74ebdca50c59121d2ddf71c9e34ba47df7f3a56/keyring-25.6.0-py3-none-any.whl", hash = "sha256:552a3f7af126ece7ed5c89753650eec89c7eaae8617d0aa4d9ad2b75111266bd", size = 39085, upload-time = "2024-12-25T15:26:44.377Z" }, -] - -[[package]] -name = "lasso-python" -source = { editable = "." } -dependencies = [ - { name = "h5py" }, - { name = "numpy" }, - { name = "pandas" }, - { name = "plotly" }, - { name = "psutil" }, - { name = "rich" }, - { name = "scikit-learn" }, - { name = "scipy" }, -] - -[package.dev-dependencies] -dev = [ - { name = "git-changelog" }, - { name = "go-task-bin" }, - { name = "mkdocs" }, - { name = "mkdocs-coverage" }, - { name = "mkdocs-material" }, - { name = "mkdocstrings", extra = ["python"] }, - { name = "pytest" }, - { name = "pytest-cov" }, - { name = "ruff" }, - { name = "twine" }, -] - -[package.metadata] -requires-dist = [ - { name = "h5py", specifier = "==3.*" }, - { name = "numpy", specifier = ">2.2" }, - { name = "pandas", specifier = "==2.*" }, - { name = "plotly", specifier = "==5.*" }, - { name = "psutil", specifier = "==5.*" }, - { name = "rich", specifier = "==13.*" }, - { name = "scikit-learn", specifier = "==1.*" }, - { name = "scipy", specifier = "==1.*" }, -] - -[package.metadata.requires-dev] -dev = [ - { name = "git-changelog", specifier = "==2.*" }, - { name = "go-task-bin" }, - { name = "mkdocs", specifier = "==1.*" }, - { name = "mkdocs-coverage", specifier = "==1.*" }, - { name = "mkdocs-material", specifier = "==9.*" }, - { name = "mkdocstrings", extras = ["python"], specifier = "==0.*" }, - { name = "pytest", specifier = "==8.*" }, - { name = "pytest-cov", specifier = "==5.*" }, - { name = "ruff", specifier = "==0.11.*" }, - { name = "twine", specifier = "==5.*" }, -] - -[[package]] -name = "markdown" -version = "3.7" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/54/28/3af612670f82f4c056911fbbbb42760255801b3068c48de792d354ff4472/markdown-3.7.tar.gz", hash = "sha256:2ae2471477cfd02dbbf038d5d9bc226d40def84b4fe2986e49b59b6b472bbed2", size = 357086, upload-time = "2024-08-16T15:55:17.812Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3f/08/83871f3c50fc983b88547c196d11cf8c3340e37c32d2e9d6152abe2c61f7/Markdown-3.7-py3-none-any.whl", hash = "sha256:7eb6df5690b81a1d7942992c97fad2938e956e79df20cbc6186e9c3a77b1c803", size = 106349, upload-time = "2024-08-16T15:55:16.176Z" }, -] - -[[package]] -name = "markdown-it-py" -version = "3.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "mdurl" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" }, -] - -[[package]] -name = "markupsafe" -version = "3.0.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", size = 20537, upload-time = "2024-10-18T15:21:54.129Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6b/28/bbf83e3f76936960b850435576dd5e67034e200469571be53f69174a2dfd/MarkupSafe-3.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d", size = 14353, upload-time = "2024-10-18T15:21:02.187Z" }, - { url = "https://files.pythonhosted.org/packages/6c/30/316d194b093cde57d448a4c3209f22e3046c5bb2fb0820b118292b334be7/MarkupSafe-3.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93", size = 12392, upload-time = "2024-10-18T15:21:02.941Z" }, - { url = "https://files.pythonhosted.org/packages/f2/96/9cdafba8445d3a53cae530aaf83c38ec64c4d5427d975c974084af5bc5d2/MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832", size = 23984, upload-time = "2024-10-18T15:21:03.953Z" }, - { url = "https://files.pythonhosted.org/packages/f1/a4/aefb044a2cd8d7334c8a47d3fb2c9f328ac48cb349468cc31c20b539305f/MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84", size = 23120, upload-time = "2024-10-18T15:21:06.495Z" }, - { url = "https://files.pythonhosted.org/packages/8d/21/5e4851379f88f3fad1de30361db501300d4f07bcad047d3cb0449fc51f8c/MarkupSafe-3.0.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca", size = 23032, upload-time = "2024-10-18T15:21:07.295Z" }, - { url = "https://files.pythonhosted.org/packages/00/7b/e92c64e079b2d0d7ddf69899c98842f3f9a60a1ae72657c89ce2655c999d/MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798", size = 24057, upload-time = "2024-10-18T15:21:08.073Z" }, - { url = "https://files.pythonhosted.org/packages/f9/ac/46f960ca323037caa0a10662ef97d0a4728e890334fc156b9f9e52bcc4ca/MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e", size = 23359, upload-time = "2024-10-18T15:21:09.318Z" }, - { url = "https://files.pythonhosted.org/packages/69/84/83439e16197337b8b14b6a5b9c2105fff81d42c2a7c5b58ac7b62ee2c3b1/MarkupSafe-3.0.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4", size = 23306, upload-time = "2024-10-18T15:21:10.185Z" }, - { url = "https://files.pythonhosted.org/packages/9a/34/a15aa69f01e2181ed8d2b685c0d2f6655d5cca2c4db0ddea775e631918cd/MarkupSafe-3.0.2-cp311-cp311-win32.whl", hash = "sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d", size = 15094, upload-time = "2024-10-18T15:21:11.005Z" }, - { url = "https://files.pythonhosted.org/packages/da/b8/3a3bd761922d416f3dc5d00bfbed11f66b1ab89a0c2b6e887240a30b0f6b/MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b", size = 15521, upload-time = "2024-10-18T15:21:12.911Z" }, - { url = "https://files.pythonhosted.org/packages/22/09/d1f21434c97fc42f09d290cbb6350d44eb12f09cc62c9476effdb33a18aa/MarkupSafe-3.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf", size = 14274, upload-time = "2024-10-18T15:21:13.777Z" }, - { url = "https://files.pythonhosted.org/packages/6b/b0/18f76bba336fa5aecf79d45dcd6c806c280ec44538b3c13671d49099fdd0/MarkupSafe-3.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225", size = 12348, upload-time = "2024-10-18T15:21:14.822Z" }, - { url = "https://files.pythonhosted.org/packages/e0/25/dd5c0f6ac1311e9b40f4af06c78efde0f3b5cbf02502f8ef9501294c425b/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028", size = 24149, upload-time = "2024-10-18T15:21:15.642Z" }, - { url = "https://files.pythonhosted.org/packages/f3/f0/89e7aadfb3749d0f52234a0c8c7867877876e0a20b60e2188e9850794c17/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8", size = 23118, upload-time = "2024-10-18T15:21:17.133Z" }, - { url = "https://files.pythonhosted.org/packages/d5/da/f2eeb64c723f5e3777bc081da884b414671982008c47dcc1873d81f625b6/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c", size = 22993, upload-time = "2024-10-18T15:21:18.064Z" }, - { url = "https://files.pythonhosted.org/packages/da/0e/1f32af846df486dce7c227fe0f2398dc7e2e51d4a370508281f3c1c5cddc/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557", size = 24178, upload-time = "2024-10-18T15:21:18.859Z" }, - { url = "https://files.pythonhosted.org/packages/c4/f6/bb3ca0532de8086cbff5f06d137064c8410d10779c4c127e0e47d17c0b71/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22", size = 23319, upload-time = "2024-10-18T15:21:19.671Z" }, - { url = "https://files.pythonhosted.org/packages/a2/82/8be4c96ffee03c5b4a034e60a31294daf481e12c7c43ab8e34a1453ee48b/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48", size = 23352, upload-time = "2024-10-18T15:21:20.971Z" }, - { url = "https://files.pythonhosted.org/packages/51/ae/97827349d3fcffee7e184bdf7f41cd6b88d9919c80f0263ba7acd1bbcb18/MarkupSafe-3.0.2-cp312-cp312-win32.whl", hash = "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30", size = 15097, upload-time = "2024-10-18T15:21:22.646Z" }, - { url = "https://files.pythonhosted.org/packages/c1/80/a61f99dc3a936413c3ee4e1eecac96c0da5ed07ad56fd975f1a9da5bc630/MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87", size = 15601, upload-time = "2024-10-18T15:21:23.499Z" }, - { url = "https://files.pythonhosted.org/packages/83/0e/67eb10a7ecc77a0c2bbe2b0235765b98d164d81600746914bebada795e97/MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", size = 14274, upload-time = "2024-10-18T15:21:24.577Z" }, - { url = "https://files.pythonhosted.org/packages/2b/6d/9409f3684d3335375d04e5f05744dfe7e9f120062c9857df4ab490a1031a/MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", size = 12352, upload-time = "2024-10-18T15:21:25.382Z" }, - { url = "https://files.pythonhosted.org/packages/d2/f5/6eadfcd3885ea85fe2a7c128315cc1bb7241e1987443d78c8fe712d03091/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", size = 24122, upload-time = "2024-10-18T15:21:26.199Z" }, - { url = "https://files.pythonhosted.org/packages/0c/91/96cf928db8236f1bfab6ce15ad070dfdd02ed88261c2afafd4b43575e9e9/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", size = 23085, upload-time = "2024-10-18T15:21:27.029Z" }, - { url = "https://files.pythonhosted.org/packages/c2/cf/c9d56af24d56ea04daae7ac0940232d31d5a8354f2b457c6d856b2057d69/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", size = 22978, upload-time = "2024-10-18T15:21:27.846Z" }, - { url = "https://files.pythonhosted.org/packages/2a/9f/8619835cd6a711d6272d62abb78c033bda638fdc54c4e7f4272cf1c0962b/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", size = 24208, upload-time = "2024-10-18T15:21:28.744Z" }, - { url = "https://files.pythonhosted.org/packages/f9/bf/176950a1792b2cd2102b8ffeb5133e1ed984547b75db47c25a67d3359f77/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", size = 23357, upload-time = "2024-10-18T15:21:29.545Z" }, - { url = "https://files.pythonhosted.org/packages/ce/4f/9a02c1d335caabe5c4efb90e1b6e8ee944aa245c1aaaab8e8a618987d816/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", size = 23344, upload-time = "2024-10-18T15:21:30.366Z" }, - { url = "https://files.pythonhosted.org/packages/ee/55/c271b57db36f748f0e04a759ace9f8f759ccf22b4960c270c78a394f58be/MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", size = 15101, upload-time = "2024-10-18T15:21:31.207Z" }, - { url = "https://files.pythonhosted.org/packages/29/88/07df22d2dd4df40aba9f3e402e6dc1b8ee86297dddbad4872bd5e7b0094f/MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", size = 15603, upload-time = "2024-10-18T15:21:32.032Z" }, - { url = "https://files.pythonhosted.org/packages/62/6a/8b89d24db2d32d433dffcd6a8779159da109842434f1dd2f6e71f32f738c/MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", size = 14510, upload-time = "2024-10-18T15:21:33.625Z" }, - { url = "https://files.pythonhosted.org/packages/7a/06/a10f955f70a2e5a9bf78d11a161029d278eeacbd35ef806c3fd17b13060d/MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", size = 12486, upload-time = "2024-10-18T15:21:34.611Z" }, - { url = "https://files.pythonhosted.org/packages/34/cf/65d4a571869a1a9078198ca28f39fba5fbb910f952f9dbc5220afff9f5e6/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", size = 25480, upload-time = "2024-10-18T15:21:35.398Z" }, - { url = "https://files.pythonhosted.org/packages/0c/e3/90e9651924c430b885468b56b3d597cabf6d72be4b24a0acd1fa0e12af67/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", size = 23914, upload-time = "2024-10-18T15:21:36.231Z" }, - { url = "https://files.pythonhosted.org/packages/66/8c/6c7cf61f95d63bb866db39085150df1f2a5bd3335298f14a66b48e92659c/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", size = 23796, upload-time = "2024-10-18T15:21:37.073Z" }, - { url = "https://files.pythonhosted.org/packages/bb/35/cbe9238ec3f47ac9a7c8b3df7a808e7cb50fe149dc7039f5f454b3fba218/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", size = 25473, upload-time = "2024-10-18T15:21:37.932Z" }, - { url = "https://files.pythonhosted.org/packages/e6/32/7621a4382488aa283cc05e8984a9c219abad3bca087be9ec77e89939ded9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", size = 24114, upload-time = "2024-10-18T15:21:39.799Z" }, - { url = "https://files.pythonhosted.org/packages/0d/80/0985960e4b89922cb5a0bac0ed39c5b96cbc1a536a99f30e8c220a996ed9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", size = 24098, upload-time = "2024-10-18T15:21:40.813Z" }, - { url = "https://files.pythonhosted.org/packages/82/78/fedb03c7d5380df2427038ec8d973587e90561b2d90cd472ce9254cf348b/MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", size = 15208, upload-time = "2024-10-18T15:21:41.814Z" }, - { url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739, upload-time = "2024-10-18T15:21:42.784Z" }, -] - -[[package]] -name = "mdurl" -version = "0.1.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, -] - -[[package]] -name = "mergedeep" -version = "1.3.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3a/41/580bb4006e3ed0361b8151a01d324fb03f420815446c7def45d02f74c270/mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", size = 4661, upload-time = "2021-02-05T18:55:30.623Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/19/04f9b178c2d8a15b076c8b5140708fa6ffc5601fb6f1e975537072df5b2a/mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307", size = 6354, upload-time = "2021-02-05T18:55:29.583Z" }, -] - -[[package]] -name = "mkdocs" -version = "1.6.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "ghp-import" }, - { name = "jinja2" }, - { name = "markdown" }, - { name = "markupsafe" }, - { name = "mergedeep" }, - { name = "mkdocs-get-deps" }, - { name = "packaging" }, - { name = "pathspec" }, - { name = "pyyaml" }, - { name = "pyyaml-env-tag" }, - { name = "watchdog" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/bc/c6/bbd4f061bd16b378247f12953ffcb04786a618ce5e904b8c5a01a0309061/mkdocs-1.6.1.tar.gz", hash = "sha256:7b432f01d928c084353ab39c57282f29f92136665bdd6abf7c1ec8d822ef86f2", size = 3889159, upload-time = "2024-08-30T12:24:06.899Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/22/5b/dbc6a8cddc9cfa9c4971d59fb12bb8d42e161b7e7f8cc89e49137c5b279c/mkdocs-1.6.1-py3-none-any.whl", hash = "sha256:db91759624d1647f3f34aa0c3f327dd2601beae39a366d6e064c03468d35c20e", size = 3864451, upload-time = "2024-08-30T12:24:05.054Z" }, -] - -[[package]] -name = "mkdocs-autorefs" -version = "1.4.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "markdown" }, - { name = "markupsafe" }, - { name = "mkdocs" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c2/44/140469d87379c02f1e1870315f3143718036a983dd0416650827b8883192/mkdocs_autorefs-1.4.1.tar.gz", hash = "sha256:4b5b6235a4becb2b10425c2fa191737e415b37aa3418919db33e5d774c9db079", size = 4131355, upload-time = "2025-03-08T13:35:21.232Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f8/29/1125f7b11db63e8e32bcfa0752a4eea30abff3ebd0796f808e14571ddaa2/mkdocs_autorefs-1.4.1-py3-none-any.whl", hash = "sha256:9793c5ac06a6ebbe52ec0f8439256e66187badf4b5334b5fde0b128ec134df4f", size = 5782047, upload-time = "2025-03-08T13:35:18.889Z" }, -] - -[[package]] -name = "mkdocs-coverage" -version = "1.1.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "mkdocs" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/93/64/a9fe7d953d6b02944610a5f7361cdab7532a9f5518ffe890287a9f187f08/mkdocs_coverage-1.1.0.tar.gz", hash = "sha256:a67cc6f6d548b8d6b4b21ecd777f2e3768b49e7a95e54c6df158e7c0f179134c", size = 5514, upload-time = "2024-06-11T18:47:23.773Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/f0/96851f1d9809e1cbd1f1545948d3c4bde7abfa3af5965b7ba8d88ec37c11/mkdocs_coverage-1.1.0-py3-none-any.whl", hash = "sha256:168ca4ebc35ba48309c1f734d0cab0359cd95b205d0d18030d27e73b6a4590d9", size = 6853, upload-time = "2024-06-11T18:47:20.649Z" }, -] - -[[package]] -name = "mkdocs-get-deps" -version = "0.2.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "mergedeep" }, - { name = "platformdirs" }, - { name = "pyyaml" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/98/f5/ed29cd50067784976f25ed0ed6fcd3c2ce9eb90650aa3b2796ddf7b6870b/mkdocs_get_deps-0.2.0.tar.gz", hash = "sha256:162b3d129c7fad9b19abfdcb9c1458a651628e4b1dea628ac68790fb3061c60c", size = 10239, upload-time = "2023-11-20T17:51:09.981Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/9f/d4/029f984e8d3f3b6b726bd33cafc473b75e9e44c0f7e80a5b29abc466bdea/mkdocs_get_deps-0.2.0-py3-none-any.whl", hash = "sha256:2bf11d0b133e77a0dd036abeeb06dec8775e46efa526dc70667d8863eefc6134", size = 9521, upload-time = "2023-11-20T17:51:08.587Z" }, -] - -[[package]] -name = "mkdocs-material" -version = "9.6.11" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "babel" }, - { name = "backrefs" }, - { name = "colorama" }, - { name = "jinja2" }, - { name = "markdown" }, - { name = "mkdocs" }, - { name = "mkdocs-material-extensions" }, - { name = "paginate" }, - { name = "pygments" }, - { name = "pymdown-extensions" }, - { name = "requests" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/5b/7e/c65e330e99daa5813e7594e57a09219ad041ed631604a72588ec7c11b34b/mkdocs_material-9.6.11.tar.gz", hash = "sha256:0b7f4a0145c5074cdd692e4362d232fb25ef5b23328d0ec1ab287af77cc0deff", size = 3951595, upload-time = "2025-04-01T07:04:42.095Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/19/91/79a15a772151aca0d505f901f6bbd4b85ee1fe54100256a6702056bab121/mkdocs_material-9.6.11-py3-none-any.whl", hash = "sha256:47f21ef9cbf4f0ebdce78a2ceecaa5d413581a55141e4464902224ebbc0b1263", size = 8703720, upload-time = "2025-04-01T07:04:39.073Z" }, -] - -[[package]] -name = "mkdocs-material-extensions" -version = "1.3.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/79/9b/9b4c96d6593b2a541e1cb8b34899a6d021d208bb357042823d4d2cabdbe7/mkdocs_material_extensions-1.3.1.tar.gz", hash = "sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443", size = 11847, upload-time = "2023-11-22T19:09:45.208Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5b/54/662a4743aa81d9582ee9339d4ffa3c8fd40a4965e033d77b9da9774d3960/mkdocs_material_extensions-1.3.1-py3-none-any.whl", hash = "sha256:adff8b62700b25cb77b53358dad940f3ef973dd6db797907c49e3c2ef3ab4e31", size = 8728, upload-time = "2023-11-22T19:09:43.465Z" }, -] - -[[package]] -name = "mkdocstrings" -version = "0.29.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "jinja2" }, - { name = "markdown" }, - { name = "markupsafe" }, - { name = "mkdocs" }, - { name = "mkdocs-autorefs" }, - { name = "pymdown-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/41/e8/d22922664a627a0d3d7ff4a6ca95800f5dde54f411982591b4621a76225d/mkdocstrings-0.29.1.tar.gz", hash = "sha256:8722f8f8c5cd75da56671e0a0c1bbed1df9946c0cef74794d6141b34011abd42", size = 1212686, upload-time = "2025-03-31T08:33:11.997Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/98/14/22533a578bf8b187e05d67e2c1721ce10e3f526610eebaf7a149d557ea7a/mkdocstrings-0.29.1-py3-none-any.whl", hash = "sha256:37a9736134934eea89cbd055a513d40a020d87dfcae9e3052c2a6b8cd4af09b6", size = 1631075, upload-time = "2025-03-31T08:33:09.661Z" }, -] - -[package.optional-dependencies] -python = [ - { name = "mkdocstrings-python" }, -] - -[[package]] -name = "mkdocstrings-python" -version = "1.16.10" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "griffe" }, - { name = "mkdocs-autorefs" }, - { name = "mkdocstrings" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/44/c8/600c4201b6b9e72bab16802316d0c90ce04089f8e6bb5e064cd2a5abba7e/mkdocstrings_python-1.16.10.tar.gz", hash = "sha256:f9eedfd98effb612ab4d0ed6dd2b73aff6eba5215e0a65cea6d877717f75502e", size = 205771, upload-time = "2025-04-03T14:24:48.12Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/53/37/19549c5e0179785308cc988a68e16aa7550e4e270ec8a9878334e86070c6/mkdocstrings_python-1.16.10-py3-none-any.whl", hash = "sha256:63bb9f01f8848a644bdb6289e86dc38ceddeaa63ecc2e291e3b2ca52702a6643", size = 124112, upload-time = "2025-04-03T14:24:46.561Z" }, -] - -[[package]] -name = "more-itertools" -version = "10.6.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/88/3b/7fa1fe835e2e93fd6d7b52b2f95ae810cf5ba133e1845f726f5a992d62c2/more-itertools-10.6.0.tar.gz", hash = "sha256:2cd7fad1009c31cc9fb6a035108509e6547547a7a738374f10bd49a09eb3ee3b", size = 125009, upload-time = "2025-01-14T16:22:47.626Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/23/62/0fe302c6d1be1c777cab0616e6302478251dfbf9055ad426f5d0def75c89/more_itertools-10.6.0-py3-none-any.whl", hash = "sha256:6eb054cb4b6db1473f6e15fcc676a08e4732548acd47c708f0e179c2c7c01e89", size = 63038, upload-time = "2025-01-14T16:22:46.014Z" }, -] - -[[package]] -name = "nh3" -version = "0.2.21" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/37/30/2f81466f250eb7f591d4d193930df661c8c23e9056bdc78e365b646054d8/nh3-0.2.21.tar.gz", hash = "sha256:4990e7ee6a55490dbf00d61a6f476c9a3258e31e711e13713b2ea7d6616f670e", size = 16581, upload-time = "2025-02-25T13:38:44.619Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/81/b83775687fcf00e08ade6d4605f0be9c4584cb44c4973d9f27b7456a31c9/nh3-0.2.21-cp313-cp313t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:fcff321bd60c6c5c9cb4ddf2554e22772bb41ebd93ad88171bbbb6f271255286", size = 1297678, upload-time = "2025-02-25T13:37:56.063Z" }, - { url = "https://files.pythonhosted.org/packages/22/ee/d0ad8fb4b5769f073b2df6807f69a5e57ca9cea504b78809921aef460d20/nh3-0.2.21-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31eedcd7d08b0eae28ba47f43fd33a653b4cdb271d64f1aeda47001618348fde", size = 733774, upload-time = "2025-02-25T13:37:58.419Z" }, - { url = "https://files.pythonhosted.org/packages/ea/76/b450141e2d384ede43fe53953552f1c6741a499a8c20955ad049555cabc8/nh3-0.2.21-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d426d7be1a2f3d896950fe263332ed1662f6c78525b4520c8e9861f8d7f0d243", size = 760012, upload-time = "2025-02-25T13:38:01.017Z" }, - { url = "https://files.pythonhosted.org/packages/97/90/1182275db76cd8fbb1f6bf84c770107fafee0cb7da3e66e416bcb9633da2/nh3-0.2.21-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9d67709bc0d7d1f5797b21db26e7a8b3d15d21c9c5f58ccfe48b5328483b685b", size = 923619, upload-time = "2025-02-25T13:38:02.617Z" }, - { url = "https://files.pythonhosted.org/packages/29/c7/269a7cfbec9693fad8d767c34a755c25ccb8d048fc1dfc7a7d86bc99375c/nh3-0.2.21-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:55823c5ea1f6b267a4fad5de39bc0524d49a47783e1fe094bcf9c537a37df251", size = 1000384, upload-time = "2025-02-25T13:38:04.402Z" }, - { url = "https://files.pythonhosted.org/packages/68/a9/48479dbf5f49ad93f0badd73fbb48b3d769189f04c6c69b0df261978b009/nh3-0.2.21-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:818f2b6df3763e058efa9e69677b5a92f9bc0acff3295af5ed013da544250d5b", size = 918908, upload-time = "2025-02-25T13:38:06.693Z" }, - { url = "https://files.pythonhosted.org/packages/d7/da/0279c118f8be2dc306e56819880b19a1cf2379472e3b79fc8eab44e267e3/nh3-0.2.21-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:b3b5c58161e08549904ac4abd450dacd94ff648916f7c376ae4b2c0652b98ff9", size = 909180, upload-time = "2025-02-25T13:38:10.941Z" }, - { url = "https://files.pythonhosted.org/packages/26/16/93309693f8abcb1088ae143a9c8dbcece9c8f7fb297d492d3918340c41f1/nh3-0.2.21-cp313-cp313t-win32.whl", hash = "sha256:637d4a10c834e1b7d9548592c7aad760611415fcd5bd346f77fd8a064309ae6d", size = 532747, upload-time = "2025-02-25T13:38:12.548Z" }, - { url = "https://files.pythonhosted.org/packages/a2/3a/96eb26c56cbb733c0b4a6a907fab8408ddf3ead5d1b065830a8f6a9c3557/nh3-0.2.21-cp313-cp313t-win_amd64.whl", hash = "sha256:713d16686596e556b65e7f8c58328c2df63f1a7abe1277d87625dcbbc012ef82", size = 528908, upload-time = "2025-02-25T13:38:14.059Z" }, - { url = "https://files.pythonhosted.org/packages/ba/1d/b1ef74121fe325a69601270f276021908392081f4953d50b03cbb38b395f/nh3-0.2.21-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:a772dec5b7b7325780922dd904709f0f5f3a79fbf756de5291c01370f6df0967", size = 1316133, upload-time = "2025-02-25T13:38:16.601Z" }, - { url = "https://files.pythonhosted.org/packages/b8/f2/2c7f79ce6de55b41e7715f7f59b159fd59f6cdb66223c05b42adaee2b645/nh3-0.2.21-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d002b648592bf3033adfd875a48f09b8ecc000abd7f6a8769ed86b6ccc70c759", size = 758328, upload-time = "2025-02-25T13:38:18.972Z" }, - { url = "https://files.pythonhosted.org/packages/6d/ad/07bd706fcf2b7979c51b83d8b8def28f413b090cf0cb0035ee6b425e9de5/nh3-0.2.21-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2a5174551f95f2836f2ad6a8074560f261cf9740a48437d6151fd2d4d7d617ab", size = 747020, upload-time = "2025-02-25T13:38:20.571Z" }, - { url = "https://files.pythonhosted.org/packages/75/99/06a6ba0b8a0d79c3d35496f19accc58199a1fb2dce5e711a31be7e2c1426/nh3-0.2.21-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:b8d55ea1fc7ae3633d758a92aafa3505cd3cc5a6e40470c9164d54dff6f96d42", size = 944878, upload-time = "2025-02-25T13:38:22.204Z" }, - { url = "https://files.pythonhosted.org/packages/79/d4/dc76f5dc50018cdaf161d436449181557373869aacf38a826885192fc587/nh3-0.2.21-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6ae319f17cd8960d0612f0f0ddff5a90700fa71926ca800e9028e7851ce44a6f", size = 903460, upload-time = "2025-02-25T13:38:25.951Z" }, - { url = "https://files.pythonhosted.org/packages/cd/c3/d4f8037b2ab02ebf5a2e8637bd54736ed3d0e6a2869e10341f8d9085f00e/nh3-0.2.21-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:63ca02ac6f27fc80f9894409eb61de2cb20ef0a23740c7e29f9ec827139fa578", size = 839369, upload-time = "2025-02-25T13:38:28.174Z" }, - { url = "https://files.pythonhosted.org/packages/11/a9/1cd3c6964ec51daed7b01ca4686a5c793581bf4492cbd7274b3f544c9abe/nh3-0.2.21-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5f77e62aed5c4acad635239ac1290404c7e940c81abe561fd2af011ff59f585", size = 739036, upload-time = "2025-02-25T13:38:30.539Z" }, - { url = "https://files.pythonhosted.org/packages/fd/04/bfb3ff08d17a8a96325010ae6c53ba41de6248e63cdb1b88ef6369a6cdfc/nh3-0.2.21-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:087ffadfdcd497658c3adc797258ce0f06be8a537786a7217649fc1c0c60c293", size = 768712, upload-time = "2025-02-25T13:38:32.992Z" }, - { url = "https://files.pythonhosted.org/packages/9e/aa/cfc0bf545d668b97d9adea4f8b4598667d2b21b725d83396c343ad12bba7/nh3-0.2.21-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ac7006c3abd097790e611fe4646ecb19a8d7f2184b882f6093293b8d9b887431", size = 930559, upload-time = "2025-02-25T13:38:35.204Z" }, - { url = "https://files.pythonhosted.org/packages/78/9d/6f5369a801d3a1b02e6a9a097d56bcc2f6ef98cffebf03c4bb3850d8e0f0/nh3-0.2.21-cp38-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:6141caabe00bbddc869665b35fc56a478eb774a8c1dfd6fba9fe1dfdf29e6efa", size = 1008591, upload-time = "2025-02-25T13:38:37.099Z" }, - { url = "https://files.pythonhosted.org/packages/a6/df/01b05299f68c69e480edff608248313cbb5dbd7595c5e048abe8972a57f9/nh3-0.2.21-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:20979783526641c81d2f5bfa6ca5ccca3d1e4472474b162c6256745fbfe31cd1", size = 925670, upload-time = "2025-02-25T13:38:38.696Z" }, - { url = "https://files.pythonhosted.org/packages/3d/79/bdba276f58d15386a3387fe8d54e980fb47557c915f5448d8c6ac6f7ea9b/nh3-0.2.21-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a7ea28cd49293749d67e4fcf326c554c83ec912cd09cd94aa7ec3ab1921c8283", size = 917093, upload-time = "2025-02-25T13:38:40.249Z" }, - { url = "https://files.pythonhosted.org/packages/e7/d8/c6f977a5cd4011c914fb58f5ae573b071d736187ccab31bfb1d539f4af9f/nh3-0.2.21-cp38-abi3-win32.whl", hash = "sha256:6c9c30b8b0d291a7c5ab0967ab200598ba33208f754f2f4920e9343bdd88f79a", size = 537623, upload-time = "2025-02-25T13:38:41.893Z" }, - { url = "https://files.pythonhosted.org/packages/23/fc/8ce756c032c70ae3dd1d48a3552577a325475af2a2f629604b44f571165c/nh3-0.2.21-cp38-abi3-win_amd64.whl", hash = "sha256:bb0014948f04d7976aabae43fcd4cb7f551f9f8ce785a4c9ef66e6c2590f8629", size = 535283, upload-time = "2025-02-25T13:38:43.355Z" }, -] - -[[package]] -name = "numpy" -version = "2.3.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/37/7d/3fec4199c5ffb892bed55cff901e4f39a58c81df9c44c280499e92cad264/numpy-2.3.2.tar.gz", hash = "sha256:e0486a11ec30cdecb53f184d496d1c6a20786c81e55e41640270130056f8ee48", size = 20489306, upload-time = "2025-07-24T21:32:07.553Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/96/26/1320083986108998bd487e2931eed2aeedf914b6e8905431487543ec911d/numpy-2.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:852ae5bed3478b92f093e30f785c98e0cb62fa0a939ed057c31716e18a7a22b9", size = 21259016, upload-time = "2025-07-24T20:24:35.214Z" }, - { url = "https://files.pythonhosted.org/packages/c4/2b/792b341463fa93fc7e55abbdbe87dac316c5b8cb5e94fb7a59fb6fa0cda5/numpy-2.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7a0e27186e781a69959d0230dd9909b5e26024f8da10683bd6344baea1885168", size = 14451158, upload-time = "2025-07-24T20:24:58.397Z" }, - { url = "https://files.pythonhosted.org/packages/b7/13/e792d7209261afb0c9f4759ffef6135b35c77c6349a151f488f531d13595/numpy-2.3.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f0a1a8476ad77a228e41619af2fa9505cf69df928e9aaa165746584ea17fed2b", size = 5379817, upload-time = "2025-07-24T20:25:07.746Z" }, - { url = "https://files.pythonhosted.org/packages/49/ce/055274fcba4107c022b2113a213c7287346563f48d62e8d2a5176ad93217/numpy-2.3.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:cbc95b3813920145032412f7e33d12080f11dc776262df1712e1638207dde9e8", size = 6913606, upload-time = "2025-07-24T20:25:18.84Z" }, - { url = "https://files.pythonhosted.org/packages/17/f2/e4d72e6bc5ff01e2ab613dc198d560714971900c03674b41947e38606502/numpy-2.3.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f75018be4980a7324edc5930fe39aa391d5734531b1926968605416ff58c332d", size = 14589652, upload-time = "2025-07-24T20:25:40.356Z" }, - { url = "https://files.pythonhosted.org/packages/c8/b0/fbeee3000a51ebf7222016e2939b5c5ecf8000a19555d04a18f1e02521b8/numpy-2.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20b8200721840f5621b7bd03f8dcd78de33ec522fc40dc2641aa09537df010c3", size = 16938816, upload-time = "2025-07-24T20:26:05.721Z" }, - { url = "https://files.pythonhosted.org/packages/a9/ec/2f6c45c3484cc159621ea8fc000ac5a86f1575f090cac78ac27193ce82cd/numpy-2.3.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1f91e5c028504660d606340a084db4b216567ded1056ea2b4be4f9d10b67197f", size = 16370512, upload-time = "2025-07-24T20:26:30.545Z" }, - { url = "https://files.pythonhosted.org/packages/b5/01/dd67cf511850bd7aefd6347aaae0956ed415abea741ae107834aae7d6d4e/numpy-2.3.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:fb1752a3bb9a3ad2d6b090b88a9a0ae1cd6f004ef95f75825e2f382c183b2097", size = 18884947, upload-time = "2025-07-24T20:26:58.24Z" }, - { url = "https://files.pythonhosted.org/packages/a7/17/2cf60fd3e6a61d006778735edf67a222787a8c1a7842aed43ef96d777446/numpy-2.3.2-cp311-cp311-win32.whl", hash = "sha256:4ae6863868aaee2f57503c7a5052b3a2807cf7a3914475e637a0ecd366ced220", size = 6599494, upload-time = "2025-07-24T20:27:09.786Z" }, - { url = "https://files.pythonhosted.org/packages/d5/03/0eade211c504bda872a594f045f98ddcc6caef2b7c63610946845e304d3f/numpy-2.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:240259d6564f1c65424bcd10f435145a7644a65a6811cfc3201c4a429ba79170", size = 13087889, upload-time = "2025-07-24T20:27:29.558Z" }, - { url = "https://files.pythonhosted.org/packages/13/32/2c7979d39dafb2a25087e12310fc7f3b9d3c7d960df4f4bc97955ae0ce1d/numpy-2.3.2-cp311-cp311-win_arm64.whl", hash = "sha256:4209f874d45f921bde2cff1ffcd8a3695f545ad2ffbef6d3d3c6768162efab89", size = 10459560, upload-time = "2025-07-24T20:27:46.803Z" }, - { url = "https://files.pythonhosted.org/packages/00/6d/745dd1c1c5c284d17725e5c802ca4d45cfc6803519d777f087b71c9f4069/numpy-2.3.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bc3186bea41fae9d8e90c2b4fb5f0a1f5a690682da79b92574d63f56b529080b", size = 20956420, upload-time = "2025-07-24T20:28:18.002Z" }, - { url = "https://files.pythonhosted.org/packages/bc/96/e7b533ea5740641dd62b07a790af5d9d8fec36000b8e2d0472bd7574105f/numpy-2.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f4f0215edb189048a3c03bd5b19345bdfa7b45a7a6f72ae5945d2a28272727f", size = 14184660, upload-time = "2025-07-24T20:28:39.522Z" }, - { url = "https://files.pythonhosted.org/packages/2b/53/102c6122db45a62aa20d1b18c9986f67e6b97e0d6fbc1ae13e3e4c84430c/numpy-2.3.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:8b1224a734cd509f70816455c3cffe13a4f599b1bf7130f913ba0e2c0b2006c0", size = 5113382, upload-time = "2025-07-24T20:28:48.544Z" }, - { url = "https://files.pythonhosted.org/packages/2b/21/376257efcbf63e624250717e82b4fae93d60178f09eb03ed766dbb48ec9c/numpy-2.3.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:3dcf02866b977a38ba3ec10215220609ab9667378a9e2150615673f3ffd6c73b", size = 6647258, upload-time = "2025-07-24T20:28:59.104Z" }, - { url = "https://files.pythonhosted.org/packages/91/ba/f4ebf257f08affa464fe6036e13f2bf9d4642a40228781dc1235da81be9f/numpy-2.3.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:572d5512df5470f50ada8d1972c5f1082d9a0b7aa5944db8084077570cf98370", size = 14281409, upload-time = "2025-07-24T20:40:30.298Z" }, - { url = "https://files.pythonhosted.org/packages/59/ef/f96536f1df42c668cbacb727a8c6da7afc9c05ece6d558927fb1722693e1/numpy-2.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8145dd6d10df13c559d1e4314df29695613575183fa2e2d11fac4c208c8a1f73", size = 16641317, upload-time = "2025-07-24T20:40:56.625Z" }, - { url = "https://files.pythonhosted.org/packages/f6/a7/af813a7b4f9a42f498dde8a4c6fcbff8100eed00182cc91dbaf095645f38/numpy-2.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:103ea7063fa624af04a791c39f97070bf93b96d7af7eb23530cd087dc8dbe9dc", size = 16056262, upload-time = "2025-07-24T20:41:20.797Z" }, - { url = "https://files.pythonhosted.org/packages/8b/5d/41c4ef8404caaa7f05ed1cfb06afe16a25895260eacbd29b4d84dff2920b/numpy-2.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc927d7f289d14f5e037be917539620603294454130b6de200091e23d27dc9be", size = 18579342, upload-time = "2025-07-24T20:41:50.753Z" }, - { url = "https://files.pythonhosted.org/packages/a1/4f/9950e44c5a11636f4a3af6e825ec23003475cc9a466edb7a759ed3ea63bd/numpy-2.3.2-cp312-cp312-win32.whl", hash = "sha256:d95f59afe7f808c103be692175008bab926b59309ade3e6d25009e9a171f7036", size = 6320610, upload-time = "2025-07-24T20:42:01.551Z" }, - { url = "https://files.pythonhosted.org/packages/7c/2f/244643a5ce54a94f0a9a2ab578189c061e4a87c002e037b0829dd77293b6/numpy-2.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:9e196ade2400c0c737d93465327d1ae7c06c7cb8a1756121ebf54b06ca183c7f", size = 12786292, upload-time = "2025-07-24T20:42:20.738Z" }, - { url = "https://files.pythonhosted.org/packages/54/cd/7b5f49d5d78db7badab22d8323c1b6ae458fbf86c4fdfa194ab3cd4eb39b/numpy-2.3.2-cp312-cp312-win_arm64.whl", hash = "sha256:ee807923782faaf60d0d7331f5e86da7d5e3079e28b291973c545476c2b00d07", size = 10194071, upload-time = "2025-07-24T20:42:36.657Z" }, - { url = "https://files.pythonhosted.org/packages/1c/c0/c6bb172c916b00700ed3bf71cb56175fd1f7dbecebf8353545d0b5519f6c/numpy-2.3.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c8d9727f5316a256425892b043736d63e89ed15bbfe6556c5ff4d9d4448ff3b3", size = 20949074, upload-time = "2025-07-24T20:43:07.813Z" }, - { url = "https://files.pythonhosted.org/packages/20/4e/c116466d22acaf4573e58421c956c6076dc526e24a6be0903219775d862e/numpy-2.3.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:efc81393f25f14d11c9d161e46e6ee348637c0a1e8a54bf9dedc472a3fae993b", size = 14177311, upload-time = "2025-07-24T20:43:29.335Z" }, - { url = "https://files.pythonhosted.org/packages/78/45/d4698c182895af189c463fc91d70805d455a227261d950e4e0f1310c2550/numpy-2.3.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:dd937f088a2df683cbb79dda9a772b62a3e5a8a7e76690612c2737f38c6ef1b6", size = 5106022, upload-time = "2025-07-24T20:43:37.999Z" }, - { url = "https://files.pythonhosted.org/packages/9f/76/3e6880fef4420179309dba72a8c11f6166c431cf6dee54c577af8906f914/numpy-2.3.2-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:11e58218c0c46c80509186e460d79fbdc9ca1eb8d8aee39d8f2dc768eb781089", size = 6640135, upload-time = "2025-07-24T20:43:49.28Z" }, - { url = "https://files.pythonhosted.org/packages/34/fa/87ff7f25b3c4ce9085a62554460b7db686fef1e0207e8977795c7b7d7ba1/numpy-2.3.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5ad4ebcb683a1f99f4f392cc522ee20a18b2bb12a2c1c42c3d48d5a1adc9d3d2", size = 14278147, upload-time = "2025-07-24T20:44:10.328Z" }, - { url = "https://files.pythonhosted.org/packages/1d/0f/571b2c7a3833ae419fe69ff7b479a78d313581785203cc70a8db90121b9a/numpy-2.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:938065908d1d869c7d75d8ec45f735a034771c6ea07088867f713d1cd3bbbe4f", size = 16635989, upload-time = "2025-07-24T20:44:34.88Z" }, - { url = "https://files.pythonhosted.org/packages/24/5a/84ae8dca9c9a4c592fe11340b36a86ffa9fd3e40513198daf8a97839345c/numpy-2.3.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:66459dccc65d8ec98cc7df61307b64bf9e08101f9598755d42d8ae65d9a7a6ee", size = 16053052, upload-time = "2025-07-24T20:44:58.872Z" }, - { url = "https://files.pythonhosted.org/packages/57/7c/e5725d99a9133b9813fcf148d3f858df98511686e853169dbaf63aec6097/numpy-2.3.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a7af9ed2aa9ec5950daf05bb11abc4076a108bd3c7db9aa7251d5f107079b6a6", size = 18577955, upload-time = "2025-07-24T20:45:26.714Z" }, - { url = "https://files.pythonhosted.org/packages/ae/11/7c546fcf42145f29b71e4d6f429e96d8d68e5a7ba1830b2e68d7418f0bbd/numpy-2.3.2-cp313-cp313-win32.whl", hash = "sha256:906a30249315f9c8e17b085cc5f87d3f369b35fedd0051d4a84686967bdbbd0b", size = 6311843, upload-time = "2025-07-24T20:49:24.444Z" }, - { url = "https://files.pythonhosted.org/packages/aa/6f/a428fd1cb7ed39b4280d057720fed5121b0d7754fd2a9768640160f5517b/numpy-2.3.2-cp313-cp313-win_amd64.whl", hash = "sha256:c63d95dc9d67b676e9108fe0d2182987ccb0f11933c1e8959f42fa0da8d4fa56", size = 12782876, upload-time = "2025-07-24T20:49:43.227Z" }, - { url = "https://files.pythonhosted.org/packages/65/85/4ea455c9040a12595fb6c43f2c217257c7b52dd0ba332c6a6c1d28b289fe/numpy-2.3.2-cp313-cp313-win_arm64.whl", hash = "sha256:b05a89f2fb84d21235f93de47129dd4f11c16f64c87c33f5e284e6a3a54e43f2", size = 10192786, upload-time = "2025-07-24T20:49:59.443Z" }, - { url = "https://files.pythonhosted.org/packages/80/23/8278f40282d10c3f258ec3ff1b103d4994bcad78b0cba9208317f6bb73da/numpy-2.3.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:4e6ecfeddfa83b02318f4d84acf15fbdbf9ded18e46989a15a8b6995dfbf85ab", size = 21047395, upload-time = "2025-07-24T20:45:58.821Z" }, - { url = "https://files.pythonhosted.org/packages/1f/2d/624f2ce4a5df52628b4ccd16a4f9437b37c35f4f8a50d00e962aae6efd7a/numpy-2.3.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:508b0eada3eded10a3b55725b40806a4b855961040180028f52580c4729916a2", size = 14300374, upload-time = "2025-07-24T20:46:20.207Z" }, - { url = "https://files.pythonhosted.org/packages/f6/62/ff1e512cdbb829b80a6bd08318a58698867bca0ca2499d101b4af063ee97/numpy-2.3.2-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:754d6755d9a7588bdc6ac47dc4ee97867271b17cee39cb87aef079574366db0a", size = 5228864, upload-time = "2025-07-24T20:46:30.58Z" }, - { url = "https://files.pythonhosted.org/packages/7d/8e/74bc18078fff03192d4032cfa99d5a5ca937807136d6f5790ce07ca53515/numpy-2.3.2-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:a9f66e7d2b2d7712410d3bc5684149040ef5f19856f20277cd17ea83e5006286", size = 6737533, upload-time = "2025-07-24T20:46:46.111Z" }, - { url = "https://files.pythonhosted.org/packages/19/ea/0731efe2c9073ccca5698ef6a8c3667c4cf4eea53fcdcd0b50140aba03bc/numpy-2.3.2-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:de6ea4e5a65d5a90c7d286ddff2b87f3f4ad61faa3db8dabe936b34c2275b6f8", size = 14352007, upload-time = "2025-07-24T20:47:07.1Z" }, - { url = "https://files.pythonhosted.org/packages/cf/90/36be0865f16dfed20f4bc7f75235b963d5939707d4b591f086777412ff7b/numpy-2.3.2-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a3ef07ec8cbc8fc9e369c8dcd52019510c12da4de81367d8b20bc692aa07573a", size = 16701914, upload-time = "2025-07-24T20:47:32.459Z" }, - { url = "https://files.pythonhosted.org/packages/94/30/06cd055e24cb6c38e5989a9e747042b4e723535758e6153f11afea88c01b/numpy-2.3.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:27c9f90e7481275c7800dc9c24b7cc40ace3fdb970ae4d21eaff983a32f70c91", size = 16132708, upload-time = "2025-07-24T20:47:58.129Z" }, - { url = "https://files.pythonhosted.org/packages/9a/14/ecede608ea73e58267fd7cb78f42341b3b37ba576e778a1a06baffbe585c/numpy-2.3.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:07b62978075b67eee4065b166d000d457c82a1efe726cce608b9db9dd66a73a5", size = 18651678, upload-time = "2025-07-24T20:48:25.402Z" }, - { url = "https://files.pythonhosted.org/packages/40/f3/2fe6066b8d07c3685509bc24d56386534c008b462a488b7f503ba82b8923/numpy-2.3.2-cp313-cp313t-win32.whl", hash = "sha256:c771cfac34a4f2c0de8e8c97312d07d64fd8f8ed45bc9f5726a7e947270152b5", size = 6441832, upload-time = "2025-07-24T20:48:37.181Z" }, - { url = "https://files.pythonhosted.org/packages/0b/ba/0937d66d05204d8f28630c9c60bc3eda68824abde4cf756c4d6aad03b0c6/numpy-2.3.2-cp313-cp313t-win_amd64.whl", hash = "sha256:72dbebb2dcc8305c431b2836bcc66af967df91be793d63a24e3d9b741374c450", size = 12927049, upload-time = "2025-07-24T20:48:56.24Z" }, - { url = "https://files.pythonhosted.org/packages/e9/ed/13542dd59c104d5e654dfa2ac282c199ba64846a74c2c4bcdbc3a0f75df1/numpy-2.3.2-cp313-cp313t-win_arm64.whl", hash = "sha256:72c6df2267e926a6d5286b0a6d556ebe49eae261062059317837fda12ddf0c1a", size = 10262935, upload-time = "2025-07-24T20:49:13.136Z" }, - { url = "https://files.pythonhosted.org/packages/c9/7c/7659048aaf498f7611b783e000c7268fcc4dcf0ce21cd10aad7b2e8f9591/numpy-2.3.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:448a66d052d0cf14ce9865d159bfc403282c9bc7bb2a31b03cc18b651eca8b1a", size = 20950906, upload-time = "2025-07-24T20:50:30.346Z" }, - { url = "https://files.pythonhosted.org/packages/80/db/984bea9d4ddf7112a04cfdfb22b1050af5757864cfffe8e09e44b7f11a10/numpy-2.3.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:546aaf78e81b4081b2eba1d105c3b34064783027a06b3ab20b6eba21fb64132b", size = 14185607, upload-time = "2025-07-24T20:50:51.923Z" }, - { url = "https://files.pythonhosted.org/packages/e4/76/b3d6f414f4eca568f469ac112a3b510938d892bc5a6c190cb883af080b77/numpy-2.3.2-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:87c930d52f45df092f7578889711a0768094debf73cfcde105e2d66954358125", size = 5114110, upload-time = "2025-07-24T20:51:01.041Z" }, - { url = "https://files.pythonhosted.org/packages/9e/d2/6f5e6826abd6bca52392ed88fe44a4b52aacb60567ac3bc86c67834c3a56/numpy-2.3.2-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:8dc082ea901a62edb8f59713c6a7e28a85daddcb67454c839de57656478f5b19", size = 6642050, upload-time = "2025-07-24T20:51:11.64Z" }, - { url = "https://files.pythonhosted.org/packages/c4/43/f12b2ade99199e39c73ad182f103f9d9791f48d885c600c8e05927865baf/numpy-2.3.2-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:af58de8745f7fa9ca1c0c7c943616c6fe28e75d0c81f5c295810e3c83b5be92f", size = 14296292, upload-time = "2025-07-24T20:51:33.488Z" }, - { url = "https://files.pythonhosted.org/packages/5d/f9/77c07d94bf110a916b17210fac38680ed8734c236bfed9982fd8524a7b47/numpy-2.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed5527c4cf10f16c6d0b6bee1f89958bccb0ad2522c8cadc2efd318bcd545f5", size = 16638913, upload-time = "2025-07-24T20:51:58.517Z" }, - { url = "https://files.pythonhosted.org/packages/9b/d1/9d9f2c8ea399cc05cfff8a7437453bd4e7d894373a93cdc46361bbb49a7d/numpy-2.3.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:095737ed986e00393ec18ec0b21b47c22889ae4b0cd2d5e88342e08b01141f58", size = 16071180, upload-time = "2025-07-24T20:52:22.827Z" }, - { url = "https://files.pythonhosted.org/packages/4c/41/82e2c68aff2a0c9bf315e47d61951099fed65d8cb2c8d9dc388cb87e947e/numpy-2.3.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5e40e80299607f597e1a8a247ff8d71d79c5b52baa11cc1cce30aa92d2da6e0", size = 18576809, upload-time = "2025-07-24T20:52:51.015Z" }, - { url = "https://files.pythonhosted.org/packages/14/14/4b4fd3efb0837ed252d0f583c5c35a75121038a8c4e065f2c259be06d2d8/numpy-2.3.2-cp314-cp314-win32.whl", hash = "sha256:7d6e390423cc1f76e1b8108c9b6889d20a7a1f59d9a60cac4a050fa734d6c1e2", size = 6366410, upload-time = "2025-07-24T20:56:44.949Z" }, - { url = "https://files.pythonhosted.org/packages/11/9e/b4c24a6b8467b61aced5c8dc7dcfce23621baa2e17f661edb2444a418040/numpy-2.3.2-cp314-cp314-win_amd64.whl", hash = "sha256:b9d0878b21e3918d76d2209c924ebb272340da1fb51abc00f986c258cd5e957b", size = 12918821, upload-time = "2025-07-24T20:57:06.479Z" }, - { url = "https://files.pythonhosted.org/packages/0e/0f/0dc44007c70b1007c1cef86b06986a3812dd7106d8f946c09cfa75782556/numpy-2.3.2-cp314-cp314-win_arm64.whl", hash = "sha256:2738534837c6a1d0c39340a190177d7d66fdf432894f469728da901f8f6dc910", size = 10477303, upload-time = "2025-07-24T20:57:22.879Z" }, - { url = "https://files.pythonhosted.org/packages/8b/3e/075752b79140b78ddfc9c0a1634d234cfdbc6f9bbbfa6b7504e445ad7d19/numpy-2.3.2-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:4d002ecf7c9b53240be3bb69d80f86ddbd34078bae04d87be81c1f58466f264e", size = 21047524, upload-time = "2025-07-24T20:53:22.086Z" }, - { url = "https://files.pythonhosted.org/packages/fe/6d/60e8247564a72426570d0e0ea1151b95ce5bd2f1597bb878a18d32aec855/numpy-2.3.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:293b2192c6bcce487dbc6326de5853787f870aeb6c43f8f9c6496db5b1781e45", size = 14300519, upload-time = "2025-07-24T20:53:44.053Z" }, - { url = "https://files.pythonhosted.org/packages/4d/73/d8326c442cd428d47a067070c3ac6cc3b651a6e53613a1668342a12d4479/numpy-2.3.2-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:0a4f2021a6da53a0d580d6ef5db29947025ae8b35b3250141805ea9a32bbe86b", size = 5228972, upload-time = "2025-07-24T20:53:53.81Z" }, - { url = "https://files.pythonhosted.org/packages/34/2e/e71b2d6dad075271e7079db776196829019b90ce3ece5c69639e4f6fdc44/numpy-2.3.2-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:9c144440db4bf3bb6372d2c3e49834cc0ff7bb4c24975ab33e01199e645416f2", size = 6737439, upload-time = "2025-07-24T20:54:04.742Z" }, - { url = "https://files.pythonhosted.org/packages/15/b0/d004bcd56c2c5e0500ffc65385eb6d569ffd3363cb5e593ae742749b2daa/numpy-2.3.2-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f92d6c2a8535dc4fe4419562294ff957f83a16ebdec66df0805e473ffaad8bd0", size = 14352479, upload-time = "2025-07-24T20:54:25.819Z" }, - { url = "https://files.pythonhosted.org/packages/11/e3/285142fcff8721e0c99b51686426165059874c150ea9ab898e12a492e291/numpy-2.3.2-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cefc2219baa48e468e3db7e706305fcd0c095534a192a08f31e98d83a7d45fb0", size = 16702805, upload-time = "2025-07-24T20:54:50.814Z" }, - { url = "https://files.pythonhosted.org/packages/33/c3/33b56b0e47e604af2c7cd065edca892d180f5899599b76830652875249a3/numpy-2.3.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:76c3e9501ceb50b2ff3824c3589d5d1ab4ac857b0ee3f8f49629d0de55ecf7c2", size = 16133830, upload-time = "2025-07-24T20:55:17.306Z" }, - { url = "https://files.pythonhosted.org/packages/6e/ae/7b1476a1f4d6a48bc669b8deb09939c56dd2a439db1ab03017844374fb67/numpy-2.3.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:122bf5ed9a0221b3419672493878ba4967121514b1d7d4656a7580cd11dddcbf", size = 18652665, upload-time = "2025-07-24T20:55:46.665Z" }, - { url = "https://files.pythonhosted.org/packages/14/ba/5b5c9978c4bb161034148ade2de9db44ec316fab89ce8c400db0e0c81f86/numpy-2.3.2-cp314-cp314t-win32.whl", hash = "sha256:6f1ae3dcb840edccc45af496f312528c15b1f79ac318169d094e85e4bb35fdf1", size = 6514777, upload-time = "2025-07-24T20:55:57.66Z" }, - { url = "https://files.pythonhosted.org/packages/eb/46/3dbaf0ae7c17cdc46b9f662c56da2054887b8d9e737c1476f335c83d33db/numpy-2.3.2-cp314-cp314t-win_amd64.whl", hash = "sha256:087ffc25890d89a43536f75c5fe8770922008758e8eeeef61733957041ed2f9b", size = 13111856, upload-time = "2025-07-24T20:56:17.318Z" }, - { url = "https://files.pythonhosted.org/packages/c1/9e/1652778bce745a67b5fe05adde60ed362d38eb17d919a540e813d30f6874/numpy-2.3.2-cp314-cp314t-win_arm64.whl", hash = "sha256:092aeb3449833ea9c0bf0089d70c29ae480685dd2377ec9cdbbb620257f84631", size = 10544226, upload-time = "2025-07-24T20:56:34.509Z" }, - { url = "https://files.pythonhosted.org/packages/cf/ea/50ebc91d28b275b23b7128ef25c3d08152bc4068f42742867e07a870a42a/numpy-2.3.2-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:14a91ebac98813a49bc6aa1a0dfc09513dcec1d97eaf31ca21a87221a1cdcb15", size = 21130338, upload-time = "2025-07-24T20:57:54.37Z" }, - { url = "https://files.pythonhosted.org/packages/9f/57/cdd5eac00dd5f137277355c318a955c0d8fb8aa486020c22afd305f8b88f/numpy-2.3.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:71669b5daae692189540cffc4c439468d35a3f84f0c88b078ecd94337f6cb0ec", size = 14375776, upload-time = "2025-07-24T20:58:16.303Z" }, - { url = "https://files.pythonhosted.org/packages/83/85/27280c7f34fcd305c2209c0cdca4d70775e4859a9eaa92f850087f8dea50/numpy-2.3.2-pp311-pypy311_pp73-macosx_14_0_arm64.whl", hash = "sha256:69779198d9caee6e547adb933941ed7520f896fd9656834c300bdf4dd8642712", size = 5304882, upload-time = "2025-07-24T20:58:26.199Z" }, - { url = "https://files.pythonhosted.org/packages/48/b4/6500b24d278e15dd796f43824e69939d00981d37d9779e32499e823aa0aa/numpy-2.3.2-pp311-pypy311_pp73-macosx_14_0_x86_64.whl", hash = "sha256:2c3271cc4097beb5a60f010bcc1cc204b300bb3eafb4399376418a83a1c6373c", size = 6818405, upload-time = "2025-07-24T20:58:37.341Z" }, - { url = "https://files.pythonhosted.org/packages/9b/c9/142c1e03f199d202da8e980c2496213509291b6024fd2735ad28ae7065c7/numpy-2.3.2-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8446acd11fe3dc1830568c941d44449fd5cb83068e5c70bd5a470d323d448296", size = 14419651, upload-time = "2025-07-24T20:58:59.048Z" }, - { url = "https://files.pythonhosted.org/packages/8b/95/8023e87cbea31a750a6c00ff9427d65ebc5fef104a136bfa69f76266d614/numpy-2.3.2-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:aa098a5ab53fa407fded5870865c6275a5cd4101cfdef8d6fafc48286a96e981", size = 16760166, upload-time = "2025-07-24T21:28:56.38Z" }, - { url = "https://files.pythonhosted.org/packages/78/e3/6690b3f85a05506733c7e90b577e4762517404ea78bab2ca3a5cb1aeb78d/numpy-2.3.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:6936aff90dda378c09bea075af0d9c675fe3a977a9d2402f95a87f440f59f619", size = 12977811, upload-time = "2025-07-24T21:29:18.234Z" }, -] - -[[package]] -name = "packaging" -version = "24.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950, upload-time = "2024-11-08T09:47:47.202Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451, upload-time = "2024-11-08T09:47:44.722Z" }, -] - -[[package]] -name = "paginate" -version = "0.5.7" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ec/46/68dde5b6bc00c1296ec6466ab27dddede6aec9af1b99090e1107091b3b84/paginate-0.5.7.tar.gz", hash = "sha256:22bd083ab41e1a8b4f3690544afb2c60c25e5c9a63a30fa2f483f6c60c8e5945", size = 19252, upload-time = "2024-08-25T14:17:24.139Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/90/96/04b8e52da071d28f5e21a805b19cb9390aa17a47462ac87f5e2696b9566d/paginate-0.5.7-py2.py3-none-any.whl", hash = "sha256:b885e2af73abcf01d9559fd5216b57ef722f8c42affbb63942377668e35c7591", size = 13746, upload-time = "2024-08-25T14:17:22.55Z" }, -] - -[[package]] -name = "pandas" -version = "2.2.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "numpy" }, - { name = "python-dateutil" }, - { name = "pytz" }, - { name = "tzdata" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9c/d6/9f8431bacc2e19dca897724cd097b1bb224a6ad5433784a44b587c7c13af/pandas-2.2.3.tar.gz", hash = "sha256:4f18ba62b61d7e192368b84517265a99b4d7ee8912f8708660fb4a366cc82667", size = 4399213, upload-time = "2024-09-20T13:10:04.827Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a8/44/d9502bf0ed197ba9bf1103c9867d5904ddcaf869e52329787fc54ed70cc8/pandas-2.2.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:66108071e1b935240e74525006034333f98bcdb87ea116de573a6a0dccb6c039", size = 12602222, upload-time = "2024-09-20T13:08:56.254Z" }, - { url = "https://files.pythonhosted.org/packages/52/11/9eac327a38834f162b8250aab32a6781339c69afe7574368fffe46387edf/pandas-2.2.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7c2875855b0ff77b2a64a0365e24455d9990730d6431b9e0ee18ad8acee13dbd", size = 11321274, upload-time = "2024-09-20T13:08:58.645Z" }, - { url = "https://files.pythonhosted.org/packages/45/fb/c4beeb084718598ba19aa9f5abbc8aed8b42f90930da861fcb1acdb54c3a/pandas-2.2.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd8d0c3be0515c12fed0bdbae072551c8b54b7192c7b1fda0ba56059a0179698", size = 15579836, upload-time = "2024-09-20T19:01:57.571Z" }, - { url = "https://files.pythonhosted.org/packages/cd/5f/4dba1d39bb9c38d574a9a22548c540177f78ea47b32f99c0ff2ec499fac5/pandas-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c124333816c3a9b03fbeef3a9f230ba9a737e9e5bb4060aa2107a86cc0a497fc", size = 13058505, upload-time = "2024-09-20T13:09:01.501Z" }, - { url = "https://files.pythonhosted.org/packages/b9/57/708135b90391995361636634df1f1130d03ba456e95bcf576fada459115a/pandas-2.2.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:63cc132e40a2e084cf01adf0775b15ac515ba905d7dcca47e9a251819c575ef3", size = 16744420, upload-time = "2024-09-20T19:02:00.678Z" }, - { url = "https://files.pythonhosted.org/packages/86/4a/03ed6b7ee323cf30404265c284cee9c65c56a212e0a08d9ee06984ba2240/pandas-2.2.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:29401dbfa9ad77319367d36940cd8a0b3a11aba16063e39632d98b0e931ddf32", size = 14440457, upload-time = "2024-09-20T13:09:04.105Z" }, - { url = "https://files.pythonhosted.org/packages/ed/8c/87ddf1fcb55d11f9f847e3c69bb1c6f8e46e2f40ab1a2d2abadb2401b007/pandas-2.2.3-cp311-cp311-win_amd64.whl", hash = "sha256:3fc6873a41186404dad67245896a6e440baacc92f5b716ccd1bc9ed2995ab2c5", size = 11617166, upload-time = "2024-09-20T13:09:06.917Z" }, - { url = "https://files.pythonhosted.org/packages/17/a3/fb2734118db0af37ea7433f57f722c0a56687e14b14690edff0cdb4b7e58/pandas-2.2.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b1d432e8d08679a40e2a6d8b2f9770a5c21793a6f9f47fdd52c5ce1948a5a8a9", size = 12529893, upload-time = "2024-09-20T13:09:09.655Z" }, - { url = "https://files.pythonhosted.org/packages/e1/0c/ad295fd74bfac85358fd579e271cded3ac969de81f62dd0142c426b9da91/pandas-2.2.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a5a1595fe639f5988ba6a8e5bc9649af3baf26df3998a0abe56c02609392e0a4", size = 11363475, upload-time = "2024-09-20T13:09:14.718Z" }, - { url = "https://files.pythonhosted.org/packages/c6/2a/4bba3f03f7d07207481fed47f5b35f556c7441acddc368ec43d6643c5777/pandas-2.2.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5de54125a92bb4d1c051c0659e6fcb75256bf799a732a87184e5ea503965bce3", size = 15188645, upload-time = "2024-09-20T19:02:03.88Z" }, - { url = "https://files.pythonhosted.org/packages/38/f8/d8fddee9ed0d0c0f4a2132c1dfcf0e3e53265055da8df952a53e7eaf178c/pandas-2.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fffb8ae78d8af97f849404f21411c95062db1496aeb3e56f146f0355c9989319", size = 12739445, upload-time = "2024-09-20T13:09:17.621Z" }, - { url = "https://files.pythonhosted.org/packages/20/e8/45a05d9c39d2cea61ab175dbe6a2de1d05b679e8de2011da4ee190d7e748/pandas-2.2.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6dfcb5ee8d4d50c06a51c2fffa6cff6272098ad6540aed1a76d15fb9318194d8", size = 16359235, upload-time = "2024-09-20T19:02:07.094Z" }, - { url = "https://files.pythonhosted.org/packages/1d/99/617d07a6a5e429ff90c90da64d428516605a1ec7d7bea494235e1c3882de/pandas-2.2.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:062309c1b9ea12a50e8ce661145c6aab431b1e99530d3cd60640e255778bd43a", size = 14056756, upload-time = "2024-09-20T13:09:20.474Z" }, - { url = "https://files.pythonhosted.org/packages/29/d4/1244ab8edf173a10fd601f7e13b9566c1b525c4f365d6bee918e68381889/pandas-2.2.3-cp312-cp312-win_amd64.whl", hash = "sha256:59ef3764d0fe818125a5097d2ae867ca3fa64df032331b7e0917cf5d7bf66b13", size = 11504248, upload-time = "2024-09-20T13:09:23.137Z" }, - { url = "https://files.pythonhosted.org/packages/64/22/3b8f4e0ed70644e85cfdcd57454686b9057c6c38d2f74fe4b8bc2527214a/pandas-2.2.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f00d1345d84d8c86a63e476bb4955e46458b304b9575dcf71102b5c705320015", size = 12477643, upload-time = "2024-09-20T13:09:25.522Z" }, - { url = "https://files.pythonhosted.org/packages/e4/93/b3f5d1838500e22c8d793625da672f3eec046b1a99257666c94446969282/pandas-2.2.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3508d914817e153ad359d7e069d752cdd736a247c322d932eb89e6bc84217f28", size = 11281573, upload-time = "2024-09-20T13:09:28.012Z" }, - { url = "https://files.pythonhosted.org/packages/f5/94/6c79b07f0e5aab1dcfa35a75f4817f5c4f677931d4234afcd75f0e6a66ca/pandas-2.2.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22a9d949bfc9a502d320aa04e5d02feab689d61da4e7764b62c30b991c42c5f0", size = 15196085, upload-time = "2024-09-20T19:02:10.451Z" }, - { url = "https://files.pythonhosted.org/packages/e8/31/aa8da88ca0eadbabd0a639788a6da13bb2ff6edbbb9f29aa786450a30a91/pandas-2.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3a255b2c19987fbbe62a9dfd6cff7ff2aa9ccab3fc75218fd4b7530f01efa24", size = 12711809, upload-time = "2024-09-20T13:09:30.814Z" }, - { url = "https://files.pythonhosted.org/packages/ee/7c/c6dbdb0cb2a4344cacfb8de1c5808ca885b2e4dcfde8008266608f9372af/pandas-2.2.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:800250ecdadb6d9c78eae4990da62743b857b470883fa27f652db8bdde7f6659", size = 16356316, upload-time = "2024-09-20T19:02:13.825Z" }, - { url = "https://files.pythonhosted.org/packages/57/b7/8b757e7d92023b832869fa8881a992696a0bfe2e26f72c9ae9f255988d42/pandas-2.2.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6374c452ff3ec675a8f46fd9ab25c4ad0ba590b71cf0656f8b6daa5202bca3fb", size = 14022055, upload-time = "2024-09-20T13:09:33.462Z" }, - { url = "https://files.pythonhosted.org/packages/3b/bc/4b18e2b8c002572c5a441a64826252ce5da2aa738855747247a971988043/pandas-2.2.3-cp313-cp313-win_amd64.whl", hash = "sha256:61c5ad4043f791b61dd4752191d9f07f0ae412515d59ba8f005832a532f8736d", size = 11481175, upload-time = "2024-09-20T13:09:35.871Z" }, - { url = "https://files.pythonhosted.org/packages/76/a3/a5d88146815e972d40d19247b2c162e88213ef51c7c25993942c39dbf41d/pandas-2.2.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:3b71f27954685ee685317063bf13c7709a7ba74fc996b84fc6821c59b0f06468", size = 12615650, upload-time = "2024-09-20T13:09:38.685Z" }, - { url = "https://files.pythonhosted.org/packages/9c/8c/f0fd18f6140ddafc0c24122c8a964e48294acc579d47def376fef12bcb4a/pandas-2.2.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:38cf8125c40dae9d5acc10fa66af8ea6fdf760b2714ee482ca691fc66e6fcb18", size = 11290177, upload-time = "2024-09-20T13:09:41.141Z" }, - { url = "https://files.pythonhosted.org/packages/ed/f9/e995754eab9c0f14c6777401f7eece0943840b7a9fc932221c19d1abee9f/pandas-2.2.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ba96630bc17c875161df3818780af30e43be9b166ce51c9a18c1feae342906c2", size = 14651526, upload-time = "2024-09-20T19:02:16.905Z" }, - { url = "https://files.pythonhosted.org/packages/25/b0/98d6ae2e1abac4f35230aa756005e8654649d305df9a28b16b9ae4353bff/pandas-2.2.3-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1db71525a1538b30142094edb9adc10be3f3e176748cd7acc2240c2f2e5aa3a4", size = 11871013, upload-time = "2024-09-20T13:09:44.39Z" }, - { url = "https://files.pythonhosted.org/packages/cc/57/0f72a10f9db6a4628744c8e8f0df4e6e21de01212c7c981d31e50ffc8328/pandas-2.2.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:15c0e1e02e93116177d29ff83e8b1619c93ddc9c49083f237d4312337a61165d", size = 15711620, upload-time = "2024-09-20T19:02:20.639Z" }, - { url = "https://files.pythonhosted.org/packages/ab/5f/b38085618b950b79d2d9164a711c52b10aefc0ae6833b96f626b7021b2ed/pandas-2.2.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:ad5b65698ab28ed8d7f18790a0dc58005c7629f227be9ecc1072aa74c0c1d43a", size = 13098436, upload-time = "2024-09-20T13:09:48.112Z" }, -] - -[[package]] -name = "pathspec" -version = "0.12.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ca/bc/f35b8446f4531a7cb215605d100cd88b7ac6f44ab3fc94870c120ab3adbf/pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712", size = 51043, upload-time = "2023-12-10T22:30:45Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191, upload-time = "2023-12-10T22:30:43.14Z" }, -] - -[[package]] -name = "pkginfo" -version = "1.10.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/2f/72/347ec5be4adc85c182ed2823d8d1c7b51e13b9a6b0c1aae59582eca652df/pkginfo-1.10.0.tar.gz", hash = "sha256:5df73835398d10db79f8eecd5cd86b1f6d29317589ea70796994d49399af6297", size = 378457, upload-time = "2024-03-03T08:34:21.011Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/56/09/054aea9b7534a15ad38a363a2bd974c20646ab1582a387a95b8df1bfea1c/pkginfo-1.10.0-py3-none-any.whl", hash = "sha256:889a6da2ed7ffc58ab5b900d888ddce90bce912f2d2de1dc1c26f4cb9fe65097", size = 30392, upload-time = "2024-03-03T08:34:18.891Z" }, -] - -[[package]] -name = "platformdirs" -version = "4.3.7" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b6/2d/7d512a3913d60623e7eb945c6d1b4f0bddf1d0b7ada5225274c87e5b53d1/platformdirs-4.3.7.tar.gz", hash = "sha256:eb437d586b6a0986388f0d6f74aa0cde27b48d0e3d66843640bfb6bdcdb6e351", size = 21291, upload-time = "2025-03-19T20:36:10.989Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6d/45/59578566b3275b8fd9157885918fcd0c4d74162928a5310926887b856a51/platformdirs-4.3.7-py3-none-any.whl", hash = "sha256:a03875334331946f13c549dbd8f4bac7a13a50a895a0eb1e8c6a8ace80d40a94", size = 18499, upload-time = "2025-03-19T20:36:09.038Z" }, -] - -[[package]] -name = "plotly" -version = "5.24.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "packaging" }, - { name = "tenacity" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/79/4f/428f6d959818d7425a94c190a6b26fbc58035cbef40bf249be0b62a9aedd/plotly-5.24.1.tar.gz", hash = "sha256:dbc8ac8339d248a4bcc36e08a5659bacfe1b079390b8953533f4eb22169b4bae", size = 9479398, upload-time = "2024-09-12T15:36:31.068Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/ae/580600f441f6fc05218bd6c9d5794f4aef072a7d9093b291f1c50a9db8bc/plotly-5.24.1-py3-none-any.whl", hash = "sha256:f67073a1e637eb0dc3e46324d9d51e2fe76e9727c892dde64ddf1e1b51f29089", size = 19054220, upload-time = "2024-09-12T15:36:24.08Z" }, -] - -[[package]] -name = "pluggy" -version = "1.5.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955, upload-time = "2024-04-20T21:34:42.531Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" }, -] - -[[package]] -name = "psutil" -version = "5.9.8" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/90/c7/6dc0a455d111f68ee43f27793971cf03fe29b6ef972042549db29eec39a2/psutil-5.9.8.tar.gz", hash = "sha256:6be126e3225486dff286a8fb9a06246a5253f4c7c53b475ea5f5ac934e64194c", size = 503247, upload-time = "2024-01-19T20:47:09.517Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e7/e3/07ae864a636d70a8a6f58da27cb1179192f1140d5d1da10886ade9405797/psutil-5.9.8-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:aee678c8720623dc456fa20659af736241f575d79429a0e5e9cf88ae0605cc81", size = 248702, upload-time = "2024-01-19T20:47:36.303Z" }, - { url = "https://files.pythonhosted.org/packages/b3/bd/28c5f553667116b2598b9cc55908ec435cb7f77a34f2bff3e3ca765b0f78/psutil-5.9.8-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cb6403ce6d8e047495a701dc7c5bd788add903f8986d523e3e20b98b733e421", size = 285242, upload-time = "2024-01-19T20:47:39.65Z" }, - { url = "https://files.pythonhosted.org/packages/c5/4f/0e22aaa246f96d6ac87fe5ebb9c5a693fbe8877f537a1022527c47ca43c5/psutil-5.9.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d06016f7f8625a1825ba3732081d77c94589dca78b7a3fc072194851e88461a4", size = 288191, upload-time = "2024-01-19T20:47:43.078Z" }, - { url = "https://files.pythonhosted.org/packages/6e/f5/2aa3a4acdc1e5940b59d421742356f133185667dd190b166dbcfcf5d7b43/psutil-5.9.8-cp37-abi3-win32.whl", hash = "sha256:bc56c2a1b0d15aa3eaa5a60c9f3f8e3e565303b465dbf57a1b730e7a2b9844e0", size = 251252, upload-time = "2024-01-19T20:47:52.88Z" }, - { url = "https://files.pythonhosted.org/packages/93/52/3e39d26feae7df0aa0fd510b14012c3678b36ed068f7d78b8d8784d61f0e/psutil-5.9.8-cp37-abi3-win_amd64.whl", hash = "sha256:8db4c1b57507eef143a15a6884ca10f7c73876cdf5d51e713151c1236a0e68cf", size = 255090, upload-time = "2024-01-19T20:47:56.019Z" }, - { url = "https://files.pythonhosted.org/packages/05/33/2d74d588408caedd065c2497bdb5ef83ce6082db01289a1e1147f6639802/psutil-5.9.8-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:d16bbddf0693323b8c6123dd804100241da461e41d6e332fb0ba6058f630f8c8", size = 249898, upload-time = "2024-01-19T20:47:59.238Z" }, -] - -[[package]] -name = "pycparser" -version = "2.22" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6", size = 172736, upload-time = "2024-03-30T13:22:22.564Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc", size = 117552, upload-time = "2024-03-30T13:22:20.476Z" }, -] - -[[package]] -name = "pygments" -version = "2.19.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581, upload-time = "2025-01-06T17:26:30.443Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" }, -] - -[[package]] -name = "pymdown-extensions" -version = "10.14.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "markdown" }, - { name = "pyyaml" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/7c/44/e6de2fdc880ad0ec7547ca2e087212be815efbc9a425a8d5ba9ede602cbb/pymdown_extensions-10.14.3.tar.gz", hash = "sha256:41e576ce3f5d650be59e900e4ceff231e0aed2a88cf30acaee41e02f063a061b", size = 846846, upload-time = "2025-02-01T15:43:15.42Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/f5/b9e2a42aa8f9e34d52d66de87941ecd236570c7ed2e87775ed23bbe4e224/pymdown_extensions-10.14.3-py3-none-any.whl", hash = "sha256:05e0bee73d64b9c71a4ae17c72abc2f700e8bc8403755a00580b49a4e9f189e9", size = 264467, upload-time = "2025-02-01T15:43:13.995Z" }, -] - -[[package]] -name = "pytest" -version = "8.3.5" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "iniconfig" }, - { name = "packaging" }, - { name = "pluggy" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891, upload-time = "2025-03-02T12:54:54.503Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634, upload-time = "2025-03-02T12:54:52.069Z" }, -] - -[[package]] -name = "pytest-cov" -version = "5.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "coverage", extra = ["toml"] }, - { name = "pytest" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/74/67/00efc8d11b630c56f15f4ad9c7f9223f1e5ec275aaae3fa9118c6a223ad2/pytest-cov-5.0.0.tar.gz", hash = "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857", size = 63042, upload-time = "2024-03-24T20:16:34.856Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/78/3a/af5b4fa5961d9a1e6237b530eb87dd04aea6eb83da09d2a4073d81b54ccf/pytest_cov-5.0.0-py3-none-any.whl", hash = "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652", size = 21990, upload-time = "2024-03-24T20:16:32.444Z" }, -] - -[[package]] -name = "python-dateutil" -version = "2.9.0.post0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "six" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, -] - -[[package]] -name = "pytz" -version = "2025.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f8/bf/abbd3cdfb8fbc7fb3d4d38d320f2441b1e7cbe29be4f23797b4a2b5d8aac/pytz-2025.2.tar.gz", hash = "sha256:360b9e3dbb49a209c21ad61809c7fb453643e048b38924c765813546746e81c3", size = 320884, upload-time = "2025-03-25T02:25:00.538Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/81/c4/34e93fe5f5429d7570ec1fa436f1986fb1f00c3e0f43a589fe2bbcd22c3f/pytz-2025.2-py2.py3-none-any.whl", hash = "sha256:5ddf76296dd8c44c26eb8f4b6f35488f3ccbf6fbbd7adee0b7262d43f0ec2f00", size = 509225, upload-time = "2025-03-25T02:24:58.468Z" }, -] - -[[package]] -name = "pywin32-ctypes" -version = "0.2.3" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/85/9f/01a1a99704853cb63f253eea009390c88e7131c67e66a0a02099a8c917cb/pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755", size = 29471, upload-time = "2024-08-14T10:15:34.626Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/de/3d/8161f7711c017e01ac9f008dfddd9410dff3674334c233bde66e7ba65bbf/pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8", size = 30756, upload-time = "2024-08-14T10:15:33.187Z" }, -] - -[[package]] -name = "pyyaml" -version = "6.0.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size = 130631, upload-time = "2024-08-06T20:33:50.674Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f8/aa/7af4e81f7acba21a4c6be026da38fd2b872ca46226673c89a758ebdc4fd2/PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774", size = 184612, upload-time = "2024-08-06T20:32:03.408Z" }, - { url = "https://files.pythonhosted.org/packages/8b/62/b9faa998fd185f65c1371643678e4d58254add437edb764a08c5a98fb986/PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee", size = 172040, upload-time = "2024-08-06T20:32:04.926Z" }, - { url = "https://files.pythonhosted.org/packages/ad/0c/c804f5f922a9a6563bab712d8dcc70251e8af811fce4524d57c2c0fd49a4/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c", size = 736829, upload-time = "2024-08-06T20:32:06.459Z" }, - { url = "https://files.pythonhosted.org/packages/51/16/6af8d6a6b210c8e54f1406a6b9481febf9c64a3109c541567e35a49aa2e7/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317", size = 764167, upload-time = "2024-08-06T20:32:08.338Z" }, - { url = "https://files.pythonhosted.org/packages/75/e4/2c27590dfc9992f73aabbeb9241ae20220bd9452df27483b6e56d3975cc5/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85", size = 762952, upload-time = "2024-08-06T20:32:14.124Z" }, - { url = "https://files.pythonhosted.org/packages/9b/97/ecc1abf4a823f5ac61941a9c00fe501b02ac3ab0e373c3857f7d4b83e2b6/PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4", size = 735301, upload-time = "2024-08-06T20:32:16.17Z" }, - { url = "https://files.pythonhosted.org/packages/45/73/0f49dacd6e82c9430e46f4a027baa4ca205e8b0a9dce1397f44edc23559d/PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e", size = 756638, upload-time = "2024-08-06T20:32:18.555Z" }, - { url = "https://files.pythonhosted.org/packages/22/5f/956f0f9fc65223a58fbc14459bf34b4cc48dec52e00535c79b8db361aabd/PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5", size = 143850, upload-time = "2024-08-06T20:32:19.889Z" }, - { url = "https://files.pythonhosted.org/packages/ed/23/8da0bbe2ab9dcdd11f4f4557ccaf95c10b9811b13ecced089d43ce59c3c8/PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44", size = 161980, upload-time = "2024-08-06T20:32:21.273Z" }, - { url = "https://files.pythonhosted.org/packages/86/0c/c581167fc46d6d6d7ddcfb8c843a4de25bdd27e4466938109ca68492292c/PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", size = 183873, upload-time = "2024-08-06T20:32:25.131Z" }, - { url = "https://files.pythonhosted.org/packages/a8/0c/38374f5bb272c051e2a69281d71cba6fdb983413e6758b84482905e29a5d/PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", size = 173302, upload-time = "2024-08-06T20:32:26.511Z" }, - { url = "https://files.pythonhosted.org/packages/c3/93/9916574aa8c00aa06bbac729972eb1071d002b8e158bd0e83a3b9a20a1f7/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", size = 739154, upload-time = "2024-08-06T20:32:28.363Z" }, - { url = "https://files.pythonhosted.org/packages/95/0f/b8938f1cbd09739c6da569d172531567dbcc9789e0029aa070856f123984/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", size = 766223, upload-time = "2024-08-06T20:32:30.058Z" }, - { url = "https://files.pythonhosted.org/packages/b9/2b/614b4752f2e127db5cc206abc23a8c19678e92b23c3db30fc86ab731d3bd/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", size = 767542, upload-time = "2024-08-06T20:32:31.881Z" }, - { url = "https://files.pythonhosted.org/packages/d4/00/dd137d5bcc7efea1836d6264f049359861cf548469d18da90cd8216cf05f/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", size = 731164, upload-time = "2024-08-06T20:32:37.083Z" }, - { url = "https://files.pythonhosted.org/packages/c9/1f/4f998c900485e5c0ef43838363ba4a9723ac0ad73a9dc42068b12aaba4e4/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", size = 756611, upload-time = "2024-08-06T20:32:38.898Z" }, - { url = "https://files.pythonhosted.org/packages/df/d1/f5a275fdb252768b7a11ec63585bc38d0e87c9e05668a139fea92b80634c/PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", size = 140591, upload-time = "2024-08-06T20:32:40.241Z" }, - { url = "https://files.pythonhosted.org/packages/0c/e8/4f648c598b17c3d06e8753d7d13d57542b30d56e6c2dedf9c331ae56312e/PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", size = 156338, upload-time = "2024-08-06T20:32:41.93Z" }, - { url = "https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size = 181309, upload-time = "2024-08-06T20:32:43.4Z" }, - { url = "https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size = 171679, upload-time = "2024-08-06T20:32:44.801Z" }, - { url = "https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size = 733428, upload-time = "2024-08-06T20:32:46.432Z" }, - { url = "https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size = 763361, upload-time = "2024-08-06T20:32:51.188Z" }, - { url = "https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size = 759523, upload-time = "2024-08-06T20:32:53.019Z" }, - { url = "https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size = 726660, upload-time = "2024-08-06T20:32:54.708Z" }, - { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597, upload-time = "2024-08-06T20:32:56.985Z" }, - { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527, upload-time = "2024-08-06T20:33:03.001Z" }, - { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446, upload-time = "2024-08-06T20:33:04.33Z" }, -] - -[[package]] -name = "pyyaml-env-tag" -version = "0.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pyyaml" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fb/8e/da1c6c58f751b70f8ceb1eb25bc25d524e8f14fe16edcce3f4e3ba08629c/pyyaml_env_tag-0.1.tar.gz", hash = "sha256:70092675bda14fdec33b31ba77e7543de9ddc88f2e5b99160396572d11525bdb", size = 5631, upload-time = "2020-11-12T02:38:26.239Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/66/bbb1dd374f5c870f59c5bb1db0e18cbe7fa739415a24cbd95b2d1f5ae0c4/pyyaml_env_tag-0.1-py3-none-any.whl", hash = "sha256:af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069", size = 3911, upload-time = "2020-11-12T02:38:24.638Z" }, -] - -[[package]] -name = "readme-renderer" -version = "44.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "docutils" }, - { name = "nh3" }, - { name = "pygments" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/5a/a9/104ec9234c8448c4379768221ea6df01260cd6c2ce13182d4eac531c8342/readme_renderer-44.0.tar.gz", hash = "sha256:8712034eabbfa6805cacf1402b4eeb2a73028f72d1166d6f5cb7f9c047c5d1e1", size = 32056, upload-time = "2024-07-08T15:00:57.805Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e1/67/921ec3024056483db83953ae8e48079ad62b92db7880013ca77632921dd0/readme_renderer-44.0-py3-none-any.whl", hash = "sha256:2fbca89b81a08526aadf1357a8c2ae889ec05fb03f5da67f9769c9a592166151", size = 13310, upload-time = "2024-07-08T15:00:56.577Z" }, -] - -[[package]] -name = "requests" -version = "2.32.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "charset-normalizer" }, - { name = "idna" }, - { name = "urllib3" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", size = 131218, upload-time = "2024-05-29T15:37:49.536Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", size = 64928, upload-time = "2024-05-29T15:37:47.027Z" }, -] - -[[package]] -name = "requests-toolbelt" -version = "1.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "requests" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f3/61/d7545dafb7ac2230c70d38d31cbfe4cc64f7144dc41f6e4e4b78ecd9f5bb/requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6", size = 206888, upload-time = "2023-05-01T04:11:33.229Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3f/51/d4db610ef29373b879047326cbf6fa98b6c1969d6f6dc423279de2b1be2c/requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06", size = 54481, upload-time = "2023-05-01T04:11:28.427Z" }, -] - -[[package]] -name = "rfc3986" -version = "2.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/85/40/1520d68bfa07ab5a6f065a186815fb6610c86fe957bc065754e47f7b0840/rfc3986-2.0.0.tar.gz", hash = "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c", size = 49026, upload-time = "2022-01-10T00:52:30.832Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ff/9a/9afaade874b2fa6c752c36f1548f718b5b83af81ed9b76628329dab81c1b/rfc3986-2.0.0-py2.py3-none-any.whl", hash = "sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd", size = 31326, upload-time = "2022-01-10T00:52:29.594Z" }, -] - -[[package]] -name = "rich" -version = "13.9.4" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "markdown-it-py" }, - { name = "pygments" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ab/3a/0316b28d0761c6734d6bc14e770d85506c986c85ffb239e688eeaab2c2bc/rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098", size = 223149, upload-time = "2024-11-01T16:43:57.873Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/19/71/39c7c0d87f8d4e6c020a393182060eaefeeae6c01dab6a84ec346f2567df/rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90", size = 242424, upload-time = "2024-11-01T16:43:55.817Z" }, -] - -[[package]] -name = "ruff" -version = "0.11.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d9/11/bcef6784c7e5d200b8a1f5c2ddf53e5da0efec37e6e5a44d163fb97e04ba/ruff-0.11.6.tar.gz", hash = "sha256:bec8bcc3ac228a45ccc811e45f7eb61b950dbf4cf31a67fa89352574b01c7d79", size = 4010053, upload-time = "2025-04-17T13:35:53.905Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6e/1f/8848b625100ebcc8740c8bac5b5dd8ba97dd4ee210970e98832092c1635b/ruff-0.11.6-py3-none-linux_armv6l.whl", hash = "sha256:d84dcbe74cf9356d1bdb4a78cf74fd47c740bf7bdeb7529068f69b08272239a1", size = 10248105, upload-time = "2025-04-17T13:35:14.758Z" }, - { url = "https://files.pythonhosted.org/packages/e0/47/c44036e70c6cc11e6ee24399c2a1e1f1e99be5152bd7dff0190e4b325b76/ruff-0.11.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9bc583628e1096148011a5d51ff3c836f51899e61112e03e5f2b1573a9b726de", size = 11001494, upload-time = "2025-04-17T13:35:18.444Z" }, - { url = "https://files.pythonhosted.org/packages/ed/5b/170444061650202d84d316e8f112de02d092bff71fafe060d3542f5bc5df/ruff-0.11.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f2959049faeb5ba5e3b378709e9d1bf0cab06528b306b9dd6ebd2a312127964a", size = 10352151, upload-time = "2025-04-17T13:35:20.563Z" }, - { url = "https://files.pythonhosted.org/packages/ff/91/f02839fb3787c678e112c8865f2c3e87cfe1744dcc96ff9fc56cfb97dda2/ruff-0.11.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63c5d4e30d9d0de7fedbfb3e9e20d134b73a30c1e74b596f40f0629d5c28a193", size = 10541951, upload-time = "2025-04-17T13:35:22.522Z" }, - { url = "https://files.pythonhosted.org/packages/9e/f3/c09933306096ff7a08abede3cc2534d6fcf5529ccd26504c16bf363989b5/ruff-0.11.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26a4b9a4e1439f7d0a091c6763a100cef8fbdc10d68593df6f3cfa5abdd9246e", size = 10079195, upload-time = "2025-04-17T13:35:24.485Z" }, - { url = "https://files.pythonhosted.org/packages/e0/0d/a87f8933fccbc0d8c653cfbf44bedda69c9582ba09210a309c066794e2ee/ruff-0.11.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b5edf270223dd622218256569636dc3e708c2cb989242262fe378609eccf1308", size = 11698918, upload-time = "2025-04-17T13:35:26.504Z" }, - { url = "https://files.pythonhosted.org/packages/52/7d/8eac0bd083ea8a0b55b7e4628428203441ca68cd55e0b67c135a4bc6e309/ruff-0.11.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f55844e818206a9dd31ff27f91385afb538067e2dc0beb05f82c293ab84f7d55", size = 12319426, upload-time = "2025-04-17T13:35:28.452Z" }, - { url = "https://files.pythonhosted.org/packages/c2/dc/d0c17d875662d0c86fadcf4ca014ab2001f867621b793d5d7eef01b9dcce/ruff-0.11.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d8f782286c5ff562e4e00344f954b9320026d8e3fae2ba9e6948443fafd9ffc", size = 11791012, upload-time = "2025-04-17T13:35:30.455Z" }, - { url = "https://files.pythonhosted.org/packages/f9/f3/81a1aea17f1065449a72509fc7ccc3659cf93148b136ff2a8291c4bc3ef1/ruff-0.11.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:01c63ba219514271cee955cd0adc26a4083df1956d57847978383b0e50ffd7d2", size = 13949947, upload-time = "2025-04-17T13:35:33.133Z" }, - { url = "https://files.pythonhosted.org/packages/61/9f/a3e34de425a668284e7024ee6fd41f452f6fa9d817f1f3495b46e5e3a407/ruff-0.11.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15adac20ef2ca296dd3d8e2bedc6202ea6de81c091a74661c3666e5c4c223ff6", size = 11471753, upload-time = "2025-04-17T13:35:35.416Z" }, - { url = "https://files.pythonhosted.org/packages/df/c5/4a57a86d12542c0f6e2744f262257b2aa5a3783098ec14e40f3e4b3a354a/ruff-0.11.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4dd6b09e98144ad7aec026f5588e493c65057d1b387dd937d7787baa531d9bc2", size = 10417121, upload-time = "2025-04-17T13:35:38.224Z" }, - { url = "https://files.pythonhosted.org/packages/58/3f/a3b4346dff07ef5b862e2ba06d98fcbf71f66f04cf01d375e871382b5e4b/ruff-0.11.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:45b2e1d6c0eed89c248d024ea95074d0e09988d8e7b1dad8d3ab9a67017a5b03", size = 10073829, upload-time = "2025-04-17T13:35:40.255Z" }, - { url = "https://files.pythonhosted.org/packages/93/cc/7ed02e0b86a649216b845b3ac66ed55d8aa86f5898c5f1691797f408fcb9/ruff-0.11.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:bd40de4115b2ec4850302f1a1d8067f42e70b4990b68838ccb9ccd9f110c5e8b", size = 11076108, upload-time = "2025-04-17T13:35:42.559Z" }, - { url = "https://files.pythonhosted.org/packages/39/5e/5b09840fef0eff1a6fa1dea6296c07d09c17cb6fb94ed5593aa591b50460/ruff-0.11.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:77cda2dfbac1ab73aef5e514c4cbfc4ec1fbef4b84a44c736cc26f61b3814cd9", size = 11512366, upload-time = "2025-04-17T13:35:45.702Z" }, - { url = "https://files.pythonhosted.org/packages/6f/4c/1cd5a84a412d3626335ae69f5f9de2bb554eea0faf46deb1f0cb48534042/ruff-0.11.6-py3-none-win32.whl", hash = "sha256:5151a871554be3036cd6e51d0ec6eef56334d74dfe1702de717a995ee3d5b287", size = 10485900, upload-time = "2025-04-17T13:35:47.695Z" }, - { url = "https://files.pythonhosted.org/packages/42/46/8997872bc44d43df986491c18d4418f1caff03bc47b7f381261d62c23442/ruff-0.11.6-py3-none-win_amd64.whl", hash = "sha256:cce85721d09c51f3b782c331b0abd07e9d7d5f775840379c640606d3159cae0e", size = 11558592, upload-time = "2025-04-17T13:35:49.837Z" }, - { url = "https://files.pythonhosted.org/packages/d7/6a/65fecd51a9ca19e1477c3879a7fda24f8904174d1275b419422ac00f6eee/ruff-0.11.6-py3-none-win_arm64.whl", hash = "sha256:3567ba0d07fb170b1b48d944715e3294b77f5b7679e8ba258199a250383ccb79", size = 10682766, upload-time = "2025-04-17T13:35:52.014Z" }, -] - -[[package]] -name = "scikit-learn" -version = "1.6.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "joblib" }, - { name = "numpy" }, - { name = "scipy" }, - { name = "threadpoolctl" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9e/a5/4ae3b3a0755f7b35a280ac90b28817d1f380318973cff14075ab41ef50d9/scikit_learn-1.6.1.tar.gz", hash = "sha256:b4fc2525eca2c69a59260f583c56a7557c6ccdf8deafdba6e060f94c1c59738e", size = 7068312, upload-time = "2025-01-10T08:07:55.348Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6c/2a/e291c29670795406a824567d1dfc91db7b699799a002fdaa452bceea8f6e/scikit_learn-1.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:72abc587c75234935e97d09aa4913a82f7b03ee0b74111dcc2881cba3c5a7b33", size = 12102620, upload-time = "2025-01-10T08:06:16.675Z" }, - { url = "https://files.pythonhosted.org/packages/25/92/ee1d7a00bb6b8c55755d4984fd82608603a3cc59959245068ce32e7fb808/scikit_learn-1.6.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:b3b00cdc8f1317b5f33191df1386c0befd16625f49d979fe77a8d44cae82410d", size = 11116234, upload-time = "2025-01-10T08:06:21.83Z" }, - { url = "https://files.pythonhosted.org/packages/30/cd/ed4399485ef364bb25f388ab438e3724e60dc218c547a407b6e90ccccaef/scikit_learn-1.6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc4765af3386811c3ca21638f63b9cf5ecf66261cc4815c1db3f1e7dc7b79db2", size = 12592155, upload-time = "2025-01-10T08:06:27.309Z" }, - { url = "https://files.pythonhosted.org/packages/a8/f3/62fc9a5a659bb58a03cdd7e258956a5824bdc9b4bb3c5d932f55880be569/scikit_learn-1.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25fc636bdaf1cc2f4a124a116312d837148b5e10872147bdaf4887926b8c03d8", size = 13497069, upload-time = "2025-01-10T08:06:32.515Z" }, - { url = "https://files.pythonhosted.org/packages/a1/a6/c5b78606743a1f28eae8f11973de6613a5ee87366796583fb74c67d54939/scikit_learn-1.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:fa909b1a36e000a03c382aade0bd2063fd5680ff8b8e501660c0f59f021a6415", size = 11139809, upload-time = "2025-01-10T08:06:35.514Z" }, - { url = "https://files.pythonhosted.org/packages/0a/18/c797c9b8c10380d05616db3bfb48e2a3358c767affd0857d56c2eb501caa/scikit_learn-1.6.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:926f207c804104677af4857b2c609940b743d04c4c35ce0ddc8ff4f053cddc1b", size = 12104516, upload-time = "2025-01-10T08:06:40.009Z" }, - { url = "https://files.pythonhosted.org/packages/c4/b7/2e35f8e289ab70108f8cbb2e7a2208f0575dc704749721286519dcf35f6f/scikit_learn-1.6.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:2c2cae262064e6a9b77eee1c8e768fc46aa0b8338c6a8297b9b6759720ec0ff2", size = 11167837, upload-time = "2025-01-10T08:06:43.305Z" }, - { url = "https://files.pythonhosted.org/packages/a4/f6/ff7beaeb644bcad72bcfd5a03ff36d32ee4e53a8b29a639f11bcb65d06cd/scikit_learn-1.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1061b7c028a8663fb9a1a1baf9317b64a257fcb036dae5c8752b2abef31d136f", size = 12253728, upload-time = "2025-01-10T08:06:47.618Z" }, - { url = "https://files.pythonhosted.org/packages/29/7a/8bce8968883e9465de20be15542f4c7e221952441727c4dad24d534c6d99/scikit_learn-1.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e69fab4ebfc9c9b580a7a80111b43d214ab06250f8a7ef590a4edf72464dd86", size = 13147700, upload-time = "2025-01-10T08:06:50.888Z" }, - { url = "https://files.pythonhosted.org/packages/62/27/585859e72e117fe861c2079bcba35591a84f801e21bc1ab85bce6ce60305/scikit_learn-1.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:70b1d7e85b1c96383f872a519b3375f92f14731e279a7b4c6cfd650cf5dffc52", size = 11110613, upload-time = "2025-01-10T08:06:54.115Z" }, - { url = "https://files.pythonhosted.org/packages/2e/59/8eb1872ca87009bdcdb7f3cdc679ad557b992c12f4b61f9250659e592c63/scikit_learn-1.6.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2ffa1e9e25b3d93990e74a4be2c2fc61ee5af85811562f1288d5d055880c4322", size = 12010001, upload-time = "2025-01-10T08:06:58.613Z" }, - { url = "https://files.pythonhosted.org/packages/9d/05/f2fc4effc5b32e525408524c982c468c29d22f828834f0625c5ef3d601be/scikit_learn-1.6.1-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:dc5cf3d68c5a20ad6d571584c0750ec641cc46aeef1c1507be51300e6003a7e1", size = 11096360, upload-time = "2025-01-10T08:07:01.556Z" }, - { url = "https://files.pythonhosted.org/packages/c8/e4/4195d52cf4f113573fb8ebc44ed5a81bd511a92c0228889125fac2f4c3d1/scikit_learn-1.6.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c06beb2e839ecc641366000ca84f3cf6fa9faa1777e29cf0c04be6e4d096a348", size = 12209004, upload-time = "2025-01-10T08:07:06.931Z" }, - { url = "https://files.pythonhosted.org/packages/94/be/47e16cdd1e7fcf97d95b3cb08bde1abb13e627861af427a3651fcb80b517/scikit_learn-1.6.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e8ca8cb270fee8f1f76fa9bfd5c3507d60c6438bbee5687f81042e2bb98e5a97", size = 13171776, upload-time = "2025-01-10T08:07:11.715Z" }, - { url = "https://files.pythonhosted.org/packages/34/b0/ca92b90859070a1487827dbc672f998da95ce83edce1270fc23f96f1f61a/scikit_learn-1.6.1-cp313-cp313-win_amd64.whl", hash = "sha256:7a1c43c8ec9fde528d664d947dc4c0789be4077a3647f232869f41d9bf50e0fb", size = 11071865, upload-time = "2025-01-10T08:07:16.088Z" }, - { url = "https://files.pythonhosted.org/packages/12/ae/993b0fb24a356e71e9a894e42b8a9eec528d4c70217353a1cd7a48bc25d4/scikit_learn-1.6.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:a17c1dea1d56dcda2fac315712f3651a1fea86565b64b48fa1bc090249cbf236", size = 11955804, upload-time = "2025-01-10T08:07:20.385Z" }, - { url = "https://files.pythonhosted.org/packages/d6/54/32fa2ee591af44507eac86406fa6bba968d1eb22831494470d0a2e4a1eb1/scikit_learn-1.6.1-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:6a7aa5f9908f0f28f4edaa6963c0a6183f1911e63a69aa03782f0d924c830a35", size = 11100530, upload-time = "2025-01-10T08:07:23.675Z" }, - { url = "https://files.pythonhosted.org/packages/3f/58/55856da1adec655bdce77b502e94a267bf40a8c0b89f8622837f89503b5a/scikit_learn-1.6.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0650e730afb87402baa88afbf31c07b84c98272622aaba002559b614600ca691", size = 12433852, upload-time = "2025-01-10T08:07:26.817Z" }, - { url = "https://files.pythonhosted.org/packages/ff/4f/c83853af13901a574f8f13b645467285a48940f185b690936bb700a50863/scikit_learn-1.6.1-cp313-cp313t-win_amd64.whl", hash = "sha256:3f59fe08dc03ea158605170eb52b22a105f238a5d512c4470ddeca71feae8e5f", size = 11337256, upload-time = "2025-01-10T08:07:31.084Z" }, -] - -[[package]] -name = "scipy" -version = "1.15.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "numpy" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b7/b9/31ba9cd990e626574baf93fbc1ac61cf9ed54faafd04c479117517661637/scipy-1.15.2.tar.gz", hash = "sha256:cd58a314d92838f7e6f755c8a2167ead4f27e1fd5c1251fd54289569ef3495ec", size = 59417316, upload-time = "2025-02-17T00:42:24.791Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/40/1f/bf0a5f338bda7c35c08b4ed0df797e7bafe8a78a97275e9f439aceb46193/scipy-1.15.2-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:92233b2df6938147be6fa8824b8136f29a18f016ecde986666be5f4d686a91a4", size = 38703651, upload-time = "2025-02-17T00:30:31.09Z" }, - { url = "https://files.pythonhosted.org/packages/de/54/db126aad3874601048c2c20ae3d8a433dbfd7ba8381551e6f62606d9bd8e/scipy-1.15.2-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:62ca1ff3eb513e09ed17a5736929429189adf16d2d740f44e53270cc800ecff1", size = 30102038, upload-time = "2025-02-17T00:30:40.219Z" }, - { url = "https://files.pythonhosted.org/packages/61/d8/84da3fffefb6c7d5a16968fe5b9f24c98606b165bb801bb0b8bc3985200f/scipy-1.15.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:4c6676490ad76d1c2894d77f976144b41bd1a4052107902238047fb6a473e971", size = 22375518, upload-time = "2025-02-17T00:30:47.547Z" }, - { url = "https://files.pythonhosted.org/packages/44/78/25535a6e63d3b9c4c90147371aedb5d04c72f3aee3a34451f2dc27c0c07f/scipy-1.15.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:a8bf5cb4a25046ac61d38f8d3c3426ec11ebc350246a4642f2f315fe95bda655", size = 25142523, upload-time = "2025-02-17T00:30:56.002Z" }, - { url = "https://files.pythonhosted.org/packages/e0/22/4b4a26fe1cd9ed0bc2b2cb87b17d57e32ab72c346949eaf9288001f8aa8e/scipy-1.15.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a8e34cf4c188b6dd004654f88586d78f95639e48a25dfae9c5e34a6dc34547e", size = 35491547, upload-time = "2025-02-17T00:31:07.599Z" }, - { url = "https://files.pythonhosted.org/packages/32/ea/564bacc26b676c06a00266a3f25fdfe91a9d9a2532ccea7ce6dd394541bc/scipy-1.15.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28a0d2c2075946346e4408b211240764759e0fabaeb08d871639b5f3b1aca8a0", size = 37634077, upload-time = "2025-02-17T00:31:15.191Z" }, - { url = "https://files.pythonhosted.org/packages/43/c2/bfd4e60668897a303b0ffb7191e965a5da4056f0d98acfb6ba529678f0fb/scipy-1.15.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:42dabaaa798e987c425ed76062794e93a243be8f0f20fff6e7a89f4d61cb3d40", size = 37231657, upload-time = "2025-02-17T00:31:22.041Z" }, - { url = "https://files.pythonhosted.org/packages/4a/75/5f13050bf4f84c931bcab4f4e83c212a36876c3c2244475db34e4b5fe1a6/scipy-1.15.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6f5e296ec63c5da6ba6fa0343ea73fd51b8b3e1a300b0a8cae3ed4b1122c7462", size = 40035857, upload-time = "2025-02-17T00:31:29.836Z" }, - { url = "https://files.pythonhosted.org/packages/b9/8b/7ec1832b09dbc88f3db411f8cdd47db04505c4b72c99b11c920a8f0479c3/scipy-1.15.2-cp311-cp311-win_amd64.whl", hash = "sha256:597a0c7008b21c035831c39927406c6181bcf8f60a73f36219b69d010aa04737", size = 41217654, upload-time = "2025-02-17T00:31:43.65Z" }, - { url = "https://files.pythonhosted.org/packages/4b/5d/3c78815cbab499610f26b5bae6aed33e227225a9fa5290008a733a64f6fc/scipy-1.15.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c4697a10da8f8765bb7c83e24a470da5797e37041edfd77fd95ba3811a47c4fd", size = 38756184, upload-time = "2025-02-17T00:31:50.623Z" }, - { url = "https://files.pythonhosted.org/packages/37/20/3d04eb066b471b6e171827548b9ddb3c21c6bbea72a4d84fc5989933910b/scipy-1.15.2-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:869269b767d5ee7ea6991ed7e22b3ca1f22de73ab9a49c44bad338b725603301", size = 30163558, upload-time = "2025-02-17T00:31:56.721Z" }, - { url = "https://files.pythonhosted.org/packages/a4/98/e5c964526c929ef1f795d4c343b2ff98634ad2051bd2bbadfef9e772e413/scipy-1.15.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:bad78d580270a4d32470563ea86c6590b465cb98f83d760ff5b0990cb5518a93", size = 22437211, upload-time = "2025-02-17T00:32:03.042Z" }, - { url = "https://files.pythonhosted.org/packages/1d/cd/1dc7371e29195ecbf5222f9afeedb210e0a75057d8afbd942aa6cf8c8eca/scipy-1.15.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:b09ae80010f52efddb15551025f9016c910296cf70adbf03ce2a8704f3a5ad20", size = 25232260, upload-time = "2025-02-17T00:32:07.847Z" }, - { url = "https://files.pythonhosted.org/packages/f0/24/1a181a9e5050090e0b5138c5f496fee33293c342b788d02586bc410c6477/scipy-1.15.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a6fd6eac1ce74a9f77a7fc724080d507c5812d61e72bd5e4c489b042455865e", size = 35198095, upload-time = "2025-02-17T00:32:14.565Z" }, - { url = "https://files.pythonhosted.org/packages/c0/53/eaada1a414c026673eb983f8b4a55fe5eb172725d33d62c1b21f63ff6ca4/scipy-1.15.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b871df1fe1a3ba85d90e22742b93584f8d2b8e6124f8372ab15c71b73e428b8", size = 37297371, upload-time = "2025-02-17T00:32:21.411Z" }, - { url = "https://files.pythonhosted.org/packages/e9/06/0449b744892ed22b7e7b9a1994a866e64895363572677a316a9042af1fe5/scipy-1.15.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:03205d57a28e18dfd39f0377d5002725bf1f19a46f444108c29bdb246b6c8a11", size = 36872390, upload-time = "2025-02-17T00:32:29.421Z" }, - { url = "https://files.pythonhosted.org/packages/6a/6f/a8ac3cfd9505ec695c1bc35edc034d13afbd2fc1882a7c6b473e280397bb/scipy-1.15.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:601881dfb761311045b03114c5fe718a12634e5608c3b403737ae463c9885d53", size = 39700276, upload-time = "2025-02-17T00:32:37.431Z" }, - { url = "https://files.pythonhosted.org/packages/f5/6f/e6e5aff77ea2a48dd96808bb51d7450875af154ee7cbe72188afb0b37929/scipy-1.15.2-cp312-cp312-win_amd64.whl", hash = "sha256:e7c68b6a43259ba0aab737237876e5c2c549a031ddb7abc28c7b47f22e202ded", size = 40942317, upload-time = "2025-02-17T00:32:45.47Z" }, - { url = "https://files.pythonhosted.org/packages/53/40/09319f6e0f276ea2754196185f95cd191cb852288440ce035d5c3a931ea2/scipy-1.15.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:01edfac9f0798ad6b46d9c4c9ca0e0ad23dbf0b1eb70e96adb9fa7f525eff0bf", size = 38717587, upload-time = "2025-02-17T00:32:53.196Z" }, - { url = "https://files.pythonhosted.org/packages/fe/c3/2854f40ecd19585d65afaef601e5e1f8dbf6758b2f95b5ea93d38655a2c6/scipy-1.15.2-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:08b57a9336b8e79b305a143c3655cc5bdbe6d5ece3378578888d2afbb51c4e37", size = 30100266, upload-time = "2025-02-17T00:32:59.318Z" }, - { url = "https://files.pythonhosted.org/packages/dd/b1/f9fe6e3c828cb5930b5fe74cb479de5f3d66d682fa8adb77249acaf545b8/scipy-1.15.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:54c462098484e7466362a9f1672d20888f724911a74c22ae35b61f9c5919183d", size = 22373768, upload-time = "2025-02-17T00:33:04.091Z" }, - { url = "https://files.pythonhosted.org/packages/15/9d/a60db8c795700414c3f681908a2b911e031e024d93214f2d23c6dae174ab/scipy-1.15.2-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:cf72ff559a53a6a6d77bd8eefd12a17995ffa44ad86c77a5df96f533d4e6c6bb", size = 25154719, upload-time = "2025-02-17T00:33:08.909Z" }, - { url = "https://files.pythonhosted.org/packages/37/3b/9bda92a85cd93f19f9ed90ade84aa1e51657e29988317fabdd44544f1dd4/scipy-1.15.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9de9d1416b3d9e7df9923ab23cd2fe714244af10b763975bea9e4f2e81cebd27", size = 35163195, upload-time = "2025-02-17T00:33:15.352Z" }, - { url = "https://files.pythonhosted.org/packages/03/5a/fc34bf1aa14dc7c0e701691fa8685f3faec80e57d816615e3625f28feb43/scipy-1.15.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb530e4794fc8ea76a4a21ccb67dea33e5e0e60f07fc38a49e821e1eae3b71a0", size = 37255404, upload-time = "2025-02-17T00:33:22.21Z" }, - { url = "https://files.pythonhosted.org/packages/4a/71/472eac45440cee134c8a180dbe4c01b3ec247e0338b7c759e6cd71f199a7/scipy-1.15.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5ea7ed46d437fc52350b028b1d44e002646e28f3e8ddc714011aaf87330f2f32", size = 36860011, upload-time = "2025-02-17T00:33:29.446Z" }, - { url = "https://files.pythonhosted.org/packages/01/b3/21f890f4f42daf20e4d3aaa18182dddb9192771cd47445aaae2e318f6738/scipy-1.15.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:11e7ad32cf184b74380f43d3c0a706f49358b904fa7d5345f16ddf993609184d", size = 39657406, upload-time = "2025-02-17T00:33:39.019Z" }, - { url = "https://files.pythonhosted.org/packages/0d/76/77cf2ac1f2a9cc00c073d49e1e16244e389dd88e2490c91d84e1e3e4d126/scipy-1.15.2-cp313-cp313-win_amd64.whl", hash = "sha256:a5080a79dfb9b78b768cebf3c9dcbc7b665c5875793569f48bf0e2b1d7f68f6f", size = 40961243, upload-time = "2025-02-17T00:34:51.024Z" }, - { url = "https://files.pythonhosted.org/packages/4c/4b/a57f8ddcf48e129e6054fa9899a2a86d1fc6b07a0e15c7eebff7ca94533f/scipy-1.15.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:447ce30cee6a9d5d1379087c9e474628dab3db4a67484be1b7dc3196bfb2fac9", size = 38870286, upload-time = "2025-02-17T00:33:47.62Z" }, - { url = "https://files.pythonhosted.org/packages/0c/43/c304d69a56c91ad5f188c0714f6a97b9c1fed93128c691148621274a3a68/scipy-1.15.2-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:c90ebe8aaa4397eaefa8455a8182b164a6cc1d59ad53f79943f266d99f68687f", size = 30141634, upload-time = "2025-02-17T00:33:54.131Z" }, - { url = "https://files.pythonhosted.org/packages/44/1a/6c21b45d2548eb73be9b9bff421aaaa7e85e22c1f9b3bc44b23485dfce0a/scipy-1.15.2-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:def751dd08243934c884a3221156d63e15234a3155cf25978b0a668409d45eb6", size = 22415179, upload-time = "2025-02-17T00:33:59.948Z" }, - { url = "https://files.pythonhosted.org/packages/74/4b/aefac4bba80ef815b64f55da06f62f92be5d03b467f2ce3668071799429a/scipy-1.15.2-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:302093e7dfb120e55515936cb55618ee0b895f8bcaf18ff81eca086c17bd80af", size = 25126412, upload-time = "2025-02-17T00:34:06.328Z" }, - { url = "https://files.pythonhosted.org/packages/b1/53/1cbb148e6e8f1660aacd9f0a9dfa2b05e9ff1cb54b4386fe868477972ac2/scipy-1.15.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7cd5b77413e1855351cdde594eca99c1f4a588c2d63711388b6a1f1c01f62274", size = 34952867, upload-time = "2025-02-17T00:34:12.928Z" }, - { url = "https://files.pythonhosted.org/packages/2c/23/e0eb7f31a9c13cf2dca083828b97992dd22f8184c6ce4fec5deec0c81fcf/scipy-1.15.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d0194c37037707b2afa7a2f2a924cf7bac3dc292d51b6a925e5fcb89bc5c776", size = 36890009, upload-time = "2025-02-17T00:34:19.55Z" }, - { url = "https://files.pythonhosted.org/packages/03/f3/e699e19cabe96bbac5189c04aaa970718f0105cff03d458dc5e2b6bd1e8c/scipy-1.15.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:bae43364d600fdc3ac327db99659dcb79e6e7ecd279a75fe1266669d9a652828", size = 36545159, upload-time = "2025-02-17T00:34:26.724Z" }, - { url = "https://files.pythonhosted.org/packages/af/f5/ab3838e56fe5cc22383d6fcf2336e48c8fe33e944b9037fbf6cbdf5a11f8/scipy-1.15.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f031846580d9acccd0044efd1a90e6f4df3a6e12b4b6bd694a7bc03a89892b28", size = 39136566, upload-time = "2025-02-17T00:34:34.512Z" }, - { url = "https://files.pythonhosted.org/packages/0a/c8/b3f566db71461cabd4b2d5b39bcc24a7e1c119535c8361f81426be39bb47/scipy-1.15.2-cp313-cp313t-win_amd64.whl", hash = "sha256:fe8a9eb875d430d81755472c5ba75e84acc980e4a8f6204d402849234d3017db", size = 40477705, upload-time = "2025-02-17T00:34:43.619Z" }, -] - -[[package]] -name = "secretstorage" -version = "3.3.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cryptography" }, - { name = "jeepney" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/53/a4/f48c9d79cb507ed1373477dbceaba7401fd8a23af63b837fa61f1dcd3691/SecretStorage-3.3.3.tar.gz", hash = "sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77", size = 19739, upload-time = "2022-08-13T16:22:46.976Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/54/24/b4293291fa1dd830f353d2cb163295742fa87f179fcc8a20a306a81978b7/SecretStorage-3.3.3-py3-none-any.whl", hash = "sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99", size = 15221, upload-time = "2022-08-13T16:22:44.457Z" }, -] - -[[package]] -name = "semver" -version = "3.0.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/d1/d3159231aec234a59dd7d601e9dd9fe96f3afff15efd33c1070019b26132/semver-3.0.4.tar.gz", hash = "sha256:afc7d8c584a5ed0a11033af086e8af226a9c0b206f313e0301f8dd7b6b589602", size = 269730, upload-time = "2025-01-24T13:19:27.617Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a6/24/4d91e05817e92e3a61c8a21e08fd0f390f5301f1c448b137c57c4bc6e543/semver-3.0.4-py3-none-any.whl", hash = "sha256:9c824d87ba7f7ab4a1890799cec8596f15c1241cb473404ea1cb0c55e4b04746", size = 17912, upload-time = "2025-01-24T13:19:24.949Z" }, -] - -[[package]] -name = "six" -version = "1.17.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, -] - -[[package]] -name = "tenacity" -version = "9.1.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/0a/d4/2b0cd0fe285e14b36db076e78c93766ff1d529d70408bd1d2a5a84f1d929/tenacity-9.1.2.tar.gz", hash = "sha256:1169d376c297e7de388d18b4481760d478b0e99a777cad3a9c86e556f4b697cb", size = 48036, upload-time = "2025-04-02T08:25:09.966Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/30/643397144bfbfec6f6ef821f36f33e57d35946c44a2352d3c9f0ae847619/tenacity-9.1.2-py3-none-any.whl", hash = "sha256:f77bf36710d8b73a50b2dd155c97b870017ad21afe6ab300326b0371b3b05138", size = 28248, upload-time = "2025-04-02T08:25:07.678Z" }, -] - -[[package]] -name = "threadpoolctl" -version = "3.6.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b7/4d/08c89e34946fce2aec4fbb45c9016efd5f4d7f24af8e5d93296e935631d8/threadpoolctl-3.6.0.tar.gz", hash = "sha256:8ab8b4aa3491d812b623328249fab5302a68d2d71745c8a4c719a2fcaba9f44e", size = 21274, upload-time = "2025-03-13T13:49:23.031Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/32/d5/f9a850d79b0851d1d4ef6456097579a9005b31fea68726a4ae5f2d82ddd9/threadpoolctl-3.6.0-py3-none-any.whl", hash = "sha256:43a0b8fd5a2928500110039e43a5eed8480b918967083ea48dc3ab9f13c4a7fb", size = 18638, upload-time = "2025-03-13T13:49:21.846Z" }, -] - -[[package]] -name = "tomli" -version = "2.2.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/18/87/302344fed471e44a87289cf4967697d07e532f2421fdaf868a303cbae4ff/tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", size = 17175, upload-time = "2024-11-27T22:38:36.873Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", size = 131077, upload-time = "2024-11-27T22:37:54.956Z" }, - { url = "https://files.pythonhosted.org/packages/c7/16/51ae563a8615d472fdbffc43a3f3d46588c264ac4f024f63f01283becfbb/tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", size = 123429, upload-time = "2024-11-27T22:37:56.698Z" }, - { url = "https://files.pythonhosted.org/packages/f1/dd/4f6cd1e7b160041db83c694abc78e100473c15d54620083dbd5aae7b990e/tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", size = 226067, upload-time = "2024-11-27T22:37:57.63Z" }, - { url = "https://files.pythonhosted.org/packages/a9/6b/c54ede5dc70d648cc6361eaf429304b02f2871a345bbdd51e993d6cdf550/tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", size = 236030, upload-time = "2024-11-27T22:37:59.344Z" }, - { url = "https://files.pythonhosted.org/packages/1f/47/999514fa49cfaf7a92c805a86c3c43f4215621855d151b61c602abb38091/tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", size = 240898, upload-time = "2024-11-27T22:38:00.429Z" }, - { url = "https://files.pythonhosted.org/packages/73/41/0a01279a7ae09ee1573b423318e7934674ce06eb33f50936655071d81a24/tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", size = 229894, upload-time = "2024-11-27T22:38:02.094Z" }, - { url = "https://files.pythonhosted.org/packages/55/18/5d8bc5b0a0362311ce4d18830a5d28943667599a60d20118074ea1b01bb7/tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", size = 245319, upload-time = "2024-11-27T22:38:03.206Z" }, - { url = "https://files.pythonhosted.org/packages/92/a3/7ade0576d17f3cdf5ff44d61390d4b3febb8a9fc2b480c75c47ea048c646/tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", size = 238273, upload-time = "2024-11-27T22:38:04.217Z" }, - { url = "https://files.pythonhosted.org/packages/72/6f/fa64ef058ac1446a1e51110c375339b3ec6be245af9d14c87c4a6412dd32/tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", size = 98310, upload-time = "2024-11-27T22:38:05.908Z" }, - { url = "https://files.pythonhosted.org/packages/6a/1c/4a2dcde4a51b81be3530565e92eda625d94dafb46dbeb15069df4caffc34/tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", size = 108309, upload-time = "2024-11-27T22:38:06.812Z" }, - { url = "https://files.pythonhosted.org/packages/52/e1/f8af4c2fcde17500422858155aeb0d7e93477a0d59a98e56cbfe75070fd0/tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", size = 132762, upload-time = "2024-11-27T22:38:07.731Z" }, - { url = "https://files.pythonhosted.org/packages/03/b8/152c68bb84fc00396b83e7bbddd5ec0bd3dd409db4195e2a9b3e398ad2e3/tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", size = 123453, upload-time = "2024-11-27T22:38:09.384Z" }, - { url = "https://files.pythonhosted.org/packages/c8/d6/fc9267af9166f79ac528ff7e8c55c8181ded34eb4b0e93daa767b8841573/tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", size = 233486, upload-time = "2024-11-27T22:38:10.329Z" }, - { url = "https://files.pythonhosted.org/packages/5c/51/51c3f2884d7bab89af25f678447ea7d297b53b5a3b5730a7cb2ef6069f07/tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", size = 242349, upload-time = "2024-11-27T22:38:11.443Z" }, - { url = "https://files.pythonhosted.org/packages/ab/df/bfa89627d13a5cc22402e441e8a931ef2108403db390ff3345c05253935e/tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", size = 252159, upload-time = "2024-11-27T22:38:13.099Z" }, - { url = "https://files.pythonhosted.org/packages/9e/6e/fa2b916dced65763a5168c6ccb91066f7639bdc88b48adda990db10c8c0b/tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", size = 237243, upload-time = "2024-11-27T22:38:14.766Z" }, - { url = "https://files.pythonhosted.org/packages/b4/04/885d3b1f650e1153cbb93a6a9782c58a972b94ea4483ae4ac5cedd5e4a09/tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", size = 259645, upload-time = "2024-11-27T22:38:15.843Z" }, - { url = "https://files.pythonhosted.org/packages/9c/de/6b432d66e986e501586da298e28ebeefd3edc2c780f3ad73d22566034239/tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", size = 244584, upload-time = "2024-11-27T22:38:17.645Z" }, - { url = "https://files.pythonhosted.org/packages/1c/9a/47c0449b98e6e7d1be6cbac02f93dd79003234ddc4aaab6ba07a9a7482e2/tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", size = 98875, upload-time = "2024-11-27T22:38:19.159Z" }, - { url = "https://files.pythonhosted.org/packages/ef/60/9b9638f081c6f1261e2688bd487625cd1e660d0a85bd469e91d8db969734/tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", size = 109418, upload-time = "2024-11-27T22:38:20.064Z" }, - { url = "https://files.pythonhosted.org/packages/04/90/2ee5f2e0362cb8a0b6499dc44f4d7d48f8fff06d28ba46e6f1eaa61a1388/tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7", size = 132708, upload-time = "2024-11-27T22:38:21.659Z" }, - { url = "https://files.pythonhosted.org/packages/c0/ec/46b4108816de6b385141f082ba99e315501ccd0a2ea23db4a100dd3990ea/tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", size = 123582, upload-time = "2024-11-27T22:38:22.693Z" }, - { url = "https://files.pythonhosted.org/packages/a0/bd/b470466d0137b37b68d24556c38a0cc819e8febe392d5b199dcd7f578365/tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", size = 232543, upload-time = "2024-11-27T22:38:24.367Z" }, - { url = "https://files.pythonhosted.org/packages/d9/e5/82e80ff3b751373f7cead2815bcbe2d51c895b3c990686741a8e56ec42ab/tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", size = 241691, upload-time = "2024-11-27T22:38:26.081Z" }, - { url = "https://files.pythonhosted.org/packages/05/7e/2a110bc2713557d6a1bfb06af23dd01e7dde52b6ee7dadc589868f9abfac/tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", size = 251170, upload-time = "2024-11-27T22:38:27.921Z" }, - { url = "https://files.pythonhosted.org/packages/64/7b/22d713946efe00e0adbcdfd6d1aa119ae03fd0b60ebed51ebb3fa9f5a2e5/tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", size = 236530, upload-time = "2024-11-27T22:38:29.591Z" }, - { url = "https://files.pythonhosted.org/packages/38/31/3a76f67da4b0cf37b742ca76beaf819dca0ebef26d78fc794a576e08accf/tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", size = 258666, upload-time = "2024-11-27T22:38:30.639Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/5af1293da642aded87e8a988753945d0cf7e00a9452d3911dd3bb354c9e2/tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", size = 243954, upload-time = "2024-11-27T22:38:31.702Z" }, - { url = "https://files.pythonhosted.org/packages/5b/b9/1ed31d167be802da0fc95020d04cd27b7d7065cc6fbefdd2f9186f60d7bd/tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", size = 98724, upload-time = "2024-11-27T22:38:32.837Z" }, - { url = "https://files.pythonhosted.org/packages/c7/32/b0963458706accd9afcfeb867c0f9175a741bf7b19cd424230714d722198/tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", size = 109383, upload-time = "2024-11-27T22:38:34.455Z" }, - { url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257, upload-time = "2024-11-27T22:38:35.385Z" }, -] - -[[package]] -name = "twine" -version = "5.1.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "importlib-metadata" }, - { name = "keyring" }, - { name = "pkginfo" }, - { name = "readme-renderer" }, - { name = "requests" }, - { name = "requests-toolbelt" }, - { name = "rfc3986" }, - { name = "rich" }, - { name = "urllib3" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/77/68/bd982e5e949ef8334e6f7dcf76ae40922a8750aa2e347291ae1477a4782b/twine-5.1.1.tar.gz", hash = "sha256:9aa0825139c02b3434d913545c7b847a21c835e11597f5255842d457da2322db", size = 225531, upload-time = "2024-06-26T15:00:46.58Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5d/ec/00f9d5fd040ae29867355e559a94e9a8429225a0284a3f5f091a3878bfc0/twine-5.1.1-py3-none-any.whl", hash = "sha256:215dbe7b4b94c2c50a7315c0275d2258399280fbb7d04182c7e55e24b5f93997", size = 38650, upload-time = "2024-06-26T15:00:43.825Z" }, -] - -[[package]] -name = "typing-extensions" -version = "4.13.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f6/37/23083fcd6e35492953e8d2aaaa68b860eb422b34627b13f2ce3eb6106061/typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef", size = 106967, upload-time = "2025-04-10T14:19:05.416Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/54/b1ae86c0973cc6f0210b53d508ca3641fb6d0c56823f288d108bc7ab3cc8/typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c", size = 45806, upload-time = "2025-04-10T14:19:03.967Z" }, -] - -[[package]] -name = "tzdata" -version = "2025.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/95/32/1a225d6164441be760d75c2c42e2780dc0873fe382da3e98a2e1e48361e5/tzdata-2025.2.tar.gz", hash = "sha256:b60a638fcc0daffadf82fe0f57e53d06bdec2f36c4df66280ae79bce6bd6f2b9", size = 196380, upload-time = "2025-03-23T13:54:43.652Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5c/23/c7abc0ca0a1526a0774eca151daeb8de62ec457e77262b66b359c3c7679e/tzdata-2025.2-py2.py3-none-any.whl", hash = "sha256:1a403fada01ff9221ca8044d701868fa132215d84beb92242d9acd2147f667a8", size = 347839, upload-time = "2025-03-23T13:54:41.845Z" }, -] - -[[package]] -name = "urllib3" -version = "2.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8a/78/16493d9c386d8e60e442a35feac5e00f0913c0f4b7c217c11e8ec2ff53e0/urllib3-2.4.0.tar.gz", hash = "sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466", size = 390672, upload-time = "2025-04-10T15:23:39.232Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6b/11/cc635220681e93a0183390e26485430ca2c7b5f9d33b15c74c2861cb8091/urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813", size = 128680, upload-time = "2025-04-10T15:23:37.377Z" }, -] - -[[package]] -name = "watchdog" -version = "6.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/db/7d/7f3d619e951c88ed75c6037b246ddcf2d322812ee8ea189be89511721d54/watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", size = 131220, upload-time = "2024-11-01T14:07:13.037Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/24/d9be5cd6642a6aa68352ded4b4b10fb0d7889cb7f45814fb92cecd35f101/watchdog-6.0.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6eb11feb5a0d452ee41f824e271ca311a09e250441c262ca2fd7ebcf2461a06c", size = 96393, upload-time = "2024-11-01T14:06:31.756Z" }, - { url = "https://files.pythonhosted.org/packages/63/7a/6013b0d8dbc56adca7fdd4f0beed381c59f6752341b12fa0886fa7afc78b/watchdog-6.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ef810fbf7b781a5a593894e4f439773830bdecb885e6880d957d5b9382a960d2", size = 88392, upload-time = "2024-11-01T14:06:32.99Z" }, - { url = "https://files.pythonhosted.org/packages/d1/40/b75381494851556de56281e053700e46bff5b37bf4c7267e858640af5a7f/watchdog-6.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:afd0fe1b2270917c5e23c2a65ce50c2a4abb63daafb0d419fde368e272a76b7c", size = 89019, upload-time = "2024-11-01T14:06:34.963Z" }, - { url = "https://files.pythonhosted.org/packages/39/ea/3930d07dafc9e286ed356a679aa02d777c06e9bfd1164fa7c19c288a5483/watchdog-6.0.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948", size = 96471, upload-time = "2024-11-01T14:06:37.745Z" }, - { url = "https://files.pythonhosted.org/packages/12/87/48361531f70b1f87928b045df868a9fd4e253d9ae087fa4cf3f7113be363/watchdog-6.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860", size = 88449, upload-time = "2024-11-01T14:06:39.748Z" }, - { url = "https://files.pythonhosted.org/packages/5b/7e/8f322f5e600812e6f9a31b75d242631068ca8f4ef0582dd3ae6e72daecc8/watchdog-6.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0", size = 89054, upload-time = "2024-11-01T14:06:41.009Z" }, - { url = "https://files.pythonhosted.org/packages/68/98/b0345cabdce2041a01293ba483333582891a3bd5769b08eceb0d406056ef/watchdog-6.0.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:490ab2ef84f11129844c23fb14ecf30ef3d8a6abafd3754a6f75ca1e6654136c", size = 96480, upload-time = "2024-11-01T14:06:42.952Z" }, - { url = "https://files.pythonhosted.org/packages/85/83/cdf13902c626b28eedef7ec4f10745c52aad8a8fe7eb04ed7b1f111ca20e/watchdog-6.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:76aae96b00ae814b181bb25b1b98076d5fc84e8a53cd8885a318b42b6d3a5134", size = 88451, upload-time = "2024-11-01T14:06:45.084Z" }, - { url = "https://files.pythonhosted.org/packages/fe/c4/225c87bae08c8b9ec99030cd48ae9c4eca050a59bf5c2255853e18c87b50/watchdog-6.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a175f755fc2279e0b7312c0035d52e27211a5bc39719dd529625b1930917345b", size = 89057, upload-time = "2024-11-01T14:06:47.324Z" }, - { url = "https://files.pythonhosted.org/packages/a9/c7/ca4bf3e518cb57a686b2feb4f55a1892fd9a3dd13f470fca14e00f80ea36/watchdog-6.0.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:7607498efa04a3542ae3e05e64da8202e58159aa1fa4acddf7678d34a35d4f13", size = 79079, upload-time = "2024-11-01T14:06:59.472Z" }, - { url = "https://files.pythonhosted.org/packages/5c/51/d46dc9332f9a647593c947b4b88e2381c8dfc0942d15b8edc0310fa4abb1/watchdog-6.0.0-py3-none-manylinux2014_armv7l.whl", hash = "sha256:9041567ee8953024c83343288ccc458fd0a2d811d6a0fd68c4c22609e3490379", size = 79078, upload-time = "2024-11-01T14:07:01.431Z" }, - { url = "https://files.pythonhosted.org/packages/d4/57/04edbf5e169cd318d5f07b4766fee38e825d64b6913ca157ca32d1a42267/watchdog-6.0.0-py3-none-manylinux2014_i686.whl", hash = "sha256:82dc3e3143c7e38ec49d61af98d6558288c415eac98486a5c581726e0737c00e", size = 79076, upload-time = "2024-11-01T14:07:02.568Z" }, - { url = "https://files.pythonhosted.org/packages/ab/cc/da8422b300e13cb187d2203f20b9253e91058aaf7db65b74142013478e66/watchdog-6.0.0-py3-none-manylinux2014_ppc64.whl", hash = "sha256:212ac9b8bf1161dc91bd09c048048a95ca3a4c4f5e5d4a7d1b1a7d5752a7f96f", size = 79077, upload-time = "2024-11-01T14:07:03.893Z" }, - { url = "https://files.pythonhosted.org/packages/2c/3b/b8964e04ae1a025c44ba8e4291f86e97fac443bca31de8bd98d3263d2fcf/watchdog-6.0.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:e3df4cbb9a450c6d49318f6d14f4bbc80d763fa587ba46ec86f99f9e6876bb26", size = 79078, upload-time = "2024-11-01T14:07:05.189Z" }, - { url = "https://files.pythonhosted.org/packages/62/ae/a696eb424bedff7407801c257d4b1afda455fe40821a2be430e173660e81/watchdog-6.0.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:2cce7cfc2008eb51feb6aab51251fd79b85d9894e98ba847408f662b3395ca3c", size = 79077, upload-time = "2024-11-01T14:07:06.376Z" }, - { url = "https://files.pythonhosted.org/packages/b5/e8/dbf020b4d98251a9860752a094d09a65e1b436ad181faf929983f697048f/watchdog-6.0.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:20ffe5b202af80ab4266dcd3e91aae72bf2da48c0d33bdb15c66658e685e94e2", size = 79078, upload-time = "2024-11-01T14:07:07.547Z" }, - { url = "https://files.pythonhosted.org/packages/07/f6/d0e5b343768e8bcb4cda79f0f2f55051bf26177ecd5651f84c07567461cf/watchdog-6.0.0-py3-none-win32.whl", hash = "sha256:07df1fdd701c5d4c8e55ef6cf55b8f0120fe1aef7ef39a1c6fc6bc2e606d517a", size = 79065, upload-time = "2024-11-01T14:07:09.525Z" }, - { url = "https://files.pythonhosted.org/packages/db/d9/c495884c6e548fce18a8f40568ff120bc3a4b7b99813081c8ac0c936fa64/watchdog-6.0.0-py3-none-win_amd64.whl", hash = "sha256:cbafb470cf848d93b5d013e2ecb245d4aa1c8fd0504e863ccefa32445359d680", size = 79070, upload-time = "2024-11-01T14:07:10.686Z" }, - { url = "https://files.pythonhosted.org/packages/33/e8/e40370e6d74ddba47f002a32919d91310d6074130fe4e17dabcafc15cbf1/watchdog-6.0.0-py3-none-win_ia64.whl", hash = "sha256:a1914259fa9e1454315171103c6a30961236f508b9b623eae470268bbcc6a22f", size = 79067, upload-time = "2024-11-01T14:07:11.845Z" }, -] - -[[package]] -name = "zipp" -version = "3.21.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3f/50/bad581df71744867e9468ebd0bcd6505de3b275e06f202c2cb016e3ff56f/zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4", size = 24545, upload-time = "2024-11-10T15:05:20.202Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/1a/7e4798e9339adc931158c9d69ecc34f5e6791489d469f5e50ec15e35f458/zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931", size = 9630, upload-time = "2024-11-10T15:05:19.275Z" }, -]