diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 80f3fca..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,189 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# EditorConfig configuration file (see ).
-
-# Indicate that this file is a root-level configuration file:
-root = true
-
-# Set properties for all files:
-[*]
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-# Set properties for JavaScript files:
-[*.{js,js.txt}]
-indent_style = tab
-
-# Set properties for JavaScript ES module files:
-[*.{mjs,mjs.txt}]
-indent_style = tab
-
-# Set properties for JavaScript CommonJS files:
-[*.{cjs,cjs.txt}]
-indent_style = tab
-
-# Set properties for JSON files:
-[*.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `cli_opts.json` files:
-[cli_opts.json]
-indent_style = tab
-
-# Set properties for TypeScript files:
-[*.ts]
-indent_style = tab
-
-# Set properties for Python files:
-[*.{py,py.txt}]
-indent_style = space
-indent_size = 4
-
-# Set properties for Julia files:
-[*.{jl,jl.txt}]
-indent_style = tab
-
-# Set properties for R files:
-[*.{R,R.txt}]
-indent_style = tab
-
-# Set properties for C files:
-[*.{c,c.txt}]
-indent_style = tab
-
-# Set properties for C header files:
-[*.{h,h.txt}]
-indent_style = tab
-
-# Set properties for C++ files:
-[*.{cpp,cpp.txt}]
-indent_style = tab
-
-# Set properties for C++ header files:
-[*.{hpp,hpp.txt}]
-indent_style = tab
-
-# Set properties for Fortran files:
-[*.{f,f.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for shell files:
-[*.{sh,sh.txt}]
-indent_style = tab
-
-# Set properties for AWK files:
-[*.{awk,awk.txt}]
-indent_style = tab
-
-# Set properties for HTML files:
-[*.{html,html.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for XML files:
-[*.{xml,xml.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for CSS files:
-[*.{css,css.txt}]
-indent_style = tab
-
-# Set properties for Makefiles:
-[Makefile]
-indent_style = tab
-
-[*.{mk,mk.txt}]
-indent_style = tab
-
-# Set properties for Markdown files:
-[*.{md,md.txt}]
-indent_style = space
-indent_size = 4
-trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim.
-
-# Set properties for `usage.txt` files:
-[usage.txt]
-indent_style = space
-indent_size = 2
-
-# Set properties for `repl.txt` files:
-[repl.txt]
-indent_style = space
-indent_size = 4
-
-# Set properties for `package.json` files:
-[package.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `datapackage.json` files:
-[datapackage.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `manifest.json` files:
-[manifest.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `tsconfig.json` files:
-[tsconfig.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for LaTeX files:
-[*.{tex,tex.txt}]
-indent_style = tab
-
-# Set properties for LaTeX Bibliography files:
-[*.{bib,bib.txt}]
-indent_style = tab
-
-# Set properties for YAML files:
-[*.{yml,yml.txt}]
-indent_style = space
-indent_size = 2
-
-# Ignore generated lock files for GitHub Agentic Workflows:
-[*.lock.yml]
-charset = unset
-end_of_line = unset
-indent_style = unset
-indent_size = unset
-trim_trailing_whitespace = unset
-insert_final_newline = unset
-
-# Set properties for GYP files:
-[binding.gyp]
-indent_style = space
-indent_size = 2
-
-[*.gypi]
-indent_style = space
-indent_size = 2
-
-# Set properties for citation files:
-[*.{cff,cff.txt}]
-indent_style = space
-indent_size = 2
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 5f30286..0000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1 +0,0 @@
-/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 24b327f..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,68 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Configuration file which assigns attributes to pathnames.
-#
-# [1]: https://git-scm.com/docs/gitattributes
-
-# Automatically normalize the line endings of any committed text files:
-* text=auto
-
-# Override line endings for certain files on checkout:
-*.crlf.csv text eol=crlf
-
-# Denote that certain files are binary and should not be modified:
-*.png binary
-*.jpg binary
-*.jpeg binary
-*.gif binary
-*.ico binary
-*.gz binary
-*.zip binary
-*.7z binary
-*.mp3 binary
-*.mp4 binary
-*.mov binary
-
-# Override what is considered "vendored" by GitHub's linguist:
-/lib/node_modules/** -linguist-vendored -linguist-generated
-
-# Configure directories which should *not* be included in GitHub language statistics:
-/deps/** linguist-vendored
-/dist/** linguist-generated
-/workshops/** linguist-vendored
-
-benchmark/** linguist-vendored
-docs/* linguist-documentation
-etc/** linguist-vendored
-examples/** linguist-documentation
-scripts/** linguist-vendored
-test/** linguist-vendored
-tools/** linguist-vendored
-
-# Configure files which should *not* be included in GitHub language statistics:
-Makefile linguist-vendored
-*.mk linguist-vendored
-*.jl linguist-vendored
-*.py linguist-vendored
-*.R linguist-vendored
-
-# Configure files which should be included in GitHub language statistics:
-docs/types/*.d.ts -linguist-documentation
-
-.github/workflows/*.lock.yml linguist-generated=true merge=ours
diff --git a/.github/.keepalive b/.github/.keepalive
deleted file mode 100644
index 2cd2345..0000000
--- a/.github/.keepalive
+++ /dev/null
@@ -1 +0,0 @@
-2026-08-20T03:06:52.289Z
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index 879d78b..0000000
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/includes) of the main repository where we’ll review and provide feedback.
-
-If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib.
-
-We look forward to receiving your contribution! :smiley:
\ No newline at end of file
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
deleted file mode 100644
index e4f10fe..0000000
--- a/.github/workflows/benchmark.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: benchmark
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to run benchmarks:
- benchmark:
-
- # Define a display name:
- name: 'Run benchmarks'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Run benchmarks:
- - name: 'Run benchmarks'
- run: |
- npm run benchmark
diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml
deleted file mode 100644
index b5291db..0000000
--- a/.github/workflows/cancel.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: cancel
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to cancel existing workflow runs:
- cancel:
-
- # Define a display name:
- name: 'Cancel workflow runs'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Time limit:
- timeout-minutes: 3
-
- # Define the sequence of job steps...
- steps:
-
- # Cancel existing workflow runs:
- - name: 'Cancel existing workflow runs'
- # Pin action to full length commit SHA
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1
- with:
- workflow_id: >-
- benchmark.yml,
- examples.yml,
- test.yml,
- test_coverage.yml,
- test_install.yml,
- publish.yml
- access_token: ${{ github.token }}
diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml
deleted file mode 100644
index b188b3a..0000000
--- a/.github/workflows/close_pull_requests.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: close_pull_requests
-
-# Workflow triggers:
-on:
- pull_request_target:
- types: [opened]
-
-# Workflow jobs:
-jobs:
-
- # Define job to close all pull requests:
- run:
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
-
- # Close pull request
- - name: 'Close pull request'
- # Pin action to full length commit SHA corresponding to v3.1.2
- uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448
- with:
- comment: |
- Thank you for submitting a pull request. :raised_hands:
-
- We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib).
-
- We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/includes) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions.
-
- Thank you again, and we look forward to receiving your contribution! :smiley:
-
- Best,
- The stdlib team
\ No newline at end of file
diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml
deleted file mode 100644
index 2984901..0000000
--- a/.github/workflows/examples.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: examples
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to run the package examples...
- examples:
-
- # Define display name:
- name: 'Run examples'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Run examples:
- - name: 'Run examples'
- run: |
- npm run examples
diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml
deleted file mode 100644
index 7625fb7..0000000
--- a/.github/workflows/npm_downloads.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2022 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: npm_downloads
-
-# Workflow triggers:
-on:
- # Run this workflow weekly:
- schedule:
- # cron: ' '
- - cron: '10 22 * * 2'
-
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job for retrieving npm download counts...
- npm_downloads:
-
- # Define display name:
- name: 'Retrieve npm download counts'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- timeout-minutes: 10
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Resolve package name:
- - name: 'Resolve package name'
- id: package_name
- run: |
- name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'`
- echo "package_name=$name" >> $GITHUB_OUTPUT
- timeout-minutes: 5
-
- # Fetch download data:
- - name: 'Fetch data'
- id: download_data
- run: |
- url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}"
- echo "$url"
- data=$(curl "$url")
- mkdir ./tmp
- echo "$data" > ./tmp/npm_downloads.json
- echo "data=$data" >> $GITHUB_OUTPUT
- timeout-minutes: 5
-
- # Print summary of download data:
- - name: 'Print summary'
- run: |
- echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY
- echo "|------|------------|" >> $GITHUB_STEP_SUMMARY
- cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY
-
- # Upload the download data:
- - name: 'Upload data'
- # Pin action to full length commit SHA
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
- with:
- # Define a name for the uploaded artifact (ensuring a unique name for each job):
- name: npm_downloads
-
- # Specify the path to the file to upload:
- path: ./tmp/npm_downloads.json
-
- # Specify the number of days to retain the artifact (default is 90 days):
- retention-days: 90
- timeout-minutes: 10
- if: success()
-
- # Send data to events server:
- - name: 'Post data'
- # Pin action to full length commit SHA
- uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3
- env:
- webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }}
- webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }}
- data: '{ "downloads": ${{ steps.download_data.outputs.data }} }'
- timeout-minutes: 5
- if: success()
diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml
deleted file mode 100644
index 83d50c4..0000000
--- a/.github/workflows/productionize.yml
+++ /dev/null
@@ -1,821 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2022 The Stdlib Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#/
-
-# Workflow name:
-name: productionize
-
-# Workflow triggers:
-on:
- # Run workflow when a new commit is pushed to the main branch:
- push:
- branches:
- - main
-
- # Allow the workflow to be manually run:
- workflow_dispatch:
- inputs:
- require-passing-tests:
- description: 'Require passing tests for creating bundles'
- type: boolean
- default: true
-
- # Run workflow upon completion of `publish` workflow run:
- workflow_run:
- workflows: ["publish"]
- types: [completed]
-
-
-# Concurrency group to prevent multiple concurrent executions:
-concurrency:
- group: productionize
- cancel-in-progress: true
-
-# Workflow jobs:
-jobs:
-
- # Define a job to create a production build...
- productionize:
-
- # Define display name:
- name: 'Productionize'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Define the sequence of job steps...
- steps:
- # Checkout main branch of repository:
- - name: 'Checkout main branch'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- with:
- ref: main
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Create production branch:
- - name: 'Create production branch'
- run: |
- git checkout -b production
-
- # Transform error messages:
- - name: 'Transform error messages'
- id: transform-error-messages
- uses: stdlib-js/transform-errors-action@main
-
- # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
- - name: 'Update dependencies in package.json'
- run: |
- PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version)
- if grep -q '"@stdlib/string-format"' package.json; then
- sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json
- else
- node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );"
- fi
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Commit changes:
- - name: 'Commit changes'
- run: |
- git add -A
- git commit -m "Transform error messages"
-
- # Push changes:
- - name: 'Push changes'
- run: |
- SLUG=${{ github.repository }}
- echo "Pushing changes to $SLUG..."
- git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force
-
- # Define a job for running tests of the productionized code...
- test:
-
- # Define a display name:
- name: 'Run Tests'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Indicate that this job depends on the prior job finishing:
- needs: productionize
-
- # Run this job regardless of the outcome of the prior job:
- if: always()
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout the repository:
- - name: 'Checkout repository'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- with:
- # Use the `production` branch:
- ref: production
-
- # Install Node.js:
- - name: 'Install Node.js'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Build native add-on if present:
- - name: 'Build native add-on (if present)'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- run: |
- if [ -f "binding.gyp" ]; then
- npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild
- fi
-
- # Run tests:
- - name: 'Run tests'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- id: tests
- run: |
- npm test || npm test || npm test
-
- # Define job to create a bundle for use in Deno...
- deno:
-
- # Define display name:
- name: 'Create Deno bundle'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Indicate that this job depends on the test job finishing:
- needs: test
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Check if remote `deno` branch exists:
- - name: 'Check if remote `deno` branch exists'
- id: deno-branch-exists
- continue-on-error: true
- run: |
- git fetch --all
- git ls-remote --exit-code --heads origin deno
- if [ $? -eq 0 ]; then
- echo "remote-exists=true" >> $GITHUB_OUTPUT
- else
- echo "remote-exists=false" >> $GITHUB_OUTPUT
- fi
-
- # If `deno` exists, delete everything in branch and merge `production` into it
- - name: 'If `deno` exists, delete everything in branch and merge `production` into it'
- if: steps.deno-branch-exists.outputs.remote-exists
- run: |
- git checkout -b deno origin/deno
-
- find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf
-
- git add -A
- git commit -m "Remove files" --allow-empty
-
- git config merge.theirs.name 'simulate `-s theirs`'
- git config merge.theirs.driver 'cat %B > %A'
- GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories
-
- # Copy files from `production` branch if necessary:
- git checkout origin/production -- .
- if [ -n "$(git status --porcelain)" ]; then
- git add -A
- git commit -m "Auto-generated commit"
- fi
-
- # If `deno` does not exist, create `deno` branch:
- - name: 'If `deno` does not exist, create `deno` branch'
- if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }}
- run: |
- git checkout production
- git checkout -b deno
-
- # Copy files to deno directory:
- - name: 'Copy files to deno directory'
- run: |
- mkdir -p deno
- cp README.md LICENSE CONTRIBUTORS NOTICE ./deno
-
- # Copy TypeScript definitions to deno directory:
- if [ -d index.d.ts ]; then
- cp index.d.ts ./deno/index.d.ts
- fi
- if [ -e ./docs/types/index.d.ts ]; then
- cp ./docs/types/index.d.ts ./deno/mod.d.ts
- fi
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: Install production and development dependencies
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Bundle package for use in Deno:
- - name: 'Bundle package for Deno'
- id: deno-bundle
- uses: stdlib-js/bundle-action@main
- with:
- target: 'deno'
-
- # Rewrite file contents:
- - name: 'Rewrite file contents'
- run: |
- # Replace links to other packages with links to the deno branch:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/";
-
- # Replace reference to `@stdlib/types` with CDN link:
- find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g"
-
- # Change wording of project description to avoid reference to JavaScript and Node.js:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g"
-
- # Rewrite all `require()`s to use jsDelivr links:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// {
- s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i
- s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/
- s/';/@deno\/mod.js';/
- }"
-
- # Rewrite first `import` to show importing of named exports if available:
- exports=$(cat lib/index.js | \
- grep -E 'setReadOnly\(.*,.*,.*\)' | \
- sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \
- sed -E "s/'//g" | \
- sort)
- if [ -n "$exports" ]; then
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/"
- fi
-
- # Remove `installation`, `cli`, and `c` sections:
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/[^<]+<\/section>//g;"
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.cli \-\->//g"
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.c \-\->//g"
-
- # Create package.json file for deno branch:
- jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json
-
- # Delete everything in current directory aside from deno folder:
- - name: 'Delete everything in current directory aside from deno folder'
- run: |
- find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf
-
- # Move deno directory to root:
- - name: 'Move deno directory to root'
- run: |
- mv ./deno/* .
- rmdir ./deno
-
- # Commit changes:
- - name: 'Commit changes'
- run: |
- git add -A
- git commit -m "Auto-generated commit"
-
- # Push changes to `deno` branch:
- - name: 'Push changes to `deno` branch'
- run: |
- SLUG=${{ github.repository }}
- echo "Pushing changes to $SLUG..."
- git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno
-
- # Send notification to Zulip if job fails:
- - name: 'Send notification to Zulip in case of failure'
- # Pin action to full length commit SHA
- uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
- if: failure()
- with:
- api-key: ${{ secrets.ZULIP_API_KEY }}
- email: 'github-actions-bot@stdlib.zulipchat.com'
- organization-url: 'https://stdlib.zulipchat.com'
- to: 'workflows-standalone'
- type: 'stream'
- topic: ${{ github.event.repository.name }}
- content: |
- :cross_mark: **${{ github.workflow }}** workflow failed
-
- **Repository:** [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }})
- **Run:** [View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
-
- # Define job to create a UMD bundle...
- umd:
-
- # Define display name:
- name: 'Create UMD bundle'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Indicate that this job depends on the test job finishing:
- needs: test
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Check if remote `umd` branch exists:
- - name: 'Check if remote `umd` branch exists'
- id: umd-branch-exists
- continue-on-error: true
- run: |
- git fetch --all
- git ls-remote --exit-code --heads origin umd
- if [ $? -eq 0 ]; then
- echo "remote-exists=true" >> $GITHUB_OUTPUT
- else
- echo "remote-exists=false" >> $GITHUB_OUTPUT
- fi
-
- # If `umd` exists, delete everything in branch and merge `production` into it
- - name: 'If `umd` exists, delete everything in branch and merge `production` into it'
- if: steps.umd-branch-exists.outputs.remote-exists
- run: |
- git checkout -b umd origin/umd
-
- find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf
-
- git add -A
- git commit -m "Remove files" --allow-empty
-
- git config merge.theirs.name 'simulate `-s theirs`'
- git config merge.theirs.driver 'cat %B > %A'
- GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories
-
- # Copy files from `production` branch if necessary:
- git checkout origin/production -- .
- if [ -n "$(git status --porcelain)" ]; then
- git add -A
- git commit -m "Auto-generated commit"
- fi
-
- # If `umd` does not exist, create `umd` branch:
- - name: 'If `umd` does not exist, create `umd` branch'
- if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }}
- run: |
- git checkout production
- git checkout -b umd
-
- # Copy files to umd directory:
- - name: 'Copy files to umd directory'
- run: |
- mkdir -p umd
- cp README.md LICENSE CONTRIBUTORS NOTICE ./umd
-
- # Install Node.js
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Extract alias:
- - name: 'Extract alias'
- id: extract-alias
- run: |
- alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/')
- echo "alias=${alias}" >> $GITHUB_OUTPUT
-
- # Create Universal Module Definition (UMD) Node.js bundle:
- - name: 'Create Universal Module Definition (UMD) Node.js bundle'
- id: umd-bundle-node
- uses: stdlib-js/bundle-action@main
- with:
- target: 'umd-node'
- alias: ${{ steps.extract-alias.outputs.alias }}
-
- # Create Universal Module Definition (UMD) browser bundle:
- - name: 'Create Universal Module Definition (UMD) browser bundle'
- id: umd-bundle-browser
- uses: stdlib-js/bundle-action@main
- with:
- target: 'umd-browser'
- alias: ${{ steps.extract-alias.outputs.alias }}
-
- # Rewrite file contents:
- - name: 'Rewrite file contents'
- run: |
-
- # Replace links to other packages with links to the umd branch:
- find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/";
-
- # Remove `installation`, `cli`, and `c` sections:
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/[^<]+<\/section>//g;"
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.cli \-\->//g"
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.c \-\->//g"
-
- # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag:
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n
+```
-```javascript
-var includes = require( '@stdlib/ndarray-includes' );
+If no recognized module system is present, access bundle contents via the global scope:
+
+```html
+
```
#### includes( x, searchElement\[, options] )
@@ -223,8 +229,13 @@ var v = ndarray2array( y );
-```javascript
-var discreteUniform = require( '@stdlib/random-base-discrete-uniform' ).factory;
+```html
+
+
+
+
+
+
+
```
@@ -372,13 +388,13 @@ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/ndarray-includes/main/LICENSE
-[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/ndarray-ctor
+[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/ndarray-ctor/tree/umd
-[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray-dtypes
+[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray-dtypes/tree/umd
-[@stdlib/ndarray/mostly-safe-casts]: https://github.com/stdlib-js/ndarray-mostly-safe-casts
+[@stdlib/ndarray/mostly-safe-casts]: https://github.com/stdlib-js/ndarray-mostly-safe-casts/tree/umd
-[@stdlib/ndarray/base/broadcast-shapes]: https://github.com/stdlib-js/ndarray-base-broadcast-shapes
+[@stdlib/ndarray/base/broadcast-shapes]: https://github.com/stdlib-js/ndarray-base-broadcast-shapes/tree/umd
diff --git a/SECURITY.md b/SECURITY.md
deleted file mode 100644
index 9702d4c..0000000
--- a/SECURITY.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Security
-
-> Policy for reporting security vulnerabilities.
-
-See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
diff --git a/benchmark/benchmark.1d.js b/benchmark/benchmark.1d.js
deleted file mode 100644
index 914925e..0000000
--- a/benchmark/benchmark.1d.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var bench = require( '@stdlib/bench-harness' );
-var isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );
-var pow = require( '@stdlib/math-base-special-pow' );
-var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
-var shape2strides = require( '@stdlib/ndarray-base-shape2strides' );
-var ndarray = require( '@stdlib/ndarray-ctor' );
-var format = require( '@stdlib/string-format' );
-var pkg = require( './../package.json' ).name;
-var includes = require( './../lib' );
-
-
-// VARIABLES //
-
-var types = [ 'float64' ];
-var orders = [ 'row-major', 'column-major' ];
-
-
-// FUNCTIONS //
-
-/**
-* Creates a benchmark function.
-*
-* @private
-* @param {PositiveInteger} len - ndarray length
-* @param {NonNegativeIntegerArray} shape - ndarray shape
-* @param {string} xtype - ndarray data type
-* @param {string} order - memory layout
-* @param {NonNegativeIntegerArray} dims - list of dimensions to reduce
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype, order, dims ) {
- var x;
-
- x = discreteUniform( len, 1, 100 );
- x = new ndarray( xtype, x, shape, shape2strides( shape, order ), 0, order );
-
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = includes( x, 101, {
- 'dims': dims
- });
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an ndarray' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var dims;
- var len;
- var min;
- var max;
- var ord;
- var sh;
- var t1;
- var f;
- var i;
- var j;
- var k;
- var n;
- var d;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- d = [
- [ 0 ],
- []
- ];
-
- for ( n = 0; n < d.length; n++ ) {
- dims = d[ n ];
- for ( k = 0; k < orders.length; k++ ) {
- ord = orders[ k ];
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len ];
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s,dims=[%s]', pkg, sh.length, len, sh.join(','), ord, t1, dims.join(',') ), f );
- }
- }
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.2d.js b/benchmark/benchmark.2d.js
deleted file mode 100644
index ae88336..0000000
--- a/benchmark/benchmark.2d.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 The Stdlib Authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-'use strict';
-
-// MODULES //
-
-var bench = require( '@stdlib/bench-harness' );
-var isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );
-var pow = require( '@stdlib/math-base-special-pow' );
-var sqrt = require( '@stdlib/math-base-special-sqrt' );
-var floor = require( '@stdlib/math-base-special-floor' );
-var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
-var shape2strides = require( '@stdlib/ndarray-base-shape2strides' );
-var ndarray = require( '@stdlib/ndarray-ctor' );
-var format = require( '@stdlib/string-format' );
-var pkg = require( './../package.json' ).name;
-var includes = require( './../lib' );
-
-
-// VARIABLES //
-
-var types = [ 'float64' ];
-var orders = [ 'row-major', 'column-major' ];
-
-
-// FUNCTIONS //
-
-/**
-* Creates a benchmark function.
-*
-* @private
-* @param {PositiveInteger} len - ndarray length
-* @param {NonNegativeIntegerArray} shape - ndarray shape
-* @param {string} xtype - ndarray data type
-* @param {string} order - memory layout
-* @param {NonNegativeIntegerArray} dims - list of dimensions to reduce
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype, order, dims ) {
- var x;
-
- x = discreteUniform( len, 1, 100 );
- x = new ndarray( xtype, x, shape, shape2strides( shape, order ), 0, order );
-
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = includes( x, 101, {
- 'dims': dims
- });
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an ndarray' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var dims;
- var len;
- var min;
- var max;
- var ord;
- var sh;
- var t1;
- var f;
- var i;
- var j;
- var k;
- var n;
- var d;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- d = [
- [ 0, 1 ],
- [ 0 ],
- [ 1 ],
- []
- ];
-
- for ( n = 0; n < d.length; n++ ) {
- dims = d[ n ];
- for ( k = 0; k < orders.length; k++ ) {
- ord = orders[ k ];
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s,dims=[%s]', pkg, sh.length, len, sh.join(','), ord, t1, dims.join(',') ), f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s,dims=[%s]', pkg, sh.length, len, sh.join(','), ord, t1, dims.join(',') ), f );
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( format( '%s:ndims=%d,len=%d,shape=[%s],xorder=%s,xtype=%s,dims=[%s]', pkg, sh.length, len, sh.join(','), ord, t1, dims.join(',') ), f );
- }
- }
- }
- }
-}
-
-main();
diff --git a/branches.md b/branches.md
deleted file mode 100644
index e694340..0000000
--- a/branches.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-# Branches
-
-This repository has the following branches:
-
-- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place.
-- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network).
-- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]).
-- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]).
-- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]).
-
-The following diagram illustrates the relationships among the above branches:
-
-```mermaid
-graph TD;
-A[stdlib]-->|generate standalone package|B;
-B[main] -->|productionize| C[production];
-C -->|bundle| D[esm];
-C -->|bundle| E[deno];
-C -->|bundle| F[umd];
-
-%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/includes"
-%% click B href "https://github.com/stdlib-js/ndarray-includes/tree/main"
-%% click C href "https://github.com/stdlib-js/ndarray-includes/tree/production"
-%% click D href "https://github.com/stdlib-js/ndarray-includes/tree/esm"
-%% click E href "https://github.com/stdlib-js/ndarray-includes/tree/deno"
-%% click F href "https://github.com/stdlib-js/ndarray-includes/tree/umd"
-```
-
-[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/includes
-[production-url]: https://github.com/stdlib-js/ndarray-includes/tree/production
-[deno-url]: https://github.com/stdlib-js/ndarray-includes/tree/deno
-[deno-readme]: https://github.com/stdlib-js/ndarray-includes/blob/deno/README.md
-[umd-url]: https://github.com/stdlib-js/ndarray-includes/tree/umd
-[umd-readme]: https://github.com/stdlib-js/ndarray-includes/blob/umd/README.md
-[esm-url]: https://github.com/stdlib-js/ndarray-includes/tree/esm
-[esm-readme]: https://github.com/stdlib-js/ndarray-includes/blob/esm/README.md
\ No newline at end of file
diff --git a/browser.js b/browser.js
new file mode 100644
index 0000000..6797f03
--- /dev/null
+++ b/browser.js
@@ -0,0 +1,3 @@
+// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
+!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).includes=r()}(this,(function(){"use strict";var t="function"==typeof Object.defineProperty?Object.defineProperty:null;var r=Object.defineProperty;function e(t){return"number"==typeof t}function n(t){var r,e="";for(r=0;r0&&(e-=1),n=t.toExponential(e)):n=t.toPrecision(r.precision),r.alternate||(n=h.call(n,v,"$1e"),n=h.call(n,m,"e"),n=h.call(n,y,""));break;default:throw new Error("invalid double notation. Value: "+r.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),r.alternate&&(n=h.call(n,g,"$1."),n=h.call(n,d,"$1.e")),t>=0&&r.sign&&(n=r.sign+n),n=r.specifier===l.call(r.specifier)?l.call(n):s.call(n)}function w(t){var r,e="";for(r=0;r127)throw new Error("invalid character code. Value: "+o.arg);o.arg=x(u)?String(o.arg):_(u)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(r||(o.precision=6),h=parseFloat(o.arg),!isFinite(h)){if(!e(o.arg))throw new Error("invalid floating-point number. Value: "+s);h=o.arg,o.padZeros=!1}o.arg=b(h,o);break;default:throw new Error("invalid specifier: "+o.specifier)}o.maxWidth>=0&&o.arg.length>o.maxWidth&&(o.arg=o.arg.substring(0,o.maxWidth)),o.padZeros?o.arg=i(o.arg,o.width||o.precision,o.padRight):o.width&&(o.arg=(g=o.arg,d=o.width,y=o.padRight,m=void 0,(m=d-g.length)<0?g:g=y?g+w(m):w(m)+g)),s+=o.arg||"",l+=1}return s}var O=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function V(t){var r={mapping:t[1]?parseInt(t[1],10):void 0,flags:t[2],width:t[3],precision:t[5],specifier:t[6]};return"."===t[4]&&void 0===t[5]&&(r.precision="1"),r}function S(t){var r,e,n,i;for(e=[],i=0,n=O.exec(t);n;)(r=t.slice(i,O.lastIndex-n[0].length)).length&&e.push(r),"%"===n[6]?e.push("%"):e.push(V(n)),i=O.lastIndex,n=O.exec(t);return(r=t.slice(i)).length&&e.push(r),e}function j(t){var r,e;if("string"!=typeof t)throw new TypeError(j("invalid argument. First argument must be a string. Value: `%s`.",t));for(r=[S(t)],e=1;ett&&et(t)}function it(t){return N(t)&&nt(t)}function ot(t){return X(t)&&nt(t.valueOf())}function at(t){return it(t)||ot(t)}function ft(t){return"boolean"==typeof t}k(at,"isPrimitive",it),k(at,"isObject",ot);var ut=Boolean,st=Boolean.prototype.toString;var lt=Y();function ht(t){return"object"==typeof t&&(t instanceof ut||(lt?function(t){try{return st.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===G(t)))}function ct(t){return ft(t)||ht(t)}function pt(t,r,e){M(t,r,{configurable:!1,enumerable:!1,get:e})}function gt(t){return it(t)&&t>0}function dt(t){return ot(t)&&t.valueOf()>0}function yt(t){return gt(t)||dt(t)}k(ct,"isPrimitive",ft),k(ct,"isObject",ht),k(yt,"isPrimitive",gt),k(yt,"isObject",dt);var mt=/./;var vt="object"==typeof self?self:null,bt="object"==typeof window?window:null,wt="object"==typeof globalThis?globalThis:null;function _t(t){if(arguments.length){if(!ft(t))throw new TypeError(j("invalid argument. Must provide a boolean. Value: `%s`.",t));if(t)return new Function("return this;")()}if(wt)return wt;if(vt)return vt;if(bt)return bt;throw new Error("unexpected error. Unable to resolve global object.")}var Et=_t(),xt=Et.document&&Et.document.childNodes,Tt=Int8Array;function At(){return/^\s*function\s*([^(]*)/i}var Ot=/^\s*function\s*([^(]*)/i;k(At,"REGEXP",Ot);var Vt=Array.isArray?Array.isArray:function(t){return"[object Array]"===G(t)};function St(t){if("function"!=typeof t)throw new TypeError(j("invalid argument. Must provide a function. Value: `%s`.",t));return function(r){var e,n;if(!Vt(r))return!1;if(0===(e=r.length))return!1;for(n=0;n=0}function Ut(t){return ot(t)&&t.valueOf()>=0}function Mt(t){return Pt(t)||Ut(t)}k(Mt,"isPrimitive",Pt),k(Mt,"isObject",Ut);var kt=9007199254740991;function Nt(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&et(t.length)&&t.length>=0&&t.length<=kt}var Ct="function"==typeof ArrayBuffer;function Yt(t){return Ct&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===G(t)}function Dt(t){return"object"==typeof t&&null!==t&&!Vt(t)}function zt(t,r){return null!=t&&("symbol"==typeof r?r in Object(t):String(r)in Object(t))}function Jt(t,r){return t2){if(n=Cr(Yr[e]))return new n(t,r);throw new TypeError(j("invalid argument. Must provide a recognized data type. Value: `%s`.",e))}return new Dr(t,r)}(n,i,zr[t.type])}}function Wr(t){return"string"==typeof t}var $r=String.prototype.valueOf;var Gr=Y();function Zr(t){return"object"==typeof t&&(t instanceof String||(Gr?function(t){try{return $r.call(t),!0}catch(t){return!1}}(t):"[object String]"===G(t)))}function qr(t){return Wr(t)||Zr(t)}k(qr,"isPrimitive",Wr),k(qr,"isObject",Zr);var Kr="function"==typeof Int16Array;var Xr=32767,Hr=-32768,Qr="function"==typeof Int16Array?Int16Array:null;var te,re="function"==typeof Int16Array?Int16Array:void 0;te=function(){var t,r,e;if("function"!=typeof Qr)return!1;try{r=new Qr([1,3.14,-3.14,Xr+1]),e=r,t=(Kr&&e instanceof Int16Array||"[object Int16Array]"===G(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&r[3]===Hr}catch(r){t=!1}return t}()?re:function(){throw new Error("not implemented")};var ee=te,ne="function"==typeof Int32Array;var ie=2147483647,oe=-2147483648,ae="function"==typeof Int32Array?Int32Array:null;var fe,ue="function"==typeof Int32Array?Int32Array:void 0;fe=function(){var t,r,e;if("function"!=typeof ae)return!1;try{r=new ae([1,3.14,-3.14,ie+1]),e=r,t=(ne&&e instanceof Int32Array||"[object Int32Array]"===G(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&r[3]===oe}catch(r){t=!1}return t}()?ue:function(){throw new Error("not implemented")};var se=fe,le="function"==typeof Int8Array;var he=127,ce=-128,pe="function"==typeof Int8Array?Int8Array:null;var ge,de="function"==typeof Int8Array?Int8Array:void 0;ge=function(){var t,r,e;if("function"!=typeof pe)return!1;try{r=new pe([1,3.14,-3.14,he+1]),e=r,t=(le&&e instanceof Int8Array||"[object Int8Array]"===G(e))&&1===r[0]&&3===r[1]&&-3===r[2]&&r[3]===ce}catch(r){t=!1}return t}()?de:function(){throw new Error("not implemented")};var ye=ge,me="function"==typeof Uint32Array;var ve=4294967295,be="function"==typeof Uint32Array?Uint32Array:null;var we,_e="function"==typeof Uint32Array?Uint32Array:void 0;we=function(){var t,r,e;if("function"!=typeof be)return!1;try{r=new be(r=[1,3.14,-3.14,ve+1,ve+2]),e=r,t=(me&&e instanceof Uint32Array||"[object Uint32Array]"===G(e))&&1===r[0]&&3===r[1]&&r[2]===ve-2&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}()?_e:function(){throw new Error("not implemented")};var Ee=we,xe="function"==typeof Uint8ClampedArray;var Te="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var Ae,Oe="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;Ae=function(){var t,r,e;if("function"!=typeof Te)return!1;try{r=new Te([-1,0,1,3.14,4.99,255,256]),e=r,t=(xe&&e instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===G(e))&&0===r[0]&&0===r[1]&&1===r[2]&&3===r[3]&&5===r[4]&&255===r[5]&&255===r[6]}catch(r){t=!1}return t}()?Oe:function(){throw new Error("not implemented")};var Ve=Ae,Se=4294967295;function je(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&et(t.length)&&t.length>=0&&t.length<=Se}var Re=St(qr.isPrimitive),Le=St(qr.isObject),Ie=St(qr);function Be(t){return t instanceof kr||t instanceof Mr||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function Fe(t){return et(t/2)}k(Ie,"primitives",Re),k(Ie,"objects",Le);var Pe=8;function Ue(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Pe}var Me=16;function ke(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Me}function Ne(){return"function"==typeof W&&"symbol"==typeof W("foo")&&J(W,"iterator")&&"symbol"==typeof W.iterator}var Ce=Ne()?Symbol.iterator:null;function Ye(t){return t.re}function De(t){return t.im}function ze(t,r){return new Fr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*r,2*(t.length-r))}function Je(t,r){return new Kt(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*r,2*(t.length-r))}var We={float64:function(t,r){return t[r]},float32:function(t,r){return t[r]},int32:function(t,r){return t[r]},int16:function(t,r){return t[r]},int8:function(t,r){return t[r]},uint32:function(t,r){return t[r]},uint16:function(t,r){return t[r]},uint8:function(t,r){return t[r]},uint8c:function(t,r){return t[r]},generic:function(t,r){return t[r]},default:function(t,r){return t[r]}};function $e(t){var r=We[t];return"function"==typeof r?r:We.default}var Ge={complex128:function(t,r){return t.get(r)},complex64:function(t,r){return t.get(r)},default:function(t,r){return t.get(r)}};function Ze(t){var r=Ge[t];return"function"==typeof r?r:Ge.default}function qe(t){var r,e,n;for(r=[];!(e=t.next()).done;)if(je(n=e.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Be(n))return new TypeError(j("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(Ye(n),De(n))}return r}var Ke=2*Fr.BYTES_PER_ELEMENT,Xe=Ne();function He(t){return t instanceof rn||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Qe(t){return t===rn||"Complex128Array"===t.name}function tn(t,r){return new Mr(t[r*=2],t[r+1])}function rn(){var t,r,e,n;if(r=arguments.length,!(this instanceof rn))return 0===r?new rn:1===r?new rn(arguments[0]):2===r?new rn(arguments[0],arguments[1]):new rn(arguments[0],arguments[1],arguments[2]);if(0===r)e=new Fr(0);else if(1===r)if(Pt(arguments[0]))e=new Fr(2*arguments[0]);else if(Nt(arguments[0]))if((n=(e=arguments[0]).length)&&Vt(e)&&Be(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;ie.byteLength-t)throw new RangeError(j("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Ke));e=new Fr(e,t,2*n)}}return k(this,"_buffer",e),k(this,"_length",e.length/2),this}function en(t){return t.re}function nn(t){return t.im}function on(t){var r,e,n;for(r=[];!(e=t.next()).done;)if(je(n=e.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Be(n))return new TypeError(j("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));r.push(en(n),nn(n))}return r}k(rn,"BYTES_PER_ELEMENT",Ke),k(rn,"name","Complex64Array"),k(rn,"from",(function(t){var r,e,n,i,o,a,f,u,s,l,h,c;if(!Bt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Qe(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Bt(n=arguments[1]))throw new TypeError(j("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(He(t)){if(u=t.length,n){for(o=(i=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(j("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Nt(t)){if(n){for(u=t.length,f=t.get&&t.set?Ze("default"):$e("default"),h=0;h=2))throw new TypeError(j("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Dt(t)&&Xe&&Bt(t[Ce])){if(!Bt((o=t[Ce]()).next))throw new TypeError(j("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,je(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Be(o))return new TypeError(j("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(Ye(o),De(o))}return n}(o,n,r):qe(o),a instanceof Error)throw a;for(o=(i=new this(u=a.length/2))._buffer,h=0;h=this._length))return tn(this._buffer,t)})),pt(rn.prototype,"buffer",(function(){return this._buffer.buffer})),pt(rn.prototype,"byteLength",(function(){return this._buffer.byteLength})),pt(rn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),k(rn.prototype,"BYTES_PER_ELEMENT",rn.BYTES_PER_ELEMENT),k(rn.prototype,"copyWithin",(function(t,r){if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),k(rn.prototype,"entries",(function(){var t,r,e,n,i,o;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,n=this._buffer,e=this._length,o=-1,k(r={},"next",(function(){if(o+=1,i||o>=e)return{done:!0};return{value:[o,tn(n,o)],done:!1}})),k(r,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(r,Ce,(function(){return t.entries()})),r})),k(rn.prototype,"every",(function(t,r){var e,n;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!et(e))throw new TypeError(j("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=Ye(t),f=De(t),u=r;u=0;n--)if(i=tn(e,n),t.call(r,i,n,this))return i})),k(rn.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=tn(e,n),t.call(r,i,n,this))return n;return-1})),k(rn.prototype,"forEach",(function(t,r){var e,n,i;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n=this._length))return tn(this._buffer,t)})),k(rn.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(t))throw new TypeError(j("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Ye(t),o=De(t),e=this._buffer,a=r;a1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Ye(t),o=De(t),e=this._buffer,a=r;a=e)return{done:!0};return{value:i,done:!1}})),k(r,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(r,Ce,(function(){return t.keys()})),r})),k(rn.prototype,"lastIndexOf",(function(t,r){var e,n,i,o,a;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(t))throw new TypeError(j("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=Ye(t),o=De(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),pt(rn.prototype,"length",(function(){return this._length})),k(rn.prototype,"map",(function(t,r){var e,n,i,o,a;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=tn(e,0),o=1}for(;o1)n=r,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=tn(e,i-1),o=i-2}for(;o>=0;o--)n=t(n,tn(e,o),o,this);return n})),k(rn.prototype,"reverse",(function(){var t,r,e,n,i,o;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,n=rt(e/2),i=0;i1){if(!Pt(e=arguments[1]))throw new TypeError(j("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Be(t)){if(e>=this._length)throw new RangeError(j("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=Ye(t),void(n[e+1]=De(t))}if(He(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*Ke,r.buffer===n.buffer&&r.byteOffsets){for(i=new Fr(r.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,s=n.byteOffset+e*Ke,r.buffer===n.buffer&&r.byteOffsets){for(i=new Fr(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(r=f)}}for(e=ti&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*Ke):(i=r-t,e=n.byteOffset+t*Ke),new this.constructor(n.buffer,e,i<0?0:i)})),k(rn.prototype,"toLocaleString",(function(t,r){var e,n,i,o,a;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Wr(t)&&!Re(t))throw new TypeError(j("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)e={};else{if(!Dt(r))throw new TypeError(j("invalid argument. Options argument must be an object. Value: `%s`.",r));e=r}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:tn(i,o),done:!1}})),k(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(t,Ce,(function(){return r.values()})),t})),k(rn.prototype,"with",(function(t,r){var e,n,i;if(!He(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!et(t))throw new TypeError(j("invalid argument. First argument must be an integer. Value: `%s`.",t));if(i=this._length,t<0&&(t+=i),t<0||t>=i)throw new RangeError(j("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Be(r))throw new TypeError(j("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=Ye(r),e[2*t+1]=De(r),n}));var an=2*Kt.BYTES_PER_ELEMENT,fn=Ne();function un(t){return t instanceof hn||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function sn(t){return t===hn||"Complex64Array"===t.name}function ln(t,r){return new kr(t[r*=2],t[r+1])}function hn(){var t,r,e,n;if(r=arguments.length,!(this instanceof hn))return 0===r?new hn:1===r?new hn(arguments[0]):2===r?new hn(arguments[0],arguments[1]):new hn(arguments[0],arguments[1],arguments[2]);if(0===r)e=new Kt(0);else if(1===r)if(Pt(arguments[0]))e=new Kt(2*arguments[0]);else if(Nt(arguments[0]))if((n=(e=arguments[0]).length)&&Vt(e)&&Be(e[0])){if(e=function(t,r){var e,n,i,o;for(e=r.length,o=0,i=0;ie.byteLength-t)throw new RangeError(j("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*an));e=new Kt(e,t,2*n)}}return k(this,"_buffer",e),k(this,"_length",e.length/2),this}function cn(t){var r,e;for(r=[];!(e=t.next()).done;)r.push(ut(e.value));return r}k(hn,"BYTES_PER_ELEMENT",an),k(hn,"name","Complex128Array"),k(hn,"from",(function(t){var r,e,n,i,o,a,f,u,s,l,h,c;if(!Bt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Bt(n=arguments[1]))throw new TypeError(j("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(un(t)){if(u=t.length,n){for(o=(i=new this(u))._buffer,c=0,h=0;h=2))throw new TypeError(j("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Nt(t)){if(n){for(u=t.length,f=t.get&&t.set?Ze("default"):$e("default"),h=0;h=2))throw new TypeError(j("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(t)}if(Dt(t)&&fn&&Bt(t[Ce])){if(!Bt((o=t[Ce]()).next))throw new TypeError(j("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,r,e){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,je(o=r.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Be(o))return new TypeError(j("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(en(o),nn(o))}return n}(o,n,r):on(o),a instanceof Error)throw a;for(o=(i=new this(u=a.length/2))._buffer,h=0;h=this._length))return ln(this._buffer,t)})),pt(hn.prototype,"buffer",(function(){return this._buffer.buffer})),pt(hn.prototype,"byteLength",(function(){return this._buffer.byteLength})),pt(hn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),k(hn.prototype,"BYTES_PER_ELEMENT",hn.BYTES_PER_ELEMENT),k(hn.prototype,"copyWithin",(function(t,r){if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*r):this._buffer.copyWithin(2*t,2*r,2*arguments[2]),this})),k(hn.prototype,"entries",(function(){var t,r,e,n,i,o,a;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._buffer,n=this._length,o=-1,a=-2,k(e={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new kr(t[a+=2],t[a+1]),{value:[o,r],done:!1}})),k(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(e,Ce,(function(){return r.entries()})),e})),k(hn.prototype,"every",(function(t,r){var e,n;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!et(e))throw new TypeError(j("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(a=en(t),f=nn(t),u=r;u=0;n--)if(i=ln(e,n),t.call(r,i,n,this))return i})),k(hn.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=ln(e,n),t.call(r,i,n,this))return n;return-1})),k(hn.prototype,"forEach",(function(t,r){var e,n,i;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n=this._length))return ln(this._buffer,t)})),pt(hn.prototype,"length",(function(){return this._length})),k(hn.prototype,"includes",(function(t,r){var e,n,i,o,a;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(t))throw new TypeError(j("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=en(t),o=nn(t),e=this._buffer,a=r;a1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=en(t),o=nn(t),e=this._buffer,a=r;a=e)return{done:!0};return{value:i,done:!1}})),k(r,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(r,Ce,(function(){return t.keys()})),r})),k(hn.prototype,"lastIndexOf",(function(t,r){var e,n,i,o,a;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Be(t))throw new TypeError(j("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!et(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=en(t),o=nn(t),e=this._buffer,a=r;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),k(hn.prototype,"map",(function(t,r){var e,n,i,o,a;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)n=r,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=ln(e,0),o=1}for(;o1)n=r,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=ln(e,i-1),o=i-2}for(;o>=0;o--)n=t(n,ln(e,o),o,this);return n})),k(hn.prototype,"reverse",(function(){var t,r,e,n,i,o;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,n=rt(e/2),i=0;i1){if(!Pt(e=arguments[1]))throw new TypeError(j("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Be(t)){if(e>=this._length)throw new RangeError(j("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=en(t),void(n[e+1]=nn(t))}if(un(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t._buffer,s=n.byteOffset+e*an,r.buffer===n.buffer&&r.byteOffsets){for(i=new Kt(r.length),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,s=n.byteOffset+e*an,r.buffer===n.buffer&&r.byteOffsets){for(i=new Kt(a),u=0;uthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,u=0;uf&&(r=f)}}for(e=ti&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*an):(i=r-t,e=n.byteOffset+t*an),new this.constructor(n.buffer,e,i<0?0:i)})),k(hn.prototype,"toLocaleString",(function(t,r){var e,n,i,o,a;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!qr(t)&&!Re(t))throw new TypeError(j("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)e={};else{if(!Dt(r))throw new TypeError(j("invalid argument. Options argument must be an object. Value: `%s`.",r));e=r}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:ln(i,o),done:!1}})),k(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(t,Ce,(function(){return r.values()})),t})),k(hn.prototype,"with",(function(t,r){var e,n,i;if(!un(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!et(t))throw new TypeError(j("invalid argument. First argument must be an integer. Value: `%s`.",t));if(i=this._length,t<0&&(t+=i),t<0||t>=i)throw new RangeError(j("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Be(r))throw new TypeError(j("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(e=(n=new this.constructor(this._buffer))._buffer)[2*t]=en(r),e[2*t+1]=nn(r),n}));var pn=vr.BYTES_PER_ELEMENT,gn=Ne();function dn(t){return"object"==typeof t&&null!==t&&"BooleanArray"===t.constructor.name&&t.BYTES_PER_ELEMENT===pn}function yn(t){return t===mn}function mn(){var t,r,e,n,i;if(r=arguments.length,!(this instanceof mn))return 0===r?new mn:1===r?new mn(arguments[0]):2===r?new mn(arguments[0],arguments[1]):new mn(arguments[0],arguments[1],arguments[2]);if(0===r)e=new vr(0);else if(1===r)if(Pt(i=arguments[0]))e=new vr(i);else if(Nt(i))e=function(t,r){var e,n;for(e=r.length,n=0;ne.byteLength-t)throw new RangeError(j("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*pn));e=new vr(e,t,n)}}return k(this,"_buffer",e),k(this,"_length",e.length),this}k(mn,"BYTES_PER_ELEMENT",pn),k(mn,"name","BooleanArray"),k(mn,"from",(function(t){var r,e,n,i,o,a,f,u,s;if(!Bt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!yn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((e=arguments.length)>1){if(!Bt(n=arguments[1]))throw new TypeError(j("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(r=arguments[2])}if(Nt(t)){if(n){for(u=t.length,f=t.get&&t.set?Ze("default"):$e("default"),o=(i=new this(u))._buffer,s=0;s=e))return ut(r[t])})),pt(mn.prototype,"buffer",(function(){return this._buffer.buffer})),pt(mn.prototype,"byteLength",(function(){return this._buffer.byteLength})),pt(mn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),k(mn.prototype,"BYTES_PER_ELEMENT",mn.BYTES_PER_ELEMENT),k(mn.prototype,"copyWithin",(function(t,r){if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(t,r):this._buffer.copyWithin(t,r,arguments[2]),this})),k(mn.prototype,"entries",(function(){var t,r,e,n,i,o;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,n=this._buffer,e=this._length,o=-1,k(r={},"next",(function(){if(o+=1,i||o>=e)return{done:!0};return{value:[o,ut(n[o])],done:!1}})),k(r,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(r,Ce,(function(){return t.entries()})),r})),k(mn.prototype,"every",(function(t,r){var e,n;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n1){if(!it(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!it(e))throw new TypeError(j("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else r=0,e=i;for(o=t?1:0,a=r;a=0;i--)if(n=ut(e[i]),t.call(r,n,i,this))return n})),k(mn.prototype,"findLastIndex",(function(t,r){var e,n,i;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,i=this._length-1;i>=0;i--)if(n=ut(e[i]),t.call(r,n,i,this))return i;return-1})),k(mn.prototype,"forEach",(function(t,r){var e,n;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Bt(t))throw new TypeError(j("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,n=0;n=this._length))return ut(this._buffer[t])})),k(mn.prototype,"includes",(function(t,r){var e,n;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ft(t))throw new TypeError(j("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!it(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(e=this._buffer,n=r;n1){if(!it(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(e=this._buffer,n=r;n0){if(!Wr(t))throw new TypeError(j("invalid argument. First argument must be a string. Value: `%s`.",t))}else t=",";for(r=this._buffer,e=[],n=0;n=e)return{done:!0};return{value:i,done:!1}})),k(r,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(r,Ce,(function(){return t.keys()})),r})),k(mn.prototype,"lastIndexOf",(function(t,r){var e,n;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ft(t))throw new TypeError(j("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!it(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(e=this._buffer,n=r;n>=0;n--)if(t===ut(e[n]))return n;return-1})),pt(mn.prototype,"length",(function(){return this._length})),k(mn.prototype,"map",(function(t,r){var e,n,i,o;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Bt(t))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",t);for(i=this._buffer,e=(n=new this.constructor(this._length))._buffer,o=0;o1)i=r,o=0;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=ut(e[0]),o=1}for(;o1)i=r,o=n-1;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=ut(e[n-1]),o=n-2}for(;o>=0;o--)i=t(i,ut(e[o]),o,this);return i})),k(mn.prototype,"reverse",(function(){var t,r,e,n,i,o;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._buffer,e=this._length,n=rt(e/2),i=0;i1){if(!Pt(e=arguments[1]))throw new TypeError(j("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Nt(t)){if(e+(o=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=dn(t)?t._buffer:t,f=n.byteOffset+e*pn,r.buffer===n.buffer&&r.byteOffsetf){for(i=new vr(r.length),a=0;a=this._length)throw new RangeError(j("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));n[e]=t?1:0}})),k(mn.prototype,"slice",(function(t,r){var e,n,i,o,a,f;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(o=this._buffer,a=this._length,0===arguments.length)t=0,r=a;else{if(!it(t))throw new TypeError(j("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a)<0&&(t=0),1===arguments.length)r=a;else{if(!it(r))throw new TypeError(j("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=a)<0&&(r=0):r>a&&(r=a)}}for(e=ti&&(r=i)}}return t>=i?(i=0,e=n.byteLength):t>=r?(i=0,e=n.byteOffset+t*pn):(i=r-t,e=n.byteOffset+t*pn),new this.constructor(n.buffer,e,i<0?0:i)})),k(mn.prototype,"toLocaleString",(function(t,r){var e,n,i,o,a;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!Wr(t)&&!Re(t))throw new TypeError(j("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)e={};else{if(!Dt(r))throw new TypeError(j("invalid argument. Options argument must be an object. Value: `%s`.",r));e=r}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:ut(i[o]),done:!1}})),k(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Ce&&k(t,Ce,(function(){return r.values()})),t})),k(mn.prototype,"with",(function(t,r){var e,n;if(!dn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!it(t))throw new TypeError(j("invalid argument. First argument must be an integer. Value: `%s`.",t));if(n=this._length,t<0&&(t+=n),t<0||t>=n)throw new RangeError(j("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!ft(r))throw new TypeError(j("invalid argument. Second argument must be a boolean. Value: `%s`.",r));return(e=new this.constructor(this._buffer))._buffer[t]=r?1:0,e}));var vn={float64:Kt,float32:Fr,int16:ee,int32:se,int8:ye,uint16:Ar,uint32:Ee,uint8:vr,uint8c:Ve,complex64:rn,complex128:hn,bool:mn};function bn(t){return vn[t]||null}function wn(t,r){return new vr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*r,t.length-r)}function _n(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}}}var En={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}},xn={"dtypes.default":En.dtypes.default,"dtypes.numeric":En.dtypes.numeric,"dtypes.real":En.dtypes.real,"dtypes.floating_point":En.dtypes.floating_point,"dtypes.real_floating_point":En.dtypes.real_floating_point,"dtypes.complex_floating_point":En.dtypes.complex_floating_point,"dtypes.integer":En.dtypes.integer,"dtypes.signed_integer":En.dtypes.signed_integer,"dtypes.unsigned_integer":En.dtypes.unsigned_integer,"dtypes.boolean":En.dtypes.boolean,"dtypes.index":En.dtypes.index,"dtypes.integer_index":En.dtypes.integer_index,"dtypes.boolean_index":En.dtypes.boolean_index,"dtypes.mask_index":En.dtypes.mask_index};k(_n,"get",(function(t){var r=xn[t];return void 0===r?null:r}));var Tn=_n.get("dtypes.default"),An=bn("complex64"),On=bn("complex128"),Vn=bn("bool");function Sn(){var t,r,e,n;if(null===(e=bn(r=(t=arguments.length)&&Wr(arguments[t-1])?arguments[t-=1]:Tn)))throw new TypeError(j("invalid argument. Must provide a recognized data type. Value: `%s`.",r));return t<=0?new e(0):1===t?((n=arguments[0])instanceof An?n=ze(n,0):n instanceof On?n=Je(n,0):n instanceof Vn&&(n=wn(n,0)),new e(n)):2===t?new e(arguments[0],arguments[1]):new e(arguments[0],arguments[1],arguments[2])}function jn(t){if(t.length)return t.isStructType?function(t){return function(){var r,e,n,i;for(r=(e=this[fr]).byteOffset+t.byteOffset,n=[],i=0;i0&&r.push("generic"),r)}var zn=kn(Dn("real_floating_point")),Jn=kn(Dn("signed_integer")),Wn=_t();function $n(){return"function"==typeof Wn.BigInt&&"function"==typeof BigInt&&"bigint"==typeof Wn.BigInt("1")&&"bigint"==typeof BigInt("1")}function Gn(t){return"bigint"==typeof t}function Zn(t){return"object"==typeof t&&"[object BigInt]"===G(t)&&function(t){try{return"bigint"==typeof t.valueOf()}catch(t){return!1}}(t)}function qn(t){return Gn(t)||Zn(t)}function Kn(t){return function(){return t}}k(qn,"isPrimitive",Gn),k(qn,"isObject",Zn);var Xn,Hn=Kn(!1),Qn=Kn(!1),ti=Kn(!1);k(Hn,"isPrimitive",Qn),k(Hn,"isObject",ti),Xn=$n()?qn:Hn;const{isPrimitive:ri}=Xn;function ei(t){return Object.keys(Object(t))}var ni,ii=void 0!==Object.keys;function oi(t){return"[object Arguments]"===G(t)}ni=function(){return oi(arguments)}();var ai=ni;function fi(t){return t!=t}function ui(t){return N(t)&&fi(t)}function si(t){return X(t)&&fi(t.valueOf())}function li(t){return ui(t)||si(t)}k(li,"isPrimitive",ui),k(li,"isObject",si);var hi=Object.prototype.propertyIsEnumerable;var ci=!hi.call("beep","0");function pi(t,r){var e;return null!=t&&(!(e=hi.call(t,r))&&ci&&qr(t)?!ui(r=+r)&&it(r)&&r>=0&&r=0&&t.length<=ve&&J(t,"callee")&&!pi(t,"callee")},di=Array.prototype.slice;var yi=pi((function(){}),"prototype"),mi=!pi({toString:null},"toString");function vi(t,r,e){var n,i;if(!Nt(t)&&!Wr(t))throw new TypeError(j("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(n=t.length))return-1;if(3===arguments.length){if(!it(e))throw new TypeError(j("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=n)return-1;i=e}else(i=n+e)<0&&(i=0)}else i=0;if(li(r)){for(;i0&&!J(t,"0"))for(f=0;f1){if(!Bi(r))throw new TypeError(j("invalid argument. Options argument must be an object. Value: `%s`.",r));if(J(r,"duplicates")&&!ft(s=r.duplicates))throw new TypeError(j("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",s))}if(n=(e=Vi(t)).length,a={},s)for(u=0;u0}var zi,Ji={float64:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},float16:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},int64:{float64:0,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},int32:{float64:1,float32:0,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},int16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:1,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},int8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:1,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint32:{float64:1,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint8c:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex128:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex32:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},generic:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},binary:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:1,generic:0,bool:0},bool:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:1}};var Wi=function(t){return 0===arguments.length?function(){var t,r,e,n,i,o,a,f,u;for(e={},r=(t=Vi(Ji)).length,u=0;u0}var Gi,Zi={float64:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},float16:{float64:1,float32:1,float16:1,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},int64:{float64:0,float32:0,float16:0,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},int32:{float64:1,float32:0,float16:0,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},int16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},int8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:1,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint32:{float64:1,float32:0,float16:0,int64:1,int32:0,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:0,complex32:0,binary:0,generic:1,bool:0},uint16:{float64:1,float32:1,float16:0,int64:1,int32:1,int16:0,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:0,binary:0,generic:1,bool:0},uint8:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},uint8c:{float64:1,float32:1,float16:1,int64:1,int32:1,int16:1,int8:0,uint64:1,uint32:1,uint16:1,uint8:1,uint8c:1,complex128:1,complex64:1,complex32:1,binary:0,generic:1,bool:0},complex128:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:0,bool:0},complex64:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:0,bool:0},complex32:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:1,complex64:1,complex32:1,binary:0,generic:0,bool:0},generic:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:0},binary:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:1,generic:0,bool:0},bool:{float64:0,float32:0,float16:0,int64:0,int32:0,int16:0,int8:0,uint64:0,uint32:0,uint16:0,uint8:0,uint8c:0,complex128:0,complex64:0,complex32:0,binary:0,generic:1,bool:1}};var qi=function(t){return 0===arguments.length?function(){var t,r,e,n,i,o,a,f,u;for(e={},r=(t=Vi(Zi)).length,u=0;u0}(t,r)))}function Xi(t){return 0===t&&1/t===tt}var Hi=1401298464324817e-60,Qi=16777215,to=-16777215;function ro(t){return t!=t||t===Q||t===tt?"float32":et(t)?t>=to&&t<=Qi?"float32":"float64":t>-Hi&&t=ce?"int8":t>=Hr?"int16":t>=oe?"int32":"float64":t<=gr?"uint8":t<=wr?"uint16":t<=ve?"uint32":"float64":t>-Hi&&t=ce?"int8":t>=Hr?"int16":t>=oe?"int32":"float64":t<=he?"int8":t<=Xr?"int16":t<=ie?"int32":"float64"}(e):eo(e):ho.dtypes.real,i=e):Be(e)?(n=uo(e)||("float32"===t.type?"complex64":"complex128"),i=e.re):ft(e)?(n="bool",i=so(e)):ri(e)?(n="int64",i=lo(e)):(n="generic",i=e);if(!Ki(n,t.type,t.castingMode))throw new TypeError(j("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[fr][r](t.byteOffset,i,Vr)}}function po(t){return ut(t)}function go(t){return ut(t.re||t.im)}function yo(t,r){return function(e){var n,i;ft(e)?(n="bool",i=so(e)):N(e)?(n=ho.dtypes.real,i=so(po(e))):ri(e)?(n="int64",i=so(function(t){return ut(t)}(e))):Be(e)?(n=uo(e)||ho.dtypes.complex,i=so(go(e))):(n="generic",i=ut(e));if(!Ki(n,t.type,t.castingMode))throw new TypeError(j("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[fr][r](t.byteOffset,i,Vr)}}var mo="function"==typeof BigInt?BigInt:void 0;function vo(t,r){return function(e){var n,i;ri(e)?(n="int64",i=e):N(e)?it(e)?(n=eo(e),i=mo(e)):(n=ho.dtypes.real,i=mo(rt(e))):ft(e)?(n="bool",i=function(t){return mo(t?1:0)}(e)):Be(e)?(n=uo(e)||ho.dtypes.complex,i=mo(rt(e.re))):(n="generic",i=mo(rt(Z(i))));if(!Ki(n,t.type,t.castingMode))throw new TypeError(j("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[fr][r](t.byteOffset,i,Vr)}}var bo={float64:function(t,r,e){t[r]=e},float32:function(t,r,e){t[r]=e},int32:function(t,r,e){t[r]=e},int16:function(t,r,e){t[r]=e},int8:function(t,r,e){t[r]=e},uint32:function(t,r,e){t[r]=e},uint16:function(t,r,e){t[r]=e},uint8:function(t,r,e){t[r]=e},uint8c:function(t,r,e){t[r]=e},generic:function(t,r,e){t[r]=e},default:function(t,r,e){t[r]=e}};function wo(t){var r=bo[t];return"function"==typeof r?r:bo.default}var _o={complex128:function(t,r,e){t.set(e,r)},complex64:function(t,r,e){t.set(e,r)},default:function(t,r,e){t.set(e,r)}};function Eo(t){var r=_o[t];return"function"==typeof r?r:_o.default}function xo(t){var r=Un(t);return Ln(t)?{data:t,dtype:r,accessorProtocol:!0,accessors:[Ze(r),Eo(r)]}:{data:t,dtype:r,accessorProtocol:!1,accessors:[$e(r),wo(r)]}}function To(t,r,e,n,i,o,a){var f,u,s,l,h,c,p;for(f=r.data,u=i.data,l=r.accessors[0],s=i.accessors[1],h=n,c=a,p=0;p0)for(l=0;l0)for(c=0;c0?0:(1-t)*r}var Po=8;function Uo(t,r,e,n,i){var o,a,f,u;if(t<=0)return e;if((f=xo(e)).accessorProtocol)return function(t,r,e,n,i){var o,a,f,u;for(o=e.data,a=e.accessors[1],f=i,u=0;u0)for(u=0;u0&&(f+=r),Wo(s=a(o,u))||(f+=String(s)),u+=n;return f}(t,r,f,n,i);for(a=i,o="",s=0;s0&&(o+=r),Wo(u=e[a])||(o+=String(u)),a+=n;return o}function Go(t,r){return $o(t.length,r,t,1,0)}function Zo(t,r){return ft(t)?null:new TypeError(j("invalid argument. `%s` field must be a boolean. Value: `%s`.",r,t))}k((function(t,r,e,n){return $o(t,r,e,n,Fo(t,n))}),"ndarray",$o);var qo=["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float32","float64","complex64","complex128","bool"];var Ko={binary:1,bool:1,complex64:8,complex128:16,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32};function Xo(t){var r;return Wr(t)?Ko[t]||null:N(t)?Ko[Pi(t)]||null:t&>(r=t.byteLength)?r:null}var Ho,Qo={int8:1,int16:2,int32:4,int64:8,uint8:1,uint16:2,uint32:4,uint64:8,float16:2,float32:4,float64:8,complex32:2,complex64:4,complex128:8,bool:1},ta=["name","type"],ra={name:function(t,r){return Wr(t)||t.length>0?null:new TypeError(j("invalid argument. `%s` field must be a non-empty string. Value: `%s`.",r,t))},type:function(t){return Mn(qo,t)||Ft(t)?null:new TypeError(j('invalid argument. `%s` field must be either a struct type or one of the following: "%s". Value: `%s`.',"type",Go(qo,", "),t))},description:function(t,r){return Wr(t)?null:new TypeError(j("invalid argument. `%s` field must be a string. Value: `%s`.",r,t))},length:function(t,r){return gt(t)?null:new TypeError(j("invalid argument. `%s` field must be a positive integer. Value: `%s`.",r,t))},enumerable:Zo,writable:Zo,default:Kn(null),castingMode:(Ho=["none","safe","mostly-safe","same-kind","unsafe"],function(t,r){return Mn(Ho,t)?null:new TypeError(j('invalid argument. `%s` field must be one of the following: "%s". Value: `%s`.',r,Go(Ho,", "),t))})};function ea(t,r){var e,n,i,o,a;for(e={isStructType:!1,description:"",byteLength:0,byteOffset:0,alignment:0,padding:0,enumerable:!0,writable:!0,default:void 0,castingMode:"none"},a=0;ar&&(r=e);return r}function ia(t){var r,e,n,i,o,a,f;if(0===(r=t.fields).length)return null;for(n=[],f=0;f0&&o.byteOffset===t[a-1].byteOffset||(o.isStructType?r.push(Nn(o.type.layout,n,sa(o.byteOffset))):r.push(j("|<%s>[%u,%u]",o.type,o.byteOffset,o.byteLength)));return"|"===(e=j("%s|",r.join("")))[e.length-2]&&(e=e.substring(0,e.length-1)),e}var ha=["none","linear","layout"],ca=kn(ha);function pa(t,r,e){var n;if(!Bi(e))throw new TypeError(j("invalid argument. Options argument must be an object. Value: `%s`.",e));if(n={format:"none"},J(e,"format")&&(n.format=e.format,!ca(n.format)))throw new TypeError(j('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"format",Go(ha,", "),e.format));return"linear"===n.format?function(t,r){var e,n,i,o,a,f,u,s,l,h,c,p,g,d,y,m,v,b,w,_,E,x;for(m=r.length,e="%"+(t.byteLength-1).toString().length+"s",d=0,_=0;_d&&(d=y);for(n="%"+d+"s",i="// %s",f="%s: %s %s",h=0,s=[],_=0;_0&&v.byteOffset===r[_-1].byteOffset)){for(l=_1?" (byte %u)":"",l){for(a=" => union: %s",u=[],x=_+1;x":b.type,u.push(j("%s<%s>[%u]",b.name,w,E%b.alignment)),x+=1;a=j(a,u.join(", "))}else a="";u=j(o+a,E%v.alignment),g=v.length?j(i,j("%s[%u]%s",v.type,rt(E/v.alignment),u)):j(i,j("%s%s",v.type,u)),s.push(j(f,c,p,g)),h+=1}for(E=0;E"}function ga(){}var da="foo"===ga.name;var ya=[Kt,Fr,se,Ee,ee,Ar,ye,vr,Ve],ma=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],va=Zt()?Li(Kt):ba;function ba(){}va="TypedArray"===function(t){if(!1===Bt(t))throw new TypeError(j("invalid argument. Must provide a function. Value: `%s`.",t));return da?t.name:Ot.exec(t.toString())[1]}(va)?va:ba;var wa=[hn,rn],_a=["Complex64Array","Complex128Array"];function Ea(){return"function"==typeof W&&"symbol"==typeof W("foo")&&J(W,"hasInstance")&&"symbol"==typeof W.hasInstance}var xa=Ea()?Symbol.hasInstance:null,Ta=Ea();function Aa(t,r){if("function"!=typeof r&&(!Ta||"object"!=typeof r||"function"!=typeof r[xa]))throw new TypeError(j("invalid argument. Second argument must be callable. Value: `%s`.",r));return t instanceof r}var Oa=[[Kt,"Float64Array"],[Fr,"Float32Array"],[se,"Int32Array"],[Ee,"Uint32Array"],[ee,"Int16Array"],[Ar,"Uint16Array"],[ye,"Int8Array"],[vr,"Uint8Array"],[Ve,"Uint8ClampedArray"],[rn,"Complex64Array"],[hn,"Complex128Array"],[mn,"BooleanArray"]];function Va(t){var r,e;for(e=0;e0){if(!Dt(t))throw new TypeError(j("invalid argument. First argument must be an object. Value: `%s`.",t));p=t}if(k(this,fr,c),void 0!==p){for(u=Wt(void 0,a.length),h={},y=0;y0&&((o=t[f-1]).padding=n,Jo(a)&&ua(o.fields,n)),a.byteOffset=i,Jo(a))for(u=0;u0?arguments[0]:{})})),k(s.prototype,"toJSON",(function(){if(!(this instanceof s))throw new Error("invalid invocation. `this` is not a struct instance.");return function(t,r){var e,n,i,o;for(e={},o=0;o0&&r.push("generic"),r)}var Fa=kn(Ba("complex_floating_point"));function Pa(t){return Fa(String(t))}var Ua=kn(Ba("boolean"));var Ma=kn(Ba("real_floating_point"));var ka=kn(Ba("unsigned_integer"));var Na=kn(Ba("signed_integer"));var Ca,Ya,Da,za=kn(Ba());function Ja(t,r){var e,n,i;if(e=arguments.length,!(this instanceof Ja))return e<2?new Ja(t):new Ja(t,r);if(za(t))n="builtin";else{if(function(t){return t instanceof Ja||"object"==typeof t&&null!==t&&"DataType"===t.constructor.name&&Wr(t.char)&&Wr(t.description)&&Wr(t.byteOrder)&&zt(t,"value")}(t))return new Ja(t.value,{description:t.description});if(!Ft(t))throw new TypeError(j("invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.",t));n="struct"}if(e>1){if(!Bi(i=r))throw new TypeError(j("invalid argument. Options argument must be an object. Value: `%s`.",i));if(J(i,"description")&&!Wr(i.description))throw new TypeError(j("invalid option. `%s` option must be a string. Option: `%s`.","description",i.description))}else i={};return k(this,"_value",t),k(this,"_description",i.description||function(t){return 0===arguments.length?{binary:"byte",bool:"boolean",complex32:"half-precision floating-point complex number",complex64:"single-precision floating-point complex number",complex128:"double-precision floating-point complex number",float16:"half-precision floating-point number",bfloat16:"brain floating-point number",float32:"single-precision floating-point number",float64:"double-precision floating-point number",float128:"quadruple-precision floating-point number",generic:"generic array value",int8:"signed 8-bit integer",int16:"signed 16-bit integer",int32:"signed 32-bit integer",int64:"signed 64-bit integer",int128:"signed 128-bit integer",int256:"signed 256-bit integer",uint8:"unsigned 8-bit integer",uint8c:"unsigned 8-bit integer (clamped)",uint16:"unsigned 16-bit integer",uint32:"unsigned 32-bit integer",uint64:"unsigned 64-bit integer",uint128:"unsigned 128-bit integer",uint256:"unsigned 256-bit integer"}:(void 0===Ca&&(Ca={binary:"byte",bool:"boolean",complex32:"half-precision floating-point complex number",complex64:"single-precision floating-point complex number",complex128:"double-precision floating-point complex number",float16:"half-precision floating-point number",bfloat16:"brain floating-point number",float32:"single-precision floating-point number",float64:"double-precision floating-point number",float128:"quadruple-precision floating-point number",generic:"generic array value",int8:"signed 8-bit integer",int16:"signed 16-bit integer",int32:"signed 32-bit integer",int64:"signed 64-bit integer",int128:"signed 128-bit integer",int256:"signed 256-bit integer",uint8:"unsigned 8-bit integer",uint8c:"unsigned 8-bit integer (clamped)",uint16:"unsigned 16-bit integer",uint32:"unsigned 32-bit integer",uint64:"unsigned 64-bit integer",uint128:"unsigned 128-bit integer",uint256:"unsigned 256-bit integer"}),Ca[ki(t)]||null)}(t)||""),k(this,"_char",function(t){return 0===arguments.length?{binary:"r",bool:"x",complex32:"j",complex64:"c",complex128:"z",float16:"h",bfloat16:"e",float32:"f",float64:"d",float128:"g",generic:"o",int8:"s",int16:"k",int32:"i",int64:"l",int128:"m",int256:"n",uint8:"b",uint8c:"a",uint16:"t",uint32:"u",uint64:"v",uint128:"w",uint256:"y"}:(void 0===Ya&&(Ya={binary:"r",bool:"x",complex32:"j",complex64:"c",complex128:"z",float16:"h",bfloat16:"e",float32:"f",float64:"d",float128:"g",generic:"o",int8:"s",int16:"k",int32:"i",int64:"l",int128:"m",int256:"n",uint8:"b",uint8c:"a",uint16:"t",uint32:"u",uint64:"v",uint128:"w",uint256:"y"}),Ya[ki(t)]||null)}(t)||""),k(this,"_enum",function(t){var r=typeof t;return"number"===r?Pi(t)?t:null:"string"===r?Mi(t):"object"===r&&t&&it(t.enum)?t.enum:Ft(t)?Mi("userdefined_type"):null}(t)||-1),k(this,"_alignment",function(t){var r;return 0===arguments.length?{binary:1,bool:1,complex32:2,complex64:4,complex128:8,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32}:(void 0===Da&&(Da={binary:1,bool:1,complex32:2,complex64:4,complex128:8,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32}),t?gt(r=t.alignment)?r:Da[ki(t)]||null:null)}(t)||-1),k(this,"_byteLength",Xo(t)||-1),k(this,"_byteOrder","host"),k(this,"_type",n),this}function Wa(t){return t instanceof Ja||"object"==typeof t&&null!==t&&it(t.alignment)&&it(t.byteLength)&&Wr(t.byteOrder)&&Wr(t.char)&&it(t.enum)&&zt(t,"value")}function $a(t){return Bt(t)&>(t.alignment)&>(t.byteLength)&&Bt(t.byteLengthOf)&&Bt(t.byteOffsetOf)&&Bt(t.bufferOf)&&Bt(t.viewOf)||Wa(t)&&$a(t.value)}function Ga(t){return t!=t||t===Q||t===tt?"float32":et(t)?t>=to&&t<=Qi?"float32":"float64":t>-Hi&&t=ce?"int8":t>=Hr?"int16":t>=oe?"int32":"float64":t<=gr?"uint8":t<=wr?"uint16":t<=ve?"uint32":"float64":t>-Hi&&t=ce?"int8":t>=Hr?"int16":t>=oe?"int32":"float64":t<=he?"int8":t<=Xr?"int16":t<=ie?"int32":"float64"}(t),r)}function Ka(t,r){return function(t){return Ra.isStruct(t)}(t)&&t.toString({format:"layout"})===r}function Xa(t,r){var e=ki(r)||"";return"generic"===e||("binary"===e?function(t){return it(t)&&"uint8"===Za(t)}(t):Ma(String(e))?function(t){return N(t)}(t):function(t){return ka(String(t))}(e)?function(t,r){return it(t)&&Di(Za(t),r)}(t,e):function(t){return Na(String(t))}(e)?qa(t,e):function(t){return Ua(String(t))}(e)?function(t){return ft(t)}(t):Pa(e)?function(t){return N(t)||Be(t)}(t):!!$a(r)&&Ka(t,e))}function Ha(t){var r,e;for(r=0,e=0;ei&&(n=!1),!n&&!r)return 0;i=o}return n&&r?3:n?1:2}k(Ja,"name","DataType"),pt(Ja.prototype,"alignment",(function(){return this._alignment})),pt(Ja.prototype,"byteLength",(function(){return this._byteLength})),pt(Ja.prototype,"byteOrder",(function(){return this._byteOrder})),pt(Ja.prototype,"char",(function(){return this._char})),pt(Ja.prototype,"description",(function(){return this._description})),pt(Ja.prototype,"enum",(function(){return this._enum})),pt(Ja.prototype,"value",(function(){return this._value})),k(Ja.prototype,"toJSON",(function(){return{type:"DataType",value:this.toString(),byteOrder:this._byteOrder,description:this._description}})),k(Ja.prototype,"toString",(function(){return"struct"===this._type?this._value.layout:String(this._value)})),k(Ja.prototype,"valueOf",(function(){return this.toString()}));var rf=Array.prototype.slice;function ef(t,r,e){var n;return function(t,r){return"function"==typeof t[r]}(t,"slice")?t.slice(r,e):(n=xo(t)).accessorProtocol?function(t,r,e){var n,i,o,a;for(n=t.data,i=t.accessors[0],o=[],a=r;a0?o+=a*(t[f]-1):a<0&&(i+=a*(t[f]-1))}return[i,o]}function ff(t){return"column-major"===t}k(af,"assign",(function(t,r,e,n){var i,o,a,f,u;for(i=t.length,o=e,a=e,u=0;u0?a+=f*(t[u]-1):f<0&&(o+=f*(t[u]-1))}return n[0]=o,n[1]=a,n}));var uf=/[-\/\\^$*+?.()|[\]{}]/g;var sf=RegExp.prototype.exec;var lf=Y();function hf(t){return"object"==typeof t&&(t instanceof RegExp||(lf?function(t){try{return sf.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===G(t)))}function cf(t,r,e){if(!Wr(t))throw new TypeError(j("invalid argument. First argument must be a string. Value: `%s`.",t));if(Wr(r))r=new RegExp(function(t){var r,e;if(!Wr(t))throw new TypeError(j("invalid argument. Must provide a regular expression string. Value: `%s`.",t));if("/"===t[0])for(e=t.length-1;e>=0&&"/"!==t[e];e--);return void 0===e||e<=0?t.replace(uf,"\\$&"):(r=(r=t.substring(1,e)).replace(uf,"\\$&"),t=t[0]+r+t.substring(e))}(r),"g");else if(!hf(r))throw new TypeError(j("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",r));if(!Wr(e)&&!Bt(e))throw new TypeError(j("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",e));return Nn(t,r,e)}var pf={int8:"new Int8Array( [ {{data}} ] )",uint8:"new Uint8Array( [ {{data}} ] )",uint8c:"new Uint8ClampedArray( [ {{data}} ] )",int16:"new Int16Array( [ {{data}} ] )",uint16:"new Uint16Array( [ {{data}} ] )",int32:"new Int32Array( [ {{data}} ] )",uint32:"new Uint32Array( [ {{data}} ] )",float32:"new Float32Array( [ {{data}} ] )",float64:"new Float64Array( [ {{data}} ] )",generic:"[ {{data}} ]",binary:"new Buffer( [ {{data}} ] )",complex64:"new Complex64Array( [ {{data}} ] )",complex128:"new Complex128Array( [ {{data}} ] )",bool:"new BooleanArray( [ {{data}} ] )"};var gf=["row-major","column-major"];function df(){return gf.slice()}var yf=["row-major","column-major"];function mf(){return{"row-major":101,"column-major":102}}k((function(){return yf.slice()}),"enum",mf);var vf={"row-major":101,"column-major":102};function bf(){return{"row-major":vf["row-major"],"column-major":vf["column-major"]}}k(df,"enum",bf);var wf=["throw","normalize","clamp","wrap"];function _f(){return wf.slice()}function Ef(){return{throw:1,clamp:2,wrap:3,normalize:4}}k(_f,"enum",Ef);var xf={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256},Tf=bf(),Af={throw:1,clamp:2,wrap:3,normalize:4};var Of=4294967295,Vf=4294967296,Sf=new vr(8),jf=new ar(Sf.buffer);function Rf(t,r,e,n){var i,o,a;if(0===t){for(a=0;a>>0,i=rt(t/Vf),Vr?(jf.setUint32(0,o,Vr),jf.setUint32(4,i,Vr)):(jf.setUint32(0,i,Vr),jf.setUint32(4,o,Vr)),a=0;a>>0,n=rt(t/4294967296),e=new ar(r.buffer),Vr?(e.setUint32(0,i,Vr),e.setUint32(4,n,Vr)):(e.setUint32(0,n,Vr),e.setUint32(4,i,Vr))),r}),"assign",Rf);var Lf={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256},If=bf(),Bf={throw:1,clamp:2,wrap:3,normalize:4};function Ff(t,r,e,n,i,o){var a,f,u,s,l;if(!(this instanceof Ff))return new Ff(t,r,e,n,i,o);for(s=1,l=0;l=0;i--)e[i]=n,n*=t[i];return e}(t)}k(Ff,"name","ndarray"),pt(Ff.prototype,"byteLength",(function(){return this._byteLength})),pt(Ff.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),pt(Ff.prototype,"data",(function(){return this._buffer})),pt(Ff.prototype,"dtype",(function(){return this._dtype})),pt(Ff.prototype,"flags",(function(){return{ROW_MAJOR_CONTIGUOUS:(t=this._flags).ROW_MAJOR_CONTIGUOUS,COLUMN_MAJOR_CONTIGUOUS:t.COLUMN_MAJOR_CONTIGUOUS,READONLY:t.READONLY};var t})),pt(Ff.prototype,"length",(function(){return this._length})),pt(Ff.prototype,"ndims",(function(){return this._ndims})),pt(Ff.prototype,"offset",(function(){return this._offset})),pt(Ff.prototype,"order",(function(){return this._order})),pt(Ff.prototype,"shape",(function(){return ef(this._shape,0,this._shape.length)})),pt(Ff.prototype,"strides",(function(){return ef(this._strides,0,this._strides.length)})),k(Ff.prototype,"get",(function(){var t,r;for(t=this._offset,r=0;r=0;a--)t-=o=t%e[a],t/=e[a],i+=o*r[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),k(Ff.prototype,"set",(function(){var t,r;for(t=this._offset,r=0;r=0;f--)t-=a=t%n[f],t/=n[f],o+=a*e[f];return this._accessors?this._buffer.set(r,o):this._buffer[o]=r,this})),k(Ff.prototype,"toString",(function(){var t,r,e,n,i,o;if(r=this._shape.length,e="ndarray( '"+(n=this._dtype)+"', ",t="",this._length<=100)if("complex64"===n||"complex128"===n)for(o=0;o=0;o--)t+=en(i=this.iget(this._length-1-o))+", "+nn(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(e+=cf(pf[this.dtype],"{{data}}",t),e+=", ",e+=0===r?"[]":"[ "+this._shape.join(", ")+" ]",e+=", ",e+="[ ",0===r)e+="0";else for(o=0;o=0;n--)r[n]=e,e*=t[n];return r}(t,e)}));var Yf="row-major";function Df(t,r){var e,n,i;return"object"!=typeof(i=t.strides)||null===i?0===(n=t.shape).length?[0]:(Wr(e=t.order)||(e=Yf),Cf(n,e)):r?kf(i):i}function zf(t,r){var e,n,i;for(n=t.length,e=0,i=0;ir?-1:t}function Xf(t,r){var e,n,i,o;for(e={},n=[],o=0;o=0&&a=0&&!(((s=t[o])<0?-s:s)<=e);)t[o+1]=s,r[a+1]=r[a],o-=1,a-=1;t[o+1]=f,r[a+1]=u,n+=1,i+=1}}(r=kf(r),n),{sh:t=eu(t,n),sx:r,sy:e=eu(e,n),idx:n}}k(tu,"assign",(function(t,r,e){var n=xo(t);return n.accessorProtocol?"complex128"===n.dtype?ru(t,Je(t,0),r,e):"complex64"===n.dtype?ru(t,ze(t,0),r,e):function(t,r,e){var n,i,o,a;for(n=t.data,i=t.accessors[1],a=e,o=0;a>=0&&a=0&&ir&&(r=n)}return(n=iu.BLOCK_SIZE_IN_BYTES/r|0)>0?n:1}function au(t,r){return ou([t,r])}function fu(t,r){var e;for(e=0;e1?arguments[1]:hu))return ko(t);if(e=function(t){return lu[t]||null}(r),null===e)throw new TypeError(j("invalid argument. Second argument must be a recognized data type. Value: `%s`.",r));return new e(t)}function pu(t,r,e,n,i){var o,a;for(o=i,a=0;a=f&&(i=f-1);else if("wrap"===o)i<0?(i+=f)<0&&0!==(i%=f)&&(i+=f):i>=f&&(i-=f)>=f&&(i%=f);else if("normalize"===o&&i<0&&(i+=f),i<0||i>=f)throw new RangeError(j("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",f,i));if(u=e,ff(n)){for(l=0;l=0;l--)i-=s=i%t[l],i/=t[l],u+=s*r[l];return u}k(du,"assign",gu);var mu="throw";var vu="throw";var bu=[function(t,r,e){r[1].data[r[1].offset]=t(du(r,1),e)},function(t,r,e,n,i){var o,a,f,u,s,l,h;for(f=(l=r[1]).shape[0],a=[n[0]],h=1;h0;){for(b0;){for(v0;){for(T0;){for(x0;){for(E0;){for(j0;){for(S0;){for(V0;){for(O0;){for(F0;){for(B0;){for(I0;){for(L0;){for(R0;){for(N0;){for(k0;){for(M0;){for(U0;){for(P0;){for(F0;){for(J0;){for(z0;){for(D0;){for(Y0;){for(C0;){for(N0;){for(k0;){for(q0;){for(Z0;){for(G0;){for($0;){for(W0;){for(J0;){for(z0;){for(D0;){for(tt0;){for(Q0;){for(H0;){for(X0;){for(K0;){for(q0;){for(Z0;){for(G0;){for($0;){for(ot0;){for(it0;){for(nt0;){for(et0;){for(rt0;){for(tt0;){for(Q0;){for(H0;){for(X0;){for(K0;){for(w0;){for(b0;){for(A0;){for(T0;){for(x0;){for(R0;){for(j0;){for(S0;){for(V0;){for(P0;){for(F0;){for(B0;){for(I0;){for(L0;){for(C0;){for(N0;){for(k0;){for(M0;){for(U0;){for(P0;){for(W0;){for(J0;){for(z0;){for(D0;){for(Y0;){for(C0;){for(N0;){for(K0;){for(q0;){for(Z0;){for(G0;){for($0;){for(W0;){for(J0;){for(z0;){for(rt0;){for(tt0;){for(Q0;){for(H0;){for(X0;){for(K0;){for(q0;){for(Z0;){for(G0;){for(at0;){for(ot0;){for(it0;){for(nt0;){for(et0;){for(rt0;){for(tt0;){for(Q0;){for(H0;){for(X3?n:{},x=r.length,u=[],S=0;So)throw new RangeError(j("invalid argument. Number of specified dimensions cannot exceed the number of dimensions in the input array. Number of dimensions: %d. Value: [%s].",o,Go(e,",")));for(A=o-T,S=1;S2?n:{};return Tu(t,r,e,i)}}));var Au=8,Ou=16;var Vu=1;var Su=5;var ju=5;function Ru(t,r,e,n,i){var o,a,f,u;if(t<=0||1===r)return e;if((f=xo(e)).accessorProtocol)return function(t,r,e,n,i){var o,a,f,u,s,l;if(o=e.data,a=e.accessors[0],f=e.accessors[1],u=i,0===n)return f(o,u,a(o,u)*t*r),e;if(1===n){if((s=t%Su)>0)for(l=0;l0)for(u=0;u=0&&!(((s=t[o])<0?-s:s)<=e);)t[o+1]=s,r[a+1]=r[a],o-=1,a-=1;t[o+1]=f,r[a+1]=u,n+=1,i+=1}}(r=kf(r),e),{sh:t=eu(t,e),sx:r,idx:e}}function Bu(t){return ou([t])}k(Lu,"ndarray",Ru);var Fu="throw";var Pu="throw";var Uu="throw";var Mu=[function(t,r){return t.data[t.offset]===r},function(t,r){var e,n,i,o,a;for(i=t.shape[0],n=t.strides[0],o=t.offset,e=t.data,a=0;a0;)for(y0;)for(d0;)for(_0;)for(w0;)for(b0;)for(O0;)for(A0;)for(T0;)for(x0;)for(L0;)for(R0;)for(j0;)for(S0;)for(V0;)for(U0;)for(P0;)for(F0;)for(B0;)for(I0;)for(L0;)for(Y0;)for(C0;)for(N0;)for(k0;)for(M0;)for(U0;)for(P