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 e3f2019..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2026-04-10T03:23:40.084Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index a53efc0..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/base/slice-dimension-from) 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 ced95ae..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/base/slice-dimension-from) 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 60a2bb4..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: '38 14 * * 5' - - # 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 sliceDimensionFrom = require( '@stdlib/ndarray-base-slice-dimension-from' ); +If no recognized module system is present, access bundle contents via the global scope: + +```html + ``` #### sliceDimensionFrom( x, dim, start, strict, writable ) @@ -137,11 +143,16 @@ The function accepts the following arguments: -```javascript -var array = require( '@stdlib/ndarray-array' ); -var ndarray2array = require( '@stdlib/ndarray-to-array' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var sliceDimensionFrom = require( '@stdlib/ndarray-base-slice-dimension-from' ); +```html + + + + + + + + + + ```
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.js b/benchmark/benchmark.js deleted file mode 100644 index 8a6b7a2..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,681 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 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 baseEmpty = require( '@stdlib/ndarray-base-empty' ); -var empty = require( '@stdlib/ndarray-empty' ); -var pkg = require( './../package.json' ).name; -var sliceDimensionFrom = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::1d,base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2 ], 'row-major' ) - ]; - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 0, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::1d,non-base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2 ], { 'dtype': 'float64' } ), - empty( [ 2 ], { 'dtype': 'float32' } ), - empty( [ 2 ], { 'dtype': 'int32' } ), - empty( [ 2 ], { 'dtype': 'complex128' } ), - empty( [ 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 0, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::1d,base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2 ], 'row-major' ) - ]; - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 0, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::1d,non-base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2 ], { 'dtype': 'float64' } ), - empty( [ 2 ], { 'dtype': 'float32' } ), - empty( [ 2 ], { 'dtype': 'int32' } ), - empty( [ 2 ], { 'dtype': 'complex128' } ), - empty( [ 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 0, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::2d,base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2 ], 'row-major' ) - ]; - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 1, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::2d,non-base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 1, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::2d,base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2 ], 'row-major' ) - ]; - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 1, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::2d,non-base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 1, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::3d,base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2, 2 ], 'row-major' ) - ]; - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 2, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::3d,non-base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 2, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::3d,base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2, 2 ], 'row-major' ) - ]; - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 2, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::3d,non-base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 2, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::4d,base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2, 2, 2 ], 'row-major' ) - ]; - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 3, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::4d,non-base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 3, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::4d,base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2, 2, 2 ], 'row-major' ) - ]; - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 3, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::4d,non-base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2, 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2, 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 3, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::5d,base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2, 2, 2, 2 ], 'row-major' ) - ]; - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 4, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::5d,non-base', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 0; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 4, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::5d,base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - values = [ - baseEmpty( 'float64', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'float32', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'int32', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'complex128', [ 2, 2, 2, 2, 2 ], 'row-major' ), - baseEmpty( 'generic', [ 2, 2, 2, 2, 2 ], 'row-major' ) - ]; - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 4, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::5d,non-base,out-of-bounds', function benchmark( b ) { - var values; - var v; - var s; - var i; - - /* eslint-disable object-curly-newline */ - - values = [ - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float64' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'float32' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'int32' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'complex128' } ), - empty( [ 2, 2, 2, 2, 2 ], { 'dtype': 'generic' } ) - ]; - - /* eslint-enable object-curly-newline */ - - s = 20; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = sliceDimensionFrom( values[ i%values.length ], 4, s, false, false ); - if ( typeof v !== 'object' ) { - b.fail( 'should return an ndarray' ); - } - } - b.toc(); - if ( !isndarrayLike( v ) ) { - b.fail( 'should return an ndarray' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/branches.md b/branches.md deleted file mode 100644 index 9543fcd..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/base/slice-dimension-from" -%% click B href "https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/main" -%% click C href "https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/production" -%% click D href "https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/esm" -%% click E href "https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/deno" -%% click F href "https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/base/slice-dimension-from -[production-url]: https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/production -[deno-url]: https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/deno -[deno-readme]: https://github.com/stdlib-js/ndarray-base-slice-dimension-from/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/umd -[umd-readme]: https://github.com/stdlib-js/ndarray-base-slice-dimension-from/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/ndarray-base-slice-dimension-from/tree/esm -[esm-readme]: https://github.com/stdlib-js/ndarray-base-slice-dimension-from/blob/esm/README.md \ No newline at end of file diff --git a/browser.js b/browser.js new file mode 100644 index 0000000..23870f5 --- /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,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).sliceDimensionFrom=n()}(this,(function(){"use strict";var t="function"==typeof Object.defineProperty?Object.defineProperty:null;var n=Object.defineProperty;function e(t){return"number"==typeof t}function r(t){var n,e="";for(n=0;n0&&(e-=1),r=t.toExponential(e)):r=t.toPrecision(n.precision),n.alternate||(r=c.call(r,d,"$1e"),r=c.call(r,b,"e"),r=c.call(r,m,""));break;default:throw new Error("invalid double notation. Value: "+n.specifier)}return r=c.call(r,h,"e+0$1"),r=c.call(r,p,"e-0$1"),n.alternate&&(r=c.call(r,g,"$1."),r=c.call(r,y,"$1.e")),t>=0&&n.sign&&(r=n.sign+r),r=n.specifier===s.call(n.specifier)?s.call(r):l.call(r)}function w(t){var n,e="";for(n=0;n127)throw new Error("invalid character code. Value: "+o.arg);o.arg=x(f)?String(o.arg):E(f)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(n||(o.precision=6),c=parseFloat(o.arg),!isFinite(c)){if(!e(o.arg))throw new Error("invalid floating-point number. Value: "+l);c=o.arg,o.padZeros=!1}o.arg=v(c,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,y=o.width,m=o.padRight,b=void 0,(b=y-g.length)<0?g:g=m?g+w(b):w(b)+g)),l+=o.arg||"",s+=1}return l}var O=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function V(t){var n={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]&&(n.precision="1"),n}function S(t){var n,e,r,i;for(e=[],i=0,r=O.exec(t);r;)(n=t.slice(i,O.lastIndex-r[0].length)).length&&e.push(n),"%"===r[6]?e.push("%"):e.push(V(r)),i=O.lastIndex,r=O.exec(t);return(n=t.slice(i)).length&&e.push(n),e}function R(t){var n,e;if("string"!=typeof t)throw new TypeError(R("invalid argument. First argument must be a string. Value: `%s`.",t));for(n=[S(t)],e=1;ent&&rt(t)}function ot(t){return N(t)&&it(t)}function at(t){return K(t)&&it(t.valueOf())}function ut(t){return ot(t)||at(t)}function ft(t){return null===t}function lt(t){return void 0===t}function st(t){return ot(t)||ft(t)||lt(t)}function ct(){var t,n,e,r;if(0===(t=arguments.length)?(n=null,e=null,r=null):1===t?(n=null,e=arguments[0],r=null):2===t?(n=arguments[0],e=arguments[1],r=null):(n=arguments[0],e=arguments[1],r=arguments[2]),!(this instanceof ct))return new ct(n,e,r);if(!st(n))throw new TypeError(R("invalid argument. First argument must be an integer, null, or undefined. Value: `%s`.",n));if(!st(e))throw new TypeError(R("invalid argument. Second argument must be an integer, null, or undefined. Value: `%s`.",e));if(!st(r))throw new TypeError(R("invalid argument. Third argument must be an integer, null, or undefined. Value: `%s`.",r));if(0===r)throw new RangeError(R("invalid argument. Third argument cannot be zero. Value: `%s`.",r));return this._start=void 0===n?null:n,this._stop=void 0===e?null:e,this._step=void 0===r?null:r,this}function ht(){return/^\s*function\s*([^(]*)/i}M(ut,"isPrimitive",ot),M(ut,"isObject",at),M(ct,"name","Slice"),C(ct.prototype,"start",(function(){return this._start})),C(ct.prototype,"stop",(function(){return this._stop})),C(ct.prototype,"step",(function(){return this._step})),M(ct.prototype,"toString",(function(){return"Slice("+this._start+","+this._stop+","+this.step+")"})),M(ct.prototype,"toJSON",(function(){return{type:"Slice",data:[this._start,this._stop,this._step]}}));var pt=/^\s*function\s*([^(]*)/i;M(ht,"REGEXP",pt);var gt=Array.isArray?Array.isArray:function(t){return"[object Array]"===q(t)};function yt(t){if("function"!=typeof t)throw new TypeError(R("invalid argument. Must provide a function. Value: `%s`.",t));return function(n){var e,r;if(!gt(n))return!1;if(0===(e=n.length))return!1;for(r=0;r=n?e?{code:"ERR_SLICE_OUT_OF_BOUNDS"}:new ct(n,n,1):t<0&&(t=n+t)<0?e?{code:"ERR_SLICE_OUT_OF_BOUNDS"}:new ct(0,0,1):new ct(t,t+1,1)}(t,n,e):function(t,n,e){var r,i,o;if(r=t.start,i=t.stop,null===(o=t.step)&&(o=1),null===r)r=o>0?0:n-1;else if(r<0){if((r=n+r)<0){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};r=0}}else if(r>=n){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};r=o<0?n-1:n}if(null===i)i=o>0?n:null;else if(i<0){if((i=n+i)<0)if(o>0){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=0}else{if(e&&i<-1)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=null}}else if(i>n){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=n}return new ct(r,i,o)}(t,n,e)}function xt(t,n,e){var r,i,o,a;for(r=t.data,i=[],a=0;a0&&e>=r||n<0&&e<=r?0:Tt((r-e)/n)}function Ot(t){var n,e,r;for(n=t.data,e=[],r=0;r=0;i--)e[i]=r,r*=t[i];return e}(t)}M(Ut,"isPrimitive",Lt),M(Ut,"isObject",Pt),M(Mt,"assign",(function(t,n,e){return kt(n)?function(t,n){var e,r;for(e=1,r=0;r=0;r--)n[r]=e,e*=t[r];return n}(t,e)}));var Ct="row-major";function Nt(t){return Math.abs(t)}var Yt="row-major",Dt="column-major";function zt(t){var n,e;return Lt(e=t.order)?e:"object"!=typeof(n=t.strides)||null===n?Yt:(e=function(t){var n,e,r,i,o,a;if(0===(e=t.length))return 0;for(n=!0,r=!0,i=Nt(t[0]),a=1;ai&&(r=!1),!r&&!n)return 0;i=o}return r&&n?3:r?1:2}(n),1===e||3===e?Yt:2===e?Dt:0===t.shape.length?Yt:null)}function Jt(t){return t.data}function $t(t){return ot(t)&&t>0}function Wt(t){return at(t)&&t.valueOf()>0}function Zt(t){return $t(t)||Wt(t)}M(Zt,"isPrimitive",$t),M(Zt,"isObject",Wt);var qt=/./;function Gt(t){return"boolean"==typeof t}var Xt=Boolean,Ht=Boolean.prototype.toString;var Kt=D();function Qt(t){return"object"==typeof t&&(t instanceof Xt||(Kt?function(t){try{return Ht.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===q(t)))}function tn(t){return Gt(t)||Qt(t)}M(tn,"isPrimitive",Gt),M(tn,"isObject",Qt);var nn="object"==typeof self?self:null,en="object"==typeof window?window:null,rn="object"==typeof globalThis?globalThis:null;function on(t){if(arguments.length){if(!Gt(t))throw new TypeError(R("invalid argument. Must provide a boolean. Value: `%s`.",t));if(t)return new Function("return this;")()}if(rn)return rn;if(nn)return nn;if(en)return en;throw new Error("unexpected error. Unable to resolve global object.")}var an=on(),un=an.document&&an.document.childNodes,fn=Int8Array;var ln="function"==typeof qt||"object"==typeof fn||"function"==typeof un?function(t){return dt(t).toLowerCase()}:function(t){var n;return null===t?"null":"object"===(n=typeof t)?dt(t).toLowerCase():n};function sn(t){return"function"===ln(t)}function cn(t){return sn(t)&&$t(t.alignment)&&$t(t.byteLength)&&sn(t.byteLengthOf)&&sn(t.byteOffsetOf)&&sn(t.bufferOf)&&sn(t.isStruct)&&sn(t.viewOf)&&$(t,"fields")&&$(t,"layout")}function hn(t){return Object.keys(Object(t))}var pn,gn=void 0!==Object.keys;function yn(t){return"[object Arguments]"===q(t)}pn=function(){return yn(arguments)}();var mn=pn;function bn(t){return t!=t}function dn(t){return N(t)&&bn(t)}function vn(t){return K(t)&&bn(t.valueOf())}function wn(t){return dn(t)||vn(t)}M(wn,"isPrimitive",dn),M(wn,"isObject",vn);var En=Object.prototype.propertyIsEnumerable;var _n=!En.call("beep","0");function xn(t,n){var e;return null!=t&&(!(e=En.call(t,n))&&_n&&Ut(t)?!dn(n=+n)&&ot(n)&&n>=0&&n=0&&t.length<=Tn&&$(t,"callee")&&!xn(t,"callee")},On=Array.prototype.slice;var Vn=xn((function(){}),"prototype"),Sn=!xn({toString:null},"toString"),Rn=9007199254740991;function jn(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&rt(t.length)&&t.length>=0&&t.length<=Rn}function Fn(t,n,e){var r,i;if(!jn(t)&&!Lt(t))throw new TypeError(R("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(r=t.length))return-1;if(3===arguments.length){if(!ot(e))throw new TypeError(R("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=r)return-1;i=e}else(i=r+e)<0&&(i=0)}else i=0;if(wn(n)){for(;i0&&!$(t,"0"))for(u=0;u1){if(!Zn(n))throw new TypeError(R("invalid argument. Options argument must be an object. Value: `%s`.",n));if($(n,"duplicates")&&!Gt(l=n.duplicates))throw new TypeError(R("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",l))}if(r=(e=Cn(t)).length,a={},l)for(f=0;f=0}function ur(t){return at(t)&&t.valueOf()>=0}function fr(t){return ar(t)||ur(t)}M(fr,"isPrimitive",ar),M(fr,"isObject",ur);var lr=4294967295;function sr(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&rt(t.length)&&t.length>=0&&t.length<=lr}var cr="function"==typeof ArrayBuffer;function hr(t){return cr&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===q(t)}var pr=yt(Ut.isPrimitive),gr=yt(Ut.isObject),yr=yt(Ut);function mr(t,n,e){k(t,n,{configurable:!1,enumerable:!0,writable:!1,value:e})}function br(t,n){if(!(this instanceof br))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!N(t))throw new TypeError(R("invalid argument. Real component must be a number. Value: `%s`.",t));if(!N(n))throw new TypeError(R("invalid argument. Imaginary component must be a number. Value: `%s`.",n));return mr(this,"re",t),mr(this,"im",n),this}M(yr,"primitives",pr),M(yr,"objects",gr),M(br,"name","Complex128"),M(br,"BYTES_PER_ELEMENT",8),M(br.prototype,"BYTES_PER_ELEMENT",8),M(br.prototype,"byteLength",16),M(br.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),M(br.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var dr="function"==typeof Math.fround?Math.fround:null,vr=new me(1);var wr="function"==typeof dr?dr:function(t){return vr[0]=t,vr[0]};function Er(t,n){if(!(this instanceof Er))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!N(t))throw new TypeError(R("invalid argument. Real component must be a number. Value: `%s`.",t));if(!N(n))throw new TypeError(R("invalid argument. Imaginary component must be a number. Value: `%s`.",n));return mr(this,"re",wr(t)),mr(this,"im",wr(n)),this}function _r(t){return t instanceof br||t instanceof Er||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function xr(t){return rt(t/2)}M(Er,"name","Complex64"),M(Er,"BYTES_PER_ELEMENT",4),M(Er.prototype,"BYTES_PER_ELEMENT",4),M(Er.prototype,"byteLength",8),M(Er.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),M(Er.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var Tr=8;function Ar(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Tr}var Or=16;function Vr(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Or}function Sr(){return"function"==typeof W&&"symbol"==typeof W("foo")&&$(W,"iterator")&&"symbol"==typeof W.iterator}var Rr=Sr()?Symbol.iterator:null;function jr(t){return t.re}function Fr(t){return t.im}function Lr(t,n){return new me(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*n,2*(t.length-n))}function Br(t,n){return new ce(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*n,2*(t.length-n))}function Ir(t){var n,e,r;for(n=[];!(e=t.next()).done;)if(sr(r=e.value)&&r.length>=2)n.push(r[0],r[1]);else{if(!_r(r))return new TypeError(R("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));n.push(jr(r),Fr(r))}return n}var Pr=2*me.BYTES_PER_ELEMENT,Ur=Sr();function kr(t){return t instanceof Nr||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Mr(t){return t===Nr||"Complex128Array"===t.name}function Cr(t,n){return new Er(t[n*=2],t[n+1])}function Nr(){var t,n,e,r;if(n=arguments.length,!(this instanceof Nr))return 0===n?new Nr:1===n?new Nr(arguments[0]):2===n?new Nr(arguments[0],arguments[1]):new Nr(arguments[0],arguments[1],arguments[2]);if(0===n)e=new me(0);else if(1===n)if(ar(arguments[0]))e=new me(2*arguments[0]);else if(jn(arguments[0]))if((r=(e=arguments[0]).length)&>(e)&&_r(e[0])){if(e=function(t,n){var e,r,i,o;for(e=n.length,o=0,i=0;ie.byteLength-t)throw new RangeError(R("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Pr));e=new me(e,t,2*r)}}return M(this,"_buffer",e),M(this,"_length",e.length/2),this}function Yr(t){return t.re}function Dr(t){return t.im}function zr(t){var n,e,r;for(n=[];!(e=t.next()).done;)if(sr(r=e.value)&&r.length>=2)n.push(r[0],r[1]);else{if(!_r(r))return new TypeError(R("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));n.push(Yr(r),Dr(r))}return n}M(Nr,"BYTES_PER_ELEMENT",Pr),M(Nr,"name","Complex64Array"),M(Nr,"from",(function(t){var n,e,r,i,o,a,u,f,l,s,c,h;if(!sn(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Mr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!sn(r=arguments[1]))throw new TypeError(R("invalid argument. Second argument must be a function. Value: `%s`.",r));e>2&&(n=arguments[2])}if(kr(t)){if(f=t.length,r){for(o=(i=new this(f))._buffer,h=0,c=0;c=2))throw new TypeError(R("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(jn(t)){if(r){for(f=t.length,u=t.get&&t.set?re("default"):oe("default"),c=0;c=2))throw new TypeError(R("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Nn(t)&&Ur&&sn(t[Rr])){if(!sn((o=t[Rr]()).next))throw new TypeError(R("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=r?function(t,n,e){var r,i,o,a;for(r=[],a=-1;!(i=t.next()).done;)if(a+=1,sr(o=n.call(e,i.value,a))&&o.length>=2)r.push(o[0],o[1]);else{if(!_r(o))return new TypeError(R("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));r.push(jr(o),Fr(o))}return r}(o,r,n):Ir(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,c=0;c=this._length))return Cr(this._buffer,t)})),C(Nr.prototype,"buffer",(function(){return this._buffer.buffer})),C(Nr.prototype,"byteLength",(function(){return this._buffer.byteLength})),C(Nr.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(Nr.prototype,"BYTES_PER_ELEMENT",Nr.BYTES_PER_ELEMENT),M(Nr.prototype,"copyWithin",(function(t,n){if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*n):this._buffer.copyWithin(2*t,2*n,2*arguments[2]),this})),M(Nr.prototype,"entries",(function(){var t,n,e,r,i,o;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,e=this._length,o=-1,M(n={},"next",(function(){if(o+=1,i||o>=e)return{done:!0};return{value:[o,Cr(r,o)],done:!1}})),M(n,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(n,Rr,(function(){return t.entries()})),n})),M(Nr.prototype,"every",(function(t,n){var e,r;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));if(n<0&&(n+=i)<0&&(n=0),arguments.length>2){if(!rt(e))throw new TypeError(R("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 n=0,e=i;for(a=jr(t),u=Fr(t),f=n;f=0;r--)if(i=Cr(e,r),t.call(n,i,r,this))return i})),M(Nr.prototype,"findLastIndex",(function(t,n){var e,r,i;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=this._length-1;r>=0;r--)if(i=Cr(e,r),t.call(n,i,r,this))return r;return-1})),M(Nr.prototype,"forEach",(function(t,n){var e,r,i;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r=this._length))return Cr(this._buffer,t)})),M(Nr.prototype,"includes",(function(t,n){var e,r,i,o,a;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_r(t))throw new TypeError(R("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=jr(t),o=Fr(t),e=this._buffer,a=n;a1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=jr(t),o=Fr(t),e=this._buffer,a=n;a=e)return{done:!0};return{value:i,done:!1}})),M(n,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(n,Rr,(function(){return t.keys()})),n})),M(Nr.prototype,"lastIndexOf",(function(t,n){var e,r,i,o,a;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_r(t))throw new TypeError(R("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n>=this._length?n=this._length-1:n<0&&(n+=this._length)}else n=this._length-1;for(i=jr(t),o=Fr(t),e=this._buffer,a=n;a>=0;a--)if(i===e[r=2*a]&&o===e[r+1])return a;return-1})),C(Nr.prototype,"length",(function(){return this._length})),M(Nr.prototype,"map",(function(t,n){var e,r,i,o,a;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)r=n,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.");r=Cr(e,0),o=1}for(;o1)r=n,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.");r=Cr(e,i-1),o=i-2}for(;o>=0;o--)r=t(r,Cr(e,o),o,this);return r})),M(Nr.prototype,"reverse",(function(){var t,n,e,r,i,o;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,r=et(e/2),i=0;i1){if(!ar(e=arguments[1]))throw new TypeError(R("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(_r(t)){if(e>=this._length)throw new RangeError(R("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return r[e*=2]=jr(t),void(r[e+1]=Fr(t))}if(kr(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t._buffer,l=r.byteOffset+e*Pr,n.buffer===r.buffer&&n.byteOffsetl){for(i=new me(n.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t,l=r.byteOffset+e*Pr,n.buffer===r.buffer&&n.byteOffsetl){for(i=new me(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;fu&&(n=u)}}for(e=ti&&(n=i)}}return t>=i?(i=0,e=r.byteLength):t>=n?(i=0,e=r.byteOffset+t*Pr):(i=n-t,e=r.byteOffset+t*Pr),new this.constructor(r.buffer,e,i<0?0:i)})),M(Nr.prototype,"toLocaleString",(function(t,n){var e,r,i,o,a;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!Lt(t)&&!pr(t))throw new TypeError(R("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)e={};else{if(!Nn(n))throw new TypeError(R("invalid argument. Options argument must be an object. Value: `%s`.",n));e=n}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:Cr(i,o),done:!1}})),M(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(t,Rr,(function(){return n.values()})),t})),M(Nr.prototype,"with",(function(t,n){var e,r,i;if(!kr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!rt(t))throw new TypeError(R("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(R("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!_r(n))throw new TypeError(R("invalid argument. Second argument must be a complex number. Value: `%s`.",n));return(e=(r=new this.constructor(this._buffer))._buffer)[2*t]=jr(n),e[2*t+1]=Fr(n),r}));var Jr=2*ce.BYTES_PER_ELEMENT,$r=Sr();function Wr(t){return t instanceof Gr||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Zr(t){return t===Gr||"Complex64Array"===t.name}function qr(t,n){return new br(t[n*=2],t[n+1])}function Gr(){var t,n,e,r;if(n=arguments.length,!(this instanceof Gr))return 0===n?new Gr:1===n?new Gr(arguments[0]):2===n?new Gr(arguments[0],arguments[1]):new Gr(arguments[0],arguments[1],arguments[2]);if(0===n)e=new ce(0);else if(1===n)if(ar(arguments[0]))e=new ce(2*arguments[0]);else if(jn(arguments[0]))if((r=(e=arguments[0]).length)&>(e)&&_r(e[0])){if(e=function(t,n){var e,r,i,o;for(e=n.length,o=0,i=0;ie.byteLength-t)throw new RangeError(R("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Jr));e=new ce(e,t,2*r)}}return M(this,"_buffer",e),M(this,"_length",e.length/2),this}function Xr(t){var n,e;for(n=[];!(e=t.next()).done;)n.push(Xt(e.value));return n}M(Gr,"BYTES_PER_ELEMENT",Jr),M(Gr,"name","Complex128Array"),M(Gr,"from",(function(t){var n,e,r,i,o,a,u,f,l,s,c,h;if(!sn(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Zr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!sn(r=arguments[1]))throw new TypeError(R("invalid argument. Second argument must be a function. Value: `%s`.",r));e>2&&(n=arguments[2])}if(Wr(t)){if(f=t.length,r){for(o=(i=new this(f))._buffer,h=0,c=0;c=2))throw new TypeError(R("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(jn(t)){if(r){for(f=t.length,u=t.get&&t.set?re("default"):oe("default"),c=0;c=2))throw new TypeError(R("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Nn(t)&&$r&&sn(t[Rr])){if(!sn((o=t[Rr]()).next))throw new TypeError(R("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=r?function(t,n,e){var r,i,o,a;for(r=[],a=-1;!(i=t.next()).done;)if(a+=1,sr(o=n.call(e,i.value,a))&&o.length>=2)r.push(o[0],o[1]);else{if(!_r(o))return new TypeError(R("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));r.push(Yr(o),Dr(o))}return r}(o,r,n):zr(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,c=0;c=this._length))return qr(this._buffer,t)})),C(Gr.prototype,"buffer",(function(){return this._buffer.buffer})),C(Gr.prototype,"byteLength",(function(){return this._buffer.byteLength})),C(Gr.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(Gr.prototype,"BYTES_PER_ELEMENT",Gr.BYTES_PER_ELEMENT),M(Gr.prototype,"copyWithin",(function(t,n){if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*n):this._buffer.copyWithin(2*t,2*n,2*arguments[2]),this})),M(Gr.prototype,"entries",(function(){var t,n,e,r,i,o,a;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return n=this,t=this._buffer,r=this._length,o=-1,a=-2,M(e={},"next",(function(){var n;if(o+=1,i||o>=r)return{done:!0};return n=new br(t[a+=2],t[a+1]),{value:[o,n],done:!1}})),M(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(e,Rr,(function(){return n.entries()})),e})),M(Gr.prototype,"every",(function(t,n){var e,r;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));if(n<0&&(n+=i)<0&&(n=0),arguments.length>2){if(!rt(e))throw new TypeError(R("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 n=0,e=i;for(a=Yr(t),u=Dr(t),f=n;f=0;r--)if(i=qr(e,r),t.call(n,i,r,this))return i})),M(Gr.prototype,"findLastIndex",(function(t,n){var e,r,i;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=this._length-1;r>=0;r--)if(i=qr(e,r),t.call(n,i,r,this))return r;return-1})),M(Gr.prototype,"forEach",(function(t,n){var e,r,i;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r=this._length))return qr(this._buffer,t)})),C(Gr.prototype,"length",(function(){return this._length})),M(Gr.prototype,"includes",(function(t,n){var e,r,i,o,a;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_r(t))throw new TypeError(R("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=Yr(t),o=Dr(t),e=this._buffer,a=n;a1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=Yr(t),o=Dr(t),e=this._buffer,a=n;a=e)return{done:!0};return{value:i,done:!1}})),M(n,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(n,Rr,(function(){return t.keys()})),n})),M(Gr.prototype,"lastIndexOf",(function(t,n){var e,r,i,o,a;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!_r(t))throw new TypeError(R("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!rt(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n>=this._length?n=this._length-1:n<0&&(n+=this._length)}else n=this._length-1;for(i=Yr(t),o=Dr(t),e=this._buffer,a=n;a>=0;a--)if(i===e[r=2*a]&&o===e[r+1])return a;return-1})),M(Gr.prototype,"map",(function(t,n){var e,r,i,o,a;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)r=n,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.");r=qr(e,0),o=1}for(;o1)r=n,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.");r=qr(e,i-1),o=i-2}for(;o>=0;o--)r=t(r,qr(e,o),o,this);return r})),M(Gr.prototype,"reverse",(function(){var t,n,e,r,i,o;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,r=et(e/2),i=0;i1){if(!ar(e=arguments[1]))throw new TypeError(R("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(_r(t)){if(e>=this._length)throw new RangeError(R("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return r[e*=2]=Yr(t),void(r[e+1]=Dr(t))}if(Wr(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t._buffer,l=r.byteOffset+e*Jr,n.buffer===r.buffer&&n.byteOffsetl){for(i=new ce(n.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t,l=r.byteOffset+e*Jr,n.buffer===r.buffer&&n.byteOffsetl){for(i=new ce(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;fu&&(n=u)}}for(e=ti&&(n=i)}}return t>=i?(i=0,e=r.byteLength):t>=n?(i=0,e=r.byteOffset+t*Jr):(i=n-t,e=r.byteOffset+t*Jr),new this.constructor(r.buffer,e,i<0?0:i)})),M(Gr.prototype,"toLocaleString",(function(t,n){var e,r,i,o,a;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!Ut(t)&&!pr(t))throw new TypeError(R("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)e={};else{if(!Nn(n))throw new TypeError(R("invalid argument. Options argument must be an object. Value: `%s`.",n));e=n}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:qr(i,o),done:!1}})),M(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(t,Rr,(function(){return n.values()})),t})),M(Gr.prototype,"with",(function(t,n){var e,r,i;if(!Wr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!rt(t))throw new TypeError(R("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(R("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!_r(n))throw new TypeError(R("invalid argument. Second argument must be a complex number. Value: `%s`.",n));return(e=(r=new this.constructor(this._buffer))._buffer)[2*t]=Yr(n),e[2*t+1]=Dr(n),r}));var Hr=Ze.BYTES_PER_ELEMENT,Kr=Sr();function Qr(t){return"object"==typeof t&&null!==t&&"BooleanArray"===t.constructor.name&&t.BYTES_PER_ELEMENT===Hr}function ti(t){return t===ni}function ni(){var t,n,e,r,i;if(n=arguments.length,!(this instanceof ni))return 0===n?new ni:1===n?new ni(arguments[0]):2===n?new ni(arguments[0],arguments[1]):new ni(arguments[0],arguments[1],arguments[2]);if(0===n)e=new Ze(0);else if(1===n)if(ar(i=arguments[0]))e=new Ze(i);else if(jn(i))e=function(t,n){var e,r;for(e=n.length,r=0;re.byteLength-t)throw new RangeError(R("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Hr));e=new Ze(e,t,r)}}return M(this,"_buffer",e),M(this,"_length",e.length),this}M(ni,"BYTES_PER_ELEMENT",Hr),M(ni,"name","BooleanArray"),M(ni,"from",(function(t){var n,e,r,i,o,a,u,f,l;if(!sn(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ti(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((e=arguments.length)>1){if(!sn(r=arguments[1]))throw new TypeError(R("invalid argument. Second argument must be a function. Value: `%s`.",r));e>2&&(n=arguments[2])}if(jn(t)){if(r){for(f=t.length,u=t.get&&t.set?re("default"):oe("default"),o=(i=new this(f))._buffer,l=0;l=e))return Xt(n[t])})),C(ni.prototype,"buffer",(function(){return this._buffer.buffer})),C(ni.prototype,"byteLength",(function(){return this._buffer.byteLength})),C(ni.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),M(ni.prototype,"BYTES_PER_ELEMENT",ni.BYTES_PER_ELEMENT),M(ni.prototype,"copyWithin",(function(t,n){if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(t,n):this._buffer.copyWithin(t,n,arguments[2]),this})),M(ni.prototype,"entries",(function(){var t,n,e,r,i,o;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,r=this._buffer,e=this._length,o=-1,M(n={},"next",(function(){if(o+=1,i||o>=e)return{done:!0};return{value:[o,Xt(r[o])],done:!1}})),M(n,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(n,Rr,(function(){return t.entries()})),n})),M(ni.prototype,"every",(function(t,n){var e,r;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r1){if(!ot(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));if(n<0&&(n+=i)<0&&(n=0),arguments.length>2){if(!ot(e))throw new TypeError(R("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 n=0,e=i;for(o=t?1:0,a=n;a=0;i--)if(r=Xt(e[i]),t.call(n,r,i,this))return r})),M(ni.prototype,"findLastIndex",(function(t,n){var e,r,i;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,i=this._length-1;i>=0;i--)if(r=Xt(e[i]),t.call(n,r,i,this))return i;return-1})),M(ni.prototype,"forEach",(function(t,n){var e,r;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!sn(t))throw new TypeError(R("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r=this._length))return Xt(this._buffer[t])})),M(ni.prototype,"includes",(function(t,n){var e,r;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Gt(t))throw new TypeError(R("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!ot(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(e=this._buffer,r=n;r1){if(!ot(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(e=this._buffer,r=n;r0){if(!Lt(t))throw new TypeError(R("invalid argument. First argument must be a string. Value: `%s`.",t))}else t=",";for(n=this._buffer,e=[],r=0;r=e)return{done:!0};return{value:i,done:!1}})),M(n,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(n,Rr,(function(){return t.keys()})),n})),M(ni.prototype,"lastIndexOf",(function(t,n){var e,r;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Gt(t))throw new TypeError(R("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!ot(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n>=this._length?n=this._length-1:n<0&&(n+=this._length)}else n=this._length-1;for(e=this._buffer,r=n;r>=0;r--)if(t===Xt(e[r]))return r;return-1})),C(ni.prototype,"length",(function(){return this._length})),M(ni.prototype,"map",(function(t,n){var e,r,i,o;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!sn(t))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",t);for(i=this._buffer,e=(r=new this.constructor(this._length))._buffer,o=0;o1)i=n,o=0;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=Xt(e[0]),o=1}for(;o1)i=n,o=r-1;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=Xt(e[r-1]),o=r-2}for(;o>=0;o--)i=t(i,Xt(e[o]),o,this);return i})),M(ni.prototype,"reverse",(function(){var t,n,e,r,i,o;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._buffer,e=this._length,r=et(e/2),i=0;i1){if(!ar(e=arguments[1]))throw new TypeError(R("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(jn(t)){if(e+(o=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=Qr(t)?t._buffer:t,u=r.byteOffset+e*Hr,n.buffer===r.buffer&&n.byteOffsetu){for(i=new Ze(n.length),a=0;a=this._length)throw new RangeError(R("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));r[e]=t?1:0}})),M(ni.prototype,"slice",(function(t,n){var e,r,i,o,a,u;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(o=this._buffer,a=this._length,0===arguments.length)t=0,n=a;else{if(!ot(t))throw new TypeError(R("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a)<0&&(t=0),1===arguments.length)n=a;else{if(!ot(n))throw new TypeError(R("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0?(n+=a)<0&&(n=0):n>a&&(n=a)}}for(e=ti&&(n=i)}}return t>=i?(i=0,e=r.byteLength):t>=n?(i=0,e=r.byteOffset+t*Hr):(i=n-t,e=r.byteOffset+t*Hr),new this.constructor(r.buffer,e,i<0?0:i)})),M(ni.prototype,"toLocaleString",(function(t,n){var e,r,i,o,a;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)r=[];else{if(!Lt(t)&&!pr(t))throw new TypeError(R("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)e={};else{if(!Nn(n))throw new TypeError(R("invalid argument. Options argument must be an object. Value: `%s`.",n));e=n}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:Xt(i[o]),done:!1}})),M(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Rr&&M(t,Rr,(function(){return n.values()})),t})),M(ni.prototype,"with",(function(t,n){var e,r;if(!Qr(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ot(t))throw new TypeError(R("invalid argument. First argument must be an integer. Value: `%s`.",t));if(r=this._length,t<0&&(t+=r),t<0||t>=r)throw new RangeError(R("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Gt(n))throw new TypeError(R("invalid argument. Second argument must be a boolean. Value: `%s`.",n));return(e=new this.constructor(this._buffer))._buffer[t]=n?1:0,e}));var ei=[ce,me,Se,Ee,Ye,Ie,or,Ze,Ke,Nr,Gr,ni],ri=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],ii=ri.length;function oi(t){var n;if(gt(t))return"generic";if(bt(t))return null;for(n=0;n0&&n.push("generic"),n)}());var yi={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 mi(t){var n;return Lt(t)?yi[t]||null:N(t)?yi[Gn(t)]||null:t&&$t(n=t.byteLength)?n:null}function bi(t,n){var e,r,i;if(e=arguments.length,!(this instanceof bi))return e<2?new bi(t):new bi(t,n);if(gi(t))r="builtin";else{if(function(t){return t instanceof bi||"object"==typeof t&&null!==t&&"DataType"===t.constructor.name&&Lt(t.char)&&Lt(t.description)&&Lt(t.byteOrder)&&Qn(t,"value")}(t))return new bi(t.value,{description:t.description});if(!cn(t))throw new TypeError(R("invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.",t));r="struct"}if(e>1){if(!Zn(i=n))throw new TypeError(R("invalid argument. Options argument must be an object. Value: `%s`.",i));if($(i,"description")&&!Lt(i.description))throw new TypeError(R("invalid option. `%s` option must be a string. Option: `%s`.","description",i.description))}else i={};return M(this,"_value",t),M(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===ci&&(ci={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"}),ci[Kn(t)]||null)}(t)||""),M(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===hi&&(hi={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"}),hi[Kn(t)]||null)}(t)||""),M(this,"_enum",function(t){var n=typeof t;return"number"===n?Gn(t)?t:null:"string"===n?Hn(t):"object"===n&&t&&ot(t.enum)?t.enum:cn(t)?Hn("userdefined_type"):null}(t)||-1),M(this,"_alignment",function(t){var n;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===pi&&(pi={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?$t(n=t.alignment)?n:pi[Kn(t)]||null:null)}(t)||-1),M(this,"_byteLength",mi(t)||-1),M(this,"_byteOrder","host"),M(this,"_type",r),this}function di(t){return sn(t)&&$t(t.alignment)&&$t(t.byteLength)&&sn(t.byteLengthOf)&&sn(t.byteOffsetOf)&&sn(t.bufferOf)&&sn(t.viewOf)||function(t){return t instanceof bi||"object"==typeof t&&null!==t&&ot(t.alignment)&&ot(t.byteLength)&&Lt(t.byteOrder)&&Lt(t.char)&&ot(t.enum)&&Qn(t,"value")}(t)&&di(t.value)}M(bi,"name","DataType"),C(bi.prototype,"alignment",(function(){return this._alignment})),C(bi.prototype,"byteLength",(function(){return this._byteLength})),C(bi.prototype,"byteOrder",(function(){return this._byteOrder})),C(bi.prototype,"char",(function(){return this._char})),C(bi.prototype,"description",(function(){return this._description})),C(bi.prototype,"enum",(function(){return this._enum})),C(bi.prototype,"value",(function(){return this._value})),M(bi.prototype,"toJSON",(function(){return{type:"DataType",value:this.toString(),byteOrder:this._byteOrder,description:this._description}})),M(bi.prototype,"toString",(function(){return"struct"===this._type?this._value.layout:String(this._value)})),M(bi.prototype,"valueOf",(function(){return this.toString()}));var vi=Object.prototype.isPrototypeOf;var wi="function"==typeof ArrayBuffer?ArrayBuffer:null;var Ei,_i="function"==typeof ArrayBuffer?ArrayBuffer:void 0;Ei=function(){var t,n,e;if("function"!=typeof wi)return!1;try{(t=hr(e=new wi(16))&&"function"==typeof wi.isView)&&((n=new ce(e))[0]=-3.14,n[1]=NaN,t=t&&wi.isView(n)&&16===e.byteLength&&-3.14===n[0]&&n[1]!=n[1])}catch(n){t=!1}return t}()?_i:function(){throw new Error("not implemented")};var xi=Ei,Ti={float64:function(t,n,e){t[n]=e},float32:function(t,n,e){t[n]=e},int32:function(t,n,e){t[n]=e},int16:function(t,n,e){t[n]=e},int8:function(t,n,e){t[n]=e},uint32:function(t,n,e){t[n]=e},uint16:function(t,n,e){t[n]=e},uint8:function(t,n,e){t[n]=e},uint8c:function(t,n,e){t[n]=e},generic:function(t,n,e){t[n]=e},default:function(t,n,e){t[n]=e}};function Ai(t){var n=Ti[t];return"function"==typeof n?n:Ti.default}var Oi={complex128:function(t,n,e){t.set(e,n)},complex64:function(t,n,e){t.set(e,n)},default:function(t,n,e){t.set(e,n)}};function Vi(t){var n=Oi[t];return"function"==typeof n?n:Oi.default}function Si(t){var n=oi(t);return ne(t)?{data:t,dtype:n,accessorProtocol:!0,accessors:[re(n),Vi(n)]}:{data:t,dtype:n,accessorProtocol:!1,accessors:[oe(n),Ai(n)]}}function Ri(t,n,e,r,i,o,a){var u,f,l,s,c,h,p;for(u=n.data,f=i.data,s=n.accessors[0],l=i.accessors[1],c=r,h=a,p=0;p0)for(s=0;s0)for(h=0;h2){if(r=Hi(Ki[e]))return new r(t,n);throw new TypeError(R("invalid argument. Must provide a recognized data type. Value: `%s`.",e))}return new Qi(t,n)}(r,i,to[t.type])}}var eo={float64:ce,float32:me,int16:Ye,int32:Se,int8:or,uint16:Ie,uint32:Ee,uint8:Ze,uint8c:Ke,complex64:Nr,complex128:Gr,bool:ni};function ro(t){return eo[t]||null}function io(t,n){return new Ze(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*n,t.length-n)}function oo(){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 ao={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"}},uo={"dtypes.default":ao.dtypes.default,"dtypes.numeric":ao.dtypes.numeric,"dtypes.real":ao.dtypes.real,"dtypes.floating_point":ao.dtypes.floating_point,"dtypes.real_floating_point":ao.dtypes.real_floating_point,"dtypes.complex_floating_point":ao.dtypes.complex_floating_point,"dtypes.integer":ao.dtypes.integer,"dtypes.signed_integer":ao.dtypes.signed_integer,"dtypes.unsigned_integer":ao.dtypes.unsigned_integer,"dtypes.boolean":ao.dtypes.boolean,"dtypes.index":ao.dtypes.index,"dtypes.integer_index":ao.dtypes.integer_index,"dtypes.boolean_index":ao.dtypes.boolean_index,"dtypes.mask_index":ao.dtypes.mask_index};M(oo,"get",(function(t){var n=uo[t];return void 0===n?null:n}));var fo=oo.get("dtypes.default"),lo=ro("complex64"),so=ro("complex128"),co=ro("bool");function ho(){var t,n,e,r;if(null===(e=ro(n=(t=arguments.length)&&Lt(arguments[t-1])?arguments[t-=1]:fo)))throw new TypeError(R("invalid argument. Must provide a recognized data type. Value: `%s`.",n));return t<=0?new e(0):1===t?((r=arguments[0])instanceof lo?r=Lr(r,0):r instanceof so?r=Br(r,0):r instanceof co&&(r=io(r,0)),new e(r)):2===t?new e(arguments[0],arguments[1]):new e(arguments[0],arguments[1],arguments[2])}function po(t){if(t.length)return t.isStructType?function(t){return function(){var n,e,r,i;for(n=(e=this[Yi]).byteOffset+t.byteOffset,r=[],i=0;i0&&n.push("generic"),n)}var bo=ui(mo("real_floating_point")),vo=ui(mo("signed_integer")),wo=on();function Eo(t){return"bigint"==typeof t}function _o(t){return"object"==typeof t&&"[object BigInt]"===q(t)&&function(t){try{return"bigint"==typeof t.valueOf()}catch(t){return!1}}(t)}function xo(t){return Eo(t)||_o(t)}function To(t){return function(){return t}}M(xo,"isPrimitive",Eo),M(xo,"isObject",_o);var Ao,Oo=To(!1),Vo=To(!1),So=To(!1);M(Oo,"isPrimitive",Vo),M(Oo,"isObject",So),Ao="function"==typeof wo.BigInt&&"function"==typeof BigInt&&"bigint"==typeof wo.BigInt("1")&&"bigint"==typeof BigInt("1")?xo:Oo;const{isPrimitive:Ro}=Ao;var jo,Fo={float64:{float64:1,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:0,complex32:0,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,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: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: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:0,complex32:0,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:0,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 Lo=function(t){return 0===arguments.length?function(){var t,n,e,r,i,o,a,u,f;for(e={},n=(t=Cn(Fo)).length,f=0;f0}(t,n):"mostly-safe"===e?function(t,n){var e;return(t=Kn(t))===(n=Kn(n))||!!(e=Po[t])&&e[n]>0}(t,n):function(t,n){var e;return(t=Kn(t))===(n=Kn(n))||!!(e=Mo[t])&&e[n]>0}(t,n)))}var No=1401298464324817e-60,Yo=16777215,Do=-16777215;function zo(t){return t!=t||t===tt||t===nt?"float32":rt(t)?t>=Do&&t<=Yo?"float32":"float64":t>-No&&t=nr?"int8":t>=ke?"int16":t>=Te?"int32":"float64":t<=ze?"uint8":t<=je?"uint16":t<=Tn?"uint32":"float64":t>-No&&t=nr?"int8":t>=ke?"int16":t>=Te?"int32":"float64":t<=tr?"int8":t<=Ue?"int16":t<=xe?"int32":"float64"}(e):Jo(e):Qo.dtypes.real,i=e):_r(e)?(r=Xo(e)||("float32"===t.type?"complex64":"complex128"),i=e.re):Gt(e)?(r="bool",i=Ho(e)):Ro(e)?(r="int64",i=Ko(e)):(r="generic",i=e);if(!Co(r,t.type,t.castingMode))throw new TypeError(R("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[Yi][n](t.byteOffset,i,Gi)}}function na(t){return Xt(t)}function ea(t){return Xt(t.re||t.im)}function ra(t,n){return function(e){var r,i;Gt(e)?(r="bool",i=Ho(e)):N(e)?(r=Qo.dtypes.real,i=Ho(na(e))):Ro(e)?(r="int64",i=Ho(function(t){return Xt(t)}(e))):_r(e)?(r=Xo(e)||Qo.dtypes.complex,i=Ho(ea(e))):(r="generic",i=Xt(e));if(!Co(r,t.type,t.castingMode))throw new TypeError(R("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[Yi][n](t.byteOffset,i,Gi)}}var ia="function"==typeof BigInt?BigInt:void 0;function oa(t,n){return function(e){var r,i;Ro(e)?(r="int64",i=e):N(e)?ot(e)?(r=Jo(e),i=ia(e)):(r=Qo.dtypes.real,i=ia(et(e))):Gt(e)?(r="bool",i=function(t){return ia(t?1:0)}(e)):_r(e)?(r=Xo(e)||Qo.dtypes.complex,i=ia(et(e.re))):(r="generic",i=ia(et(G(i))));if(!Co(r,t.type,t.castingMode))throw new TypeError(R("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[Yi][n](t.byteOffset,i,Gi)}}function aa(t){return Nn(t)&&Ui(t[Yi])}var ua=ui(mo("complex_floating_point")),fa=ui(mo("boolean")),la=ui(mo("real"));function sa(t,n){if(Vr(t))return Br(t,n);if(Ar(t))return Lr(t,n);throw new TypeError(R("invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.",t))}function ca(t,n){return n>0?0:(1-t)*n}var ha=8;function pa(t,n,e,r,i){var o,a,u,f;if(t<=0)return e;if((u=Si(e)).accessorProtocol)return function(t,n,e,r,i){var o,a,u,f;for(o=e.data,a=e.accessors[1],u=i,f=0;f0)for(f=0;f0&&(u+=n),Ea(l=a(o,f))||(u+=String(l)),f+=r;return u}(t,n,u,r,i);for(a=i,o="",l=0;l0&&(o+=n),Ea(f=e[a])||(o+=String(f)),a+=r;return o}function xa(t,n){return _a(t.length,n,t,1,0)}function Ta(t,n){return Gt(t)?null:new TypeError(R("invalid argument. `%s` field must be a boolean. Value: `%s`.",n,t))}M((function(t,n,e,r){return _a(t,n,e,r,ca(t,r))}),"ndarray",_a);var Aa=["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float32","float64","complex64","complex128","bool"];var Oa,Va={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},Sa=["name","type"],Ra={name:function(t,n){return Lt(t)||t.length>0?null:new TypeError(R("invalid argument. `%s` field must be a non-empty string. Value: `%s`.",n,t))},type:function(t){return ai(Aa,t)||cn(t)?null:new TypeError(R('invalid argument. `%s` field must be either a struct type or one of the following: "%s". Value: `%s`.',"type",xa(Aa,", "),t))},description:function(t,n){return Lt(t)?null:new TypeError(R("invalid argument. `%s` field must be a string. Value: `%s`.",n,t))},length:function(t,n){return $t(t)?null:new TypeError(R("invalid argument. `%s` field must be a positive integer. Value: `%s`.",n,t))},enumerable:Ta,writable:Ta,default:To(null),castingMode:(Oa=["none","safe","mostly-safe","same-kind","unsafe"],function(t,n){return ai(Oa,t)?null:new TypeError(R('invalid argument. `%s` field must be one of the following: "%s". Value: `%s`.',n,xa(Oa,", "),t))})};function ja(t,n){var e,r,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;an&&(n=e);return n}function La(t){var n,e,r,i,o,a,u;if(0===(n=t.fields).length)return null;for(r=[],u=0;u0&&o.byteOffset===t[a-1].byteOffset||(o.isStructType?n.push(fi(o.type.layout,r,ka(o.byteOffset))):n.push(R("|<%s>[%u,%u]",o.type,o.byteOffset,o.byteLength)));return"|"===(e=R("%s|",n.join("")))[e.length-2]&&(e=e.substring(0,e.length-1)),e}var Ca=["none","linear","layout"],Na=ui(Ca);function Ya(t,n,e){var r;if(!Zn(e))throw new TypeError(R("invalid argument. Options argument must be an object. Value: `%s`.",e));if(r={format:"none"},$(e,"format")&&(r.format=e.format,!Na(r.format)))throw new TypeError(R('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"format",xa(Ca,", "),e.format));return"linear"===r.format?function(t,n){var e,r,i,o,a,u,f,l,s,c,h,p,g,y,m,b,d,v,w,E,_,x;for(b=n.length,e="%"+(t.byteLength-1).toString().length+"s",y=0,E=0;Ey&&(y=m);for(r="%"+y+"s",i="// %s",u="%s: %s %s",c=0,l=[],E=0;E0&&d.byteOffset===n[E-1].byteOffset)){for(s=E1?" (byte %u)":"",s){for(a=" => union: %s",f=[],x=E+1;x":v.type,f.push(R("%s<%s>[%u]",v.name,w,_%v.alignment)),x+=1;a=R(a,f.join(", "))}else a="";f=R(o+a,_%d.alignment),g=d.length?R(i,R("%s[%u]%s",d.type,et(_/d.alignment),f)):R(i,R("%s%s",d.type,f)),l.push(R(u,h,p,g)),c+=1}for(_=0;_"}function Da(){}var za="foo"===Da.name;var Ja=[ce,me,Se,Ee,Ye,Ie,or,Ze,Ke],$a=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],Wa=le()?$n(ce):Za;function Za(){}Wa="TypedArray"===function(t){if(!1===sn(t))throw new TypeError(R("invalid argument. Must provide a function. Value: `%s`.",t));return za?t.name:pt.exec(t.toString())[1]}(Wa)?Wa:Za;var qa=[Gr,Nr],Ga=["Complex64Array","Complex128Array"];function Xa(){return"function"==typeof W&&"symbol"==typeof W("foo")&&$(W,"hasInstance")&&"symbol"==typeof W.hasInstance}var Ha=Xa()?Symbol.hasInstance:null,Ka=Xa();function Qa(t,n){if("function"!=typeof n&&(!Ka||"object"!=typeof n||"function"!=typeof n[Ha]))throw new TypeError(R("invalid argument. Second argument must be callable. Value: `%s`.",n));return t instanceof n}var tu=[[ce,"Float64Array"],[me,"Float32Array"],[Se,"Int32Array"],[Ee,"Uint32Array"],[Ye,"Int16Array"],[Ie,"Uint16Array"],[or,"Int8Array"],[Ze,"Uint8Array"],[Ke,"Uint8ClampedArray"],[Nr,"Complex64Array"],[Gr,"Complex128Array"],[ni,"BooleanArray"]];function nu(t){var n,e;for(e=0;e0){if(!Nn(t))throw new TypeError(R("invalid argument. First argument must be an object. Value: `%s`.",t));p=t}if(M(this,Yi,h),void 0!==p){for(f=St(void 0,a.length),c={},m=0;m0&&((o=t[u-1]).padding=r,wa(a)&&Ua(o.fields,r)),a.byteOffset=i,wa(a))for(f=0;f0?arguments[0]:{})})),M(l.prototype,"toJSON",(function(){if(!(this instanceof l))throw new Error("invalid invocation. `this` is not a struct instance.");return function(t,n){var e,r,i,o;for(e={},o=0;o=u.byteLength)throw new RangeError(R("invalid argument. Second argument exceeds the bounds of the ArrayBuffer. Value: `%s`.",e));if(2===a){if(!ot(f=(u.byteLength-e)/n))throw new RangeError(R("invalid argument. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",n,u.byteLength-e))}else{if(!ar(f=r))throw new TypeError(R("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",f));if(f*n>u.byteLength-e)throw new RangeError(R("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",f*n))}}return M(this,"_buffer",u),M(this,"_byteOffset",e||0),M(this,"_byteLength",f*n),M(this,"_length",f),this}return n=i.byteLength,e=i.layout,r=i.fields,M(o,"BYTES_PER_ELEMENT",n),M(o,"name",au),M(o,"struct",i),C(o.prototype,"buffer",(function(){return this._buffer})),C(o.prototype,"byteLength",(function(){return this._byteLength})),C(o.prototype,"byteOffset",(function(){return this._byteOffset})),M(o.prototype,"BYTES_PER_ELEMENT",o.BYTES_PER_ELEMENT),M(o.prototype,"get",(function(t){if(!a(this))throw new TypeError(R("invalid invocation. `this` is not a %s.",au));if(!ar(t))throw new TypeError(R("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return new i(this._buffer,this._byteOffset+t*n,n)})),C(o.prototype,"length",(function(){return this._length})),M(o.prototype,"set",(function(t){var o,u,f,l,s,c,h,p,g,y,m,b;if(!a(this))throw new TypeError(R("invalid invocation. `this` is not a %s.",au));if(l=this._buffer,arguments.length>1){if(!ar(f=arguments[1]))throw new TypeError(R("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",f))}else f=0;if(u={format:"layout"},h=i.byteLength,!jn(t)||ai(r,"length")){if(f>=this._length)throw new RangeError(R("invalid argument. Index argument is out-of-bounds. Value: `%u`.",f));if(!Nn(t))throw new TypeError(R("invalid argument. Must provide either a valid object or a struct instance. Value: `%s`.",t));if(t.toString(u)===e)return o=i.viewOf(t),void Bi(h,new Ze(o.buffer,o.byteOffset,h),1,0,new Ze(l,this._byteOffset+f*n,h),1,0);for(g=new i(l,this._byteOffset+f*n,h),m=0;mthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(c=(o=t).get&&o.set?re("default"):oe("default"),b=this._byteOffset+f*n,o.buffer===l&&o.byteOffsetb){for(s=[],m=0;m>18&63]+su[i>>12&63]+su[i>>6&63]+su[63&i]);return o.join("")}function mu(t){var n;pu||gu();for(var e=t.length,r=e%3,i="",o=[],a=16383,u=0,f=e-r;uf?f:u+a));return 1===r?(n=t[e-1],i+=su[n>>2],i+=su[n<<4&63],i+="=="):2===r&&(n=(t[e-2]<<8)+t[e-1],i+=su[n>>10],i+=su[n>>4&63],i+=su[n<<2&63],i+="="),o.push(i),o.join("")}function bu(t,n,e,r,i){var o,a,u=8*i-r-1,f=(1<>1,s=-7,c=e?i-1:0,h=e?-1:1,p=t[n+c];for(c+=h,o=p&(1<<-s)-1,p>>=-s,s+=u;s>0;o=256*o+t[n+c],c+=h,s-=8);for(a=o&(1<<-s)-1,o>>=-s,s+=r;s>0;a=256*a+t[n+c],c+=h,s-=8);if(0===o)o=1-l;else{if(o===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)}function du(t,n,e,r,i,o){var a,u,f,l=8*o-i-1,s=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,g=r?1:-1,y=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(u=isNaN(n)?1:0,a=s):(a=Math.floor(Math.log(n)/Math.LN2),n*(f=Math.pow(2,-a))<1&&(a--,f*=2),(n+=a+c>=1?h/f:h*Math.pow(2,1-c))*f>=2&&(a++,f/=2),a+c>=s?(u=0,a=s):a+c>=1?(u=(n*f-1)*Math.pow(2,i),a+=c):(u=n*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[e+p]=255&u,p+=g,u/=256,i-=8);for(a=a<0;t[e+p]=255&a,p+=g,a/=256,l-=8);t[e+p-g]|=128*y}var vu={}.toString,wu=Array.isArray||function(t){return"[object Array]"==vu.call(t)};Tu.TYPED_ARRAY_SUPPORT=void 0===lu.TYPED_ARRAY_SUPPORT||lu.TYPED_ARRAY_SUPPORT;var Eu=_u();function _u(){return Tu.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function xu(t,n){if(_u()=_u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_u().toString(16)+" bytes");return 0|t}function ju(t){return!(null==t||!t._isBuffer)}function Fu(t,n){if(ju(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var r=!1;;)switch(n){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return of(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return af(t).length;default:if(r)return of(t).length;n=(""+n).toLowerCase(),r=!0}}function Lu(t,n,e){var r=!1;if((void 0===n||n<0)&&(n=0),n>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(n>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zu(this,n,e);case"utf8":case"utf-8":return zu(this,n,e);case"ascii":return $u(this,n,e);case"latin1":case"binary":return Wu(this,n,e);case"base64":return Du(this,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qu(this,n,e);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function Bu(t,n,e){var r=t[n];t[n]=t[e],t[e]=r}function Iu(t,n,e,r,i){if(0===t.length)return-1;if("string"==typeof e?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof n&&(n=Tu.from(n,r)),ju(n))return 0===n.length?-1:Pu(t,n,e,r,i);if("number"==typeof n)return n&=255,Tu.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,n,e):Uint8Array.prototype.lastIndexOf.call(t,n,e):Pu(t,[n],e,r,i);throw new TypeError("val must be string, number or Buffer")}function Pu(t,n,e,r,i){var o,a=1,u=t.length,f=n.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||n.length<2)return-1;a=2,u/=2,f/=2,e/=2}function l(t,n){return 1===a?t[n]:t.readUInt16BE(n*a)}if(i){var s=-1;for(o=e;ou&&(e=u-f),o=e;o>=0;o--){for(var c=!0,h=0;hi&&(r=i):r=i;var o=n.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=e%256,o.push(i),o.push(r);return o}(n,t.length-e),t,e,r)}function Du(t,n,e){return 0===n&&e===t.length?mu(t):mu(t.slice(n,e))}function zu(t,n,e){e=Math.min(t.length,e);for(var r=[],i=n;i239?4:l>223?3:l>191?2:1;if(i+c<=e)switch(c){case 1:l<128&&(s=l);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&l)<<6|63&o)>127&&(s=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&l)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(s=f);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(f=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(s=f)}null===s?(s=65533,c=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=c}return function(t){var n=t.length;if(n<=Ju)return String.fromCharCode.apply(String,t);var e="",r=0;for(;r0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},Tu.prototype.compare=function(t,n,e,r,i){if(!ju(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===e&&(e=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),n<0||e>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&n>=e)return 0;if(r>=i)return-1;if(n>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(e>>>=0)-(n>>>=0),u=Math.min(o,a),f=this.slice(r,i),l=t.slice(n,e),s=0;si)&&(e=i),t.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Uu(this,t,n,e);case"utf8":case"utf-8":return ku(this,t,n,e);case"ascii":return Mu(this,t,n,e);case"latin1":case"binary":return Cu(this,t,n,e);case"base64":return Nu(this,t,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yu(this,t,n,e);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Tu.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Ju=4096;function $u(t,n,e){var r="";e=Math.min(t.length,e);for(var i=n;ir)&&(e=r);for(var i="",o=n;oe)throw new RangeError("Trying to access beyond buffer length")}function Xu(t,n,e,r,i,o){if(!ju(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>i||nt.length)throw new RangeError("Index out of range")}function Hu(t,n,e,r){n<0&&(n=65535+n+1);for(var i=0,o=Math.min(t.length-e,2);i>>8*(r?i:1-i)}function Ku(t,n,e,r){n<0&&(n=4294967295+n+1);for(var i=0,o=Math.min(t.length-e,4);i>>8*(r?i:3-i)&255}function Qu(t,n,e,r,i,o){if(e+r>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function tf(t,n,e,r,i){return i||Qu(t,0,e,4),du(t,n,e,r,23,4),e+4}function nf(t,n,e,r,i){return i||Qu(t,0,e,8),du(t,n,e,r,52,8),e+8}Tu.prototype.slice=function(t,n){var e,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(n=void 0===n?r:~~n)<0?(n+=r)<0&&(n=0):n>r&&(n=r),n0&&(i*=256);)r+=this[t+--n]*i;return r},Tu.prototype.readUInt8=function(t,n){return n||Gu(t,1,this.length),this[t]},Tu.prototype.readUInt16LE=function(t,n){return n||Gu(t,2,this.length),this[t]|this[t+1]<<8},Tu.prototype.readUInt16BE=function(t,n){return n||Gu(t,2,this.length),this[t]<<8|this[t+1]},Tu.prototype.readUInt32LE=function(t,n){return n||Gu(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Tu.prototype.readUInt32BE=function(t,n){return n||Gu(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Tu.prototype.readIntLE=function(t,n,e){t|=0,n|=0,e||Gu(t,n,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*n)),r},Tu.prototype.readIntBE=function(t,n,e){t|=0,n|=0,e||Gu(t,n,this.length);for(var r=n,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*n)),o},Tu.prototype.readInt8=function(t,n){return n||Gu(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Tu.prototype.readInt16LE=function(t,n){n||Gu(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},Tu.prototype.readInt16BE=function(t,n){n||Gu(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},Tu.prototype.readInt32LE=function(t,n){return n||Gu(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Tu.prototype.readInt32BE=function(t,n){return n||Gu(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Tu.prototype.readFloatLE=function(t,n){return n||Gu(t,4,this.length),bu(this,t,!0,23,4)},Tu.prototype.readFloatBE=function(t,n){return n||Gu(t,4,this.length),bu(this,t,!1,23,4)},Tu.prototype.readDoubleLE=function(t,n){return n||Gu(t,8,this.length),bu(this,t,!0,52,8)},Tu.prototype.readDoubleBE=function(t,n){return n||Gu(t,8,this.length),bu(this,t,!1,52,8)},Tu.prototype.writeUIntLE=function(t,n,e,r){(t=+t,n|=0,e|=0,r)||Xu(this,t,n,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[n]=255&t;++o=0&&(o*=256);)this[n+i]=t/o&255;return n+e},Tu.prototype.writeUInt8=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,1,255,0),Tu.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=255&t,n+1},Tu.prototype.writeUInt16LE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,2,65535,0),Tu.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):Hu(this,t,n,!0),n+2},Tu.prototype.writeUInt16BE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,2,65535,0),Tu.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):Hu(this,t,n,!1),n+2},Tu.prototype.writeUInt32LE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,4,4294967295,0),Tu.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=255&t):Ku(this,t,n,!0),n+4},Tu.prototype.writeUInt32BE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,4,4294967295,0),Tu.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):Ku(this,t,n,!1),n+4},Tu.prototype.writeIntLE=function(t,n,e,r){if(t=+t,n|=0,!r){var i=Math.pow(2,8*e-1);Xu(this,t,n,e,i-1,-i)}var o=0,a=1,u=0;for(this[n]=255&t;++o>0)-u&255;return n+e},Tu.prototype.writeIntBE=function(t,n,e,r){if(t=+t,n|=0,!r){var i=Math.pow(2,8*e-1);Xu(this,t,n,e,i-1,-i)}var o=e-1,a=1,u=0;for(this[n+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[n+o+1]&&(u=1),this[n+o]=(t/a>>0)-u&255;return n+e},Tu.prototype.writeInt8=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,1,127,-128),Tu.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=255&t,n+1},Tu.prototype.writeInt16LE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,2,32767,-32768),Tu.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8):Hu(this,t,n,!0),n+2},Tu.prototype.writeInt16BE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,2,32767,-32768),Tu.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=255&t):Hu(this,t,n,!1),n+2},Tu.prototype.writeInt32LE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,4,2147483647,-2147483648),Tu.TYPED_ARRAY_SUPPORT?(this[n]=255&t,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):Ku(this,t,n,!0),n+4},Tu.prototype.writeInt32BE=function(t,n,e){return t=+t,n|=0,e||Xu(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Tu.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=255&t):Ku(this,t,n,!1),n+4},Tu.prototype.writeFloatLE=function(t,n,e){return tf(this,t,n,!0,e)},Tu.prototype.writeFloatBE=function(t,n,e){return tf(this,t,n,!1,e)},Tu.prototype.writeDoubleLE=function(t,n,e){return nf(this,t,n,!0,e)},Tu.prototype.writeDoubleBE=function(t,n,e){return nf(this,t,n,!1,e)},Tu.prototype.copy=function(t,n,e,r){if(e||(e=0),r||0===r||(r=this.length),n>=t.length&&(n=t.length),n||(n=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-n=0;--i)t[i+n]=this[i+e];else if(o<1e3||!Tu.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=n;o55295&&e<57344){if(!i){if(e>56319){(n-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(n-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(n-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(n-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((n-=1)<0)break;o.push(e)}else if(e<2048){if((n-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((n-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((n-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function af(t){return function(t){var n,e,r,i,o,a;pu||gu();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new hu(3*u/4-o),r=o>0?u-4:u;var f=0;for(n=0,e=0;n>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=cu[t.charCodeAt(n)]<<2|cu[t.charCodeAt(n+1)]>>4,a[f++]=255&i):1===o&&(i=cu[t.charCodeAt(n)]<<10|cu[t.charCodeAt(n+1)]<<4|cu[t.charCodeAt(n+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(ef,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function uf(t,n,e,r){for(var i=0;i=n.length||i>=t.length);++i)n[i+e]=t[i];return i}function ff(t){return null!=t&&(!!t._isBuffer||lf(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&lf(t.slice(0,0))}(t))}function lf(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}fu(Object.freeze({__proto__:null,Buffer:Tu,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),Tu.alloc(+t)},isBuffer:ff,kMaxLength:Eu})).Buffer;var sf=function(){throw new Error("not implemented")};function cf(){throw new Error("not implemented")}var hf={binary:sf,float64:ce,float32:me,float16:cf,generic:Array,int16:Ye,int32:Se,int8:or,uint16:Ie,uint32:Ee,uint8:Ze,uint8c:Ke,complex32:cf,complex64:Nr,complex128:Gr,bool:ni},pf={};var gf=sn(sf.allocUnsafe)?function(t){if(!fr(t))throw new TypeError(R("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return sf.allocUnsafe(t)}:function(t){if(!fr(t))throw new TypeError(R("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return new sf(t)};function yf(t){return function(t,n,e,r){var i;return function(t,n){return"function"==typeof t["fill"]}(t)?t.fill(n,e,r):(e<0&&(e+=t.length)<0&&(e=0),r<0?r+=t.length:r>t.length&&(r=t.length),(i=Si(t)).accessorProtocol?function(t,n,e,r){var i,o,a;for(i=t.data,o=t.accessors[1],a=e;a0&&(h=Rt(h.length))}else h=Ot(p);return 0===jt(h)?bf(c,a,Vt(h,l),f,!r):(o=function(t,n,e){var r,i,o;for(r=t.data,i=e,o=0;ol?-1:f))throw new RangeError(vf("1lDF8",a,n));return(o=St(null,a))[u]=new ct(e,null),df(t,Et(o),r,i)}})); +//# sourceMappingURL=browser.js.map diff --git a/browser.js.map b/browser.js.map new file mode 100644 index 0000000..be6841e --- /dev/null +++ b/browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.js","sources":["../node_modules/@stdlib/utils-define-property/lib/define_property.js","../node_modules/@stdlib/utils-define-property/lib/builtin.js","../node_modules/@stdlib/string-base-format-interpolate/lib/is_number.js","../node_modules/@stdlib/string-base-format-interpolate/lib/zero_pad.js","../node_modules/@stdlib/string-base-format-interpolate/lib/format_integer.js","../node_modules/@stdlib/string-base-format-interpolate/lib/format_double.js","../node_modules/@stdlib/string-base-format-interpolate/lib/space_pad.js","../node_modules/@stdlib/string-base-format-interpolate/lib/main.js","../node_modules/@stdlib/string-base-format-interpolate/lib/is_string.js","../node_modules/@stdlib/string-base-format-tokenize/lib/main.js","../node_modules/@stdlib/string-format/lib/main.js","../node_modules/@stdlib/string-format/lib/is_string.js","../node_modules/@stdlib/utils-define-property/lib/polyfill.js","../node_modules/@stdlib/utils-define-property/lib/index.js","../node_modules/@stdlib/utils-define-property/lib/has_define_property_support.js","../node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/main.js","../node_modules/@stdlib/utils-define-nonenumerable-read-only-accessor/lib/main.js","../node_modules/@stdlib/assert-is-number/lib/primitive.js","../node_modules/@stdlib/assert-has-tostringtag-support/lib/main.js","../node_modules/@stdlib/assert-has-symbol-support/lib/main.js","../node_modules/@stdlib/utils-native-class/lib/tostring.js","../node_modules/@stdlib/assert-has-own-property/lib/main.js","../node_modules/@stdlib/symbol-ctor/lib/main.js","../node_modules/@stdlib/utils-native-class/lib/tostringtag.js","../node_modules/@stdlib/utils-native-class/lib/index.js","../node_modules/@stdlib/utils-native-class/lib/polyfill.js","../node_modules/@stdlib/utils-native-class/lib/main.js","../node_modules/@stdlib/number-ctor/lib/main.js","../node_modules/@stdlib/assert-is-number/lib/tostring.js","../node_modules/@stdlib/assert-is-number/lib/object.js","../node_modules/@stdlib/assert-is-number/lib/try2serialize.js","../node_modules/@stdlib/assert-is-number/lib/main.js","../node_modules/@stdlib/assert-is-number/lib/index.js","../node_modules/@stdlib/constants-float64-pinf/lib/index.js","../node_modules/@stdlib/constants-float64-ninf/lib/index.js","../node_modules/@stdlib/math-base-special-floor/lib/main.js","../node_modules/@stdlib/math-base-assert-is-integer/lib/main.js","../node_modules/@stdlib/assert-is-integer/lib/integer.js","../node_modules/@stdlib/assert-is-integer/lib/primitive.js","../node_modules/@stdlib/assert-is-integer/lib/object.js","../node_modules/@stdlib/assert-is-integer/lib/main.js","../node_modules/@stdlib/assert-is-null/lib/main.js","../node_modules/@stdlib/assert-is-undefined/lib/main.js","../node_modules/@stdlib/slice-ctor/lib/main.js","../node_modules/@stdlib/regexp-function-name/lib/main.js","../node_modules/@stdlib/assert-is-integer/lib/index.js","../node_modules/@stdlib/regexp-function-name/lib/regexp.js","../node_modules/@stdlib/regexp-function-name/lib/index.js","../node_modules/@stdlib/assert-is-array/lib/main.js","../node_modules/@stdlib/assert-tools-array-function/lib/main.js","../node_modules/@stdlib/assert-is-object-like/lib/main.js","../node_modules/@stdlib/assert-is-buffer/lib/main.js","../node_modules/@stdlib/utils-constructor-name/lib/main.js","../node_modules/@stdlib/slice-multi/lib/main.js","../node_modules/@stdlib/assert-is-slice/lib/main.js","../node_modules/@stdlib/slice-base-args2multislice/lib/main.js","../node_modules/@stdlib/slice-base-normalize-multi-slice/lib/main.js","../node_modules/@stdlib/slice-base-int2slice/lib/main.js","../node_modules/@stdlib/slice-base-int2slice/lib/error_out_of_bounds.js","../node_modules/@stdlib/slice-base-normalize-slice/lib/main.js","../node_modules/@stdlib/slice-base-normalize-slice/lib/error_out_of_bounds.js","../node_modules/@stdlib/assert-is-object-like/lib/index.js","../node_modules/@stdlib/math-base-special-ceil/lib/main.js","../node_modules/@stdlib/slice-base-length/lib/main.js","../node_modules/@stdlib/slice-base-shape/lib/main.js","../node_modules/@stdlib/array-base-take-indexed/lib/main.js","../node_modules/@stdlib/array-base-filled/lib/main.js","../node_modules/@stdlib/array-base-zeros/lib/main.js","../node_modules/@stdlib/ndarray-base-numel/lib/main.js","../node_modules/@stdlib/array-base-copy-indexed/lib/main.js","../node_modules/@stdlib/assert-is-string/lib/primitive.js","../node_modules/@stdlib/assert-is-string/lib/valueof.js","../node_modules/@stdlib/assert-is-string/lib/object.js","../node_modules/@stdlib/assert-is-string/lib/try2valueof.js","../node_modules/@stdlib/assert-is-string/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-column-major-string/lib/main.js","../node_modules/@stdlib/ndarray-base-shape2strides/lib/main.js","../node_modules/@stdlib/assert-is-string/lib/index.js","../node_modules/@stdlib/ndarray-base-shape2strides/lib/index.js","../node_modules/@stdlib/ndarray-base-shape2strides/lib/assign.js","../node_modules/@stdlib/ndarray-base-strides/lib/main.js","../node_modules/@stdlib/math-base-special-abs/lib/main.js","../node_modules/@stdlib/ndarray-base-order/lib/main.js","../node_modules/@stdlib/ndarray-base-strides2order/lib/main.js","../node_modules/@stdlib/ndarray-base-data-buffer/lib/main.js","../node_modules/@stdlib/assert-is-positive-integer/lib/primitive.js","../node_modules/@stdlib/assert-is-positive-integer/lib/object.js","../node_modules/@stdlib/assert-is-positive-integer/lib/main.js","../node_modules/@stdlib/assert-is-positive-integer/lib/index.js","../node_modules/@stdlib/utils-type-of/lib/fixtures/re.js","../node_modules/@stdlib/assert-is-boolean/lib/primitive.js","../node_modules/@stdlib/boolean-ctor/lib/main.js","../node_modules/@stdlib/assert-is-boolean/lib/tostring.js","../node_modules/@stdlib/assert-is-boolean/lib/object.js","../node_modules/@stdlib/assert-is-boolean/lib/try2serialize.js","../node_modules/@stdlib/assert-is-boolean/lib/main.js","../node_modules/@stdlib/assert-is-boolean/lib/index.js","../node_modules/@stdlib/utils-global/lib/self.js","../node_modules/@stdlib/utils-global/lib/window.js","../node_modules/@stdlib/utils-global/lib/global_this.js","../node_modules/@stdlib/utils-global/lib/browser.js","../node_modules/@stdlib/utils-global/lib/codegen.js","../node_modules/@stdlib/utils-type-of/lib/fixtures/nodelist.js","../node_modules/@stdlib/utils-type-of/lib/fixtures/typedarray.js","../node_modules/@stdlib/utils-type-of/lib/index.js","../node_modules/@stdlib/utils-type-of/lib/check.js","../node_modules/@stdlib/utils-type-of/lib/polyfill.js","../node_modules/@stdlib/utils-type-of/lib/main.js","../node_modules/@stdlib/assert-is-function/lib/main.js","../node_modules/@stdlib/assert-is-struct-constructor-like/lib/main.js","../node_modules/@stdlib/utils-keys/lib/builtin.js","../node_modules/@stdlib/utils-keys/lib/has_builtin.js","../node_modules/@stdlib/assert-is-arguments/lib/detect.js","../node_modules/@stdlib/assert-is-arguments/lib/main.js","../node_modules/@stdlib/math-base-assert-is-nan/lib/main.js","../node_modules/@stdlib/assert-is-nan/lib/primitive.js","../node_modules/@stdlib/assert-is-nan/lib/object.js","../node_modules/@stdlib/assert-is-nan/lib/main.js","../node_modules/@stdlib/assert-is-nan/lib/index.js","../node_modules/@stdlib/assert-is-enumerable-property/lib/native.js","../node_modules/@stdlib/assert-is-enumerable-property/lib/has_string_enumerability_bug.js","../node_modules/@stdlib/assert-is-enumerable-property/lib/main.js","../node_modules/@stdlib/constants-uint32-max/lib/index.js","../node_modules/@stdlib/assert-is-arguments/lib/index.js","../node_modules/@stdlib/assert-is-arguments/lib/polyfill.js","../node_modules/@stdlib/utils-keys/lib/builtin_wrapper.js","../node_modules/@stdlib/utils-keys/lib/has_enumerable_prototype_bug.js","../node_modules/@stdlib/utils-noop/lib/main.js","../node_modules/@stdlib/utils-keys/lib/has_non_enumerable_properties_bug.js","../node_modules/@stdlib/constants-array-max-typed-array-length/lib/index.js","../node_modules/@stdlib/assert-is-collection/lib/main.js","../node_modules/@stdlib/utils-index-of/lib/main.js","../node_modules/@stdlib/utils-keys/lib/is_constructor_prototype.js","../node_modules/@stdlib/utils-keys/lib/window.js","../node_modules/@stdlib/utils-keys/lib/has_automation_equality_bug.js","../node_modules/@stdlib/utils-keys/lib/has_window.js","../node_modules/@stdlib/utils-keys/lib/main.js","../node_modules/@stdlib/utils-keys/lib/has_arguments_bug.js","../node_modules/@stdlib/utils-keys/lib/polyfill.js","../node_modules/@stdlib/utils-keys/lib/is_constructor_prototype_wrapper.js","../node_modules/@stdlib/assert-is-object/lib/main.js","../node_modules/@stdlib/object-ctor/lib/main.js","../node_modules/@stdlib/utils-get-prototype-of/lib/detect.js","../node_modules/@stdlib/utils-get-prototype-of/lib/native.js","../node_modules/@stdlib/utils-get-prototype-of/lib/polyfill.js","../node_modules/@stdlib/utils-get-prototype-of/lib/proto.js","../node_modules/@stdlib/utils-get-prototype-of/lib/main.js","../node_modules/@stdlib/assert-is-plain-object/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-enum2str/lib/main.js","../node_modules/@stdlib/object-inverse/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-enums/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-str2enum/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-resolve-str/lib/main.js","../node_modules/@stdlib/assert-has-property/lib/main.js","../node_modules/@stdlib/array-base-assert-is-accessor-array/lib/main.js","../node_modules/@stdlib/array-base-accessor-getter/lib/main.js","../node_modules/@stdlib/array-base-getter/lib/main.js","../node_modules/@stdlib/array-dtype/lib/ctor2dtype.js","../node_modules/@stdlib/assert-is-float64array/lib/main.js","../node_modules/@stdlib/assert-has-float64array-support/lib/float64array.js","../node_modules/@stdlib/assert-has-float64array-support/lib/main.js","../node_modules/@stdlib/array-float64/lib/main.js","../node_modules/@stdlib/array-float64/lib/index.js","../node_modules/@stdlib/array-float64/lib/polyfill.js","../node_modules/@stdlib/assert-is-float32array/lib/main.js","../node_modules/@stdlib/assert-has-float32array-support/lib/float32array.js","../node_modules/@stdlib/array-float32/lib/main.js","../node_modules/@stdlib/array-float32/lib/index.js","../node_modules/@stdlib/assert-has-float32array-support/lib/main.js","../node_modules/@stdlib/array-float32/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint32array/lib/main.js","../node_modules/@stdlib/assert-has-uint32array-support/lib/uint32array.js","../node_modules/@stdlib/array-uint32/lib/main.js","../node_modules/@stdlib/array-uint32/lib/index.js","../node_modules/@stdlib/assert-has-uint32array-support/lib/main.js","../node_modules/@stdlib/array-uint32/lib/polyfill.js","../node_modules/@stdlib/assert-is-int32array/lib/main.js","../node_modules/@stdlib/constants-int32-max/lib/index.js","../node_modules/@stdlib/constants-int32-min/lib/index.js","../node_modules/@stdlib/assert-has-int32array-support/lib/int32array.js","../node_modules/@stdlib/array-int32/lib/main.js","../node_modules/@stdlib/array-int32/lib/index.js","../node_modules/@stdlib/assert-has-int32array-support/lib/main.js","../node_modules/@stdlib/array-int32/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint16array/lib/main.js","../node_modules/@stdlib/constants-uint16-max/lib/index.js","../node_modules/@stdlib/assert-has-uint16array-support/lib/uint16array.js","../node_modules/@stdlib/array-uint16/lib/main.js","../node_modules/@stdlib/array-uint16/lib/index.js","../node_modules/@stdlib/assert-has-uint16array-support/lib/main.js","../node_modules/@stdlib/array-uint16/lib/polyfill.js","../node_modules/@stdlib/assert-is-int16array/lib/main.js","../node_modules/@stdlib/constants-int16-max/lib/index.js","../node_modules/@stdlib/constants-int16-min/lib/index.js","../node_modules/@stdlib/assert-has-int16array-support/lib/int16array.js","../node_modules/@stdlib/array-int16/lib/main.js","../node_modules/@stdlib/array-int16/lib/index.js","../node_modules/@stdlib/assert-has-int16array-support/lib/main.js","../node_modules/@stdlib/array-int16/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint8array/lib/main.js","../node_modules/@stdlib/constants-uint8-max/lib/index.js","../node_modules/@stdlib/assert-has-uint8array-support/lib/uint8array.js","../node_modules/@stdlib/array-uint8/lib/main.js","../node_modules/@stdlib/array-uint8/lib/index.js","../node_modules/@stdlib/assert-has-uint8array-support/lib/main.js","../node_modules/@stdlib/array-uint8/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint8clampedarray/lib/main.js","../node_modules/@stdlib/assert-has-uint8clampedarray-support/lib/uint8clampedarray.js","../node_modules/@stdlib/array-uint8c/lib/main.js","../node_modules/@stdlib/array-uint8c/lib/index.js","../node_modules/@stdlib/assert-has-uint8clampedarray-support/lib/main.js","../node_modules/@stdlib/array-uint8c/lib/polyfill.js","../node_modules/@stdlib/assert-is-int8array/lib/main.js","../node_modules/@stdlib/constants-int8-max/lib/index.js","../node_modules/@stdlib/constants-int8-min/lib/index.js","../node_modules/@stdlib/assert-has-int8array-support/lib/int8array.js","../node_modules/@stdlib/array-int8/lib/main.js","../node_modules/@stdlib/array-int8/lib/index.js","../node_modules/@stdlib/assert-has-int8array-support/lib/main.js","../node_modules/@stdlib/array-int8/lib/polyfill.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/primitive.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/object.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/main.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/index.js","../node_modules/@stdlib/constants-array-max-array-length/lib/index.js","../node_modules/@stdlib/assert-is-array-like-object/lib/main.js","../node_modules/@stdlib/assert-is-arraybuffer/lib/main.js","../node_modules/@stdlib/assert-is-string-array/lib/index.js","../node_modules/@stdlib/utils-define-read-only-property/lib/main.js","../node_modules/@stdlib/complex-float64-ctor/lib/main.js","../node_modules/@stdlib/complex-float64-ctor/lib/tostring.js","../node_modules/@stdlib/complex-float64-ctor/lib/tojson.js","../node_modules/@stdlib/number-float64-base-to-float32/lib/main.js","../node_modules/@stdlib/number-float64-base-to-float32/lib/polyfill.js","../node_modules/@stdlib/number-float64-base-to-float32/lib/index.js","../node_modules/@stdlib/complex-float32-ctor/lib/main.js","../node_modules/@stdlib/assert-is-complex-like/lib/main.js","../node_modules/@stdlib/math-base-assert-is-even/lib/main.js","../node_modules/@stdlib/complex-float32-ctor/lib/tostring.js","../node_modules/@stdlib/complex-float32-ctor/lib/tojson.js","../node_modules/@stdlib/array-base-assert-is-complex64array/lib/main.js","../node_modules/@stdlib/array-base-assert-is-complex128array/lib/main.js","../node_modules/@stdlib/assert-has-iterator-symbol-support/lib/main.js","../node_modules/@stdlib/symbol-iterator/lib/main.js","../node_modules/@stdlib/complex-float32-real/lib/main.js","../node_modules/@stdlib/complex-float32-imag/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-complex64/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-complex128/lib/main.js","../node_modules/@stdlib/array-complex64/lib/from_iterator.js","../node_modules/@stdlib/array-complex64/lib/main.js","../node_modules/@stdlib/array-complex64/lib/from_array.js","../node_modules/@stdlib/complex-float64-real/lib/main.js","../node_modules/@stdlib/complex-float64-imag/lib/main.js","../node_modules/@stdlib/array-complex128/lib/from_iterator.js","../node_modules/@stdlib/array-complex64/lib/from_iterator_map.js","../node_modules/@stdlib/array-complex128/lib/main.js","../node_modules/@stdlib/array-complex128/lib/from_array.js","../node_modules/@stdlib/array-bool/lib/from_iterator.js","../node_modules/@stdlib/array-complex128/lib/from_iterator_map.js","../node_modules/@stdlib/array-bool/lib/main.js","../node_modules/@stdlib/array-bool/lib/from_array.js","../node_modules/@stdlib/array-bool/lib/from_iterator_map.js","../node_modules/@stdlib/array-dtype/lib/ctors.js","../node_modules/@stdlib/array-dtype/lib/dtypes.js","../node_modules/@stdlib/array-dtype/lib/main.js","../node_modules/@stdlib/array-base-assert-contains/lib/main.js","../node_modules/@stdlib/array-base-assert-contains/lib/factory.js","../node_modules/@stdlib/string-base-replace/lib/main.js","../node_modules/@stdlib/array-base-assert-contains/lib/index.js","../node_modules/@stdlib/ndarray-base-dtype-strings/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-data-type-string/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-desc/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-char/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-alignment/lib/main.js","../node_modules/@stdlib/ndarray-base-bytes-per-element/lib/main.js","../node_modules/@stdlib/ndarray-dtype-ctor/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-desc/lib/table.js","../node_modules/@stdlib/ndarray-base-dtype-char/lib/table.js","../node_modules/@stdlib/ndarray-base-dtype-resolve-enum/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-alignment/lib/table.js","../node_modules/@stdlib/ndarray-base-assert-is-struct-data-type/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-struct-data-type/node_modules/@stdlib/ndarray-base-assert-is-data-type-object/lib/main.js","../node_modules/@stdlib/assert-is-prototype-of/lib/main.js","../node_modules/@stdlib/assert-has-arraybuffer-support/lib/arraybuffer.js","../node_modules/@stdlib/array-buffer/lib/main.js","../node_modules/@stdlib/array-buffer/lib/index.js","../node_modules/@stdlib/assert-has-arraybuffer-support/lib/main.js","../node_modules/@stdlib/array-buffer/lib/polyfill.js","../node_modules/@stdlib/array-base-setter/lib/main.js","../node_modules/@stdlib/array-base-accessor-setter/lib/main.js","../node_modules/@stdlib/array-base-arraylike2object/lib/main.js","../node_modules/@stdlib/blas-base-gcopy/lib/accessors.js","../node_modules/@stdlib/blas-base-gcopy/lib/main.js","../node_modules/@stdlib/blas-base-gcopy/lib/ndarray.js","../node_modules/@stdlib/math-base-special-fast-min/lib/main.js","../node_modules/@stdlib/blas-base-gcopy/lib/index.js","../node_modules/@stdlib/assert-is-dataview/lib/main.js","../node_modules/@stdlib/assert-has-dataview-support/lib/dataview.js","../node_modules/@stdlib/array-dataview/lib/main.js","../node_modules/@stdlib/array-dataview/lib/index.js","../node_modules/@stdlib/assert-has-dataview-support/lib/main.js","../node_modules/@stdlib/array-dataview/lib/polyfill.js","../node_modules/@stdlib/dstructs-struct/lib/private_buffer.js","../node_modules/@stdlib/dstructs-struct/lib/ctor_name.js","../node_modules/@stdlib/utils-define-nonenumerable-read-write-accessor/lib/main.js","../node_modules/@stdlib/utils-define-read-only-accessor/lib/main.js","../node_modules/@stdlib/utils-define-read-write-accessor/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/data_view_methods.js","../node_modules/@stdlib/assert-is-little-endian/lib/main.js","../node_modules/@stdlib/assert-is-little-endian/lib/ctors.js","../node_modules/@stdlib/complex-ctors/lib/ctors.js","../node_modules/@stdlib/complex-ctors/lib/main.js","../node_modules/@stdlib/complex-cmplx/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/get_complex.js","../node_modules/@stdlib/array-typed-ctors/lib/ctors.js","../node_modules/@stdlib/array-typed-ctors/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-boolean/lib/main.js","../node_modules/@stdlib/array-defaults/lib/main.js","../node_modules/@stdlib/array-defaults/lib/get.js","../node_modules/@stdlib/array-defaults/lib/index.js","../node_modules/@stdlib/array-typed/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/getter.js","../node_modules/@stdlib/dstructs-struct/lib/get_struct_array.js","../node_modules/@stdlib/dstructs-struct/lib/get_typedarray.js","../node_modules/@stdlib/dstructs-struct/lib/get_bigint.js","../node_modules/@stdlib/dstructs-struct/lib/get_boolean.js","../node_modules/@stdlib/dstructs-struct/lib/get_struct.js","../node_modules/@stdlib/array-dtypes/lib/main.js","../node_modules/@stdlib/array-base-assert-is-real-floating-point-data-type/lib/main.js","../node_modules/@stdlib/array-base-assert-is-signed-integer-data-type/lib/main.js","../node_modules/@stdlib/assert-has-bigint-support/lib/main.js","../node_modules/@stdlib/assert-is-bigint/lib/primitive.js","../node_modules/@stdlib/assert-is-bigint/lib/object.js","../node_modules/@stdlib/assert-is-bigint/lib/try2valueof.js","../node_modules/@stdlib/assert-is-bigint/lib/generic.js","../node_modules/@stdlib/utils-constant-function/lib/main.js","../node_modules/@stdlib/assert-is-bigint/lib/main.js","../node_modules/@stdlib/assert-is-bigint/lib/polyfill.js","../node_modules/@stdlib/assert-is-bigint/lib/index.js","../node_modules/@stdlib/ndarray-safe-casts/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-safe-data-type-cast/lib/main.js","../node_modules/@stdlib/ndarray-mostly-safe-casts/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-mostly-safe-data-type-cast/lib/main.js","../node_modules/@stdlib/ndarray-same-kind-casts/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-same-kind-data-type-cast/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-allowed-data-type-cast/lib/main.js","../node_modules/@stdlib/constants-float32-smallest-subnormal/lib/index.js","../node_modules/@stdlib/constants-float32-max-safe-integer/lib/index.js","../node_modules/@stdlib/constants-float32-min-safe-integer/lib/index.js","../node_modules/@stdlib/array-min-dtype/lib/main.js","../node_modules/@stdlib/math-base-assert-is-negative-zero/lib/main.js","../node_modules/@stdlib/complex-dtype/lib/ctor2dtype.js","../node_modules/@stdlib/complex-dtype/lib/dtypes.js","../node_modules/@stdlib/complex-dtype/lib/ctors.js","../node_modules/@stdlib/complex-dtypes/lib/main.js","../node_modules/@stdlib/complex-dtype/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/boolean2number.js","../node_modules/@stdlib/dstructs-struct/lib/bigint2number.js","../node_modules/@stdlib/dstructs-struct/lib/set_number.js","../node_modules/@stdlib/array-base-min-signed-integer-dtype/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/number2boolean.js","../node_modules/@stdlib/dstructs-struct/lib/complex2boolean.js","../node_modules/@stdlib/dstructs-struct/lib/set_boolean.js","../node_modules/@stdlib/dstructs-struct/lib/bigint2boolean.js","../node_modules/@stdlib/bigint-ctor/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/set_bigint.js","../node_modules/@stdlib/dstructs-struct/lib/boolean2bigint.js","../node_modules/@stdlib/dstructs-struct/lib/is_struct_instance.js","../node_modules/@stdlib/array-base-assert-is-complex-floating-point-data-type/lib/main.js","../node_modules/@stdlib/array-base-assert-is-boolean-data-type/lib/main.js","../node_modules/@stdlib/array-base-assert-is-real-data-type/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-complex/lib/main.js","../node_modules/@stdlib/strided-base-stride2offset/lib/main.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/ndarray.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/accessors.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/main.js","../node_modules/@stdlib/array-base-map/lib/assign.js","../node_modules/@stdlib/array-base-map/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/complex2number.js","../node_modules/@stdlib/dstructs-struct/lib/setter.js","../node_modules/@stdlib/dstructs-struct/lib/set_struct_array.js","../node_modules/@stdlib/dstructs-struct/lib/set_typedarray.js","../node_modules/@stdlib/dstructs-struct/lib/set_complex.js","../node_modules/@stdlib/dstructs-struct/lib/set_struct.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/index.js","../node_modules/@stdlib/array-base-map/lib/index.js","../node_modules/@stdlib/dstructs-struct/lib/field_properties.js","../node_modules/@stdlib/dstructs-struct/lib/is_union_type.js","../node_modules/@stdlib/assert-is-undefined-or-null/lib/main.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/ndarray.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/accessors.js","../node_modules/@stdlib/array-base-join/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_boolean.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/index.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/dtypes.js","../node_modules/@stdlib/dstructs-struct/lib/casting_modes.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_one_of.js","../node_modules/@stdlib/dstructs-struct/lib/alignments.js","../node_modules/@stdlib/dstructs-struct/lib/normalize_field.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_nonempty_string.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_type.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_string.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_positive_integer.js","../node_modules/@stdlib/dstructs-struct/lib/init_field_object.js","../node_modules/@stdlib/dstructs-struct/lib/has_properties.js","../node_modules/@stdlib/dstructs-struct/lib/byte_length.js","../node_modules/@stdlib/dstructs-struct/lib/resolve_alignment.js","../node_modules/@stdlib/dstructs-struct/lib/normalize_union.js","../node_modules/@stdlib/array-base-index-of/lib/main.js","../node_modules/@stdlib/array-base-resolve-getter/lib/main.js","../node_modules/@stdlib/assert-is-accessor-array/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/field_index.js","../node_modules/@stdlib/dstructs-struct/lib/byte_offsets.js","../node_modules/@stdlib/dstructs-struct/lib/format_layout.js","../node_modules/@stdlib/dstructs-struct/lib/to_string.js","../node_modules/@stdlib/dstructs-struct/lib/format_linear.js","../node_modules/@stdlib/assert-has-function-name-support/lib/foo.js","../node_modules/@stdlib/utils-function-name/lib/main.js","../node_modules/@stdlib/assert-has-function-name-support/lib/main.js","../node_modules/@stdlib/assert-is-typed-array/lib/ctors.js","../node_modules/@stdlib/assert-is-typed-array/lib/main.js","../node_modules/@stdlib/assert-is-complex-typed-array/lib/ctors.js","../node_modules/@stdlib/assert-has-has-instance-symbol-support/lib/main.js","../node_modules/@stdlib/symbol-has-instance/lib/main.js","../node_modules/@stdlib/assert-instance-of/lib/main.js","../node_modules/@stdlib/array-to-json/lib/ctors.js","../node_modules/@stdlib/array-to-json/lib/type.js","../node_modules/@stdlib/array-to-json/lib/main.js","../node_modules/@stdlib/assert-is-booleanarray/lib/main.js","../node_modules/@stdlib/assert-is-complex-typed-array/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/normalize_field_list.js","../node_modules/@stdlib/dstructs-struct/lib/field_names.js","../node_modules/@stdlib/dstructs-struct/lib/flatten_fields.js","../node_modules/@stdlib/dstructs-struct/lib/partitions.js","../node_modules/@stdlib/dstructs-struct/lib/create_prototype_accessors.js","../node_modules/@stdlib/dstructs-struct/lib/to_json.js","../node_modules/@stdlib/array-struct-factory/lib/from_array.js","../node_modules/@stdlib/array-struct-factory/lib/main.js","../node_modules/@stdlib/array-struct-factory/lib/from_iterator.js","../node_modules/@stdlib/buffer-ctor/lib/main.js","../node_modules/@stdlib/buffer-ctor/lib/index.js","../node_modules/@stdlib/buffer-ctor/lib/polyfill.js","../node_modules/@stdlib/ndarray-base-buffer-ctors/lib/ctors.js","../node_modules/@stdlib/ndarray-base-buffer-ctors/lib/main.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/index.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/has_alloc_unsafe.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/main.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/polyfill.js","../node_modules/@stdlib/ndarray-base-buffer/lib/main.js","../node_modules/@stdlib/array-base-fill/lib/main.js","../node_modules/@stdlib/ndarray-base-slice/lib/empty.js","../node_modules/@stdlib/ndarray-base-slice/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype/lib/main.js","../node_modules/@stdlib/ndarray-base-shape/lib/main.js","../node_modules/@stdlib/ndarray-base-offset/lib/main.js","../node_modules/@stdlib/ndarray-base-strides2offset/lib/main.js","../node_modules/@stdlib/slice-base-nonreduced-dimensions/lib/main.js","../node_modules/@stdlib/ndarray-base-slice/lib/slice_start.js","../node_modules/@stdlib/ndarray-base-slice/lib/slice_strides.js","../node_modules/@stdlib/error-tools-fmtprodmsg/lib/main.js","../lib/main.js","../node_modules/@stdlib/ndarray-base-normalize-index/lib/main.js","../node_modules/@stdlib/ndarray-base-ndims/lib/main.js","../node_modules/@stdlib/array-base-nulls/lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @name defineProperty\n* @type {Function}\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nvar defineProperty = Object.defineProperty;\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' ); // NOTE: we inline the `isNumber.isPrimitive` function from `@stdlib/assert/is-number` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Tests if a string starts with a minus sign (`-`).\n*\n* @private\n* @param {string} str - input string\n* @returns {boolean} boolean indicating if a string starts with a minus sign (`-`)\n*/\nfunction startsWithMinus( str ) {\n\treturn str[ 0 ] === '-';\n}\n\n/**\n* Returns a string of `n` zeros.\n*\n* @private\n* @param {number} n - number of zeros\n* @returns {string} string of zeros\n*/\nfunction zeros( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += '0';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with zeros to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction zeroPad( str, width, right ) {\n\tvar negative = false;\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tif ( startsWithMinus( str ) ) {\n\t\tnegative = true;\n\t\tstr = str.substr( 1 );\n\t}\n\tstr = ( right ) ?\n\t\tstr + zeros( pad ) :\n\t\tzeros( pad ) + str;\n\tif ( negative ) {\n\t\tstr = '-' + str;\n\t}\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default zeroPad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNumber from './is_number.js';\nimport zeroPad from './zero_pad.js';\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as an integer.\n*\n* @private\n* @param {Object} token - token object\n* @throws {Error} must provide a valid integer\n* @returns {string} formatted token argument\n*/\nfunction formatInteger( token ) {\n\tvar base;\n\tvar out;\n\tvar i;\n\n\tswitch ( token.specifier ) {\n\tcase 'b':\n\t\t// Case: %b (binary)\n\t\tbase = 2;\n\t\tbreak;\n\tcase 'o':\n\t\t// Case: %o (octal)\n\t\tbase = 8;\n\t\tbreak;\n\tcase 'x':\n\tcase 'X':\n\t\t// Case: %x, %X (hexadecimal)\n\t\tbase = 16;\n\t\tbreak;\n\tcase 'd':\n\tcase 'i':\n\tcase 'u':\n\tdefault:\n\t\t// Case: %d, %i, %u (decimal)\n\t\tbase = 10;\n\t\tbreak;\n\t}\n\tout = token.arg;\n\ti = parseInt( out, 10 );\n\tif ( !isFinite( i ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\tif ( !isNumber( out ) ) {\n\t\t\tthrow new Error( 'invalid integer. Value: ' + out );\n\t\t}\n\t\ti = 0;\n\t}\n\tif ( i < 0 && ( token.specifier === 'u' || base !== 10 ) ) {\n\t\ti = 0xffffffff + i + 1;\n\t}\n\tif ( i < 0 ) {\n\t\tout = ( -i ).toString( base );\n\t\tif ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tout = '-' + out;\n\t} else {\n\t\tout = i.toString( base );\n\t\tif ( !i && !token.precision ) {\n\t\t\tout = '';\n\t\t} else if ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tif ( token.sign ) {\n\t\t\tout = token.sign + out;\n\t\t}\n\t}\n\tif ( base === 16 ) {\n\t\tif ( token.alternate ) {\n\t\t\tout = '0x' + out;\n\t\t}\n\t\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\t\tuppercase.call( out ) :\n\t\t\tlowercase.call( out );\n\t}\n\tif ( base === 8 ) {\n\t\tif ( token.alternate && out.charAt( 0 ) !== '0' ) {\n\t\t\tout = '0' + out;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar abs = Math.abs; // eslint-disable-line stdlib/no-builtin-math\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\nvar replace = String.prototype.replace;\n\n\n// VARIABLES //\n\nvar RE_EXP_POS_DIGITS = /e\\+(\\d)$/;\nvar RE_EXP_NEG_DIGITS = /e-(\\d)$/;\nvar RE_ONLY_DIGITS = /^(\\d+)$/;\nvar RE_DIGITS_BEFORE_EXP = /^(\\d+)e/;\nvar RE_TRAILING_PERIOD_ZERO = /\\.0$/;\nvar RE_PERIOD_ZERO_EXP = /\\.0*e/;\nvar RE_ZERO_BEFORE_EXP = /(\\..*[^0])0*e/;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as a floating-point number.\n*\n* @private\n* @param {number} f - parsed number\n* @param {Object} token - token object\n* @throws {Error} must provide a valid floating-point number\n* @returns {string} formatted token argument\n*/\nfunction formatDouble( f, token ) {\n\tvar digits;\n\tvar out;\n\n\tswitch ( token.specifier ) {\n\tcase 'e':\n\tcase 'E':\n\t\tout = f.toExponential( token.precision );\n\t\tbreak;\n\tcase 'f':\n\tcase 'F':\n\t\tout = f.toFixed( token.precision );\n\t\tbreak;\n\tcase 'g':\n\tcase 'G':\n\t\tif ( abs( f ) < 0.0001 ) {\n\t\t\tdigits = token.precision;\n\t\t\tif ( digits > 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport isNumber from './is_number.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar f;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\tf = parseFloat( token.arg );\n\t\t\t\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\t\t\t\tif ( !isNumber( token.arg ) ) {\n\t\t\t\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t\t\t\t}\n\t\t\t\t\t// Case: NaN, Infinity, or -Infinity\n\t\t\t\t\tf = token.arg;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( f, token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\t// Check for an escaped percent sign `%%`...\n\t\tif ( match[ 6 ] === '%' ) {\n\t\t\ttokens.push( '%' );\n\t\t} else {\n\t\t\ttokens.push( parse( match ) );\n\t\t}\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils-define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils-define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnlyAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasSymbols from '@stdlib/assert-has-symbol-support';\n\n\n// VARIABLES //\n\nvar FLG = hasSymbols();\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.toStringTag` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.toStringTag` support\n*\n* @example\n* var bool = hasToStringTagSupport();\n* // returns \n*/\nfunction hasToStringTagSupport() {\n\treturn ( FLG && typeof Symbol.toStringTag === 'symbol' );\n}\n\n\n// EXPORTS //\n\nexport default hasToStringTagSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests for native `Symbol` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol` support\n*\n* @example\n* var bool = hasSymbolSupport();\n* // returns \n*/\nfunction hasSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nexport default toStr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nexport default hasOwnProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar Sym = ( typeof Symbol === 'function' ) ? Symbol : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Sym;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nexport default toStrTag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils-native-class\n*\n* @example\n* import nativeClass from '@stdlib/utils-native-class';\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport toStringTag from './tostringtag.js';\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nexport default Number; // eslint-disable-line stdlib/require-globals\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Number.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Number from '@stdlib/number-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\nfunction isNumber( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Number ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Number]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a number\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( null );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a number.\n*\n* @module @stdlib/assert-is-number\n*\n* @example\n* import isNumber from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* @module @stdlib/constants-float64-pinf\n* @type {number}\n*\n* @example\n* import FLOAT64_PINF from '@stdlib/constants-float64-pinf';\n* // returns Infinity\n*/\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point positive infinity has the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.POSITIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default FLOAT64_PINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants-float64-ninf\n* @type {number}\n*\n* @example\n* import FLOAT64_NINF from '@stdlib/constants-float64-ninf';\n* // returns -Infinity\n*/\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nexport default FLOAT64_NINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default floor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport floor from '@stdlib/math-base-special-floor';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport isInt from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is `null`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is null\n*\n* @example\n* var bool = isNull( null );\n* // returns true\n*\n* bool = isNull( true );\n* // returns false\n*/\nfunction isNull( value ) {\n\treturn value === null;\n}\n\n\n// EXPORTS //\n\nexport default isNull;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is `undefined`.\n*\n* ## Notes\n*\n* - In older browsers, `undefined` is a global which can be overridden. `void`, however, is an operator which **cannot** be overridden. Consequently, better to use `void` to check for `undefined`. See [Stack Overflow][1].\n*\n* [1]: http://stackoverflow.com/a/19369078/2225624\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is undefined\n*\n* @example\n* var bool = isUndefined( undefined );\n* // returns true\n*\n* bool = isUndefined( null );\n* // returns false\n*/\nfunction isUndefined( value ) {\n\treturn value === void 0;\n}\n\n\n// EXPORTS //\n\nexport default isUndefined;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isNull from '@stdlib/assert-is-null';\nimport isUndefined from '@stdlib/assert-is-undefined';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an input argument is valid.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether the argument is valid\n*\n* @example\n* var bool = isValid( 3 );\n* // returns true\n*\n* bool = isValid( null );\n* // returns true\n*\n* bool = isValid( void 0 );\n* // returns true\n*\n* bool = isValid( '3' );\n* // returns false\n*/\nfunction isValid( value ) {\n\treturn ( isInteger( value ) || isNull( value ) || isUndefined( value ) );\n}\n\n\n// MAIN //\n\n/**\n* Slice constructor.\n*\n* @constructor\n* @param {(integer|null|void)} [start] - starting index (inclusive)\n* @param {(integer|null|void)} stop - ending index (exclusive)\n* @param {(integer|null|void)} [step] - index increment\n* @throws {TypeError} first argument must be an integer, null, or undefined\n* @throws {TypeError} second argument must be an integer, null, or undefined\n* @throws {TypeError} third argument must be an integer, null, or undefined\n* @throws {RangeError} third argument cannot be zero\n* @returns {Slice} Slice instance\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var start = s.start;\n* // returns null\n*\n* var stop = s.stop;\n* // returns 10\n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*\n* var stop = s.stop;\n* // returns 10\n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*\n* var stop = s.stop;\n* // returns 10\n*\n* var step = s.step;\n* // returns 2\n*/\nfunction Slice() {\n\tvar nargs;\n\tvar start;\n\tvar stop;\n\tvar step;\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tstart = null;\n\t\tstop = null;\n\t\tstep = null;\n\t} else if ( nargs === 1 ) {\n\t\tstart = null;\n\t\tstop = arguments[ 0 ];\n\t\tstep = null;\n\t} else if ( nargs === 2 ) {\n\t\tstart = arguments[ 0 ];\n\t\tstop = arguments[ 1 ];\n\t\tstep = null;\n\t} else {\n\t\tstart = arguments[ 0 ];\n\t\tstop = arguments[ 1 ];\n\t\tstep = arguments[ 2 ];\n\t}\n\tif ( !( this instanceof Slice ) ) {\n\t\treturn new Slice( start, stop, step );\n\t}\n\tif ( !isValid( start ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer, null, or undefined. Value: `%s`.', start ) );\n\t}\n\tif ( !isValid( stop ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer, null, or undefined. Value: `%s`.', stop ) );\n\t}\n\tif ( !isValid( step ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer, null, or undefined. Value: `%s`.', step ) );\n\t} else if ( step === 0 ) {\n\t\tthrow new RangeError( format( 'invalid argument. Third argument cannot be zero. Value: `%s`.', step ) );\n\t}\n\tthis._start = ( start === void 0 ) ? null : start;\n\tthis._stop = ( stop === void 0 ) ? null : stop;\n\tthis._step = ( step === void 0 ) ? null : step;\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Slice\n* @readonly\n* @type {string}\n* @default 'Slice'\n*\n* @example\n* var str = Slice.name;\n* // returns 'Slice'\n*/\nsetReadOnly( Slice, 'name', 'Slice' );\n\n/**\n* Returns the slice's starting index.\n*\n* @name start\n* @memberof Slice.prototype\n* @readonly\n* @type {(integer|null)}\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var start = s.start;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*/\nsetReadOnlyAccessor( Slice.prototype, 'start', function get() {\n\treturn this._start;\n});\n\n/**\n* Returns the slice's ending index.\n*\n* @name stop\n* @memberof Slice.prototype\n* @readonly\n* @type {(integer|null)}\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var stop = s.stop;\n* // returns 10\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var stop = s.stop;\n* // returns 10\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var stop = s.stop;\n* // returns 10\n*/\nsetReadOnlyAccessor( Slice.prototype, 'stop', function get() {\n\treturn this._stop;\n});\n\n/**\n* Returns the slice's index increment.\n*\n* @name step\n* @memberof Slice.prototype\n* @readonly\n* @type {(integer|null)}\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var step = s.step;\n* // returns 2\n*/\nsetReadOnlyAccessor( Slice.prototype, 'step', function get() {\n\treturn this._step;\n});\n\n/**\n* Serializes a slice to a string.\n*\n* @name toString\n* @memberof Slice.prototype\n* @type {Function}\n* @returns {string} serialized Slice\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var str = s.toString();\n* // returns 'Slice(null,10,null)'\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var str = s.toString();\n* // returns 'Slice(3,10,null)'\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var str = s.toString();\n* // returns 'Slice(3,10,2)'\n*/\nsetReadOnly( Slice.prototype, 'toString', function toString() {\n\treturn 'Slice('+this._start+','+this._stop+','+this.step+')';\n});\n\n/**\n* Serializes a slice as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Slice` instance.\n*\n* @name toJSON\n* @memberof Slice.prototype\n* @type {Function}\n* @returns {Object} serialized Slice\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var o = s.toJSON();\n* // returns { 'type': 'Slice', 'data': [ null, 10, null ] }\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var o = s.toJSON();\n* // returns { 'type': 'Slice', 'data': [ 3, 10, null ] }\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var o = s.toJSON();\n* // returns { 'type': 'Slice', 'data': [ 3, 10, 2 ] }\n*/\nsetReadOnly( Slice.prototype, 'toJSON', function toJSON() {\n\treturn {\n\t\t'type': 'Slice',\n\t\t'data': [\n\t\t\tthis._start,\n\t\t\tthis._stop,\n\t\t\tthis._step\n\t\t]\n\t};\n});\n\n\n// EXPORTS //\n\nexport default Slice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\nfunction reFunctionName() {\n\treturn /^\\s*function\\s*([^(]*)/i;\n}\n\n\n// EXPORTS //\n\nexport default reFunctionName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an integer.\n*\n* @module @stdlib/assert-is-integer\n*\n* @example\n* import isInteger from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* import { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* import { isObject as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport reFunctionName from './main.js';\n\n\n// MAIN //\n\n/**\n* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* Regular expression: `/^\\s*function\\s*([^(]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `\\s*`\n* - Match zero or more spaces after the word `function`\n*\n* - `()`\n* - Capture\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `/i`\n* - ignore case\n*\n* @constant\n* @type {RegExp}\n* @default /^\\s*function\\s*([^(]*)/i\n*/\nvar RE_FUNCTION_NAME = reFunctionName();\n\n\n// EXPORTS //\n\nexport default RE_FUNCTION_NAME;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @module @stdlib/regexp-function-name\n*\n* @example\n* import reFunctionName from '@stdlib/regexp-function-name';\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport REGEXP from './regexp.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'REGEXP', REGEXP );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nexport default f;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from '@stdlib/assert-is-array';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array function\n*\n* @example\n* import isOdd from '@stdlib/assert-is-odd';\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arrayfcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArray( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default arrayfcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is object-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is object-like\n*\n* @example\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( [] );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( null );\n* // returns false\n*/\nfunction isObjectLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObjectLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObjectLike from '@stdlib/assert-is-object-like';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Buffer instance.\n*\n* @param {*} value - value to validate\n* @returns {boolean} boolean indicating if a value is a Buffer instance\n*\n* @example\n* var v = isBuffer( new Buffer( 'beep' ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( new Buffer( [1,2,3,4] ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( {} );\n* // returns false\n*\n* @example\n* var v = isBuffer( [] );\n* // returns false\n*/\nfunction isBuffer( value ) {\n\treturn (\n\t\tisObjectLike( value ) &&\n\t\t(\n\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\tvalue._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)\n\t\t\t(\n\t\t\t\tvalue.constructor &&\n\n\t\t\t\t// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions\n\t\t\t\ttypeof value.constructor.isBuffer === 'function' &&\n\t\t\t\tvalue.constructor.isBuffer( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\nimport { REGEXP as RE } from '@stdlib/regexp-function-name';\nimport isBuffer from '@stdlib/assert-is-buffer';\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nexport default constructorName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isNull from '@stdlib/assert-is-null';\nimport isUndefined from '@stdlib/assert-is-undefined';\nimport isSlice from '@stdlib/assert-is-slice';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an input argument is valid.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether the argument is valid\n*\n* @example\n* var bool = isValid( 3 );\n* // returns true\n*\n* bool = isValid( null );\n* // returns true\n*\n* bool = isValid( void 0 );\n* // returns true\n*\n* bool = isValid( '3' );\n* // returns false\n*/\nfunction isValid( value ) {\n\treturn (\n\t\tisInteger( value ) ||\n\t\tisNull( value ) ||\n\t\tisUndefined( value ) ||\n\t\tisSlice( value )\n\t);\n}\n\n\n// MAIN //\n\n/**\n* Multi-slice constructor.\n*\n* @constructor\n* @param {...(Slice|integer|null)} slice - slice\n* @throws {TypeError} a provided argument must be either a Slice, integer, null, or undefined\n* @returns {MultiSlice} MultiSlice instance\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*/\nfunction MultiSlice() {\n\tvar nargs;\n\tvar proxy;\n\tvar args;\n\tvar v;\n\tvar i;\n\n\tnargs = arguments.length;\n\tif ( !( this instanceof MultiSlice ) ) {\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ] ); // eslint-disable-line max-len\n\t\t}\n\t\tif ( nargs === 4 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ] ); // eslint-disable-line max-len\n\t\t}\n\t\tif ( nargs === 5 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ] ); // eslint-disable-line max-len\n\t\t}\n\t\targs = [];\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\t// Use a workaround for being unable to combine `.apply` with the `new` operator:\n\t\tproxy = Object.create( MultiSlice.prototype );\n\t\treturn MultiSlice.apply( proxy, args );\n\t}\n\tthis._data = [];\n\tfor ( i = 0; i < nargs; i++ ) {\n\t\tv = arguments[ i ];\n\t\tif ( !isValid( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Provided arguments must be either a Slice, integer, null, or undefined. Argument: `%d`. Value: `%s`.', i, String( v ) ) );\n\t\t}\n\t\tthis._data.push( ( v === void 0 ) ? null : v );\n\t}\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof MultiSlice\n* @readonly\n* @type {string}\n* @default 'MultiSlice'\n*\n* @example\n* var str = MultiSlice.name;\n* // returns 'MultiSlice'\n*/\nsetReadOnly( MultiSlice, 'name', 'MultiSlice' );\n\n/**\n* Returns the number of slice dimensions.\n*\n* @name ndims\n* @memberof MultiSlice.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var ndims = ms.ndims;\n* // returns 4\n*/\nsetReadOnlyAccessor( MultiSlice.prototype, 'ndims', function get() {\n\treturn this._data.length;\n});\n\n/**\n* Returns multi-slice data.\n*\n* @name data\n* @memberof MultiSlice.prototype\n* @readonly\n* @type {Array}\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var data = ms.data;\n* // returns [...]\n*\n* var v = data[ 0 ];\n* // returns null\n*\n* v = data[ 1 ];\n* // returns \n*\n* v = data[ 2 ];\n* // returns \n*\n* v = data[ 3 ];\n* // returns 2\n*/\nsetReadOnlyAccessor( MultiSlice.prototype, 'data', function get() {\n\treturn this._data.slice();\n});\n\n/**\n* Serializes a multi-slice to a string.\n*\n* @name toString\n* @memberof MultiSlice.prototype\n* @type {Function}\n* @returns {string} serialized MultiSlice\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var str = ms.toString();\n* // returns 'MultiSlice(null,Slice(0,10,1),Slice(2,12,2),2)'\n*/\nsetReadOnly( MultiSlice.prototype, 'toString', function toString() {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tdata = this._data;\n\tout = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tout.push( String( data[ i ] ) );\n\t}\n\treturn 'MultiSlice('+out.join( ',' )+')';\n});\n\n/**\n* Serializes a multi-slice as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `MultiSlice` instance.\n*\n* @name toJSON\n* @memberof MultiSlice.prototype\n* @type {Function}\n* @returns {Object} serialized MultiSlice\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var o = ms.toJSON();\n* // returns { 'type': 'MultiSlice', 'data': [ null, { 'type': 'Slice', 'data': [ 0, 10, 1 ] }, { 'type': 'Slice', 'data': [ 2, 12, 2 ] }, 2 ] }\n*/\nsetReadOnly( MultiSlice.prototype, 'toJSON', function toJSON() {\n\tvar data;\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tdata = this._data;\n\tout = {\n\t\t'type': 'MultiSlice',\n\t\t'data': []\n\t};\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tv = data[ i ];\n\t\tout.data.push( ( v && typeof v.toJSON === 'function' ) ? v.toJSON() : v );\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default MultiSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Slice from '@stdlib/slice-ctor';\nimport constructorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Slice object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a Slice object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = new Slice( 0, 10, 2 );\n*\n* var bool = isSlice( s );\n* // returns true\n*/\nfunction isSlice( value ) {\n\treturn (\n\t\tvalue instanceof Slice ||\n\t\tconstructorName( value ) === 'Slice'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nimport MultiSlice from '@stdlib/slice-multi';\n\n\n// MAIN //\n\n/**\n* Creates a MultiSlice object from a list of MultiSlice constructor arguments.\n*\n* @param {(Slice|integer|null|void)} args - constructor arguments\n* @returns {MultiSlice} MultiSlice object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ void 0, new Slice( 0, 10, 1 ) ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ null, ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ new Slice( 0, 10, 1 ), void 0 ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ , null ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ new Slice( 0, 10, 1 ), void 0, void 0, new Slice( 0, 10, 1 ) ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ , null, null, ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ void 0, new Slice( 0, 10, 1 ), null, void 0, new Slice( 2, 9, 2 ), null, void 0 ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ null, , null, null, , null, null ]\n*/\nfunction args2multislice( args ) {\n\tswitch ( args.length ) {\n\tcase 0:\n\t\treturn new MultiSlice();\n\tcase 1:\n\t\treturn new MultiSlice( args[ 0 ] );\n\tcase 2:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ] );\n\tcase 3:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ] );\n\tcase 4:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ] );\n\tcase 5:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ] );\n\tcase 6:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ] );\n\tcase 7:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ] );\n\tcase 8:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ], args[ 7 ] );\n\tcase 9:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ], args[ 7 ], args[ 8 ] );\n\tcase 10:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ], args[ 7 ], args[ 8 ], args[ 9 ] );\n\tdefault:\n\t\treturn MultiSlice.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default args2multislice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport args2multislice from '@stdlib/slice-base-args2multislice';\nimport Slice from '@stdlib/slice-ctor';\nimport normalizeSlice from '@stdlib/slice-base-normalize-slice';\nimport int2slice from '@stdlib/slice-base-int2slice';\n\n\n// FUNCTIONS //\n\n/**\n* Normalizes an individual MultiSlice element.\n*\n* @private\n* @param {(Slice|integer|null)} value - input slice\n* @param {NonNegativeInteger} len - maximum number of elements which are allowed in a slice\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {Slice} slice object\n*/\nfunction normalize( value, len, strict ) {\n\t// Case: null\n\tif ( value === null ) {\n\t\t// Create a slice with default extents and a default increment:\n\t\treturn new Slice( 0, len, 1 );\n\t}\n\t// Case: integer\n\tif ( typeof value === 'number' ) {\n\t\treturn int2slice( value, len, strict );\n\t}\n\t// Case: slice\n\treturn normalizeSlice( value, len, strict );\n}\n\n\n// MAIN //\n\n/**\n* Returns a normalized MultiSlice object.\n*\n* @param {MultiSlice} slice - input slice\n* @param {NonNegativeIntegerArray} shape - maximum allowed slice shape\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {(MultiSlice|ErrorObject)} multi-slice object or an error object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n*\n* var shape = [ 10, 10, 10 ];\n*\n* var s1 = new MultiSlice( new Slice( 2, null, 2 ), null, -4 );\n* var s2 = normalizeMultiSlice( s1, shape, false );\n* // returns \n*\n* var d = s2.data;\n* // returns [ , , ]\n*\n* var v = d[ 0 ];\n* // returns \n*\n* var start = v.start;\n* // returns 2\n*\n* var stop = v.stop;\n* // returns 10\n*\n* var step = v.step;\n* // returns 2\n*\n* v = d[ 1 ];\n* // returns \n*\n* start = v.start;\n* // returns 0\n*\n* stop = v.stop;\n* // returns 10\n*\n* step = v.step;\n* // returns 1\n*\n* v = d[ 2 ];\n* // returns \n*\n* start = v.start;\n* // returns 6\n*\n* stop = v.stop;\n* // returns 7\n*\n* step = v.step;\n* // returns 1\n*/\nfunction normalizeMultiSlice( slice, shape, strict ) {\n\tvar data;\n\tvar args;\n\tvar s;\n\tvar i;\n\n\tdata = slice.data;\n\targs = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\ts = normalize( data[ i ], shape[ i ], strict );\n\t\tif ( s.code !== void 0 ) {\n\t\t\treturn s;\n\t\t}\n\t\targs.push( s );\n\t}\n\n\t// Return a normalized slice:\n\treturn args2multislice( args );\n}\n\n\n// EXPORTS //\n\nexport default normalizeMultiSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Slice from '@stdlib/slice-ctor';\nimport eOutOfBounds from './error_out_of_bounds.js';\n\n\n// MAIN //\n\n/**\n* Converts an integer to a Slice object.\n*\n* @param {integer} value - input value\n* @param {NonNegativeInteger} max - index upper bound\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {(Slice|Object)} Slice object or an error object\n*\n* @example\n* var s = int2slice( -4, 10, false );\n* // returns \n*\n* var start = s.start;\n* // returns 6\n*\n* var stop = s.stop;\n* // returns 7\n*\n* var step = s.step;\n* // returns 1\n*/\nfunction int2slice( value, max, strict ) {\n\t// If a value exceeds the last possible index, create an \"empty\" slice...\n\tif ( value >= max ) {\n\t\tif ( strict ) {\n\t\t\treturn eOutOfBounds();\n\t\t}\n\t\treturn new Slice( max, max, 1 );\n\t}\n\t// Check whether we need to resolve a slice relative to the last possible index...\n\tif ( value < 0 ) {\n\t\tvalue = max + value;\n\n\t\t// If a value exceeds the first index, create an \"empty\" slice...\n\t\tif ( value < 0 ) {\n\t\t\tif ( strict ) {\n\t\t\t\treturn eOutOfBounds();\n\t\t\t}\n\t\t\treturn new Slice( 0, 0, 1 );\n\t\t}\n\t\treturn new Slice( value, value+1, 1 ); // e.g., Slice( 2, 3, 1 ), which is the slice equivalent of only selecting the second row\n\t}\n\t// 0 <= s < N\n\treturn new Slice( value, value+1, 1 );\n}\n\n\n// EXPORTS //\n\nexport default int2slice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an error object for a slice which exceeds index bounds.\n*\n* @private\n* @returns {Object} error object\n*/\nfunction error() {\n\treturn {\n\t\t'code': 'ERR_SLICE_OUT_OF_BOUNDS'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default error;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Slice from '@stdlib/slice-ctor';\nimport eOutOfBounds from './error_out_of_bounds.js';\n\n\n// MAIN //\n\n/**\n* Returns a normalized Slice object.\n*\n* @param {Slice} slice - input slice\n* @param {NonNegativeInteger} len - maximum number of elements allowed in a slice\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {(Slice|ErrorObject)} slice object or an error object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice(), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 0\n*\n* v = s.stop;\n* // returns 10\n*\n* v = s.step;\n* // returns 1\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice( null, 20, 2 ), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 0\n*\n* v = s.stop;\n* // returns 10\n*\n* v = s.step;\n* // returns 2\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice( -5, -1, 1 ), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 5\n*\n* v = s.stop;\n* // returns 9\n*\n* v = s.step;\n* // returns 1\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice( -5, null, -1 ), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 5\n*\n* v = s.stop;\n* // returns null\n*\n* v = s.step;\n* // returns -1\n*/\nfunction normalizeSlice( slice, len, strict ) {\n\tvar start;\n\tvar stop;\n\tvar step;\n\n\tstart = slice.start;\n\tstop = slice.stop;\n\tstep = slice.step;\n\n\t// If necessary, set the default increment...\n\tif ( step === null ) {\n\t\tstep = 1;\n\t}\n\n\t// Case: start is not specified\n\tif ( start === null ) {\n\t\t// If the step is positive, we default to the first index...\n\t\tif ( step > 0 ) {\n\t\t\tstart = 0;\n\t\t}\n\t\t// If the step is negative, we default to the last index (inclusive)...\n\t\telse {\n\t\t\tstart = len - 1;\n\t\t}\n\t}\n\t// Case: start is negative and should be resolved relative to the last index\n\telse if ( start < 0 ) {\n\t\tstart = len + start;\n\n\t\t// Check whether start still exceeds the index bounds...\n\t\tif ( start < 0 ) {\n\t\t\tif ( strict ) {\n\t\t\t\treturn eOutOfBounds();\n\t\t\t}\n\t\t\t// Clamp to the first index (inclusive):\n\t\t\tstart = 0;\n\t\t}\n\t}\n\t// Case: start exceeds index bounds\n\telse if ( start >= len ) {\n\t\tif ( strict ) {\n\t\t\treturn eOutOfBounds();\n\t\t}\n\t\t// If the increment is negative, clamp to the last index (inclusive)...\n\t\tif ( step < 0 ) {\n\t\t\tstart = len - 1;\n\t\t}\n\t\t// If the increment is positive, clamp to the \"index\" following the last index...\n\t\telse {\n\t\t\tstart = len;\n\t\t}\n\t}\n\n\t// Case: stop is not specified\n\tif ( stop === null ) {\n\t\t// If the step is positive, we default to just beyond the last index, as the stopping index is exclusive...\n\t\tif ( step > 0 ) {\n\t\t\tstop = len;\n\t\t}\n\t\t// If the step is negative, we default to a sentinel value indicating that one should iterate through the first index when decrementing...\n\t\telse {\n\t\t\tstop = null;\n\t\t}\n\t}\n\t// Case: stop is negative and should be resolved relative to the last index\n\telse if ( stop < 0 ) {\n\t\tstop = len + stop;\n\n\t\t// Check whether stop still exceeds the index bounds...\n\t\tif ( stop < 0 ) {\n\t\t\t// If the step is positive, we should clamp to the first index, as Slice(x,0,step) is an empty slice regardless of `x`...\n\t\t\tif ( step > 0 ) {\n\t\t\t\tif ( strict ) {\n\t\t\t\t\treturn eOutOfBounds();\n\t\t\t\t}\n\t\t\t\tstop = 0;\n\t\t\t}\n\t\t\t// If the step is negative, we default to just beyond the first index (using a sentinel value), as the stopping index is exclusive, thus indicating to iterate through the first index when decrementing...\n\t\t\telse {\n\t\t\t\tif ( strict && stop < -1 ) {\n\t\t\t\t\treturn eOutOfBounds();\n\t\t\t\t}\n\t\t\t\tstop = null;\n\t\t\t}\n\t\t}\n\t}\n\t// Case: stop exceeds index bounds\n\telse if ( stop > len ) {\n\t\tif ( strict ) {\n\t\t\treturn eOutOfBounds();\n\t\t}\n\t\t// Clamp to just beyond the last index, as the stopping index is exclusive:\n\t\tstop = len;\n\t}\n\n\t// Return a normalized slice:\n\treturn new Slice( start, stop, step );\n}\n\n\n// EXPORTS //\n\nexport default normalizeSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an error object for a slice which exceeds index bounds.\n*\n* @private\n* @returns {Object} error object\n*/\nfunction error() {\n\treturn {\n\t\t'code': 'ERR_SLICE_OUT_OF_BOUNDS'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default error;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is object-like.\n*\n* @module @stdlib/assert-is-object-like\n*\n* @example\n* import isObjectLike from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* bool = isObjectLike( [] );\n* // returns true\n*\n* bool = isObjectLike( null );\n* // returns false\n*\n* @example\n* import { isObjectLikeArray as isObjectLike } from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( [ {}, [] ] );\n* // returns true\n*\n* bool = isObjectLike( [ {}, '3.0' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport main from './main.js';\n\n\n// VARIABLES //\n\nvar isObjectLikeArray = arrayfun( main );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isObjectLikeArray', isObjectLikeArray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward positive infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = ceil( -4.2 );\n* // returns -4.0\n*\n* @example\n* var v = ceil( 9.99999 );\n* // returns 10.0\n*\n* @example\n* var v = ceil( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = ceil( NaN );\n* // returns NaN\n*/\nvar ceil = Math.ceil; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default ceil;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ceil from '@stdlib/math-base-special-ceil';\n\n\n// MAIN //\n\n/**\n* Returns the number of elements in a normalized slice.\n*\n* @param {Slice} slice - normalized Slice object\n* @returns {NonNegativeInteger} number of elements\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 2, null, 1 );\n* // returns \n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 8\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 9\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 3\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 2, null, 2 );\n* // returns \n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 4\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 5\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 2\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( -1, null, -2 );\n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 5\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 6\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 3\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 3, 5, -1 );\n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 0\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 5, 3, 1 );\n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 0\n*/\nfunction sliceLength( slice ) {\n\tvar inc;\n\tvar x1;\n\tvar x2;\n\n\tx1 = slice.start;\n\tx2 = slice.stop;\n\tinc = slice.step;\n\n\t// For a normalized slice, stop should only be `null` when the increment is negative...\n\tif ( x2 === null ) {\n\t\tx2 = -1; // set to -1 to ensure that the first element is included\n\t}\n\tif (\n\t\t// If the increment is positive, the slice is empty whenever the starting index is greater than or equal to the stopping index:\n\t\t( inc > 0 && x1 >= x2 ) ||\n\n\t\t// If the increment is negative, the slice is empty whenever the starting index is less than or equal to the stopping index:\n\t\t( inc < 0 && x1 <= x2 )\n\t) {\n\t\treturn 0;\n\t}\n\treturn ceil( ( x2 - x1 ) / inc );\n}\n\n\n// EXPORTS //\n\nexport default sliceLength;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport sliceLength from '@stdlib/slice-base-length';\n\n\n// MAIN //\n\n/**\n* Returns the shape of a normalized multi-slice.\n*\n* @param {MultiSlice} slice - normalized MultiSlice object\n* @returns {NonNegativeIntegerArray} slice shape\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\n*\n* var s = new MultiSlice( new Slice( 2, null, 1 ), null, 10 );\n*\n* var v = sliceShape( normalizeMultiSlice( s, [ 10, 5, 20 ], false ) );\n* // returns [ 8, 5, 1 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 11, 3, 12 ], false ) );\n* // returns [ 9, 3, 1 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 5, 10, 15 ], false ) );\n* // returns [ 3, 10, 1 ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\n*\n* var s = new MultiSlice( null, new Slice( -1, 3, -2 ) );\n*\n* var v = sliceShape( normalizeMultiSlice( s, [ 10, 5 ], false ) );\n* // returns [ 10, 1 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 11, 10 ], false ) );\n* // returns [ 11, 3 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 5, 15 ], false ) );\n* // returns [ 5, 6 ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\n*\n* var s = new MultiSlice( 1, new Slice( 0, 0, 1 ) );\n*\n* var v = sliceShape( normalizeMultiSlice( s, [ 10, 5 ], false ) );\n* // returns [ 1, 0 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 11, 10 ], false ) );\n* // returns [ 1, 0 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 5, 15 ], false ) );\n* // returns [ 1, 0 ]\n*/\nfunction sliceShape( slice ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tdata = slice.data;\n\tout = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tout.push( sliceLength( data[ i ] ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default sliceShape;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Takes elements from an indexed array.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} indices - list of indices\n* @returns {Array} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n* var indices = [ 3, 1, 2, 0 ];\n*\n* var y = take( x, indices );\n* // returns [ 4, 2, 3, 1 ]\n*/\nfunction take( x, indices ) {\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < indices.length; i++ ) {\n\t\tout.push( x[ indices[ i ] ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default take;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled \"generic\" array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} filled array\n*\n* @example\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filled( value, len ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( value );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default filled;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport filled from '@stdlib/array-base-filled';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled \"generic\" array.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction zeros( len ) {\n\treturn filled( 0.0, len );\n}\n\n\n// EXPORTS //\n\nexport default zeros;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the number of elements in an array.\n*\n* @param {(NonNegativeIntegerArray|EmptyArray)} shape - array shape\n* @returns {NonNegativeInteger} number of elements\n*\n* @example\n* var n = numel( [ 3, 3, 3 ] );\n* // returns 27\n*/\nfunction numel( shape ) {\n\tvar ndims;\n\tvar n;\n\tvar i;\n\n\tndims = shape.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0;\n\t}\n\tn = 1;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tn *= shape[ i ];\n\t}\n\treturn n;\n}\n\n\n// EXPORTS //\n\nexport default numel;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tlen = x.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( x[ i ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default copy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar valueOf = String.prototype.valueOf; // non-generic\n\n\n// EXPORTS //\n\nexport default valueOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport test from './try2valueof.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string object\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns false\n*/\nfunction isString( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof String ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object String]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport valueOf from './valueof.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to extract a string value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a string can be extracted\n*/\nfunction test( value ) {\n\ttry {\n\t\tvalueOf.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a string\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*/\nfunction isString( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests whether an input value is the string representing column-major order.\n*\n* @param {*} v - value to test\n* @returns {boolean} boolean result\n*\n* @example\n* var bool = isColumnMajorString( 'column-major' );\n* // returns true\n*\n* bool = isColumnMajorString( 'row-major' );\n* // returns false\n*\n* bool = isColumnMajorString( 'foo' );\n* // returns false\n*/\nfunction isColumnMajorString( v ) {\n\treturn ( v === 'column-major' );\n}\n\n\n// EXPORTS //\n\nexport default isColumnMajorString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction rowmajor( shape ) {\n\tvar ndims;\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tout = [];\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tout.push( 0 );\n\t}\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction columnmajor( shape ) {\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tout = [];\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout.push( s );\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @returns {Array} array strides\n*\n* @example\n* var s = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* s = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape );\n\t}\n\treturn rowmajor( shape );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a string.\n*\n* @module @stdlib/assert-is-string\n*\n* @example\n* import isString from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 5 );\n* // returns false\n*\n* @example\n* import { isObject as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 'beep' );\n* // returns false\n*\n* @example\n* import { isPrimitive as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a stride array from an array shape.\n*\n* @module @stdlib/ndarray-base-shape2strides\n*\n* @example\n* import shape2strides from '@stdlib/ndarray-base-shape2strides';\n*\n* var strides = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* strides = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction rowmajor( shape, out ) {\n\tvar ndims;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction columnmajor( shape, out ) {\n\tvar s;\n\tvar i;\n\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*\n* @example\n* var strides = [ 0, 0 ];\n*\n* var out = shape2strides( [ 3, 2 ], 'row-major', strides );\n* // returns [ 2, 1 ]\n*\n* var bool = ( out === strides );\n* // returns true\n*\n* out = shape2strides( [ 3, 2 ], 'column-major', strides );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order, out ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape, out );\n\t}\n\treturn rowmajor( shape, out );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport shape2strides from '@stdlib/ndarray-base-shape2strides';\nimport copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\n\n\n// MAIN //\n\n/**\n* Returns the strides of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `strides` property\n* @returns {IntegerArray} strides\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = strides( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 9, 3, 1 ]\n*/\nfunction strides( x, copy ) {\n\tvar ord;\n\tvar sh;\n\tvar st;\n\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\tsh = x.shape;\n\t\tif ( sh.length === 0 ) {\n\t\t\treturn [ 0 ];\n\t\t}\n\t\tord = x.order;\n\t\tif ( !isString( ord ) ) {\n\t\t\tord = ROW_MAJOR;\n\t\t}\n\t\treturn shape2strides( sh, ord );\n\t}\n\tif ( copy ) {\n\t\treturn copyIndexed( st );\n\t}\n\treturn st;\n}\n\n\n// EXPORTS //\n\nexport default strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the absolute value of a double-precision floating-point number `x`.\n*\n* @param {number} x - input value\n* @returns {number} absolute value\n*\n* @example\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* @example\n* var v = abs( 2.0 );\n* // returns 2.0\n*\n* @example\n* var v = abs( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( -0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( NaN );\n* // returns NaN\n*/\nfunction abs( x ) {\n\treturn Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math\n}\n\n\n// EXPORTS //\n\nexport default abs;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\nvar COLUMN_MAJOR = 'column-major';\n\n\n// MAIN //\n\n/**\n* Returns the layout order of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {(string|null)} layout order\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'order': 'row-major'\n* });\n*\n* var out = order( x );\n* // returns 'row-major'\n*/\nfunction order( x ) {\n\tvar st;\n\tvar o;\n\n\to = x.order;\n\tif ( isString( o ) ) {\n\t\treturn o;\n\t}\n\t// Try to infer the layout order from the strides array...\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn ROW_MAJOR; // WARNING: default to row-major for ndarray-like objects lacking strides. This may or may not be accurate, and we're defaulting to row-major here based on the belief that row-major is more likely given that, e.g., JavaScript arrays are similar to C arrays (i.e., stored in row-major order).\n\t}\n\to = strides2order( st );\n\tif ( o === 1 || o === 3 ) {\n\t\treturn ROW_MAJOR; // for o == 3 (both row- and column-major; e.g., one-dimensional ndarrays), default to row-major\n\t}\n\tif ( o === 2 ) {\n\t\treturn COLUMN_MAJOR;\n\t}\n\t// o === 0\n\tif ( x.shape.length === 0 ) {\n\t\treturn ROW_MAJOR; // default to row-major for zero-dimensional ndarrays\n\t}\n\t// Case: mixed strides (e.g., [ 2, 3, 1 ] )\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default order;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport abs from '@stdlib/math-base-special-abs';\n\n\n// MAIN //\n\n/**\n* Determines the order of a multidimensional array based on a provided stride array.\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} order\n*\n* @example\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\nfunction strides2order( strides ) {\n\tvar column;\n\tvar ndims;\n\tvar row;\n\tvar s1;\n\tvar s2;\n\tvar i;\n\n\tndims = strides.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0|0; // 'none'\n\t}\n\tcolumn = true;\n\trow = true;\n\n\ts1 = abs( strides[ 0 ] );\n\tfor ( i = 1; i < ndims; i++ ) {\n\t\ts2 = abs( strides[ i ] );\n\t\tif ( column && s2 < s1 ) {\n\t\t\tcolumn = false;\n\t\t} else if ( row && s2 > s1 ) {\n\t\t\trow = false;\n\t\t}\n\t\tif ( row || column ) {\n\t\t\ts1 = s2;\n\t\t} else {\n\t\t\treturn 0|0; // 'none'\n\t\t}\n\t}\n\tif ( row && column ) {\n\t\treturn 3|0; // 'both'\n\t}\n\tif ( row ) {\n\t\treturn 1|0; // 'row-major'\n\t}\n\treturn 2|0; // 'column-major'\n}\n\n\n// EXPORTS //\n\nexport default strides2order;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the underlying data buffer of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {Collection} underlying data buffer\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var out = data( x );\n* // returns \n*/\nfunction data( x ) {\n\treturn x.data;\n}\n\n\n// EXPORTS //\n\nexport default data;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a positive integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a positive integer\n*\n* @example\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( null );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a positive integer.\n*\n* @module @stdlib/assert-is-positive-integer\n*\n* @example\n* import isPositiveInteger from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* bool = isPositiveInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar RE = /./;\n\n\n// EXPORTS //\n\nexport default RE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a boolean primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean primitive\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns false\n*/\nfunction isBoolean( value ) {\n\treturn ( typeof value === 'boolean' );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a boolean.\n*\n* @name Boolean\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {(boolean|Boolean)} boolean\n*\n* @example\n* var b = Boolean( null );\n* // returns false\n*\n* b = Boolean( [] );\n* // returns true\n*\n* b = Boolean( {} );\n* // returns true\n*\n* @example\n* var b = new Boolean( false );\n* // returns \n*/\nvar Bool = Boolean; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Boolean.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Boolean from '@stdlib/boolean-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean object\n*\n* @example\n* var bool = isBoolean( true );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Boolean ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Boolean]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a boolean\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a boolean.\n*\n* @module @stdlib/assert-is-boolean\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import isBoolean from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( true ) );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import { isObject as isBoolean } from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( true );\n* // returns false\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport format from '@stdlib/string-format';\nimport getThis from './codegen.js';\nimport Self from './self.js';\nimport Win from './window.js';\nimport GlobalThis from './global_this.js';\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @private\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getGlobal from '@stdlib/utils-global';\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nexport default nodeList;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default typedarray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine a value's type.\n*\n* @module @stdlib/utils-type-of\n*\n* @example\n* import typeOf from '@stdlib/utils-type-of';\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nimport usePolyfill from './check.js';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport RE from './fixtures/re.js';\nimport nodeList from './fixtures/nodelist.js';\nimport typedarray from './fixtures/typedarray.js';\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default check;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport typeOf from '@stdlib/utils-type-of';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a function.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a function\n*\n* @example\n* function beep() {\n* return 'beep';\n* }\n*\n* var bool = isFunction( beep );\n* // returns true\n*/\nfunction isFunction( value ) {\n\t// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.\n\treturn ( typeOf( value ) === 'function' );\n}\n\n\n// EXPORTS //\n\nexport default isFunction;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport isFunction from '@stdlib/assert-is-function';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\n\n\n// MAIN //\n\n/**\n* Tests if a value is struct constructor-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is struct constructor-like\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema = [\n* {\n* 'name': 'foo',\n* 'type': 'float64'\n* }\n* ];\n* var Struct = structFactory( schema );\n*\n* var bool = isStructConstructorLike( Struct );\n* // returns true\n*\n* bool = isStructConstructorLike( [] );\n* // returns false\n*/\nfunction isStructConstructorLike( value ) {\n\treturn (\n\t\tisFunction( value ) &&\n\t\tisPositiveInteger( value.alignment ) &&\n\t\tisPositiveInteger( value.byteLength ) &&\n\t\tisFunction( value.byteLengthOf ) &&\n\t\tisFunction( value.byteOffsetOf ) &&\n\t\tisFunction( value.bufferOf ) &&\n\t\tisFunction( value.isStruct ) &&\n\t\tisFunction( value.viewOf ) &&\n\t\thasOwnProp( value, 'fields' ) &&\n\t\thasOwnProp( value, 'layout' )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isStructConstructorLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\treturn Object.keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.keys !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArguments from './main.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment returns the expected internal class of the `arguments` object.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment behaves as expected\n*\n* @example\n* var bool = detect();\n* // returns \n*/\nfunction detect() {\n\treturn isArguments( arguments );\n}\n\n\n// MAIN //\n\nbool = detect();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn ( nativeClass( value ) === '[object Arguments]' );\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a `NaN` number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `NaN` number primitive\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a value of `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( null );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is `NaN`.\n*\n* @module @stdlib/assert-is-nan\n*\n* @example\n* import isnan from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns false\n*\n* @example\n* import { isObject as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @private\n* @name isEnumerableProperty\n* @type {Function}\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'hasOwnProperty' );\n* // returns false\n*/\nvar isEnumerableProperty = Object.prototype.propertyIsEnumerable;\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnum from './native.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment has a bug where String indices are not detected as \"enumerable\" properties. Observed in Node v0.10.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment has the bug\n*/\nfunction detect() {\n\treturn !isEnum.call( 'beep', '0' );\n}\n\n\n// MAIN //\n\nbool = detect();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isString from '@stdlib/assert-is-string';\nimport { isPrimitive as isnan } from '@stdlib/assert-is-nan';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isEnum from './native.js';\nimport hasStringEnumBug from './has_string_enumerability_bug.js';\n\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );\n* // returns false\n*/\nfunction isEnumerableProperty( value, property ) {\n\tvar bool;\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\tbool = isEnum.call( value, property );\n\tif ( !bool && hasStringEnumBug && isString( value ) ) {\n\t\t// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.\n\t\tproperty = +property;\n\t\treturn (\n\t\t\t!isnan( property ) &&\n\t\t\tisInteger( property ) &&\n\t\t\tproperty >= 0 &&\n\t\t\tproperty < value.length\n\t\t);\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* @module @stdlib/constants-uint32-max\n* @type {uinteger32}\n*\n* @example\n* import UINT32_MAX from '@stdlib/constants-uint32-max';\n* // returns 4294967295\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar UINT32_MAX = 4294967295;\n\n\n// EXPORTS //\n\nexport default UINT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an `arguments` object.\n*\n* @module @stdlib/assert-is-arguments\n*\n* @example\n* import isArguments from '@stdlib/assert-is-arguments';\n*\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* bool = isArguments( [] );\n* // returns false\n*/\n\n// MODULES //\n\nimport hasArgumentsClass from './detect.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar isArguments;\nif ( hasArgumentsClass ) {\n\tisArguments = main;\n} else {\n\tisArguments = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport isArray from '@stdlib/assert-is-array';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-uint32-max';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object' &&\n\t\t!isArray( value ) &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH &&\n\t\thasOwnProp( value, 'callee' ) &&\n\t\t!isEnumerableProperty( value, 'callee' )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArguments from '@stdlib/assert-is-arguments';\nimport builtin from './builtin.js';\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tif ( isArguments( value ) ) {\n\t\treturn builtin( slice.call( value ) );\n\t}\n\treturn builtin( value );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport noop from '@stdlib/utils-noop';\n\n\n// MAIN //\n\n// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...\nvar bool = isEnumerableProperty( noop, 'prototype' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* No operation.\n*\n* @example\n* noop();\n* // ...does nothing.\n*/\nfunction noop() {\n\t// Empty function...\n}\n\n\n// EXPORTS //\n\nexport default noop;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\n\n\n// VARIABLES //\n\nvar obj = {\n\t'toString': null\n};\n\n\n// MAIN //\n\n// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...\nvar bool = !isEnumerableProperty( obj, 'toString' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a typed array.\n*\n* @module @stdlib/constants-array-max-typed-array-length\n*\n* @example\n* import MAX_TYPED_ARRAY_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nexport default MAX_TYPED_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isCollection;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isnan from '@stdlib/assert-is-nan';\nimport isCollection from '@stdlib/assert-is-collection';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @param {ArrayLike} arr - array-like object\n* @param {*} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)\n* @throws {TypeError} must provide an array-like object\n* @throws {TypeError} third argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 5 );\n* // returns -1\n*\n* @example\n* // Using a `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* @example\n* // `fromIndex` which exceeds `array` length:\n* var arr = [ 1, 2, 3, 4, 2, 5 ];\n* var idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* @example\n* // Negative `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* var idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* @example\n* // Negative `fromIndex` exceeding input `array` length:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* @example\n* // Array-like objects:\n* var str = 'bebop';\n* var idx = indexOf( str, 'o' );\n* // returns 3\n*/\nfunction indexOf( arr, searchElement, fromIndex ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( len === 0 ) {\n\t\treturn -1;\n\t}\n\tif ( arguments.length === 3 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= 0 ) {\n\t\t\tif ( fromIndex >= len ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti = fromIndex;\n\t\t} else {\n\t\t\ti = len + fromIndex;\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ti = 0;\n\t}\n\t// Check for `NaN`...\n\tif ( isnan( searchElement ) ) {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( isnan( arr[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( arr[ i ] === searchElement ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// EXPORTS //\n\nexport default indexOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests whether a value equals the prototype of its constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction isConstructorPrototype( value ) {\n\treturn ( value.constructor && value.constructor.prototype === value );\n}\n\n\n// EXPORTS //\n\nexport default isConstructorPrototype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar w = ( typeof window === 'undefined' ) ? void 0 : window;\n\n\n// EXPORTS //\n\nexport default w;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport indexOf from '@stdlib/utils-index-of';\nimport typeOf from '@stdlib/utils-type-of';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport EXCLUDED_KEYS from './excluded_keys.json';\nimport win from './window.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).\n*\n* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment is buggy\n*/\nfunction check() {\n\tvar k;\n\tif ( typeOf( win ) === 'undefined' ) {\n\t\treturn false;\n\t}\n\tfor ( k in win ) { // eslint-disable-line guard-for-in\n\t\ttry {\n\t\t\tif (\n\t\t\t\tindexOf( EXCLUDED_KEYS, k ) === -1 &&\n\t\t\t\thasOwnProp( win, k ) &&\n\t\t\t\twin[ k ] !== null &&\n\t\t\t\ttypeOf( win[ k ] ) === 'object'\n\t\t\t) {\n\t\t\t\tisConstructorPrototype( win[ k ] );\n\t\t\t}\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\nbool = check();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof window !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasArgumentsBug from './has_arguments_bug.js';\nimport HAS_BUILTIN from './has_builtin.js';\nimport builtin from './builtin.js';\nimport wrapper from './builtin_wrapper.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @name keys\n* @type {Function}\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nvar keys;\nif ( HAS_BUILTIN ) {\n\tif ( hasArgumentsBug() ) {\n\t\tkeys = wrapper;\n\t} else {\n\t\tkeys = builtin;\n\t}\n} else {\n\tkeys = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport keys from './builtin.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests the built-in `Object.keys()` implementation when provided `arguments`.\n*\n* @private\n* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys\n*/\nfunction test() {\n\treturn ( keys( arguments ) || '' ).length !== 2;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.\n*\n* ## Notes\n*\n* - Safari 5.0 does **not** support `arguments` as an input value.\n*\n* @private\n* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`\n*/\nfunction check() {\n\treturn test( 1, 2 );\n}\n\n\n// EXPORTS //\n\nexport default check;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObjectLike from '@stdlib/assert-is-object-like';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport isArguments from '@stdlib/assert-is-arguments';\nimport HAS_ENUM_PROTO_BUG from './has_enumerable_prototype_bug.js';\nimport HAS_NON_ENUM_PROPS_BUG from './has_non_enumerable_properties_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype_wrapper.js';\nimport NON_ENUMERABLE from './non_enumerable.json';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tvar skipConstructor;\n\tvar skipPrototype;\n\tvar isFcn;\n\tvar out;\n\tvar k;\n\tvar p;\n\tvar i;\n\n\tout = [];\n\tif ( isArguments( value ) ) {\n\t\t// Account for environments which treat `arguments` differently...\n\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\tout.push( i.toString() );\n\t\t}\n\t\t// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).\n\t\treturn out;\n\t}\n\tif ( typeof value === 'string' ) {\n\t\t// Account for environments which do not treat string character indices as \"own\" properties...\n\t\tif ( value.length > 0 && !hasOwnProp( value, '0' ) ) {\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\tout.push( i.toString() );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tisFcn = ( typeof value === 'function' );\n\t\tif ( isFcn === false && !isObjectLike( value ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tskipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );\n\t}\n\tfor ( k in value ) {\n\t\tif ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {\n\t\t\tout.push( String( k ) );\n\t\t}\n\t}\n\tif ( HAS_NON_ENUM_PROPS_BUG ) {\n\t\tskipConstructor = isConstructorPrototype( value );\n\t\tfor ( i = 0; i < NON_ENUMERABLE.length; i++ ) {\n\t\t\tp = NON_ENUMERABLE[ i ];\n\t\t\tif ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {\n\t\t\t\tout.push( String( p ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasAutomationEqualityBug from './has_automation_equality_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport HAS_WINDOW from './has_window.js';\n\n\n// MAIN //\n\n/**\n* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction wrapper( value ) {\n\tif ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {\n\t\treturn isConstructorPrototype( value );\n\t}\n\ttry {\n\t\treturn isConstructorPrototype( value );\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrapper;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from '@stdlib/assert-is-array';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an object; e.g., `{}`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an object\n*\n* @example\n* var bool = isObject( {} );\n* // returns true\n*\n* @example\n* var bool = isObject( null );\n* // returns false\n*/\nfunction isObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t!isArray( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object.\n*\n* @name Object\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {Object} object\n*\n* @example\n* var o = new Object( null );\n* // returns {}\n*\n* @example\n* var o = new Object( 5.0 );\n* // returns \n*\n* @example\n* var o = new Object( 'beep' );\n* // returns \n*\n* @example\n* var o1 = {};\n*\n* var o2 = new Object( o1 );\n* // returns {}\n*\n* var bool = ( o1 === o2 );\n* // returns true\n*/\nvar Obj = Object; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport builtin from './native.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar getProto;\nif ( isFunction( Object.getPrototypeOf ) ) {\n\tgetProto = builtin;\n} else {\n\tgetProto = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar getProto = Object.getPrototypeOf;\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\nimport Object from '@stdlib/object-ctor';\nimport getProto from './proto.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {(Object|null)} prototype\n*/\nfunction getPrototypeOf( obj ) {\n\tvar proto = getProto( obj );\n\tif ( proto || proto === null ) {\n\t\treturn proto;\n\t}\n\tif ( nativeClass( obj.constructor ) === '[object Function]' ) {\n\t\t// May break if the constructor has been tampered with...\n\t\treturn obj.constructor.prototype;\n\t}\n\tif ( obj instanceof Object ) {\n\t\treturn Object.prototype;\n\t}\n\t// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the value of the `__proto__` property.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {*} value of `__proto__` property\n*/\nfunction getProto( obj ) {\n\t// eslint-disable-next-line no-proto\n\treturn obj.__proto__;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Object from '@stdlib/object-ctor';\nimport getProto from './detect.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @param {*} value - input value\n* @returns {(Object|null)} prototype\n*\n* @example\n* var proto = getPrototypeOf( {} );\n* // returns {}\n*/\nfunction getPrototypeOf( value ) {\n\tif (\n\t\tvalue === null ||\n\t\tvalue === void 0\n\t) {\n\t\treturn null;\n\t}\n\t// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:\n\tvalue = Object( value );\n\n\treturn getProto( value );\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar objectPrototype = Object.prototype;\n\n\n// FUNCTIONS //\n\n/**\n* Tests that an object only has own properties.\n*\n* @private\n* @param {Object} obj - value to test\n* @returns {boolean} boolean indicating if an object only has own properties\n*/\nfunction ownProps( obj ) {\n\tvar key;\n\n\t// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).\n\tfor ( key in obj ) {\n\t\tif ( !hasOwnProp( obj, key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// MAIN //\n\n/**\n* Tests if a value is a plain object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a plain object\n*\n* @example\n* var bool = isPlainObject( {} );\n* // returns true\n*\n* @example\n* var bool = isPlainObject( null );\n* // returns false\n*/\nfunction isPlainObject( value ) {\n\tvar proto;\n\n\t// Screen for obvious non-objects...\n\tif ( !isObject( value ) ) {\n\t\treturn false;\n\t}\n\t// Objects with no prototype (e.g., `Object.create( null )`) are plain...\n\tproto = getPrototypeOf( value );\n\tif ( !proto ) {\n\t\treturn true;\n\t}\n\t// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...\n\treturn (\n\t\t// Cannot have own `constructor` property:\n\t\t!hasOwnProp( value, 'constructor' ) &&\n\n\t\t// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):\n\t\thasOwnProp( proto, 'constructor' ) &&\n\t\tisFunction( proto.constructor ) &&\n\t\tnativeClass( proto.constructor ) === '[object Function]' &&\n\n\t\t// Test for object-specific method:\n\t\thasOwnProp( proto, 'isPrototypeOf' ) &&\n\t\tisFunction( proto.isPrototypeOf ) &&\n\n\t\t(\n\t\t\t// Test if the prototype matches the global `Object` prototype (same realm):\n\t\t\tproto === objectPrototype ||\n\n\t\t\t// Test that all properties are own properties (cross-realm; *most* likely a plain object):\n\t\t\townProps( value )\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPlainObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport objectInverse from '@stdlib/object-inverse';\nimport dtypeEnums from '@stdlib/ndarray-base-dtype-enums';\n\n\n// VARIABLES //\n\nvar hash = objectInverse( dtypeEnums(), {\n\t'duplicates': false\n});\n\n\n// MAIN //\n\n/**\n* Returns the data type string associated with an ndarray data type enumeration constant.\n*\n* @param {integer} dtype - data type enumeration constant\n* @returns {(string|null)} data type string or null\n*\n* @example\n* import str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n*\n* var v = str2enum( 'float64' );\n* // returns \n*\n* var dt = enum2str( v );\n* // returns 'float64'\n*/\nfunction enum2str( dtype ) {\n\tvar v = hash[ dtype ];\n\treturn ( isString( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain\n}\n\n\n// EXPORTS //\n\nexport default enum2str;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport isArray from '@stdlib/assert-is-array';\nimport isObject from '@stdlib/assert-is-plain-object';\nimport isObjectLike from '@stdlib/assert-is-object-like';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} second argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invert( obj, opts ) {\n\tvar allowDupes = true;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = obj[ key ];\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tout[ obj[ key ] ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default invert;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable stdlib/empty-line-before-comment */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping supported data type strings to enumeration constants.\n*\n* ## Notes\n*\n* - Downstream consumers of this mapping should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the object should be used in an opaque manner.\n* - The main purpose of this function is JavaScript and C inter-operation of ndarray objects.\n*\n* @returns {Object} object mapping supported data type strings to enumeration constants\n*\n* @example\n* var table = dtypeEnums();\n* // returns {...}\n*/\nfunction dtypeEnums() {\n\t// NOTE: the following should match the C enumeration in `@stdlib/ndarray/dtypes`!!!!\n\treturn {\n\t\t// Boolean data types:\n\t\t'bool': 0,\n\n\t\t// Integer data types:\n\t\t'int8': 1,\n\t\t'uint8': 2,\n\t\t'uint8c': 3,\n\t\t'int16': 4,\n\t\t'uint16': 5,\n\t\t'int32': 6,\n\t\t'uint32': 7,\n\t\t'int64': 8,\n\t\t'uint64': 9,\n\t\t// 'int128': 10, // uncomment once supported\n\t\t// 'uint128': 11,\n\t\t// 'int256': 12,\n\t\t// 'uint256': 13,\n\n\t\t// Floating-point data types:\n\t\t'float16': 10,\n\t\t// 'bfloat16': 15,\n\t\t'float32': 11,\n\t\t'float64': 12,\n\t\t// 'float128': 18, // uncomment once supported\n\n\t\t// Complex floating-point number data types:\n\t\t'complex32': 13,\n\t\t'complex64': 14,\n\t\t'complex128': 15,\n\n\t\t// Data type for \"binary\" data (i.e., data stored in a Node.js `Buffer` object):\n\t\t'binary': 16,\n\n\t\t// Data type for \"generic\" JavaScript values (objects):\n\t\t'generic': 17,\n\n\t\t// Define a signaling value which is guaranteed not to be a valid type enumeration value:\n\t\t'notype': 18,\n\n\t\t// Indicate the start of user defined type numbers (leaving room for type growth above):\n\t\t'userdefined_type': 256\n\t};\n}\n\n\n// EXPORTS //\n\nexport default dtypeEnums;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport dtypeEnums from '@stdlib/ndarray-base-dtype-enums';\n\n\n// VARIABLES //\n\nvar ENUM = dtypeEnums();\n\n\n// MAIN //\n\n/**\n* Returns the enumeration constant associated with an ndarray data type string.\n*\n* ## Notes\n*\n* - Downstream consumers of this function should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the function should be used in an opaque manner.\n*\n* @param {string} dtype - data type string\n* @returns {(integer|null)} integer value or null\n*\n* @example\n* var v = str2enum( 'int8' );\n* // returns \n*/\nfunction str2enum( dtype ) {\n\tvar v = ENUM[ dtype ];\n\treturn ( isNumber( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain\n}\n\n\n// EXPORTS //\n\nexport default str2enum;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n\n\n// MAIN //\n\n/**\n* Returns the data type string associated with a supported ndarray data type value.\n*\n* @param {*} dtype - data type value\n* @returns {(string|null)} data type string or null\n*\n* @example\n* import str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n*\n* var v = resolve( str2enum( 'float64' ) );\n* // returns 'float64'\n*/\nfunction resolve( dtype ) {\n\tvar t = ( typeof dtype );\n\tif ( t === 'string' ) {\n\t\treturn ( str2enum( dtype ) === null ) ? null : dtype;\n\t}\n\tif ( t === 'number' ) {\n\t\treturn enum2str( dtype );\n\t}\n\tif ( t === 'object' && dtype ) {\n\t\treturn String( dtype );\n\t}\n\tif ( isStructConstructorLike( dtype ) ) {\n\t\treturn dtype.layout;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default resolve;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property, either own or inherited.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasProp( value, property ) {\n\tif ( value === void 0 || value === null ) {\n\t\treturn false;\n\t}\n\tif ( typeof property === 'symbol' ) {\n\t\treturn property in Object( value );\n\t}\n\treturn ( String( property ) in Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default hasProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128',\n\t'BooleanArray': 'bool'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat64Array from '@stdlib/assert-is-float64array';\nimport GlobalFloat64Array from './float64array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns \n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat64ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float64\n*\n* @example\n* import ctor from '@stdlib/array-float64';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasFloat32Array = ( typeof Float32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float32Array\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var bool = isFloat32Array( new Float32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat32Array( [] );\n* // returns false\n*/\nfunction isFloat32Array( value ) {\n\treturn (\n\t\t( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float32\n*\n* @example\n* import ctor from '@stdlib/array-float32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat32ArraySupport from '@stdlib/assert-has-float32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat32Array from '@stdlib/assert-is-float32array';\nimport PINF from '@stdlib/constants-float64-pinf';\nimport GlobalFloat32Array from './float32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float32Array` support\n*\n* @example\n* var bool = hasFloat32ArraySupport();\n* // returns \n*/\nfunction hasFloat32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );\n\t\tbool = (\n\t\t\tisFloat32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.140000104904175 &&\n\t\t\tarr[ 2 ] === -3.140000104904175 &&\n\t\t\tarr[ 3 ] === PINF\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint32\n*\n* @example\n* import ctor from '@stdlib/array-uint32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint32ArraySupport from '@stdlib/assert-has-uint32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint32Array from '@stdlib/assert-is-uint32array';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\nimport GlobalUint32Array from './uint32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns \n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int32Array\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var bool = isInt32Array( new Int32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt32Array( [] );\n* // returns false\n*/\nfunction isInt32Array( value ) {\n\treturn (\n\t\t( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 32-bit integer.\n*\n* @module @stdlib/constants-int32-max\n* @type {integer32}\n*\n* @example\n* import INT32_MAX from '@stdlib/constants-int32-max';\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{31} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 2147483647\n*/\nvar INT32_MAX = 2147483647|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 32-bit integer.\n*\n* @module @stdlib/constants-int32-min\n* @type {integer32}\n*\n* @example\n* import INT32_MIN from '@stdlib/constants-int32-min';\n* // returns -2147483648\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{31})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -2147483648\n*/\nvar INT32_MIN = -2147483648|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int32Array === 'function' ) ? Int32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int32\n*\n* @example\n* import ctor from '@stdlib/array-int32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt32ArraySupport from '@stdlib/assert-has-int32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt32Array from '@stdlib/assert-is-int32array';\nimport INT32_MAX from '@stdlib/constants-int32-max';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport GlobalInt32Array from './int32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int32Array` support\n*\n* @example\n* var bool = hasInt32ArraySupport();\n* // returns \n*/\nfunction hasInt32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT32_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* @module @stdlib/constants-uint16-max\n* @type {integer32}\n*\n* @example\n* import UINT16_MAX from '@stdlib/constants-uint16-max';\n* // returns 65535\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{16} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 1111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 65535\n*/\nvar UINT16_MAX = 65535|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint16\n*\n* @example\n* import ctor from '@stdlib/array-uint16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint16ArraySupport from '@stdlib/assert-has-uint16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint16Array from '@stdlib/assert-is-uint16array';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport GlobalUint16Array from './uint16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns \n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int16Array\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var bool = isInt16Array( new Int16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt16Array( [] );\n* // returns false\n*/\nfunction isInt16Array( value ) {\n\treturn (\n\t\t( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 16-bit integer.\n*\n* @module @stdlib/constants-int16-max\n* @type {integer32}\n*\n* @example\n* import INT16_MAX from '@stdlib/constants-int16-max';\n* // returns 32767\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{15} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 32767\n*/\nvar INT16_MAX = 32767|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 16-bit integer.\n*\n* @module @stdlib/constants-int16-min\n* @type {integer32}\n*\n* @example\n* import INT16_MIN from '@stdlib/constants-int16-min';\n* // returns -32768\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{15})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 1000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -32768\n*/\nvar INT16_MIN = -32768|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int16\n*\n* @example\n* import ctor from '@stdlib/array-int16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt16ArraySupport from '@stdlib/assert-has-int16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt16Array from '@stdlib/assert-is-int16array';\nimport INT16_MAX from '@stdlib/constants-int16-max';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport GlobalInt16Array from './int16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int16Array` support\n*\n* @example\n* var bool = hasInt16ArraySupport();\n* // returns \n*/\nfunction hasInt16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT16_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* @module @stdlib/constants-uint8-max\n* @type {integer32}\n*\n* @example\n* import UINT8_MAX from '@stdlib/constants-uint8-max';\n* // returns 255\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{8} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 255\n*/\nvar UINT8_MAX = 255|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint8\n*\n* @example\n* import ctor from '@stdlib/array-uint8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ArraySupport from '@stdlib/assert-has-uint8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8Array from '@stdlib/assert-is-uint8array';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport GlobalUint8Array from './uint8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns \n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8ClampedArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8ClampedArray( [] );\n* // returns false\n*/\nfunction isUint8ClampedArray( value ) {\n\treturn (\n\t\t( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8ClampedArray]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8ClampedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array-uint8c\n*\n* @example\n* import ctor from '@stdlib/array-uint8c';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ClampedArraySupport from '@stdlib/assert-has-uint8clampedarray-support'; // eslint-disable-line id-length\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8ClampedArray from '@stdlib/assert-is-uint8clampedarray';\nimport GlobalUint8ClampedArray from './uint8clampedarray.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8ClampedArray` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support\n*\n* @example\n* var bool = hasUint8ClampedArraySupport();\n* // returns \n*/\nfunction hasUint8ClampedArraySupport() { // eslint-disable-line id-length\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8ClampedArray !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );\n\t\tbool = (\n\t\t\tisUint8ClampedArray( arr ) &&\n\t\t\tarr[ 0 ] === 0 && // clamped\n\t\t\tarr[ 1 ] === 0 &&\n\t\t\tarr[ 2 ] === 1 &&\n\t\t\tarr[ 3 ] === 3 && // round to nearest\n\t\t\tarr[ 4 ] === 5 && // round to nearest\n\t\t\tarr[ 5 ] === 255 &&\n\t\t\tarr[ 6 ] === 255 // clamped\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ClampedArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int8Array\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var bool = isInt8Array( new Int8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt8Array( [] );\n* // returns false\n*/\nfunction isInt8Array( value ) {\n\treturn (\n\t\t( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 8-bit integer.\n*\n* @module @stdlib/constants-int8-max\n* @type {integer32}\n*\n* @example\n* import INT8_MAX from '@stdlib/constants-int8-max';\n* // returns 127\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* 2^{7} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 127\n*/\nvar INT8_MAX = 127|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 8-bit integer.\n*\n* @module @stdlib/constants-int8-min\n* @type {integer32}\n*\n* @example\n* import INT8_MIN from '@stdlib/constants-int8-min';\n* // returns -128\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* -(2^{7})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -128\n*/\nvar INT8_MIN = -128|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int8Array === 'function' ) ? Int8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int8\n*\n* @example\n* import ctor from '@stdlib/array-int8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt8ArraySupport from '@stdlib/assert-has-int8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt8Array from '@stdlib/assert-is-int8array';\nimport INT8_MAX from '@stdlib/constants-int8-max';\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport GlobalInt8Array from './int8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int8Array` support\n*\n* @example\n* var bool = hasInt8ArraySupport();\n* // returns \n*/\nfunction hasInt8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT8_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert-is-nonnegative-integer\n*\n* @example\n* import isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a generic array.\n*\n* @module @stdlib/constants-array-max-array-length\n*\n* @example\n* import MAX_ARRAY_LENGTH from '@stdlib/constants-array-max-array-length';\n* // returns 4294967295\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a generic array.\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default MAX_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is an array-like object\n*\n* @example\n* var bool = isArrayLikeObject( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( { 'length': 10 } );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( 'beep' );\n* // returns false\n*/\nfunction isArrayLikeObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayLikeObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array of strings.\n*\n* @module @stdlib/assert-is-string-array\n*\n* @example\n* import isStringArray from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', 123 ] );\n* // returns false\n*\n* @example\n* import { primitives as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', new String( 'def' ) ] );\n* // returns false\n*\n* @example\n* import { objects as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );\n* // returns true\n*\n* bool = isStringArray( [ new String( 'abc' ), 'def' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport isString from '@stdlib/assert-is-string';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isString.isPrimitive );\nvar isObjectArray = arrayfun( isString.isObject );\n\n\n// MAIN //\n\nvar isStringArray = arrayfun( isString );\nsetReadOnly( isStringArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isStringArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isStringArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport setEnumerableReadOnly from '@stdlib/utils-define-read-only-property';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport format from '@stdlib/string-format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 128-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex128} 128-bit complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex128( real, imag ) {\n\tif ( !( this instanceof Complex128 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', real );\n\tsetEnumerableReadOnly( this, 'im', imag );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128\n* @readonly\n* @type {string}\n* @default 'Complex128'\n*\n* @example\n* var name = Complex128.name;\n* // returns 'Complex128'\n*/\nsetReadOnly( Complex128, 'name', 'Complex128' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex128.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128.prototype, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 16\n*/\nsetReadOnly( Complex128.prototype, 'byteLength', 16 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex128.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance.\n*\n* @name toJSON\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex128.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex128;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex128';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar fround = ( typeof Math.fround === 'function' ) ? Math.fround : null; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default fround;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float32Array from '@stdlib/array-float32';\n\n\n// VARIABLES //\n\nvar FLOAT32_VIEW = new Float32Array( 1 );\n\n\n// MAIN //\n\n/**\n* Converts a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @param {number} x - double-precision floating-point number\n* @returns {number} nearest single-precision floating-point number\n*\n* @example\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\nfunction float64ToFloat32( x ) {\n\tFLOAT32_VIEW[ 0 ] = x;\n\treturn FLOAT32_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @module @stdlib/number-float64-base-to-float32\n*\n* @example\n* import float64ToFloat32 from '@stdlib/number-float64-base-to-float32';\n*\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\n\n// MODULES //\n\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar float64ToFloat32;\nif ( typeof builtin === 'function' ) {\n\tfloat64ToFloat32 = builtin;\n} else {\n\tfloat64ToFloat32 = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport setEnumerableReadOnly from '@stdlib/utils-define-read-only-property';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport float64ToFloat32 from '@stdlib/number-float64-base-to-float32';\nimport format from '@stdlib/string-format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 64-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex64} 64-bit complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex64( real, imag ) {\n\tif ( !( this instanceof Complex64 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', float64ToFloat32( real ) );\n\tsetEnumerableReadOnly( this, 'im', float64ToFloat32( imag ) );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64\n* @readonly\n* @type {string}\n* @default 'Complex64'\n*\n* @example\n* var name = Complex64.name;\n* // returns 'Complex64'\n*/\nsetReadOnly( Complex64, 'name', 'Complex64' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex64.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 8\n*/\nsetReadOnly( Complex64.prototype, 'byteLength', 8 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex64.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex64` instance.\n*\n* @name toJSON\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex64.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex64;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from '@stdlib/complex-float64-ctor';\nimport Complex64 from '@stdlib/complex-float32-ctor';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex number-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex number-like object.\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var x = new Complex128( 4.0, 2.0 );\n* var bool = isComplexLike( x );\n* // returns true\n*\n* x = new Complex64( 4.0, 2.0 );\n* bool = isComplexLike( x );\n* // returns true\n*/\nfunction isComplexLike( value ) {\n\tif ( value instanceof Complex128 || value instanceof Complex64 ) {\n\t\treturn true;\n\t}\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.re === 'number' &&\n\t\ttypeof value.im === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplexLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nexport default isEven;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex64';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var bool = isComplex64Array( new Complex64Array( 10 ) );\n* // returns true\n*\n* bool = isComplex64Array( [] );\n* // returns false\n*/\nfunction isComplex64Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex64Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex64array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isComplex128Array( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplex128Array( [] );\n* // returns false\n*/\nfunction isComplex128Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex128array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.iterator` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.iterator` support\n*\n* @example\n* var bool = hasIteratorSymbolSupport();\n* // returns \n*/\nfunction hasIteratorSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'iterator' ) &&\n\t\ttypeof Symbol.iterator === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasIteratorSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\n\n\n// MAIN //\n\n/**\n* Iterator symbol.\n*\n* @name IteratorSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* function iterator() {\n* var it;\n* var i;\n*\n* i = -1;\n*\n* it = {};\n* it.next = next;\n* it.return = done;\n*\n* if ( IteratorSymbol ) {\n* it[ IteratorSymbol ] = iterator;\n* }\n* return it;\n*\n* function next() {\n* i += 1;\n* return {\n* 'value': i,\n* 'done': false\n* };\n* }\n*\n* function done( value ) {\n* if ( arguments.length === 0 ) {\n* return {\n* 'done': true\n* };\n* }\n* return {\n* 'value': value,\n* 'done': true\n* };\n* }\n* }\n*\n* var obj = iterator();\n*/\nvar IteratorSymbol = ( hasIteratorSymbolSupport() ) ? Symbol.iterator : null;\n\n\n// EXPORTS //\n\nexport default IteratorSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float32Array from '@stdlib/array-float32';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex64Array` as a `Float32Array`.\n*\n* @param {Complex64Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} `Float32Array` view\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex128Array` as a `Float64Array`.\n*\n* @param {Complex128Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} `Float64Array` view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float32Array from '@stdlib/array-float32';\nimport Complex64 from '@stdlib/complex-float32-ctor';\nimport format from '@stdlib/string-format';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = realf( z );\n* // returns 9.0\n*\n* im = imagf( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, getComplex64( buf, i ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex64Array} modified array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.fill( new Complex64( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = realf( value );\n\tim = imagf( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( v, i ) {\n* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2\n*\n* var im = imagf( z );\n* // returns -2\n*/\nsetReadOnly( Complex64Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex64( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = realf( v );\n\t\t\toutbuf[ (2*i)+1 ] = imagf( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = realf( tmp[i] );\n\t\tbuf[ j+1 ] = imagf( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex64Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = realf( v );\n* // returns 1.0\n*\n* var im = imagf( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = realf( v );\n* // returns 2.0\n*\n* im = imagf( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex64( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex64Array} new typed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 4.0\n*\n* var im = imagf( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = realf( value );\n\tbuf[ (2*index)+1 ] = imagf( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport isString from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float64Array from '@stdlib/array-float64';\nimport Complex128 from '@stdlib/complex-float64-ctor';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = real( z );\n* // returns 9.0\n*\n* im = imag( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex128Array} modified array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.fill( new Complex128( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex128Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex128Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex128( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 );\n* // returns 3\n*/\nsetReadOnly( Complex128Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex128( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function scale( v, i ) {\n* return new Complex128( 2.0*real( v ), 2.0*imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns -2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex128( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = real( v );\n\t\t\toutbuf[ (2*i)+1 ] = imag( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = real( tmp[i] );\n\t\tbuf[ j+1 ] = imag( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex128Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = real( v );\n* // returns 1.0\n*\n* var im = imag( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = real( v );\n* // returns 2.0\n*\n* im = imag( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex128( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex128Array} new typed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex128( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 4.0\n*\n* var im = imag( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex128Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = real( value );\n\tbuf[ (2*index)+1 ] = imag( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( Boolean( v.value ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Boolean from '@stdlib/boolean-ctor';\nimport getter from '@stdlib/array-base-getter';\nimport floor from '@stdlib/math-base-special-floor';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Uint8Array.BYTES_PER_ELEMENT;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a boolean typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean typed array constructor\n*/\nfunction isBooleanArrayConstructor( value ) {\n\treturn ( value === BooleanArray );\n}\n\n\n// MAIN //\n\n/**\n* Boolean array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new BooleanArray( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new BooleanArray( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 16\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 8\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new BooleanArray( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction BooleanArray() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof BooleanArray) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new BooleanArray();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new BooleanArray( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new BooleanArray( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new BooleanArray( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Uint8Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new Uint8Array( arg.length ), arg );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( fromIterator( buf ) );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new Uint8Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var nbytes = BooleanArray.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof BooleanArray\n* @readonly\n* @type {string}\n* @default 'BooleanArray'\n*\n* @example\n* var str = BooleanArray.name;\n* // returns 'BooleanArray'\n*/\nsetReadOnly( BooleanArray, 'name', 'BooleanArray' );\n\n/**\n* Creates a new boolean array from an array-like object or an iterable.\n*\n* @name from\n* @memberof BooleanArray\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.from( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return !v;\n* }\n*\n* var arr = BooleanArray.from( [ true, false ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( BooleanArray, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ i ] = Boolean( clbk.call( thisArg, get( src, i ), i ) );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new boolean array from a variable number of arguments.\n*\n* @name of\n* @memberof BooleanArray\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.of( true, true, true, true );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( BooleanArray, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide an integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.at( 0 );\n* // returns true\n*\n* v = arr.at( -1 );\n* // returns true\n*\n* v = arr.at( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'at', function at( idx ) {\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tif ( idx < 0 ) {\n\t\tidx += len;\n\t}\n\tif ( idx < 0 || idx >= len ) {\n\t\treturn;\n\t}\n\treturn Boolean( buf[ idx ] );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray.prototype, 'BYTES_PER_ELEMENT', BooleanArray.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 4 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n* arr.set( true, 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* var v = arr.get( 2 );\n* // returns true\n*\n* v = arr.get( 3 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target, start );\n\t} else {\n\t\tthis._buffer.copyWithin( target, start, arguments[2] );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var it = arr.entries();\n*\n* var v = it.next().value;\n* // returns [ 0, true ]\n*\n* v = it.next().value;\n* // returns [ 1, false ]\n*\n* v = it.next().value;\n* // returns [ 2, true ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, Boolean( buf[ i ] ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.fill( true, 1 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar val;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tif ( value ) {\n\t\tval = 1;\n\t} else {\n\t\tval = 0;\n\t}\n\tfor ( i = start; i < end; i++ ) {\n\t\tbuf[ i ] = val;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* function predicate( v ) {\n* return ( v === true );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 2\n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.find( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findIndex( predicate );\n* // returns 0\n*/\nsetReadOnly( BooleanArray.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLast( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLastIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( BooleanArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tfcn.call( thisArg, Boolean( buf[ i ] ), i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'get', function get( idx ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn Boolean( this._buffer[ idx ] );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a value\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var bool = arr.includes( true );\n* // returns true\n*\n* bool = arr.includes( false, 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.indexOf( true );\n* // returns 0\n*\n* idx = arr.indexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.indexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.join();\n* // returns 'true,false,true'\n*\n* str = arr.join( '|' );\n* // returns 'true|false|true'\n*/\nsetReadOnly( BooleanArray.prototype, 'join', function join( separator ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isString( separator ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t\t}\n\t} else {\n\t\tseparator = ',';\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( separator );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.lastIndexOf( true );\n* // returns 4\n*\n* idx = arr.lastIndexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} new boolean array\n*\n* @example\n* function invert( v ) {\n* return !v;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.map( invert );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns false\n*\n* z = out.get( 1 );\n* // returns true\n*\n* z = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be a function. Value: `%s`.', fcn );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\toutbuf[ i ] = Boolean( fcn.call( thisArg, Boolean( buf[ i ] ), i, this ) );\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduce( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ 0 ] );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduceRight( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len - 1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ len-1 ] );\n\t\ti = len - 2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ i ];\n\t\tbuf[ i ] = buf[ j ];\n\t\tbuf[ j ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(Collection|BooleanArray|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tif ( isBooleanArray( value ) ) {\n\t\t\tsbuf = value._buffer; // eslint-disable-line no-underscore-dangle\n\t\t} else {\n\t\t\tsbuf = value;\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Uint8Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf[ idx ] = ( sbuf[ i ] ) ? 1 : 0;\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf[ idx ] = ( value ) ? 1 : 0;\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be integer\n* @throws {TypeError} second argument must be integer\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var bool = out.get( 0 );\n* // returns true\n*\n* bool = out.get( len-1 );\n* // returns true\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* bool = out.get( 0 );\n* // returns false\n*\n* bool = out.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'slice', function slice( begin, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar len;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin < end ) {\n\t\toutlen = end - begin;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\toutbuf[ i ] = buf[ i+begin ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( false, 0 );\n* arr.set( true, 1 );\n* arr.set( false, 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.sort( compare );\n*\n* var v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'sort', function sort( compareFcn ) {\n\tvar buf;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length === 0 ) {\n\t\tbuf.sort();\n\t\treturn this;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf.sort( compare );\n\treturn this;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {BooleanArray} subarray\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var bool = subarr.get( 0 );\n* // returns true\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* bool = subarr.get( 0 );\n* // returns false\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toLocaleString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( Boolean( buf[ i ] ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ len - i - 1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*\n* v = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ i ];\n\t}\n\tif ( arguments.length === 0 ) {\n\t\toutbuf.sort();\n\t\treturn out;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\toutbuf.sort( compare );\n\treturn out;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns true\n*\n* v = iter.next().value;\n* // returns false\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': Boolean( buf[ i ] ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {boolean} value - new value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a boolean\n* @returns {BooleanArray} new typed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.with( 0, false );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tif ( value ) {\n\t\tbuf[ index ] = 1;\n\t} else {\n\t\tbuf[ index ] = 0;\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default BooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Fills an output array with \"boolean\" values.\n*\n* @private\n* @param {Uint8Array} buf - output array\n* @param {Array} arr - input array\n* @returns {Uint8Array} output array\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar i;\n\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbuf[ i ] = Boolean( arr[ i ] );\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( Boolean( clbk.call( thisArg, v.value, i ) ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int8Array from '@stdlib/array-int8';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array,\n\tBooleanArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128',\n\t'bool'\n];\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from '@stdlib/assert-is-buffer';\nimport isArray from '@stdlib/assert-is-array';\nimport constructorName from '@stdlib/utils-constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport getter from '@stdlib/array-base-getter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*\n* @example\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\nfunction contains( x, value ) {\n\tvar len;\n\tvar get;\n\tvar dt;\n\tvar i;\n\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t} else {\n\t\tget = getter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Loop over the elements...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( get( x, i ) === value ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default contains;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport dtype from '@stdlib/array-dtype';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function to tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @throws {TypeError} must provide an array-like object\n* @returns {Function} function to test if an array contains a search value\n*\n* @example\n* var contains = factory( [ 1, 2, 3 ] );\n* // returns \n*\n* var bool = contains( 2 );\n* // returns true\n*/\nfunction factory( x ) {\n\tvar get;\n\tvar len;\n\tvar dt;\n\n\tif ( !isCollection( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', x ) );\n\t}\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\treturn ( get === void 0 ) ? contains : accessors;\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*\n\t* @example\n\t* var out = contains( [ 1, 2, 3 ], 2 );\n\t* // returns true\n\t*/\n\tfunction contains( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( x[ i ] === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*/\n\tfunction accessors( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( get( x, i ) === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Replaces search occurrences with a replacement string.\n*\n* @param {string} str - input string\n* @param {RegExp} search - search expression\n* @param {(string|Function)} newval - replacement value or function\n* @returns {string} new string containing replacement(s)\n*\n* @example\n* var str = 'Hello World';\n* var out = replace( str, /world/i, 'Mr. President' );\n* // returns 'Hello Mr. President'\n*\n* @example\n* import capitalize from '@stdlib/string-base-capitalize';\n*\n* var str = 'Oranges and lemons say the bells of St. Clement\\'s';\n*\n* function replacer( match, p1 ) {\n* return capitalize( p1 );\n* }\n*\n* var out = replace( str, /([^\\s]*)/gi, replacer );\n* // returns 'Oranges And Lemons Say The Bells Of St. Clement\\'s'\n*/\nfunction replace( str, search, newval ) {\n\treturn str.replace( search, newval );\n}\n\n\n// EXPORTS //\n\nexport default replace;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if an array contains a provided search value.\n*\n* @module @stdlib/array-base-assert-contains\n*\n* @example\n* import contains from '@stdlib/array-base-assert-contains';\n*\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport factory from './factory.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"factory\": \"main.factory\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport replace from '@stdlib/string-base-replace';\nimport DTYPES from './dtypes.json';\n\n\n// VARIABLES //\n\nvar RE_SUFFIX = /_and_generic$/;\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data type strings.\n*\n* @param {string} [kind] - data type kind\n* @returns {Array} list of ndarray data type strings\n*\n* @example\n* var list = dtypeStrings();\n* // returns [...]\n*\n* @example\n* var list = dtypeStrings( 'floating_point' );\n* // returns [...]\n*/\nfunction dtypeStrings() {\n\tvar kind;\n\tvar out;\n\tvar FLG;\n\tif ( arguments.length === 0 ) {\n\t\treturn DTYPES.all.slice();\n\t}\n\tFLG = false;\n\tkind = arguments[ 0 ];\n\tif ( RE_SUFFIX.test( kind ) ) {\n\t\tkind = replace( kind, RE_SUFFIX, '' );\n\t\tif ( kind !== 'all' && kind !== 'index' ) {\n\t\t\tFLG = true;\n\t\t}\n\t}\n\tout = DTYPES[ kind ];\n\tout = ( out ) ? out.slice() : [];\n\tif ( FLG && out.length > 0 ) {\n\t\tout.push( 'generic' );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default dtypeStrings;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/ndarray-base-dtype-strings';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported built-in ndarray data type string.\n*\n* @name isDataTypeString\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported built-in ndarray data type string\n*\n* @example\n* var bool = isDataTypeString( 'binary' );\n* // returns true\n*\n* bool = isDataTypeString( 'float32' );\n* // returns true\n*\n* bool = isDataTypeString( 'float64' );\n* // returns true\n*\n* bool = isDataTypeString( 'generic' );\n* // returns true\n*\n* bool = isDataTypeString( 'int16' );\n* // returns true\n*\n* bool = isDataTypeString( 'int32' );\n* // returns true\n*\n* bool = isDataTypeString( 'int8' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint16' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint32' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint8' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint8c' );\n* // returns true\n*\n* bool = isDataTypeString( 'foo' );\n* // returns false\n*/\nvar isDataTypeString = contains( dtypes() );\n\n\n// EXPORTS //\n\nexport default isDataTypeString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport table from './table.js';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// MAIN //\n\n/**\n* Returns the description for a provided data type.\n*\n* @param {*} [dtype] - data type value\n* @returns {(Object|string|null)} description(s)\n*\n* @example\n* var obj = dtypeDesc();\n* // returns {...}\n*\n* @example\n* var desc = dtypeDesc( 'float64' );\n* // returns '...'\n*\n* desc = dtypeDesc( 'generic' );\n* // returns '...'\n*/\nfunction dtypeDesc( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn table();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\tTABLE = table();\n\t}\n\treturn TABLE[ resolve( dtype ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtypeDesc;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport table from './table.js';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// MAIN //\n\n/**\n* Returns the single letter character abbreviation for an underlying array data type.\n*\n* @param {*} [dtype] - data type value\n* @returns {(Object|string|null)} single letter character abbreviation(s)\n*\n* @example\n* var obj = dtypeChar();\n* // returns {...}\n*\n* @example\n* var ch = dtypeChar( 'float64' );\n* // returns 'd'\n*\n* ch = dtypeChar( 'generic' );\n* // returns 'o'\n*/\nfunction dtypeChar( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn table();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\tTABLE = table();\n\t}\n\treturn TABLE[ resolve( dtype ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtypeChar;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport table from './table.js';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// MAIN //\n\n/**\n* Returns the alignment (in bytes) for an underlying array data type.\n*\n* ## Notes\n*\n* - If provided an unrecognized/unsupported data type, the function returns `null`.\n*\n* @param {*} [dtype] - data type value\n* @returns {(Object|number|null)} alignment (in bytes)\n*\n* @example\n* var obj = dtypeAlignment();\n* // returns {...}\n*\n* @example\n* var out = dtypeAlignment( 'float64' );\n* // returns 8\n*\n* out = dtypeAlignment( 'generic' );\n* // returns null\n*/\nfunction dtypeAlignment( dtype ) {\n\tvar v;\n\tif ( arguments.length === 0 ) {\n\t\treturn table();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\tTABLE = table();\n\t}\n\tif ( dtype ) {\n\t\tv = dtype.alignment;\n\t\tif ( isPositiveInteger( v ) ) {\n\t\t\treturn v;\n\t\t}\n\t\treturn TABLE[ resolve( dtype ) ] || null;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default dtypeAlignment;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport BYTES_PER_ELEMENT from './bytes_per_element.json';\n\n\n// MAIN //\n\n/**\n* Returns the number of bytes per element for a provided underlying ndarray data type.\n*\n* @param {*} dtype - data type\n* @returns {(PositiveInteger|null)} number of bytes per element\n*\n* @example\n* var nbytes = bytesPerElement( 'float64' );\n* // returns 8\n*\n* nbytes = bytesPerElement( 'generic' );\n* // returns null\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema = [\n* {\n* 'name': 'value',\n* 'type': 'float64'\n* }\n* ];\n* var Struct = structFactory( schema );\n* // returns \n*\n* var nbytes = bytesPerElement( Struct );\n* // returns 8\n*/\nfunction bytesPerElement( dtype ) {\n\tvar v;\n\tif ( isString( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ dtype ] || null;\n\t}\n\tif ( isNumber( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ enum2str( dtype ) ] || null;\n\t}\n\tif ( dtype ) {\n\t\tv = dtype.byteLength;\n\t\tif ( isPositiveInteger( v ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default bytesPerElement;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport isPlainObject from '@stdlib/assert-is-plain-object';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport isDataTypeString from '@stdlib/ndarray-base-assert-is-data-type-string';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport hasProp from '@stdlib/assert-has-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport resolveEnum from '@stdlib/ndarray-base-dtype-resolve-enum';\nimport dtype2desc from '@stdlib/ndarray-base-dtype-desc';\nimport dtype2char from '@stdlib/ndarray-base-dtype-char';\nimport dtype2alignment from '@stdlib/ndarray-base-dtype-alignment';\nimport bytesPerElement from '@stdlib/ndarray-base-bytes-per-element';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `DataType`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `DataType`\n*/\nfunction isDataType( value ) { // NOTE: we do not use `ndarray/base/assert/is-data-type-object` in order to avoid circular dependencies\n\treturn (\n\t\tvalue instanceof DataType ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\tvalue.constructor.name === 'DataType' &&\n\t\t\tisString( value.char ) &&\n\t\t\tisString( value.description ) &&\n\t\t\tisString( value.byteOrder ) &&\n\t\t\thasProp( value, 'value' )\n\t\t)\n\t);\n}\n\n\n// MAIN //\n\n/**\n* Data type constructor.\n*\n* @constructor\n* @param {*} value - data type value\n* @param {Options} [options] - constructor options\n* @param {string} [options.description] - data type description\n* @throws {TypeError} first argument must be a supported data type value\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {DataType} data type instance\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var str = dt.toString();\n* // returns 'float64'\n*/\nfunction DataType( value, options ) {\n\tvar nargs;\n\tvar type;\n\tvar opts;\n\n\tnargs = arguments.length;\n\tif ( !( this instanceof DataType ) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new DataType( value );\n\t\t}\n\t\treturn new DataType( value, options );\n\t}\n\tif ( isDataTypeString( value ) ) {\n\t\ttype = 'builtin';\n\t} else if ( isDataType( value ) ) {\n\t\t// Clone the input data type:\n\t\treturn new DataType( value.value, {\n\t\t\t'description': value.description\n\t\t});\n\t} else if ( isStructConstructorLike( value ) ) {\n\t\ttype = 'struct';\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.', value ) );\n\t}\n\tif ( nargs > 1 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'description' ) && !isString( opts.description ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'description', opts.description ) );\n\t\t}\n\t} else {\n\t\topts = {};\n\t}\n\tsetReadOnly( this, '_value', value );\n\tsetReadOnly( this, '_description', opts.description || ( dtype2desc( value ) || '' ) );\n\tsetReadOnly( this, '_char', dtype2char( value ) || '' );\n\tsetReadOnly( this, '_enum', resolveEnum( value ) || -1 );\n\tsetReadOnly( this, '_alignment', dtype2alignment( value ) || -1 );\n\tsetReadOnly( this, '_byteLength', bytesPerElement( value ) || -1 );\n\tsetReadOnly( this, '_byteOrder', 'host' ); // TODO: consider supporting little-endian and big-endian byte orders\n\tsetReadOnly( this, '_type', type );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof DataType\n* @type {string}\n* @default 'DataType'\n*\n* @example\n* var v = DataType.name;\n* // returns 'DataType'\n*/\nsetReadOnly( DataType, 'name', 'DataType' );\n\n/**\n* Alignment (in bytes) for the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a known alignment, the returned value is `-1`.\n*\n* @name alignment\n* @memberof DataType.prototype\n* @readonly\n* @type {integer}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.alignment;\n* // returns 8\n*/\nsetReadOnlyAccessor( DataType.prototype, 'alignment', function get() {\n\treturn this._alignment;\n});\n\n/**\n* Size (in bytes) of the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a known size, the returned value is `-1`.\n*\n* @name byteLength\n* @memberof DataType.prototype\n* @readonly\n* @type {integer}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.byteLength;\n* // returns 8\n*/\nsetReadOnlyAccessor( DataType.prototype, 'byteLength', function get() {\n\treturn this._byteLength;\n});\n\n/**\n* Data type byte order.\n*\n* ## Notes\n*\n* - Potential values:\n*\n* - **host**: host platform byte order.\n* - **little-endian**: little-endian byte order.\n* - **big-endian**: big-endian byte order.\n*\n* @name byteOrder\n* @memberof DataType.prototype\n* @readonly\n* @type {string}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.byteOrder;\n* // returns 'host'\n*/\nsetReadOnlyAccessor( DataType.prototype, 'byteOrder', function get() {\n\treturn this._byteOrder;\n});\n\n/**\n* Single letter character abbreviation for the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a corresponding single letter character abbreviation, the returned value is an empty string.\n*\n* @name char\n* @memberof DataType.prototype\n* @readonly\n* @type {string}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.char;\n* // returns 'd'\n*/\nsetReadOnlyAccessor( DataType.prototype, 'char', function get() {\n\treturn this._char;\n});\n\n/**\n* Data type description.\n*\n* ## Notes\n*\n* - If a data type does not have an associated description, the returned value is an empty string.\n*\n* @name description\n* @memberof DataType.prototype\n* @readonly\n* @type {string}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.description;\n* // returns \n*/\nsetReadOnlyAccessor( DataType.prototype, 'description', function get() {\n\treturn this._description;\n});\n\n/**\n* Enumeration constant for the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a corresponding known enumeration constant, the returned value is `-1`.\n*\n* @name enum\n* @memberof DataType.prototype\n* @readonly\n* @type {integer}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.enum;\n* // returns \n*/\nsetReadOnlyAccessor( DataType.prototype, 'enum', function get() {\n\treturn this._enum;\n});\n\n/**\n* Raw (original) data type value.\n*\n* @name value\n* @memberof DataType.prototype\n* @readonly\n* @type {*}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.value;\n* // returns 'float64'\n*/\nsetReadOnlyAccessor( DataType.prototype, 'value', function get() {\n\treturn this._value;\n});\n\n/**\n* Serializes a data type instance as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `DataType` instance.\n*\n* @name toJSON\n* @memberof DataType.prototype\n* @type {Function}\n* @returns {Object} serialized instance\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var o = dt.toJSON();\n* // returns {...}\n*/\nsetReadOnly( DataType.prototype, 'toJSON', function toJSON() {\n\treturn {\n\t\t'type': 'DataType',\n\t\t'value': this.toString(),\n\t\t'byteOrder': this._byteOrder,\n\t\t'description': this._description\n\t};\n});\n\n/**\n* Serializes a data type instance to a string.\n*\n* @name toString\n* @memberof DataType.prototype\n* @type {Function}\n* @returns {string} serialized string\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.toString();\n* // returns 'float64'\n*/\nsetReadOnly( DataType.prototype, 'toString', function toString() {\n\treturn ( this._type === 'struct' ) ? this._value.layout : String( this._value );\n});\n\n/**\n* Converts a data type instance to a primitive value.\n*\n* @name valueOf\n* @memberof DataType.prototype\n* @type {Function}\n* @returns {string} primitive value\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.valueOf();\n* // returns 'float64'\n*/\nsetReadOnly( DataType.prototype, 'valueOf', function valueOf() {\n\treturn this.toString();\n});\n\n\n// EXPORTS //\n\nexport default DataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping data type strings to descriptions.\n*\n* @private\n* @returns {Object} object mapping data type strings to descriptions\n*/\nfunction table() {\n\treturn {\n\t\t'binary': 'byte',\n\n\t\t'bool': 'boolean',\n\n\t\t'complex32': 'half-precision floating-point complex number',\n\t\t'complex64': 'single-precision floating-point complex number',\n\t\t'complex128': 'double-precision floating-point complex number',\n\n\t\t'float16': 'half-precision floating-point number',\n\t\t'bfloat16': 'brain floating-point number',\n\t\t'float32': 'single-precision floating-point number',\n\t\t'float64': 'double-precision floating-point number',\n\t\t'float128': 'quadruple-precision floating-point number',\n\n\t\t'generic': 'generic array value',\n\n\t\t'int8': 'signed 8-bit integer',\n\t\t'int16': 'signed 16-bit integer',\n\t\t'int32': 'signed 32-bit integer',\n\t\t'int64': 'signed 64-bit integer',\n\t\t'int128': 'signed 128-bit integer',\n\t\t'int256': 'signed 256-bit integer',\n\n\t\t'uint8': 'unsigned 8-bit integer',\n\t\t'uint8c': 'unsigned 8-bit integer (clamped)',\n\t\t'uint16': 'unsigned 16-bit integer',\n\t\t'uint32': 'unsigned 32-bit integer',\n\t\t'uint64': 'unsigned 64-bit integer',\n\t\t'uint128': 'unsigned 128-bit integer',\n\t\t'uint256': 'unsigned 256-bit integer'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default table;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping data type strings to single letter abbreviations.\n*\n* @private\n* @returns {Object} object mapping data type string to single letter abbreviations\n*/\nfunction table() {\n\treturn {\n\t\t'binary': 'r',\n\n\t\t'bool': 'x',\n\n\t\t'complex32': 'j',\n\t\t'complex64': 'c',\n\t\t'complex128': 'z',\n\n\t\t'float16': 'h',\n\t\t'bfloat16': 'e',\n\t\t'float32': 'f',\n\t\t'float64': 'd',\n\t\t'float128': 'g',\n\n\t\t'generic': 'o',\n\n\t\t'int8': 's',\n\t\t'int16': 'k',\n\t\t'int32': 'i',\n\t\t'int64': 'l',\n\t\t'int128': 'm',\n\t\t'int256': 'n',\n\n\t\t'uint8': 'b',\n\t\t'uint8c': 'a',\n\t\t'uint16': 't',\n\t\t'uint32': 'u',\n\t\t'uint64': 'v',\n\t\t'uint128': 'w',\n\t\t'uint256': 'y'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default table;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n\n\n// MAIN //\n\n/**\n* Returns the enumeration constant associated with a supported ndarray data type value.\n*\n* ## Notes\n*\n* - Downstream consumers of this function should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the function should be used in an opaque manner.\n*\n* @param {*} dtype - data type value\n* @returns {(integer|null)} enumeration constant or null\n*\n* @example\n* var v = resolve( 'int8' );\n* // returns \n*/\nfunction resolve( dtype ) {\n\tvar t = ( typeof dtype );\n\tif ( t === 'number' ) {\n\t\treturn ( enum2str( dtype ) ) ? dtype : null;\n\t}\n\tif ( t === 'string' ) {\n\t\treturn str2enum( dtype );\n\t}\n\tif ( t === 'object' && dtype && isInteger( dtype.enum ) ) {\n\t\treturn dtype.enum;\n\t}\n\tif ( isStructConstructorLike( dtype ) ) {\n\t\treturn str2enum( 'userdefined_type' );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default resolve;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping data type strings to alignments (in bytes).\n*\n* @private\n* @returns {Object} object mapping data type string to alignments (in bytes)\n*/\nfunction table() {\n\treturn {\n\t\t'binary': 1,\n\n\t\t'bool': 1,\n\n\t\t'complex32': 2, // same as float16\n\t\t'complex64': 4, // same as float32\n\t\t'complex128': 8, // same as float64\n\n\t\t'float16': 2,\n\t\t'bfloat16': 2,\n\t\t'float32': 4,\n\t\t'float64': 8,\n\t\t'float128': 16,\n\n\t\t'generic': null,\n\n\t\t'int8': 1,\n\t\t'int16': 2,\n\t\t'int32': 4,\n\t\t'int64': 8,\n\t\t'int128': 16,\n\t\t'int256': 32,\n\n\t\t'uint8': 1,\n\t\t'uint8c': 1,\n\t\t'uint16': 2,\n\t\t'uint32': 4,\n\t\t'uint64': 8,\n\t\t'uint128': 16,\n\t\t'uint256': 32\n\t};\n}\n\n\n// EXPORTS //\n\nexport default table;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isDataTypeObject from '@stdlib/ndarray-base-assert-is-data-type-object';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport isFunction from '@stdlib/assert-is-function';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported ndarray struct data type.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported ndarray struct data type\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var Struct = structFactory([\n* {\n* 'name': 'foo',\n* 'type': 'float64'\n* }\n* ]);\n*\n* var bool = isStructDataType( Struct );\n* // returns true\n*\n* bool = isStructDataType( 'binary' );\n* // returns false\n*\n* bool = isStructDataType( 'float32' );\n* // returns false\n*\n* bool = isStructDataType( 'float64' );\n* // returns false\n*\n* bool = isStructDataType( 'generic' );\n* // returns false\n*\n* bool = isStructDataType( 'int16' );\n* // returns false\n*\n* bool = isStructDataType( 'int32' );\n* // returns false\n*\n* bool = isStructDataType( 'int8' );\n* // returns false\n*\n* bool = isStructDataType( 'uint16' );\n* // returns false\n*\n* bool = isStructDataType( 'uint32' );\n* // returns false\n*\n* bool = isStructDataType( 'uint8' );\n* // returns false\n*\n* bool = isStructDataType( 'uint8c' );\n* // returns false\n*\n* bool = isStructDataType( 'foo' );\n* // returns false\n*/\nfunction isStructDataType( value ) {\n\treturn (\n\t\tisFunction( value ) &&\n\t\tisPositiveInteger( value.alignment ) &&\n\t\tisPositiveInteger( value.byteLength ) &&\n\t\tisFunction( value.byteLengthOf ) &&\n\t\tisFunction( value.byteOffsetOf ) &&\n\t\tisFunction( value.bufferOf ) &&\n\t\tisFunction( value.viewOf )\n\t) || (\n\t\tisDataTypeObject( value ) &&\n\t\tisStructDataType( value.value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isStructDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport hasProp from '@stdlib/assert-has-property';\nimport DataType from '@stdlib/ndarray-dtype-ctor';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is an ndarray data type object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether an input value is an ndarray data type object\n*\n* @example\n* import DataType from '@stdlib/ndarray-dtype-ctor';\n*\n* var bool = isDataTypeObject( new DataType( 'float64' ) );\n* // returns true\n*\n* bool = isDataTypeObject( 'float64' );\n* // returns false\n*\n* bool = isDataTypeObject( {} );\n* // returns false\n*/\nfunction isDataTypeObject( value ) {\n\treturn (\n\t\tvalue instanceof DataType ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\tisInteger( value.alignment ) &&\n\t\t\tisInteger( value.byteLength ) &&\n\t\t\tisString( value.byteOrder ) &&\n\t\t\tisString( value.char ) &&\n\t\t\tisInteger( value.enum ) &&\n\t\t\thasProp( value, 'value' )\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isDataTypeObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar isProtoOf = Object.prototype.isPrototypeOf;\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests if an object's prototype chain contains a provided prototype.\n*\n* @param {*} value - value to test\n* @param {(Object|Function)} proto - prototype\n* @throws {TypeError} second argument must be an object and not null\n* @returns {boolean} boolean indicating if a provided prototype exists in a prototype chain\n*\n* @example\n* import inherit from '@stdlib/utils-inherit';\n*\n* function Foo() {\n* return this;\n* }\n*\n* function Bar() {\n* return this;\n* }\n* inherit( Bar, Foo );\n*\n* var bar = new Bar();\n*\n* var bool = isPrototypeOf( bar, Foo.prototype );\n* // returns true\n*/\nfunction isPrototypeOf( value, proto ) { // eslint-disable-line stdlib/no-redeclare\n\tvar type = typeof proto;\n\tif (\n\t\tproto === null ||\n\t\t(type !== 'object' && type !== 'function')\n\t) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be either an object (except null) or a function. Value: `%s`.', proto ) );\n\t}\n\ttype = typeof value;\n\tif (\n\t\tvalue === null ||\n\t\t(type !== 'object' && type !== 'function')\n\t) {\n\t\treturn false;\n\t}\n\treturn isProtoOf.call( proto, value );\n}\n\n\n// EXPORTS //\n\nexport default isPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @module @stdlib/array-buffer\n*\n* @example\n* import ctor from '@stdlib/array-buffer';\n*\n* var buf = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasArrayBufferSupport from '@stdlib/assert-has-arraybuffer-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasArrayBufferSupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport Float64Array from '@stdlib/array-float64';\nimport GlobalArrayBuffer from './arraybuffer.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `ArrayBuffer` support.\n*\n* @returns {boolean} boolean indicating if an environment has `ArrayBuffer` support\n*\n* @example\n* var bool = hasArrayBufferSupport();\n* // returns \n*/\nfunction hasArrayBufferSupport() {\n\tvar bool;\n\tvar view;\n\tvar buf;\n\n\tif ( typeof GlobalArrayBuffer !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tbuf = new GlobalArrayBuffer( 16 );\n\t\tbool = ( isArrayBuffer( buf ) && typeof GlobalArrayBuffer.isView === 'function' );\n\t\tif ( bool ) {\n\t\t\tview = new Float64Array( buf );\n\t\t\tview[ 0 ] = -3.14;\n\t\t\tview[ 1 ] = NaN;\n\t\t\tbool = (\n\t\t\t\tbool &&\n\t\t\t\tGlobalArrayBuffer.isView( view ) &&\n\t\t\t\tbuf.byteLength === 16 &&\n\t\t\t\tview[ 0 ] === -3.14 &&\n\t\t\t\tview[ 1 ] !== view[ 1 ]\n\t\t\t);\n\t\t}\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasArrayBufferSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport getter from '@stdlib/array-base-getter';\nimport setter from '@stdlib/array-base-setter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport accessorSetter from '@stdlib/array-base-accessor-setter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Converts an array-like to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding array meta data to ensure that internal functions operating on arrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **data**: reference to the input array.\n* - **dtype**: array data type.\n* - **accessorProtocol**: `boolean` indicating whether the input array uses accessors for getting and setting elements.\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing array meta data\n*\n* @example\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\nfunction arraylike2object( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn {\n\t\t\t'data': x,\n\t\t\t'dtype': dt,\n\t\t\t'accessorProtocol': true,\n\t\t\t'accessors': [\n\t\t\t\taccessorGetter( dt ),\n\t\t\t\taccessorSetter( dt )\n\t\t\t]\n\t\t};\n\t}\n\treturn {\n\t\t'data': x,\n\t\t'dtype': dt,\n\t\t'accessorProtocol': false,\n\t\t'accessors': [\n\t\t\tgetter( dt ),\n\t\t\tsetter( dt )\n\t\t]\n\t};\n}\n\n\n// EXPORTS //\n\nexport default arraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Object} y - output array object\n* @param {Collection} y.data - output array data\n* @param {Array} y.accessors - array element accessors\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Object} output array object\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var x = {\n* 'data': new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* var y = {\n* 'data': new Complex64Array( [ 5.0, 6.0, 7.0, 8.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* gcopy( x.data.length, x, 1, 0, y, 1, 0 );\n*\n* var view = reinterpret64( y.data, 0 );\n* // view => [ 1.0, 2.0, 3.0, 4.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( ybuf, iy, get( xbuf, ix ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Collection} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\tif ( strideX < 0 ) {\n\t\t\tix = (1-N) * strideX;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\tif ( strideY < 0 ) {\n\t\t\tiy = (1-N) * strideY;\n\t\t} else {\n\t\t\tiy = 0;\n\t\t}\n\t\taccessors( N, ox, strideX, ix, oy, strideY, iy );\n\t\treturn oy.data;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Collection} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn oy.data;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the minimum value.\n*\n* @param {number} x - first number\n* @param {number} y - second number\n* @returns {number} minimum value\n*\n* @example\n* var v = min( 3.14, 4.2 );\n* // returns 3.14\n*\n* @example\n* var v = min( 3.14, NaN );\n* // returns NaN\n*\n* @example\n* var v = min( NaN, 3.14 );\n* // returns 3.14\n*\n* @example\n* var v = min( -0.0, +0.0 );\n* // returns +0.0\n*\n* @example\n* var v = min( +0.0, -0.0 );\n* // returns -0.0\n*/\nfunction min( x, y ) {\n\tif ( x < y ) {\n\t\treturn x;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default min;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas-base-gcopy\n*\n* @example\n* import gcopy from '@stdlib/blas-base-gcopy';\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* import gcopy from '@stdlib/blas-base-gcopy';\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasDataView = ( typeof DataView === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a `DataView`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a DataView\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n* import DataView from '@stdlib/array-dataview';\n*\n* var bool = isDataView( new DataView( new ArrayBuffer( 10 ) ) );\n* // returns true\n*\n* @example\n* var bool = isDataView( [] );\n* // returns false\n*/\nfunction isDataView( value ) {\n\treturn (\n\t\t( hasDataView && value instanceof DataView ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object DataView]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isDataView;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof DataView === 'function' ) ? DataView : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof DataView === 'function' ) ? DataView : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor which returns a data view representing a provided array buffer.\n*\n* @module @stdlib/array-dataview\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n* import DataView from '@stdlib/array-dataview';\n*\n* var buf = new ArrayBuffer( 10 );\n* // returns \n*\n* var dv = new DataView( buf );\n* // returns \n*/\n\n// MODULES //\n\nimport hasDataViewSupport from '@stdlib/assert-has-dataview-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasDataViewSupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isDataView from '@stdlib/assert-is-dataview';\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport GlobalDataView from './dataview.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `DataView` support.\n*\n* @returns {boolean} boolean indicating if an environment has `DataView` support\n*\n* @example\n* var bool = hasDataViewSupport();\n* // returns \n*/\nfunction hasDataViewSupport() {\n\tvar bool;\n\tvar view;\n\tvar buf;\n\n\tif ( typeof GlobalDataView !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tbuf = new ArrayBuffer( 24 );\n\t\tview = new GlobalDataView( buf, 8 );\n\t\tbool = ( isDataView( view ) && typeof view.getFloat64 === 'function' && typeof view.setFloat64 === 'function' );\n\t\tif ( bool ) {\n\t\t\tview.setFloat64( 0, -3.14 );\n\t\t\tview.setFloat64( 8, NaN );\n\t\t\tbool = (\n\t\t\t\tbool &&\n\t\t\t\tview.buffer === buf &&\n\t\t\t\tview.byteLength === 16 &&\n\t\t\t\tview.byteOffset === 8 &&\n\t\t\t\tview.getFloat64( 0 ) === -3.14 &&\n\t\t\t\tview.getFloat64( 8 ) !== view.getFloat64( 8 )\n\t\t\t);\n\t\t}\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasDataViewSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Constructor which returns a data view representing a provided array buffer.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Define a property name which is unlikely to be used in end user code:\nvar PRIVATE_BUFFER = '__@@##$$@@__struct_buffer__@@$$##@@__';\n\n\n// EXPORTS //\n\nexport default PRIVATE_BUFFER;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar CTOR_NAME = 'Struct';\n\n\n// EXPORTS //\n\nexport default CTOR_NAME;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadWriteAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnlyAccessor( obj, prop, getter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadOnlyAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setReadWriteAccessor( obj, prop, getter, setter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadWriteAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar DATA_VIEW_METHODS = {\n\t'int8': {\n\t\t'get': 'getInt8',\n\t\t'set': 'setInt8'\n\t},\n\t'int16': {\n\t\t'get': 'getInt16',\n\t\t'set': 'setInt16'\n\t},\n\t'int32': {\n\t\t'get': 'getInt32',\n\t\t'set': 'setInt32'\n\t},\n\t'int64': {\n\t\t'get': 'getBigInt64',\n\t\t'set': 'setBigInt64'\n\t},\n\t'uint8': {\n\t\t'get': 'getUint8',\n\t\t'set': 'setUint8'\n\t},\n\t'uint16': {\n\t\t'get': 'getUint16',\n\t\t'set': 'setUint16'\n\t},\n\t'uint32': {\n\t\t'get': 'getUint32',\n\t\t'set': 'setUint32'\n\t},\n\t'uint64': {\n\t\t'get': 'getBigUint64',\n\t\t'set': 'setBigUint64'\n\t},\n\t'float16': {\n\t\t'get': 'getFloat16',\n\t\t'set': 'setFloat16'\n\t},\n\t'float32': {\n\t\t'get': 'getFloat32',\n\t\t'set': 'setFloat32'\n\t},\n\t'float64': {\n\t\t'get': 'getFloat64',\n\t\t'set': 'setFloat64'\n\t},\n\t'complex32': {\n\t\t'get': 'getFloat16',\n\t\t'set': 'setFloat16'\n\t},\n\t'complex64': {\n\t\t'get': 'getFloat32',\n\t\t'set': 'setFloat32'\n\t},\n\t'complex128': {\n\t\t'get': 'getFloat64',\n\t\t'set': 'setFloat64'\n\t},\n\t'bool': {\n\t\t'get': 'getUint8',\n\t\t'set': 'setUint8'\n\t}\n};\n\n\n// EXPORTS //\n\nexport default DATA_VIEW_METHODS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from './ctors.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an environment is little endian.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment is little endian\n*\n* @example\n* var bool = isLittleEndian();\n* // returns \n*/\nfunction isLittleEndian() {\n\tvar uint16view;\n\tvar uint8view;\n\n\tuint16view = new ctors[ 'uint16' ]( 1 );\n\n\t/*\n\t* Set the uint16 view to a value having distinguishable lower and higher order words.\n\t*\n\t* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)\n\t*/\n\tuint16view[ 0 ] = 0x1234;\n\n\t// Create a uint8 view on top of the uint16 buffer:\n\tuint8view = new ctors[ 'uint8' ]( uint16view.buffer );\n\n\t// If little endian, the least significant byte will be first...\n\treturn ( uint8view[ 0 ] === 0x34 );\n}\n\n\n// MAIN //\n\nbool = isLittleEndian();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint16Array from '@stdlib/array-uint16';\n\n\n// MAIN //\n\nvar ctors = {\n\t'uint16': Uint16Array,\n\t'uint8': Uint8Array\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex64 from '@stdlib/complex-float32-ctor';\nimport Complex128 from '@stdlib/complex-float64-ctor';\n\n\n// MAIN //\n\n// Mapping from data types to constructors...\nvar ctors = {\n\t'complex64': Complex64,\n\t'complex128': Complex128\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport table from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns a complex number constructor.\n*\n* @param {string} dtype - data type\n* @returns {(Function|null)} constructor or null\n*\n* @example\n* var ctor = ctors( 'complex128' );\n* // returns \n*\n* @example\n* var ctor = ctors( 'complex' );\n* // returns null\n*/\nfunction ctors( dtype ) {\n\treturn table[ dtype ] || null;\n}\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from '@stdlib/complex-ctors';\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar TABLE = {\n\t'float64': 'complex128',\n\t'float32': 'complex64'\n};\nvar DEFAULT_CTOR = ctors( TABLE[ 'float64' ] );\n\n\n// MAIN //\n\n/**\n* Creates a complex number.\n*\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @param {string} [dtype=\"float64\"] - data type\n* @throws {TypeError} must provide a recognized data type\n* @returns {Complex} complex number\n*\n* @example\n* var z = complex( 5.0, 3.0, 'float64' );\n* // returns \n*/\nfunction complex( real, imag, dtype ) {\n\tvar ctor;\n\tif ( arguments.length > 2 ) {\n\t\tctor = ctors( TABLE[ dtype ] );\n\t\tif ( ctor ) {\n\t\t\treturn new ctor( real, imag );\n\t\t}\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized data type. Value: `%s`.', dtype ) );\n\t}\n\treturn new DEFAULT_CTOR( real, imag );\n}\n\n\n// EXPORTS //\n\nexport default complex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport complex from '@stdlib/complex-cmplx';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// VARIABLES //\n\nvar CMPLX_TO_REAL = {\n\t'complex128': 'float64',\n\t'complex64': 'float32',\n\t'complex32': 'float16'\n};\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for resolving field data\n*/\nfunction getComplex( obj, method ) {\n\treturn getter;\n\n\t/**\n\t* Reads a complex number from an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {Complex} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\tvar re = view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );\n\t\tvar im = view[ method ]( obj.byteOffset+(obj.byteLength/2), IS_LITTLE_ENDIAN );\n\t\treturn complex( re, im, CMPLX_TO_REAL[ obj.type ] );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getComplex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Int16Array from '@stdlib/array-int16';\nimport Int32Array from '@stdlib/array-int32';\nimport Int8Array from '@stdlib/array-int8';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\n// Mapping from data types to constructors...\nvar ctors = {\n\t'float64': Float64Array,\n\t'float32': Float32Array,\n\t'int16': Int16Array,\n\t'int32': Int32Array,\n\t'int8': Int8Array,\n\t'uint16': Uint16Array,\n\t'uint32': Uint32Array,\n\t'uint8': Uint8Array,\n\t'uint8c': Uint8ClampedArray,\n\t'complex64': Complex64Array,\n\t'complex128': Complex128Array,\n\t'bool': BooleanArray\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport table from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns a typed array constructor.\n*\n* @param {string} dtype - data type\n* @returns {(Function|null)} constructor or null\n*\n* @example\n* var ctor = ctors( 'float64' );\n* // returns \n*\n* @example\n* var ctor = ctors( 'float' );\n* // returns null\n*/\nfunction ctors( dtype ) {\n\treturn table[ dtype ] || null;\n}\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `BooleanArray` as a `Uint8Array`.\n*\n* @param {BooleanArray} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Uint8Array} `Uint8Array` view\n*\n* @example\n* import BooleanArray from '@stdlib/array-bool';\n*\n* var x = new BooleanArray( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Uint8Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default array settings.\n*\n* @returns {Object} defaults\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t// Data types:\n\t\t'dtypes': {\n\t\t\t'default': 'float64',\n\t\t\t'numeric': 'float64',\n\t\t\t'real': 'float64',\n\t\t\t'floating_point': 'float64',\n\t\t\t'real_floating_point': 'float64',\n\t\t\t'complex_floating_point': 'complex128',\n\t\t\t'integer': 'int32',\n\t\t\t'signed_integer': 'int32',\n\t\t\t'unsigned_integer': 'uint32',\n\t\t\t'boolean': 'bool',\n\t\t\t'index': 'int32',\n\t\t\t'integer_index': 'int32',\n\t\t\t'boolean_index': 'bool',\n\t\t\t'mask_index': 'uint8'\n\t\t}\n\t};\n}\n\n\n// EXPORTS //\n\nexport default defaults;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defaults from './main.js';\n\n\n// VARIABLES //\n\nvar DEFAULTS = defaults();\nvar HASH = {\n\t'dtypes.default': DEFAULTS.dtypes.default,\n\t'dtypes.numeric': DEFAULTS.dtypes.numeric,\n\t'dtypes.real': DEFAULTS.dtypes.real,\n\t'dtypes.floating_point': DEFAULTS.dtypes.floating_point,\n\t'dtypes.real_floating_point': DEFAULTS.dtypes.real_floating_point,\n\t'dtypes.complex_floating_point': DEFAULTS.dtypes.complex_floating_point,\n\t'dtypes.integer': DEFAULTS.dtypes.integer,\n\t'dtypes.signed_integer': DEFAULTS.dtypes.signed_integer,\n\t'dtypes.unsigned_integer': DEFAULTS.dtypes.unsigned_integer,\n\t'dtypes.boolean': DEFAULTS.dtypes.boolean,\n\t'dtypes.index': DEFAULTS.dtypes.index,\n\t'dtypes.integer_index': DEFAULTS.dtypes.integer_index,\n\t'dtypes.boolean_index': DEFAULTS.dtypes.boolean_index,\n\t'dtypes.mask_index': DEFAULTS.dtypes.mask_index\n};\n\n\n// MAIN //\n\n/**\n* Returns a default array setting.\n*\n* @param {string} name - setting name\n* @returns {*} default setting or null\n*\n* @example\n* var v = get( 'dtypes.default' );\n* // returns \n*/\nfunction get( name ) {\n\tvar v = HASH[ name ];\n\treturn ( v === void 0 ) ? null : v;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return default array settings.\n*\n* @module @stdlib/array-defaults\n*\n* @example\n* import defaults from '@stdlib/array-defaults';\n*\n* var o = defaults();\n* // returns {...}\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport get from './get.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'get', get );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport ctors from '@stdlib/array-typed-ctors';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport defaults from '@stdlib/array-defaults';\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar DEFAULT_DTYPE = defaults.get( 'dtypes.default' );\nvar Complex64Array = ctors( 'complex64' );\nvar Complex128Array = ctors( 'complex128' );\nvar BooleanArray = ctors( 'bool' );\n\n\n// MAIN //\n\n/**\n* Creates a typed array.\n*\n* @param {(NonNegativeInteger|ComplexArray|TypedArray|ArrayLikeObject|ArrayBuffer)} [arg] - a length, typed array, array-like object, or buffer\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @param {string} [dtype=\"float64\"] - data type\n* @throws {TypeError} must provide a recognized data type\n* @returns {(ComplexArray|TypedArray)} typed array\n*\n* @example\n* var arr = typedarray();\n* // returns \n*\n* @example\n* var arr = typedarray( 2 );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* var arr = typedarray( 2, 'float32' );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* var arr = typedarray( [ 0.5, 0.5 ] );\n* // returns [ 0.5, 0.5 ]\n*\n* @example\n* var arr = typedarray( [ 5, -3 ], 'int32' );\n* // returns [ 5, -3 ]\n*\n* @example\n* var arr1 = typedarray( [ 5, 3 ], 'int32' );\n* var arr2 = typedarray( arr1 );\n* // returns [ 5.0, 3.0 ]\n*\n* @example\n* var arr1 = typedarray( [ 5, 3 ], 'int32' );\n* var arr2 = typedarray( arr1, 'uint32' );\n* // returns [ 5, 3 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf, 'float32' );\n* // returns [ 0.0, 0.0, 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf, 8 );\n* // returns [ 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf, 8, 'float32' );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = typedarray( buf, 8, 2 );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = typedarray( buf, 8, 2, 'int32' );\n* // returns [ 0, 0 ]\n*/\nfunction typedarray() {\n\tvar nargs;\n\tvar dtype;\n\tvar ctor;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( nargs && isString( arguments[ nargs-1 ] ) ) {\n\t\tnargs -= 1;\n\t\tdtype = arguments[ nargs ];\n\t} else {\n\t\tdtype = DEFAULT_DTYPE;\n\t}\n\tctor = ctors( dtype );\n\tif ( ctor === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized data type. Value: `%s`.', dtype ) );\n\t}\n\tif ( nargs <= 0 ) {\n\t\treturn new ctor( 0 );\n\t}\n\tif ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\n\t\t// Note: the following checks are not particularly robust, as `instanceof` will fail for cross-realm instances...\n\t\tif ( arg instanceof Complex64Array ) {\n\t\t\targ = reinterpret64( arg, 0 );\n\t\t} else if ( arg instanceof Complex128Array ) {\n\t\t\targ = reinterpret128( arg, 0 );\n\t\t} else if ( arg instanceof BooleanArray ) {\n\t\t\targ = reinterpretBoolean( arg, 0 );\n\t\t}\n\t\treturn new ctor( arg );\n\t}\n\tif ( nargs === 2 ) {\n\t\treturn new ctor( arguments[0], arguments[1] );\n\t}\n\treturn new ctor( arguments[0], arguments[1], arguments[2] );\n}\n\n\n// EXPORTS //\n\nexport default typedarray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\nimport DATA_VIEW_METHODS from './data_view_methods.js';\nimport getNumber from './get_number.js';\nimport getBoolean from './get_boolean.js';\nimport getComplex from './get_complex.js';\nimport getBigInt from './get_bigint.js';\nimport getStruct from './get_struct.js';\nimport getTypedArray from './get_typedarray.js';\nimport getStructArray from './get_struct_array.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @throws {Error} unexpected error\n* @returns {Function} function for resolving field data\n*/\nfunction getter( obj ) {\n\tif ( obj.length ) {\n\t\tif ( obj.isStructType ) {\n\t\t\treturn getStructArray( obj );\n\t\t}\n\t\treturn getTypedArray( obj );\n\t}\n\tswitch ( obj.type ) {\n\tcase 'float64':\n\tcase 'float32':\n\tcase 'float16':\n\tcase 'int8':\n\tcase 'int16':\n\tcase 'int32':\n\tcase 'uint8':\n\tcase 'uint16':\n\tcase 'uint32':\n\t\treturn getNumber( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tcase 'int64':\n\tcase 'uint64':\n\t\treturn getBigInt( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tcase 'bool':\n\t\treturn getBoolean( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tcase 'complex128':\n\tcase 'complex64':\n\tcase 'complex32':\n\t\treturn getComplex( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tdefault:\n\t\tif ( obj.isStructType ) {\n\t\t\treturn getStruct( obj );\n\t\t}\n\t\t// Ensure that we fail loudly if we have failed to add support for newly added data types:\n\t\tthrow new Error( format( 'unexpected error. Unrecognized data type. Value: `%s`.', obj.type ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for resolving field data\n*/\nfunction getStructArray( obj ) {\n\treturn getter;\n\n\t/**\n\t* Returns a list of `struct` views of an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {Array} result\n\t*/\n\tfunction getter() {\n\t\tvar offset;\n\t\tvar view;\n\t\tvar out;\n\t\tvar i;\n\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\toffset = view.byteOffset + obj.byteOffset;\n\t\tout = [];\n\t\tfor ( i = 0; i < obj.length; i++ ) {\n\t\t\tout.push( new obj.type( view.buffer, offset, obj.byteLength ) );\n\t\t\toffset += obj.byteOffset;\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getStructArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport typedarray from '@stdlib/array-typed';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for resolving field data\n*/\nfunction getTypedArray( obj ) {\n\treturn getter;\n\n\t/**\n\t* Returns a typed array view of an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {TypedArray} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn typedarray( view.buffer, view.byteOffset+obj.byteOffset, obj.length, obj.type ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for resolving field data\n*/\nfunction getBigInt( obj, method ) {\n\treturn getter;\n\n\t/**\n\t* Reads a BigInt value from an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {BigInt} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport Boolean from '@stdlib/boolean-ctor';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for resolving field data\n*/\nfunction getBoolean( obj, method ) {\n\treturn getter;\n\n\t/**\n\t* Reads a boolean value from an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {boolean} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn Boolean( view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for resolving field data\n*/\nfunction getStruct( obj ) {\n\treturn getter;\n\n\t/**\n\t* Returns a `struct` view of an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {Object} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn new obj.type( view.buffer, view.byteOffset+obj.byteOffset, obj.byteLength ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getStruct;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport replace from '@stdlib/string-base-replace';\nimport DTYPES from './dtypes.json';\n\n\n// VARIABLES //\n\nvar RE_SUFFIX = /_and_generic$/;\n\n\n// MAIN //\n\n/**\n* Returns a list of array data types.\n*\n* @param {string} [kind] - data type kind\n* @returns {StringArray} list of array data types\n*\n* @example\n* var list = dtypes();\n* // e.g., returns [ 'float32', 'float64', ... ]\n*\n* @example\n* var list = dtypes( 'floating_point' );\n* // returns [...]\n*/\nfunction dtypes() {\n\tvar kind;\n\tvar out;\n\tvar FLG;\n\tif ( arguments.length === 0 ) {\n\t\treturn DTYPES.all.slice();\n\t}\n\tFLG = false;\n\tkind = arguments[ 0 ];\n\tif ( RE_SUFFIX.test( kind ) ) {\n\t\tkind = replace( kind, RE_SUFFIX, '' );\n\t\tif ( kind !== 'all' && kind !== 'index' ) {\n\t\t\tFLG = true;\n\t\t}\n\t}\n\tout = DTYPES[ kind ];\n\tout = ( out ) ? out.slice() : [];\n\tif ( FLG && out.length > 0 ) {\n\t\tout.push( 'generic' );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array real-valued floating-point data type.\n*\n* @name isRealFloatingPointDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array real-valued floating-point data type\n*\n* @example\n* var bool = isRealFloatingPointDataType( 'float32' );\n* // returns true\n*\n* bool = isRealFloatingPointDataType( 'float64' );\n* // returns true\n*\n* bool = isRealFloatingPointDataType( 'generic' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'int16' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'int32' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'int8' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint16' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint32' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint8' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint8c' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'foo' );\n* // returns false\n*/\nvar isRealFloatingPointDataType = contains( dtypes( 'real_floating_point' ) ); // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default isRealFloatingPointDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array signed integer data type.\n*\n* @name isSignedIntegerDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array signed integer data type\n*\n* @example\n* var bool = isSignedIntegerDataType( 'float32' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'float64' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'generic' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'int16' );\n* // returns true\n*\n* bool = isSignedIntegerDataType( 'int32' );\n* // returns true\n*\n* bool = isSignedIntegerDataType( 'int8' );\n* // returns true\n*\n* bool = isSignedIntegerDataType( 'uint16' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'uint32' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'uint8' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'uint8c' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'foo' );\n* // returns false\n*/\nvar isSignedIntegerDataType = contains( dtypes( 'signed_integer' ) );\n\n\n// EXPORTS //\n\nexport default isSignedIntegerDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getGlobal from '@stdlib/utils-global';\n\n\n// VARIABLES //\n\nvar Global = getGlobal();\n\n\n// MAIN //\n\n/**\n* Tests for native `BigInt` support.\n*\n* @returns {boolean} boolean indicating if an environment has `BigInt` support\n*\n* @example\n* var bool = hasBigIntSupport();\n* // returns \n*/\nfunction hasBigIntSupport() {\n\treturn (\n\t\ttypeof Global.BigInt === 'function' &&\n\t\ttypeof BigInt === 'function' && // eslint-disable-line stdlib/require-globals\n\t\ttypeof Global.BigInt( '1' ) === 'bigint' &&\n\t\ttypeof BigInt( '1' ) === 'bigint' // eslint-disable-line stdlib/require-globals, no-undef, stdlib/no-builtin-big-int\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasBigIntSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a BigInt primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a BigInt primitive\n*/\nfunction isBigInt( value ) {\n\treturn ( typeof value === 'bigint' );\n}\n\n\n// EXPORTS //\n\nexport default isBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\nimport test from './try2valueof.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a BigInt object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a BigInt object\n*/\nfunction BigInt( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tnativeClass( value ) === '[object BigInt]' &&\n\t\ttest( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default BigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Attempts to call a `BigInt` method.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if able to call a `BigInt` method\n*/\nfunction test( value ) {\n\ttry {\n\t\treturn (\n\t\t\t// Objects created via `Object.create( null )` have no `valueOf()` method:\n\t\t\ttypeof value.valueOf() === 'bigint'\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a BigInt.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a BigInt\n*/\nfunction isBigInt( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Creates a function which always returns the same value.\n*\n* @param {*} [value] - value to always return\n* @returns {Function} constant function\n*\n* @example\n* var fcn = wrap( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\nfunction wrap( value ) {\n\treturn constantFunction;\n\n\t/**\n\t* Constant function.\n\t*\n\t* @private\n\t* @returns {*} constant value\n\t*/\n\tfunction constantFunction() {\n\t\treturn value;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport isSymbol from './generic.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( isSymbol, 'isPrimitive', isPrimitive );\nsetReadOnly( isSymbol, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default isSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport constantFunction from '@stdlib/utils-constant-function';\n\n\n// MAIN //\n\nvar isBigInt = constantFunction( false );\nvar isPrimitive = constantFunction( false );\nvar isObject = constantFunction( false );\n\nsetReadOnly( isBigInt, 'isPrimitive', isPrimitive );\nsetReadOnly( isBigInt, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default isBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a BigInt.\n*\n* @module @stdlib/assert-is-bigint\n*\n* @example\n* import BigInt from '@stdlib/bigint-ctor';\n* import isBigInt from '@stdlib/assert-is-bigint';\n*\n* var bool = isBigInt( BigInt( '1' ) );\n* // returns true\n*\n* bool = isBigInt( Object( BigInt( '1' ) ) );\n* // returns true\n*\n* bool = isBigInt( {} );\n* // returns false\n*\n* @example\n* import { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\n*\n* var bool = isBigInt( BigInt( '1' ) );\n* // returns true\n*\n* bool = isBigInt( Object( BigInt( '1' ) ) );\n* // returns false\n*\n* bool = isBigInt( {} );\n* // returns false\n*\n* @example\n* import { isObject as isBigIntObject } from '@stdlib/assert-is-bigint';\n*\n* var bool = isBigIntObject( BigInt( '1' ) );\n* // returns false\n*\n* bool = isBigIntObject( Object( BigInt( '1' ) ) );\n* // returns true\n*\n* bool = isBigIntObject( {} );\n* // returns false\n*/\n\n// MODULES //\n\nimport hasBigInts from '@stdlib/assert-has-bigint-support';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar isBigInt;\nif ( hasBigInts() ) {\n\tisBigInt = main;\n} else {\n\tisBigInt = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default isBigInt;\n\n// exports: { \"isPrimitive\": \"isBigInt.isPrimitive\", \"isObject\": \"isBigInt.isObject\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport SAFE_CASTS from './safe_casts.json';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast.\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = safeCasts( 'float32' );\n* // returns [...]\n*/\nfunction safeCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default safeCasts;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport safeCasts from '@stdlib/ndarray-safe-casts';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// VARIABLES //\n\nvar TABLE = safeCasts();\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be safely cast to another ndarray data type.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @returns {boolean} boolean indicating if a data type can be safely cast to another data type\n*\n* @example\n* var bool = isSafeCast( 'float32', 'float64' );\n* // returns true\n*\n* bool = isSafeCast( 'float64', 'int32' );\n* // returns false\n*/\nfunction isSafeCast( from, to ) {\n\tvar t;\n\tfrom = resolveStr( from );\n\tto = resolveStr( to );\n\tif ( from === to ) { // note: for \"struct\" data types, require strict equality to be considered a safe cast\n\t\treturn true;\n\t}\n\tt = TABLE[ from ];\n\tif ( t ) {\n\t\treturn t[ to ] > 0;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isSafeCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport CASTS from './data.json';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast and, for floating-point data types, can be downcast.\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = mostlySafeCasts( 'float32' );\n* // returns [...]\n*/\nfunction mostlySafeCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default mostlySafeCasts;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport casts from '@stdlib/ndarray-mostly-safe-casts';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// VARIABLES //\n\nvar TABLE = casts();\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be safely cast or, for floating-point data types, downcast to another ndarray data type.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @returns {boolean} boolean indicating if a data type can be cast to another data type\n*\n* @example\n* var bool = isMostlySafeCast( 'float32', 'float64' );\n* // returns true\n*\n* bool = isMostlySafeCast( 'float64', 'int32' );\n* // returns false\n*/\nfunction isMostlySafeCast( from, to ) {\n\tvar t;\n\tfrom = resolveStr( from );\n\tto = resolveStr( to );\n\tif ( from === to ) { // note: for \"struct\" data types, require strict equality to be considered a \"mostly\" safe cast\n\t\treturn true;\n\t}\n\tt = TABLE[ from ];\n\tif ( t ) {\n\t\treturn t[ to ] > 0;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isMostlySafeCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport SAME_KIND_CASTS from './same_kind_casts.json';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of same \"kind\" casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAME_KIND_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAME_KIND_CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of same \"kind\" casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAME_KIND_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAME_KIND_CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast or cast within the same \"kind\".\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = sameKindCasts( 'float32' );\n* // returns [...]\n*/\nfunction sameKindCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default sameKindCasts;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport sameKindCasts from '@stdlib/ndarray-same-kind-casts';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// VARIABLES //\n\nvar TABLE = sameKindCasts();\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be safely cast to, or is of the same \"kind\" as, another ndarray data type.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @returns {boolean} boolean indicating if a data type can be cast to another data type\n*\n* @example\n* var bool = isSameKindCast( 'float32', 'float64' );\n* // returns true\n*\n* bool = isSameKindCast( 'uint16', 'int16' );\n* // returns false\n*/\nfunction isSameKindCast( from, to ) {\n\tvar t;\n\tfrom = resolveStr( from );\n\tto = resolveStr( to );\n\tif ( from === to ) { // note: for \"struct\" data types, require strict equality to be considered a safe cast\n\t\treturn true;\n\t}\n\tt = TABLE[ from ];\n\tif ( t ) {\n\t\treturn t[ to ] > 0;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isSameKindCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSafeCast from '@stdlib/ndarray-base-assert-is-safe-data-type-cast';\nimport isMostlySafeCast from '@stdlib/ndarray-base-assert-is-mostly-safe-data-type-cast';\nimport isSameKindCast from '@stdlib/ndarray-base-assert-is-same-kind-data-type-cast';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be cast to another ndarray data type according to a specified casting mode.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @param {string} casting - ndarray casting mode\n* @returns {boolean} boolean indicating if a data type can be cast to another data type\n*\n* @example\n* var bool = isAllowedCast( 'float32', 'float64', 'safe' );\n* // returns true\n*\n* bool = isAllowedCast( 'float64', 'int32', 'safe' );\n* // returns false\n*/\nfunction isAllowedCast( from, to, casting ) {\n\tvar dt1;\n\tvar dt2;\n\n\t// Anything goes for \"unsafe\" casting...\n\tif ( casting === 'unsafe' ) {\n\t\treturn true;\n\t}\n\tdt1 = resolveStr( from );\n\tdt2 = resolveStr( to );\n\n\t// \"Casting\" to the same data type is always allowed, regardless of the casting mode...\n\tif ( dt1 === dt2 ) {\n\t\treturn true;\n\t}\n\t// No casts between different data types are allowed in \"none\" or \"equiv\" casting modes...\n\tif ( casting === 'none' || casting === 'equiv' ) {\n\t\treturn false;\n\t}\n\t// In \"safe\" casting mode, only casts which preserve values are allowed...\n\tif ( casting === 'safe' ) {\n\t\treturn isSafeCast( from, to );\n\t}\n\t// In \"mostly-safe\" casting mode, in addition to \"safe\" casts, for floating-point data types, downcasts are allowed...\n\tif ( casting === 'mostly-safe' ) {\n\t\treturn isMostlySafeCast( from, to );\n\t}\n\t// In \"same-kind\" casting mode, in addition to \"safe\" casts, casts within a \"kind\" (e.g., between signed integers or between floating-point numbers) are allowed...\n\treturn isSameKindCast( from, to );\n}\n\n\n// EXPORTS //\n\nexport default isAllowedCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Smallest positive single-precision floating-point subnormal number.\n*\n* @module @stdlib/constants-float32-smallest-subnormal\n* @type {number}\n*\n* @example\n* import FLOAT32_SMALLEST_SUBNORMAL from '@stdlib/constants-float32-smallest-subnormal';\n* // returns 1.401298464324817e-45\n*/\n\n\n// MAIN //\n\n/**\n* Smallest positive single-precision floating-point subnormal number.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* \\frac{1}{2^{127-1} 2^{23}}\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000 00000000000000000000001\n* ```\n*\n* @constant\n* @type {number}\n* @default 1.401298464324817e-45\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT32_SMALLEST_SUBNORMAL = 1.401298464324817e-45;\n\n\n// EXPORTS //\n\nexport default FLOAT32_SMALLEST_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum safe single-precision floating-point integer.\n*\n* @module @stdlib/constants-float32-max-safe-integer\n* @type {number}\n*\n* @example\n* import FLOAT32_MAX_SAFE_INTEGER from '@stdlib/constants-float32-max-safe-integer';\n* // returns 16777215\n*/\n\n\n// MAIN //\n\n/**\n* Maximum safe single-precision floating-point integer.\n*\n* ## Notes\n*\n* The maximum safe integer is given by\n*\n* ```tex\n* 2^{24} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 16777215\n* @see [Safe Integers]{@link http://www.2ality.com/2013/10/safe-integers.html}\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT32_MAX_SAFE_INTEGER = 16777215;\n\n\n// EXPORTS //\n\nexport default FLOAT32_MAX_SAFE_INTEGER;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum safe single-precision floating-point integer.\n*\n* @module @stdlib/constants-float32-min-safe-integer\n* @type {number}\n*\n* @example\n* import FLOAT32_MIN_SAFE_INTEGER from '@stdlib/constants-float32-min-safe-integer';\n* // returns -16777215\n*/\n\n\n// MAIN //\n\n/**\n* Minimum safe single-precision floating-point integer.\n*\n* ## Notes\n*\n* The minimum safe integer is given by\n*\n* ```tex\n* -(2^{24} - 1)\n* ```\n*\n* @constant\n* @type {number}\n* @default -16777215\n* @see [Safe Integers]{@link http://www.2ality.com/2013/10/safe-integers.html}\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT32_MIN_SAFE_INTEGER = -16777215;\n\n\n// EXPORTS //\n\nexport default FLOAT32_MIN_SAFE_INTEGER;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isNegativeZero from '@stdlib/math-base-assert-is-negative-zero';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport FLOAT32_SMALLEST_SUBNORMAL from '@stdlib/constants-float32-smallest-subnormal'; // eslint-disable-line id-length\nimport FLOAT32_MAX_SAFE_INTEGER from '@stdlib/constants-float32-max-safe-integer';\nimport FLOAT32_MIN_SAFE_INTEGER from '@stdlib/constants-float32-min-safe-integer';\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\n\n\n// FUNCTIONS //\n\n/**\n* Returns the minimum floating-point array data type of the closest \"kind\" necessary for storing a provided scalar.\n*\n* @private\n* @param {number} value - real value\n* @returns {string} array data type\n*/\nfunction minFloatDataType( value ) {\n\tif ( value !== value || value === PINF || value === NINF ) {\n\t\treturn 'float32';\n\t}\n\tif ( isInteger( value ) ) {\n\t\tif ( value >= FLOAT32_MIN_SAFE_INTEGER && value <= FLOAT32_MAX_SAFE_INTEGER ) { // eslint-disable-line max-len\n\t\t\treturn 'float32';\n\t\t}\n\t\treturn 'float64';\n\t}\n\t// Assume that if we are provided a tiny value, we don't want to underflow to zero by storing as `float32`...\n\tif (\n\t\tvalue > -FLOAT32_SMALLEST_SUBNORMAL &&\n\t\tvalue < FLOAT32_SMALLEST_SUBNORMAL\n\t) {\n\t\treturn 'float64';\n\t}\n\t// Any number which reaches this point is less than the maximum single-precision floating-point number, as floating-point format supports a limited number of decimals (e.g., (1.0+EPS)*10**15 => 1000000000000000.2, which is less than ~3.4e38)...\n\treturn 'float32';\n}\n\n\n// MAIN //\n\n/**\n* Returns the minimum array data type of the closest \"kind\" necessary for storing a provided scalar value.\n*\n* @param {*} value - scalar value\n* @returns {string} array data type\n*\n* @example\n* var dt = minDataType( 3.141592653589793 );\n* // returns 'float32'\n*\n* @example\n* var dt = minDataType( 3 );\n* // returns 'uint8'\n*/\nfunction minDataType( value ) {\n\tif ( !isNumber( value ) ) {\n\t\tif ( isBoolean( value ) ) {\n\t\t\treturn 'bool';\n\t\t}\n\t\tif ( isComplexLike( value ) ) {\n\t\t\tif ( minFloatDataType( value.re ) === 'float64' || minFloatDataType( value.im ) === 'float64' ) {\n\t\t\t\treturn 'complex128';\n\t\t\t}\n\t\t\treturn 'complex64';\n\t\t}\n\t\treturn 'generic';\n\t}\n\tif ( value !== value || value === PINF || value === NINF ) {\n\t\treturn 'float32';\n\t}\n\tif ( isInteger( value ) ) {\n\t\tif ( value === 0 && isNegativeZero( value ) ) {\n\t\t\treturn 'float32';\n\t\t}\n\t\tif ( value < 0 ) {\n\t\t\tif ( value >= INT8_MIN ) {\n\t\t\t\treturn 'int8';\n\t\t\t}\n\t\t\tif ( value >= INT16_MIN ) {\n\t\t\t\treturn 'int16';\n\t\t\t}\n\t\t\tif ( value >= INT32_MIN ) {\n\t\t\t\treturn 'int32';\n\t\t\t}\n\t\t\treturn 'float64';\n\t\t}\n\t\tif ( value <= UINT8_MAX ) {\n\t\t\treturn 'uint8';\n\t\t}\n\t\tif ( value <= UINT16_MAX ) {\n\t\t\treturn 'uint16';\n\t\t}\n\t\tif ( value <= UINT32_MAX ) {\n\t\t\treturn 'uint32';\n\t\t}\n\t\treturn 'float64';\n\t}\n\t// Assume that if we are provided a tiny value, we don't want to underflow to zero by storing as `float32`...\n\tif (\n\t\tvalue > -FLOAT32_SMALLEST_SUBNORMAL &&\n\t\tvalue < FLOAT32_SMALLEST_SUBNORMAL\n\t) {\n\t\treturn 'float64';\n\t}\n\t// Any number which reaches this point is less than the maximum single-precision floating-point number, as floating-point format supports a limited number of decimals (e.g., (1.0+EPS)*10**15 => 1000000000000000.2, which is less than ~3.4e38)...\n\treturn 'float32';\n}\n\n\n// EXPORTS //\n\nexport default minDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport NINF from '@stdlib/constants-float64-ninf';\n\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is negative zero.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is negative zero\n*\n* @example\n* var bool = isNegativeZero( -0.0 );\n* // returns true\n*\n* @example\n* var bool = isNegativeZero( 0.0 );\n* // returns false\n*/\nfunction isNegativeZero( x ) {\n\treturn (x === 0.0 && 1.0/x === NINF);\n}\n\n\n// EXPORTS //\n\nexport default isNegativeZero;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from complex number constructors to data types...\nvar ctor2dtypes = {\n\t'Complex64': 'complex64',\n\t'Complex128': 'complex128'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport dtypes from '@stdlib/complex-dtypes';\n\n\n// MAIN //\n\nvar DTYPES = dtypes();\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from '@stdlib/complex-ctors';\nimport DTYPES from './dtypes.js';\n\n\n// MAIN //\n\nvar CTORS = [];\nvar i;\nfor ( i = 0; i < DTYPES.length; i++ ) {\n\tCTORS.push( ctors( DTYPES[ i ] ) );\n}\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport DTYPES from './dtypes.json';\n\n\n// MAIN //\n\n/**\n* Returns a list of complex number data types.\n*\n* @returns {StringArray} list of complex number data types\n*\n* @example\n* var list = dtypes();\n* // e.g., returns [ 'complex64', 'complex128' ]\n*/\nfunction dtypes() {\n\treturn DTYPES.slice();\n}\n\n\n// EXPORTS //\n\nexport default dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport constructorName from '@stdlib/utils-constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of a complex number.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var dt = dtype( new Complex128( 1.0, 2.0 ) );\n* // returns 'complex128'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Converts a boolean to a number.\n*\n* @private\n* @param {boolean} value - input value\n* @returns {number} result\n*/\nfunction boolean2number( value ) {\n\treturn ( value ) ? 1 : 0;\n}\n\n\n// EXPORTS //\n\nexport default boolean2number;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a BigInt to a number.\n*\n* @private\n* @param {BigInt} value - input value\n* @returns {number} result\n*/\nfunction bigint2number( value ) {\n\treturn Number( value );\n}\n\n\n// EXPORTS //\n\nexport default bigint2number;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport isRealFloatingPointDataType from '@stdlib/array-base-assert-is-real-floating-point-data-type'; // eslint-disable-line id-length\nimport isSignedIntegerDataType from '@stdlib/array-base-assert-is-signed-integer-data-type';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport minDataType from '@stdlib/array-min-dtype';\nimport minSignedIntegerDataType from '@stdlib/array-base-min-signed-integer-dtype';\nimport complexDType from '@stdlib/complex-dtype';\nimport format from '@stdlib/string-format';\nimport boolean2number from './boolean2number.js';\nimport bigint2number from './bigint2number.js';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport defaults from './defaults.json';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setNumber( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a number value to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar v;\n\t\tif ( isNumber( value ) ) {\n\t\t\tif ( isRealFloatingPointDataType( obj.type ) ) {\n\t\t\t\tdt = obj.type;\n\t\t\t} else if ( !isInteger( value ) ) {\n\t\t\t\tdt = defaults.dtypes.real;\n\t\t\t} else if ( isSignedIntegerDataType( obj.type ) ) {\n\t\t\t\tdt = minSignedIntegerDataType( value );\n\t\t\t} else {\n\t\t\t\tdt = minDataType( value );\n\t\t\t}\n\t\t\tv = value;\n\t\t} else if ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || ( ( obj.type === 'float32' ) ? 'complex64' : 'complex128' );\n\t\t\tv = value.re; // discard imaginary component\n\t\t} else if ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tv = boolean2number( value );\n\t\t} else if ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // note: the specific integer data type (int64 vs uint64) should not matter here\n\t\t\tv = bigint2number( value );\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tv = value;\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport INT8_MAX from '@stdlib/constants-int8-max';\nimport INT16_MAX from '@stdlib/constants-int16-max';\nimport INT32_MAX from '@stdlib/constants-int32-max';\n\n\n// MAIN //\n\n/**\n* Returns the minimum array data type for storing a provided signed integer value.\n*\n* @param {integer} value - scalar value\n* @returns {string} array data type\n*\n* @example\n* var dt = minSignedIntegerDataType( 9999 );\n* // returns 'int16'\n*\n* @example\n* var dt = minSignedIntegerDataType( 3 );\n* // returns 'int8'\n*/\nfunction minSignedIntegerDataType( value ) {\n\tif ( value < 0 ) {\n\t\tif ( value >= INT8_MIN ) {\n\t\t\treturn 'int8';\n\t\t}\n\t\tif ( value >= INT16_MIN ) {\n\t\t\treturn 'int16';\n\t\t}\n\t\tif ( value >= INT32_MIN ) {\n\t\t\treturn 'int32';\n\t\t}\n\t\treturn 'float64';\n\t}\n\tif ( value <= INT8_MAX ) {\n\t\treturn 'int8';\n\t}\n\tif ( value <= INT16_MAX ) {\n\t\treturn 'int16';\n\t}\n\tif ( value <= INT32_MAX ) {\n\t\treturn 'int32';\n\t}\n\treturn 'float64';\n}\n\n\n// EXPORTS //\n\nexport default minSignedIntegerDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a number to a boolean.\n*\n* @private\n* @param {number} value - input value\n* @returns {boolean} result\n*/\nfunction number2boolean( value ) {\n\treturn Boolean( value );\n}\n\n\n// EXPORTS //\n\nexport default number2boolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a complex number to a boolean.\n*\n* @private\n* @param {ComplexLike} value - input value\n* @returns {boolean} result\n*/\nfunction complex2boolean( value ) {\n\treturn Boolean( value.re || value.im );\n}\n\n\n// EXPORTS //\n\nexport default complex2boolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport complexDType from '@stdlib/complex-dtype';\nimport Boolean from '@stdlib/boolean-ctor';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport boolean2number from './boolean2number.js';\nimport number2boolean from './number2boolean.js';\nimport complex2boolean from './complex2boolean.js';\nimport bigint2boolean from './bigint2boolean.js';\nimport defaults from './defaults.json';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setBoolean( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a boolean value to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar v;\n\t\tif ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tv = boolean2number( value );\n\t\t} else if ( isNumber( value ) ) {\n\t\t\tdt = defaults.dtypes.real;\n\t\t\tv = boolean2number( number2boolean( value ) );\n\t\t} else if ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // note: the specific integer data type (int64 vs uint64) should not matter here\n\t\t\tv = boolean2number( bigint2boolean( value ) );\n\t\t} else if ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || defaults.dtypes.complex;\n\t\t\tv = boolean2number( complex2boolean( value ) );\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tv = Boolean( value );\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a BigInt to a boolean.\n*\n* @private\n* @param {BigInt} value - input value\n* @returns {boolean} result\n*/\nfunction bigint2boolean( value ) {\n\treturn Boolean( value );\n}\n\n\n// EXPORTS //\n\nexport default bigint2boolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* global BigInt */\n\n'use strict';\n\n// MAIN //\n\nvar BigInteger = ( typeof BigInt === 'function' ) ? BigInt : void 0; // eslint-disable-line stdlib/require-globals, node/no-unsupported-features/es-builtins\n\n\n// EXPORTS //\n\nexport default BigInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport minDataType from '@stdlib/array-min-dtype';\nimport complexDType from '@stdlib/complex-dtype';\nimport BigInt from '@stdlib/bigint-ctor';\nimport Number from '@stdlib/number-ctor';\nimport floor from '@stdlib/math-base-special-floor';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport boolean2bigint from './boolean2bigint.js';\nimport defaults from './defaults.json';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setBigInt( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a number value to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar v;\n\t\tif ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // FIXME: support both int64 and uint64\n\t\t\tv = value;\n\t\t} else if ( isNumber( value ) ) {\n\t\t\tif ( isInteger( value ) ) {\n\t\t\t\tdt = minDataType( value );\n\t\t\t\tv = BigInt( value );\n\t\t\t} else {\n\t\t\t\tdt = defaults.dtypes.real;\n\t\t\t\tv = BigInt( floor( value ) );\n\t\t\t}\n\t\t} else if ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tv = boolean2bigint( value );\n\t\t} else if ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || defaults.dtypes.complex;\n\t\t\tv = BigInt( floor( value.re ) ); // discard imaginary component\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tv = BigInt( floor( Number( v ) ) );\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport BigInt from '@stdlib/bigint-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a boolean to a BigInt.\n*\n* @private\n* @param {boolean} value - input value\n* @returns {number} result\n*/\nfunction boolean2bigint( value ) {\n\treturn BigInt( ( value ) ? 1 : 0 );\n}\n\n\n// EXPORTS //\n\nexport default boolean2bigint;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isDataView from '@stdlib/assert-is-dataview';\nimport isObject from '@stdlib/assert-is-object';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `struct` instance.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `struct` instance\n*/\nfunction isStructInstance( value ) {\n\t// NOTE: the following is a relatively weak test, but we cannot use `instanceof` checks, etc, due to the factory nature of the implementation. Regardless, here, we are just trying to sniff out a `struct` type. If calling as a constructor later fails, we punt the responsibility off to the user to handle what should be an edge case. If, in the future, this check proves insufficient, we can add further \"brand\" checks...\n\treturn (\n\t\tisObject( value ) &&\n\t\tisDataView( value[ PRIVATE_BUFFER ] )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isStructInstance;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array complex-valued floating-point data type.\n*\n* @name isComplexFloatingPointDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array complex-valued floating-point data type\n*\n* @example\n* var bool = isComplexFloatingPointDataType( 'complex64' );\n* // returns true\n*\n* bool = isComplexFloatingPointDataType( 'complex128' );\n* // returns true\n*\n* bool = isComplexFloatingPointDataType( 'float32' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'float64' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'generic' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'int16' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'int32' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'int8' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint16' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint32' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint8' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint8c' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'foo' );\n* // returns false\n*/\nvar isComplexFloatingPointDataType = contains( dtypes( 'complex_floating_point' ) ); // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default isComplexFloatingPointDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array boolean data type.\n*\n* @name isBooleanDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array boolean data type\n*\n* @example\n* var bool = isBooleanDataType( 'bool' );\n* // returns true\n*\n* bool = isBooleanDataType( 'complex64' );\n* // returns false\n*\n* bool = isBooleanDataType( 'complex128' );\n* // returns false\n*\n* bool = isBooleanDataType( 'float32' );\n* // returns false\n*\n* bool = isBooleanDataType( 'float64' );\n* // returns false\n*\n* bool = isBooleanDataType( 'generic' );\n* // returns false\n*\n* bool = isBooleanDataType( 'int16' );\n* // returns false\n*\n* bool = isBooleanDataType( 'int32' );\n* // returns false\n*\n* bool = isBooleanDataType( 'int8' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint16' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint32' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint8' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint8c' );\n* // returns false\n*\n* bool = isBooleanDataType( 'foo' );\n* // returns false\n*/\nvar isBooleanDataType = contains( dtypes( 'boolean' ) );\n\n\n// EXPORTS //\n\nexport default isBooleanDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array real-valued data type.\n*\n* @name isRealDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array real-valued data type\n*\n* @example\n* var bool = isRealDataType( 'float32' );\n* // returns true\n*\n* bool = isRealDataType( 'float64' );\n* // returns true\n*\n* bool = isRealDataType( 'complex128' );\n* // returns false\n*\n* bool = isRealDataType( 'generic' );\n* // returns false\n*\n* bool = isRealDataType( 'int16' );\n* // returns true\n*\n* bool = isRealDataType( 'int32' );\n* // returns true\n*\n* bool = isRealDataType( 'int8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint16' );\n* // returns true\n*\n* bool = isRealDataType( 'uint32' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8c' );\n* // returns true\n*\n* bool = isRealDataType( 'foo' );\n* // returns false\n*/\nvar isRealDataType = contains( dtypes( 'real' ) );\n\n\n// EXPORTS //\n\nexport default isRealDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Reinterprets a complex-valued floating-point array as a real-valued floating-point array having the same precision.\n*\n* @param {(Complex128Array|Complex64Array)} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @throws {TypeError} first argument must be a supported complex-valued floating-point array\n* @returns {(Float64Array|Float32Array)} real-valued floating-point array view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\tif ( isComplex128Array( x ) ) {\n\t\treturn reinterpret128( x, offset );\n\t}\n\tif ( isComplex64Array( x ) ) {\n\t\treturn reinterpret64( x, offset );\n\t}\n\t// Note: intentionally throw here to catch the scenario in which we add, e.g., a Complex32Array and need to explicitly add support here...\n\tthrow new TypeError( format( 'invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a strided array.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {integer} stride - index increment\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var offset = stride2offset( 10, -10 );\n* // returns 90\n*/\nfunction stride2offset( N, stride ) {\n\tif ( stride > 0 ) {\n\t\treturn 0;\n\t}\n\treturn ( 1 - N ) * stride;\n}\n\n\n// EXPORTS //\n\nexport default stride2offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar constant\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {Collection} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, strideX, offsetX ) {\n\tvar ix;\n\tvar m;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, alpha, o, strideX, offsetX );\n\t\treturn o.data;\n\t}\n\tix = offsetX;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( strideX === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += strideX;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += strideX;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar constant\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {Object} input array object\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ null, setter ]\n* };\n*\n* var alpha = new Complex64( 5.0, 5.0 );\n*\n* gfill( data.length, alpha, x, 1, 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // returns [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, strideX, offsetX ) {\n\tvar xbuf;\n\tvar set;\n\tvar ix;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessor:\n\tset = x.accessors[ 1 ];\n\n\tix = offsetX;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( xbuf, ix, alpha );\n\t\tix += strideX;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport stride2offset from '@stdlib/strided-base-stride2offset';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar constant\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @returns {Collection} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, strideX ) {\n\treturn ndarray( N, alpha, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nexport default gfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\n\n\n// FUNCTIONS //\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in an output array.\n*\n* @private\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - stride length for output array\n* @param {NonNegativeInteger} offset - starting index for output array\n* @param {Function} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n* var out = internal( x, y, 1, 0, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* var bool = ( out === y );\n* // returns true\n*/\nfunction internal( x, y, stride, offset, fcn, thisArg ) {\n\tvar io;\n\tvar i;\n\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\ty[ io ] = fcn.call( thisArg, x[ i ], i, x );\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in an output array.\n*\n* @private\n* @param {Object} x - input array object\n* @param {Object} y - output array object\n* @param {integer} stride - stride length for output array\n* @param {NonNegativeInteger} offset - starting index for output array\n* @param {Function} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {Object} output array object\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n*\n* var out = accessors( arraylike2object( toAccessorArray( x ) ), arraylike2object( toAccessorArray( y ) ), 1, 0, scale );\n* // y => [ 10.0, 10.0, 10.0, 10.0 ]\n*/\nfunction accessors( x, y, stride, offset, fcn, thisArg ) {\n\tvar xdata;\n\tvar ydata;\n\tvar xget;\n\tvar yset;\n\tvar io;\n\tvar i;\n\n\txdata = x.data;\n\tydata = y.data;\n\txget = x.accessors[ 0 ];\n\tyset = y.accessors[ 1 ];\n\n\tio = offset;\n\tfor ( i = 0; i < xdata.length; i++ ) {\n\t\tyset( ydata, io, fcn.call( thisArg, xget( xdata, i ), i, xdata ) );\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in an output array.\n*\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - stride length for output array\n* @param {NonNegativeInteger} offset - starting index for output array\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n*\n* var out = assign( x, y, 1, 0, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* var bool = ( out === y );\n* // returns true\n*/\nfunction assign( x, y, stride, offset, fcn, thisArg ) {\n\tvar xobj;\n\tvar yobj;\n\n\txobj = arraylike2object( x );\n\tyobj = arraylike2object( y );\n\tif ( xobj.accessorProtocol || yobj.accessorProtocol ) {\n\t\taccessors( xobj, yobj, stride, offset, fcn, thisArg );\n\t\treturn y;\n\t}\n\treturn internal( x, y, stride, offset, fcn, thisArg );\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeros from '@stdlib/array-base-zeros';\nimport assign from './assign.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'map' );\n* // returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in a new output array.\n*\n* @param {Collection} x - input array\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = map( x, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*/\nfunction map( x, fcn, thisArg ) {\n\tif ( hasMethod( x, 'map' ) ) {\n\t\treturn x.map( fcn, thisArg );\n\t}\n\treturn assign( x, zeros( x.length ), 1, 0, fcn, thisArg );\n}\n\n\n// EXPORTS //\n\nexport default map;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Converts a complex number to a number.\n*\n* @private\n* @param {ComplexLike} value - input value\n* @returns {number} result\n*/\nfunction complex2number( value ) {\n\treturn value.re;\n}\n\n\n// EXPORTS //\n\nexport default complex2number;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\nimport DATA_VIEW_METHODS from './data_view_methods.js';\nimport setNumber from './set_number.js';\nimport setComplex from './set_complex.js';\nimport setBoolean from './set_boolean.js';\nimport setBigInt from './set_bigint.js';\nimport setStruct from './set_struct.js';\nimport setTypedArray from './set_typedarray.js';\nimport setStructArray from './set_struct_array.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for setting field data.\n*\n* @private\n* @param {Object} obj - field object\n* @throws {Error} unexpected error\n* @returns {Function} function for setting field data\n*/\nfunction setter( obj ) {\n\tif ( obj.length ) {\n\t\tif ( obj.isStructType ) {\n\t\t\treturn setStructArray( obj );\n\t\t}\n\t\treturn setTypedArray( obj );\n\t}\n\tswitch ( obj.type ) {\n\tcase 'float64':\n\tcase 'float32':\n\tcase 'float16':\n\tcase 'int8':\n\tcase 'int16':\n\tcase 'int32':\n\tcase 'uint8':\n\tcase 'uint16':\n\tcase 'uint32':\n\t\treturn setNumber( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tcase 'int64':\n\tcase 'uint64':\n\t\treturn setBigInt( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tcase 'bool':\n\t\treturn setBoolean( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tcase 'complex128':\n\tcase 'complex64':\n\tcase 'complex32':\n\t\treturn setComplex( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tdefault:\n\t\tif ( obj.isStructType ) {\n\t\t\treturn setStruct( obj );\n\t\t}\n\t\t// Ensure that we fail loudly if we have failed to add support for newly added data types:\n\t\tthrow new Error( format( 'unexpected error. Unrecognized data type. Value: `%s`.', obj.type ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport Uint8Array from '@stdlib/array-uint8';\nimport gcopy from '@stdlib/blas-base-gcopy';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for writing field data\n*/\nfunction setStructArray( obj ) {\n\treturn setter;\n\n\t/**\n\t* Writes a list of `struct` instances to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {Collection} values - list of `struct` instances\n\t* @throws {TypeError} must provide an array-like object\n\t* @throws {RangeError} must provide an array-like object having an expected length\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( values ) {\n\t\tvar offset;\n\t\tvar views;\n\t\tvar view;\n\t\tvar dest;\n\t\tvar src;\n\t\tvar buf;\n\t\tvar nb;\n\t\tvar i;\n\n\t\tif ( !isCollection( values ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be an array-like object. Value: `%s`.', obj.name, values ) );\n\t\t}\n\t\tif ( values.length !== obj.length ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be an array-like object having length %u.', obj.name, obj.length ) );\n\t\t}\n\t\tif ( obj.casting === 'none' ) {\n\t\t\tfor ( i = 0; i < values.length; i++ ) {\n\t\t\t\tif ( !( values[ i ] instanceof obj.type ) ) { // note: this check will fail for cross-realm `struct` instances\n\t\t\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Value: `%s`.', obj.name, values[ i ] ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Compute the expected number of bytes per struct view:\n\t\tnb = obj.byteLength / obj.length; // note: as a field is expected to have a homogeneous data type, the byte length should be evenly divisible by the number of elements\n\n\t\t// Check that all struct instances have the same byte length...\n\t\tviews = [];\n\t\tfor ( i = 0; i < values.length; i++ ) {\n\t\t\tbuf = this.constructor.viewOf( values[ i ] );\n\t\t\tif ( buf.byteLength !== nb ) {\n\t\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be an array-like object containing `struct` instances having the same byte length.', obj.name ) );\n\t\t\t}\n\t\t\tsrc = new Uint8Array( buf.buffer, buf.byteOffset, nb );\n\t\t\tviews.push( src );\n\t\t}\n\t\t// Write the data for each `struct` to the underlying byte buffer...\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\toffset = view.byteOffset + obj.byteOffset;\n\t\tfor ( i = 0; i < values.length; i++ ) {\n\t\t\tdest = new Uint8Array( view.buffer, offset, nb );\n\t\t\tgcopy( obj.length, views[ i ], 1, dest, 1 );\n\t\t\toffset += nb;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setStructArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport isComplexDataType from '@stdlib/array-base-assert-is-complex-floating-point-data-type';\nimport isBooleanDataType from '@stdlib/array-base-assert-is-boolean-data-type';\nimport isRealDataType from '@stdlib/array-base-assert-is-real-data-type';\nimport typedarray from '@stdlib/array-typed';\nimport dtype from '@stdlib/array-dtype';\nimport reinterpretComplex from '@stdlib/strided-base-reinterpret-complex';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport gcopy from '@stdlib/blas-base-gcopy';\nimport gfill from '@stdlib/blas-ext-base-gfill';\nimport map from '@stdlib/array-base-map';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport isStructInstance from './is_struct_instance.js';\nimport number2boolean from './number2boolean.js';\nimport complex2boolean from './complex2boolean.js';\nimport complex2number from './complex2number.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for writing field data\n*/\nfunction setTypedArray( obj ) {\n\treturn setter;\n\n\t/**\n\t* Writes a list of values to a typed array view of an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {Collection} value - value to set\n\t* @throws {TypeError} must provide an array-like object\n\t* @throws {RangeError} must provide an array-like object having an expected length\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar buf;\n\t\tvar dt;\n\t\tif ( !isCollection( value ) || isStructInstance( value ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be an array-like object. Value: `%s`.', obj.name, value ) );\n\t\t}\n\t\tif ( value.length !== obj.length ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be an array-like object having length %u.', obj.name, obj.length ) );\n\t\t}\n\t\tdt = dtype( value );\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tbuf = this[ PRIVATE_BUFFER ];\n\t\tview = typedarray( buf.buffer, buf.byteOffset+obj.byteOffset, obj.length, obj.type );\n\t\tif ( dt === obj.type ) {\n\t\t\t// Case: complex => complex\n\t\t\tif ( isComplexDataType( dt ) ) {\n\t\t\t\tgcopy( obj.length*2, reinterpretComplex( value, 0 ), 1, reinterpretComplex( view, 0 ), 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: boolean => boolean\n\t\t\tif ( isBooleanDataType( dt ) ) {\n\t\t\t\tgcopy( obj.length, reinterpretBoolean( value, 0 ), 1, reinterpretBoolean( view, 0 ), 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: real => real\n\t\t\tgcopy( obj.length, value, 1, view, 1 );\n\t\t\treturn;\n\t\t}\n\t\t// Case: real => ???\n\t\tif ( isRealDataType( dt ) ) {\n\t\t\t// Case: real => real\n\t\t\tif ( isRealDataType( obj.type ) ) {\n\t\t\t\tgcopy( obj.length, value, 1, view, 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: real => complex\n\t\t\tif ( isComplexDataType( obj.type ) ) {\n\t\t\t\tview = reinterpretComplex( view, 0 );\n\n\t\t\t\t// TODO: consider refactoring to avoid two-passes; may require creating a separate strided utility explicitly aimed at casting real-valued arrays to complex arrays\n\t\t\t\tgcopy( obj.length, view, 2, value, 1 ); // assign to only real-components\n\t\t\t\tgfill.ndarray( obj.length, 0.0, view, 2, 1 ); // fill imaginary components with zeros\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: real => boolean\n\t\t\tmap.assign( value, view, 1, 0, number2boolean );\n\t\t\treturn;\n\t\t}\n\t\t// Case: complex => ???\n\t\tif ( isComplexDataType( dt ) ) {\n\t\t\t// Case: complex => real\n\t\t\tif ( isRealDataType( obj.type ) ) {\n\t\t\t\tmap.assign( value, view, 1, 0, complex2number ); // discard imaginary components\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: complex => complex\n\t\t\tif ( isComplexDataType( obj.type ) ) {\n\t\t\t\tgcopy( obj.length*2, reinterpretComplex( value, 0 ), 1, reinterpretComplex( view, 0 ), 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: complex => boolean\n\t\t\tmap.assign( value, view, 1, 0, complex2boolean );\n\t\t\treturn;\n\t\t}\n\t\t// Case: boolean => ???\n\n\t\t// Case: boolean => real\n\t\tif ( isRealDataType( obj.type ) ) {\n\t\t\tgcopy( obj.length, reinterpretBoolean( value, 0 ), 1, view, 1 );\n\t\t\treturn;\n\t\t}\n\t\t// Case: boolean => complex\n\t\tview = reinterpretComplex( view, 0 );\n\n\t\t// TODO: consider refactoring to avoid two-passes; may require creating a separate strided utility explicitly aimed at casting real-valued arrays to complex arrays\n\t\tgcopy( obj.length, view, 2, reinterpretBoolean( value, 0 ), 1 ); // assign to only real-components\n\t\tgfill.ndarray( obj.length, 0.0, view, 2, 1 ); // fill imaginary components with zeros\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport complexDType from '@stdlib/complex-dtype';\nimport format from '@stdlib/string-format';\nimport boolean2number from './boolean2number.js';\nimport bigint2number from './bigint2number.js';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setComplex( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a complex number to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar re;\n\t\tvar im;\n\t\tif ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || obj.type;\n\t\t\tre = value.re;\n\t\t\tim = value.im;\n\t\t} else if ( isNumber( value ) ) {\n\t\t\tdt = ( obj.type === 'complex64' ) ? 'float32' : 'float64';\n\t\t\tre = value;\n\t\t\tim = 0.0;\n\t\t} else if ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // note: the specific integer data type (int64 vs uint64) should not matter here\n\t\t\tre = bigint2number( value );\n\t\t\tim = 0.0;\n\t\t} else if ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tre = boolean2number( value );\n\t\t\tim = 0.0;\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tre = value;\n\t\t\tim = 0.0;\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, re, IS_LITTLE_ENDIAN );\n\t\tview[ method ]( obj.byteOffset+(obj.byteLength/2), im, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setComplex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\nimport gcopy from '@stdlib/blas-base-gcopy';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport isStructInstance from './is_struct_instance.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for writing field data\n*/\nfunction setStruct( obj ) {\n\treturn setter;\n\n\t/**\n\t* Writes `struct` data to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {Object} value - value to set\n\t* @throws {TypeError} must be a `struct` instance\n\t* @throws {RangeError} must be a `struct` instance having the same byte length\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dest;\n\t\tvar src;\n\t\tvar buf;\n\t\tvar nb;\n\t\tif ( !isStructInstance( value ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a `struct` instance. Value: `%s`.', obj.name, value ) );\n\t\t}\n\t\tif ( obj.casting === 'none' && !( value instanceof obj.type ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Value: `%s`.', obj.name, value ) );\n\t\t}\n\t\tnb = obj.byteLength;\n\n\t\tbuf = this.constructor.viewOf( value );\n\t\tif ( buf.byteLength !== nb ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be a `struct` instance having the same byte length.', obj.name ) );\n\t\t}\n\t\tsrc = new Uint8Array( buf.buffer, buf.byteOffset, nb );\n\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tdest = new Uint8Array( view.buffer, view.byteOffset+obj.byteOffset, nb ); // eslint-disable-line max-len\n\n\t\tgcopy( obj.length, src, 1, dest, 1 );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setStruct;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with a specified scalar constant.\n*\n* @module @stdlib/blas-ext-base-gfill\n*\n* @example\n* import gfill from '@stdlib/blas-ext-base-gfill';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* import gfill from '@stdlib/blas-ext-base-gfill';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a callback function to elements in an input array and assign results to elements in a new output array.\n*\n* @module @stdlib/array-base-map\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import map from '@stdlib/array-base-map';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = map( x, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n* import map from '@stdlib/array-base-map';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n*\n* var out = map.assign( x, y, 1, 0, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* var bool = ( out === y );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar FIELD_PROPERTIES = [\n\t'name',\n\t'type',\n\t'description',\n\t'length',\n\t'enumerable',\n\t'writable',\n\t'default',\n\t'castingMode'\n];\n\n\n// EXPORTS //\n\nexport default FIELD_PROPERTIES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating whether a field object represents a union type.\n*\n* @private\n* @param {Object} obj - input field object\n* @returns {boolean} result\n*/\nfunction isUnionType( obj ) {\n\treturn obj.type === 'union' && isCollection( obj.fields );\n}\n\n\n// EXPORTS //\n\nexport default isUnionType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is `undefined` or `null`.\n*\n* ## Notes\n*\n* - In older browsers, `undefined` is a global which can be overridden. `void`, however, is an operator which **cannot** be overridden. Consequently, better to use `void` to check for `undefined`. See [Stack Overflow][1].\n*\n* [1]: http://stackoverflow.com/a/19369078/2225624\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is undefined\n*\n* @example\n* var bool = isUndefinedOrNull( undefined );\n* // returns true\n*\n* bool = isUndefinedOrNull( null );\n* // returns true\n*\n* bool = isUndefinedOrNull( false );\n* // returns false\n*/\nfunction isUndefinedOrNull( value ) {\n\treturn ( value === void 0 || value === null );\n}\n\n\n// EXPORTS //\n\nexport default isUndefinedOrNull;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUndefinedOrNull from '@stdlib/assert-is-undefined-or-null';\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'join' );\n* // returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining strided array elements using a specified separator and alternative indexing semantics.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {string} separator - separator\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {string} joined string\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = gjoin( x.length, ',', x, 1, 0 );\n* // returns '1,2,3,4'\n*/\nfunction gjoin( N, separator, x, strideX, offsetX ) {\n\tvar out;\n\tvar ix;\n\tvar o;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn '';\n\t}\n\t// Check for a contiguous strided array with left-to-right iteration...\n\tif ( strideX === 1 && offsetX === 0 && N === x.length && hasMethod( x, 'join' ) ) {\n\t\treturn x.join( separator );\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\treturn accessors( N, separator, o, strideX, offsetX );\n\t}\n\tix = offsetX;\n\tout = '';\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( i > 0 ) {\n\t\t\tout += separator;\n\t\t}\n\t\tv = x[ ix ];\n\t\tif ( !isUndefinedOrNull( v ) ) {\n\t\t\tout += String( v );\n\t\t}\n\t\tix += strideX;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default gjoin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUndefinedOrNull from '@stdlib/assert-is-undefined-or-null';\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining strided array elements using a specified separator.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {string} separator - separator\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {string} joined string\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = gjoin( x.length, ',', arraylike2object( toAccessorArray( x ) ), 1, 0 );\n* // returns '1,2,3,4'\n*/\nfunction gjoin( N, separator, x, strideX, offsetX ) {\n\tvar xbuf;\n\tvar get;\n\tvar out;\n\tvar ix;\n\tvar v;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessor:\n\tget = x.accessors[ 0 ];\n\n\tix = offsetX;\n\tout = '';\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( i > 0 ) {\n\t\t\tout += separator;\n\t\t}\n\t\tv = get( xbuf, ix );\n\t\tif ( !isUndefinedOrNull( v ) ) {\n\t\t\tout += String( v );\n\t\t}\n\t\tix += strideX;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default gjoin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { ndarray as strided } from '@stdlib/blas-ext-base-gjoin';\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining array elements using a specified separator.\n*\n* @param {Collection} x - input array\n* @param {string} separator - separator\n* @returns {string} output string\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = join( x, ',' );\n* // returns '1,2,3,4'\n*\n* @example\n* var x = [ 1, 2, 3, null, undefined, 4 ];\n*\n* var out = join( x, '-' );\n* // returns '1-2-3---4'\n*/\nfunction join( x, separator ) {\n\treturn strided( x.length, separator, x, 1, 0 );\n}\n\n\n// EXPORTS //\n\nexport default join;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid boolean field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidBoolean( value, name ) {\n\tif ( isBoolean( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a boolean. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string created by joining strided array elements using a specified separator.\n*\n* @module @stdlib/blas-ext-base-gjoin\n*\n* @example\n* import gjoin from '@stdlib/blas-ext-base-gjoin';\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var str = gjoin( x.length, ',', x, 1 );\n* // returns '1,2,3,4'\n*\n* @example\n* import gjoin from '@stdlib/blas-ext-base-gjoin';\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var str = gjoin.ndarray( x.length, ',', x, 1, 0 );\n* // returns '1,2,3,4'\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport stride2offset from '@stdlib/strided-base-stride2offset';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining strided array elements using a specified separator.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {string} separator - separator\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @returns {string} joined string\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = gjoin( x.length, ',', x, 1 );\n* // returns '1,2,3,4'\n*/\nfunction gjoin( N, separator, x, strideX ) {\n\treturn ndarray( N, separator, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nexport default gjoin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar DTYPES = [\n\t'int8',\n\t'int16',\n\t'int32',\n\t'int64',\n\n\t'uint8',\n\t'uint16',\n\t'uint32',\n\t'uint64',\n\n\t// 'float16', // TODO: uncomment once supported\n\n\t'float32',\n\t'float64',\n\n\t// 'complex32', // TODO: uncomment once supported\n\n\t'complex64',\n\t'complex128',\n\n\t'bool'\n];\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar CASTING_MODES = [\n\t'none',\n\t'safe',\n\t'mostly-safe',\n\t'same-kind',\n\t'unsafe'\n];\n\n\n// EXPORTS //\n\nexport default CASTING_MODES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport contains from '@stdlib/array-base-assert-contains';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether a provided value is a valid enumerated field.\n*\n* @private\n* @param {Collection} values - list of possible values\n* @returns {Function} output function\n*/\nfunction isValidOneOf( values ) {\n\treturn isValid;\n\n\t/**\n\t* Tests whether a provided value is a valid enumerated field.\n\t*\n\t* @private\n\t* @param {*} value - input value\n\t* @param {string} name - field name\n\t* @returns {(null|TypeError)} error object or null\n\t*/\n\tfunction isValid( value, name ) {\n\t\tif ( contains( values, value ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new TypeError( format( 'invalid argument. `%s` field must be one of the following: \"%s\". Value: `%s`.', name, join( values, ', ' ), value ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default isValidOneOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ALIGNMENTS = {\n\t'int8': 1,\n\t'int16': 2,\n\t'int32': 4,\n\t'int64': 8,\n\n\t'uint8': 1,\n\t'uint16': 2,\n\t'uint32': 4,\n\t'uint64': 8,\n\n\t'float16': 2,\n\t'float32': 4,\n\t'float64': 8,\n\n\t'complex32': 2, // same as float16\n\t'complex64': 4, // same as float32\n\t'complex128': 8, // same as float64\n\n\t'bool': 1\n};\n\n\n// EXPORTS //\n\nexport default ALIGNMENTS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport hasProp from '@stdlib/assert-has-property';\nimport join from '@stdlib/array-base-join';\nimport constantFunction from '@stdlib/utils-constant-function';\nimport format from '@stdlib/string-format';\nimport hasProperties from './has_properties.js';\nimport isValidNonEmptyString from './is_valid_nonempty_string.js';\nimport isValidString from './is_valid_string.js';\nimport isValidPositiveInteger from './is_valid_positive_integer.js';\nimport isValidBoolean from './is_valid_boolean.js';\nimport isValidType from './is_valid_type.js';\nimport isValidOneOf from './is_valid_one_of.js';\nimport initFieldObject from './init_field_object.js';\nimport byteLength from './byte_length.js';\nimport CASTING_MODES from './casting_modes.js';\nimport ALIGNMENTS from './alignments.js';\n\n\n// VARIABLES //\n\nvar MANDATORY_FIELD_NAMES = [\n\t'name',\n\t'type'\n];\n\nvar VALIDATORS = {\n\t'name': isValidNonEmptyString,\n\t'type': isValidType,\n\t'description': isValidString,\n\t'length': isValidPositiveInteger,\n\t'enumerable': isValidBoolean,\n\t'writable': isValidBoolean,\n\t'default': constantFunction( null ),\n\t'castingMode': isValidOneOf( CASTING_MODES )\n};\n\n\n// MAIN //\n\n/**\n* Normalizes a provided field object.\n*\n* @private\n* @param {Object} obj - input field object\n* @param {Array} keys - list of keys to standardize\n* @returns {(Object|Error)} output object or an error\n*/\nfunction normalize( obj, keys ) {\n\tvar out;\n\tvar err;\n\tvar v;\n\tvar k;\n\tvar i;\n\n\tout = initFieldObject();\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tk = keys[ i ];\n\t\tif ( hasProp( obj, k ) ) {\n\t\t\tv = obj[ k ];\n\t\t\terr = VALIDATORS[ k ]( v, k );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\tout[ k ] = v;\n\t\t}\n\t}\n\tif ( !hasProperties( out, MANDATORY_FIELD_NAMES ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Field objects must have the following properties: \"%s\". Value: `%s`.', join( MANDATORY_FIELD_NAMES, ', ' ), JSON.stringify( obj ) ) );\n\t}\n\tout.isStructType = isStructConstructorLike( out.type );\n\tout.byteLength = byteLength( out );\n\tif ( out.isStructType ) {\n\t\tout.alignment = out.type.alignment;\n\t} else {\n\t\tout.alignment = ALIGNMENTS[ out.type ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid string field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidNonEmptyString( value, name ) {\n\tif ( isString( value ) || value.length > 0 ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a non-empty string. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidNonEmptyString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport contains from '@stdlib/array-base-assert-contains';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\nimport DTYPES from './dtypes.js';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid `type` field.\n*\n* @private\n* @param {*} value - input value\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidType( value ) {\n\tif ( contains( DTYPES, value ) || isStructConstructorLike( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be either a struct type or one of the following: \"%s\". Value: `%s`.', 'type', join( DTYPES, ', ' ), value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid string field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidString( value, name ) {\n\tif ( isString( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a string. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid positive integer field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidPositiveInteger( value, name ) {\n\tif ( isPositiveInteger( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a positive integer. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an initialized field object.\n*\n* @private\n* @returns {Object} initialized field object\n*/\nfunction initFieldObject() {\n\treturn {\n\t\t'isStructType': false,\n\t\t'description': '',\n\t\t'byteLength': 0,\n\t\t'byteOffset': 0,\n\t\t'alignment': 0,\n\t\t'padding': 0,\n\t\t'enumerable': true,\n\t\t'writable': true,\n\t\t'default': void 0, // explicitly set to `undefined`\n\t\t'castingMode': 'none'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default initFieldObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasProp from '@stdlib/assert-has-property';\n\n\n// MAIN //\n\n/**\n* Tests whether an object has a list of properties.\n*\n* @private\n* @param {Object} obj - input object\n* @param {Array} keys - list of property names\n* @returns {boolean} result\n*/\nfunction hasProperties( obj, keys ) {\n\tvar i;\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tif ( !hasProp( obj, keys[ i ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default hasProperties;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport bytesPerElement from '@stdlib/ndarray-base-bytes-per-element';\n\n\n// MAIN //\n\n/**\n* Returns the number of bytes required to store a field value.\n*\n* @private\n* @param {Object} obj - input field object\n* @returns {PositiveInteger} number of bytes\n*/\nfunction byteLength( obj ) {\n\tvar nb;\n\tif ( obj.isStructType ) {\n\t\tnb = obj.type.byteLength;\n\t} else {\n\t\tnb = bytesPerElement( obj.type );\n\t}\n\tif ( obj.length ) {\n\t\tnb *= obj.length;\n\t}\n\treturn nb;\n}\n\n\n// EXPORTS //\n\nexport default byteLength;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Resolves the struct's byte alignment.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @returns {PositiveInteger} alignment\n*/\nfunction alignment( fields ) {\n\tvar max;\n\tvar v;\n\tvar i;\n\n\tmax = 0;\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\tv = fields[ i ].alignment;\n\t\tif ( v > max ) {\n\t\t\tmax = v;\n\t\t}\n\t}\n\treturn max;\n}\n\n\n// EXPORTS //\n\nexport default alignment;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert-is-object';\nimport hasProp from '@stdlib/assert-has-property';\nimport format from '@stdlib/string-format';\nimport isUnionType from './is_union_type.js';\nimport FIELD_PROPERTIES from './field_properties.js';\nimport normalizeField from './normalize_field.js';\nimport resolveAlignment from './resolve_alignment.js';\n\n\n// MAIN //\n\n/**\n* Normalizes a field object representing a union type.\n*\n* @private\n* @param {Object} obj - input field object\n* @returns {(Object|null|Error)} normalized field object or error object\n*/\nfunction normalizeUnion( obj ) {\n\tvar fields;\n\tvar dflg;\n\tvar out;\n\tvar tmp;\n\tvar len;\n\tvar o;\n\tvar i;\n\n\tfields = obj.fields;\n\tif ( fields.length === 0 ) {\n\t\treturn null;\n\t}\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tif ( !isObject( o ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( isUnionType( o ) ) {\n\t\t\treturn new TypeError( format( 'invalid argument. Union types cannot contain nested union types. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t}\n\t\tif ( dflg === void 0 && hasProp( o, 'default' ) ) {\n\t\t\tdflg = true;\n\t\t} else if ( dflg === true && hasProp( o, 'default' ) ) {\n\t\t\treturn new TypeError( format( 'invalid argument. Union types can only contain one field with a default value. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t}\n\t\ttmp = normalizeField( o, FIELD_PROPERTIES );\n\t\tif ( tmp instanceof Error ) {\n\t\t\treturn tmp;\n\t\t}\n\t\tif ( i === 0 ) {\n\t\t\tlen = tmp.byteLength;\n\t\t} else if ( tmp.byteLength !== len ) {\n\t\t\treturn new RangeError( format( 'invalid argument. Union types must contain fields having the same byte length. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn {\n\t\t'type': 'union',\n\t\t'fields': out,\n\t\t'byteLength': len,\n\t\t'byteOffset': 0,\n\t\t'alignment': resolveAlignment( out ),\n\t\t'padding': 0\n\t};\n}\n\n\n// EXPORTS //\n\nexport default normalizeUnion;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/assert-is-accessor-array';\nimport resolveGetter from '@stdlib/array-base-resolve-getter';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'indexOf' );\n* // returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n/**\n* Returns the index of the first element which equals a provided search element.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = internal( x, 2, 0 );\n* // returns 1\n*/\nfunction internal( x, searchElement, fromIndex ) {\n\tvar i;\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( searchElement === x[ i ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element.\n*\n* @private\n* @param {Object} x - input array object\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n*\n* var x = toAccessorArray( [ 1, 2, 3, 4 ] );\n*\n* var idx = accessors( x, 2, 0 );\n* // returns 1\n*/\nfunction accessors( x, searchElement, fromIndex ) {\n\tvar get;\n\tvar i;\n\n\tget = resolveGetter( x );\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( searchElement === get( x, i ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// MAIN //\n\n/**\n* Returns the index of the first element which equals a provided search element.\n*\n* ## Notes\n*\n* - If unable to find an element which equals a provided search element, the function returns `-1`.\n*\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {integer} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = indexOf( x, 2, 0 );\n* // returns 1\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var x = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var idx = indexOf( x, 2, 0 );\n* // returns 1\n*/\nfunction indexOf( x, searchElement, fromIndex ) {\n\tif ( hasMethod( x, 'indexOf' ) ) {\n\t\treturn x.indexOf( searchElement, fromIndex );\n\t}\n\tif ( fromIndex < 0 ) {\n\t\tfromIndex += x.length;\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex = 0;\n\t\t}\n\t}\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessors( x, searchElement, fromIndex );\n\t}\n\treturn internal( x, searchElement, fromIndex );\n}\n\n\n// EXPORTS //\n\nexport default indexOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport getter from '@stdlib/array-base-getter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object.\n*\n* @param {Collection} x - input array\n* @returns {Function} accessor\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction resolveGetter( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessorGetter( dt );\n\t}\n\treturn getter( dt );\n}\n\n\n// EXPORTS //\n\nexport default resolveGetter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isFunction from '@stdlib/assert-is-function';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object supporting the accessor (get/set) protocol.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*\n* @example\n* var bool = isAccessorArray( {} );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn (\n\t\tisCollection( value ) &&\n\t\tisFunction( value.get ) &&\n\t\tisFunction( value.set )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport indexOf from '@stdlib/array-base-index-of';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns the index of a specified field name in a provided list of field names.\n*\n* @private\n* @param {Array} names - list of field names\n* @param {string} name - field name\n* @throws {Error} struct must have at least one field\n* @throws {TypeError} must provide a recognized field name\n* @returns {(integer|Error)} index or an error object\n*/\nfunction fieldIndex( names, name ) {\n\tvar idx;\n\tif ( names.length === 0 ) {\n\t\treturn new Error( 'invalid operation. struct does not have any fields.' );\n\t}\n\tidx = indexOf( names, name, 0 );\n\tif ( idx < 0 ) {\n\t\treturn new TypeError( format( 'invalid argument. Field name must be one of the following: \"%s\". Value: `%s`.', join( names, ', ' ), name ) );\n\t}\n\treturn idx;\n}\n\n\n// EXPORTS //\n\nexport default fieldIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport min from '@stdlib/math-base-special-fast-min';\nimport isUnionType from './is_union_type.js';\n\n\n// FUNCTIONS //\n\n/**\n* Sets alignment padding for one or more field objects.\n*\n* ## Notes\n*\n* - This function mutates each field object.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @param {NonNegativeInteger} padding - alignment padding\n* @returns {Array} input array\n*/\nfunction setPadding( fields, padding ) {\n\tvar i;\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\tfields[ i ].padding = padding;\n\t}\n\treturn fields;\n}\n\n\n// MAIN //\n\n/**\n* Computes the byte offset for each field.\n*\n* ## Notes\n*\n* - This function mutates each field object.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @param {PositiveInteger} max - maximum alignment\n* @returns {Array} input array\n*/\nfunction byteOffsets( fields, max ) {\n\tvar alignment;\n\tvar padding;\n\tvar offset;\n\tvar tmp;\n\tvar o;\n\tvar i;\n\tvar j;\n\n\toffset = 0;\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// Resolve the alignment requirement for this field:\n\t\talignment = min( o.alignment, max );\n\n\t\t// Align the current offset to the required boundary:\n\t\tpadding = ( alignment-(offset%alignment) ) % alignment;\n\t\toffset += padding;\n\n\t\t// Set the padding for the previous member:\n\t\tif ( i > 0 ) {\n\t\t\ttmp = fields[ i-1 ];\n\t\t\ttmp.padding = padding;\n\t\t\tif ( isUnionType( o ) ) {\n\t\t\t\tsetPadding( tmp.fields, padding );\n\t\t\t}\n\t\t}\n\t\t// Set the offset for the current member:\n\t\to.byteOffset = offset;\n\n\t\t// If the current member is a union type, propagate the offset to its child field objects...\n\t\tif ( isUnionType( o ) ) {\n\t\t\tfor ( j = 0; j < o.fields.length; j++ ) {\n\t\t\t\to.fields[ j ].byteOffset = offset;\n\t\t\t}\n\t\t}\n\t\t// Advance the offset by the size, in bytes, of the member:\n\t\toffset += o.byteLength;\n\t}\n\t// Compute the padding for the last member:\n\tpadding = ( alignment - (offset%alignment) ) % alignment;\n\n\t// Set the padding for the last member:\n\to.padding = padding;\n\n\t// If the last member is a union type, propagate the offset to its child field objects...\n\tif ( isUnionType( o ) ) {\n\t\tsetPadding( o.fields, padding );\n\t}\n\n\treturn fields;\n}\n\n\n// EXPORTS //\n\nexport default byteOffsets;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport replace from '@stdlib/string-base-replace';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Returns a new regular expression for matching byte parameters.\n*\n* @private\n* @returns {RegExp} regular expression\n*/\nfunction reByteOffset() {\n\treturn /\\[(\\d{1,}),/g;\n}\n\n/**\n* Returns a function for replacing byte values in a serialized struct.\n*\n* @private\n* @param {NonNegativeInteger} offset - byte offset\n* @returns {Function} replacer function\n*/\nfunction replacer( offset ) {\n\treturn wrapped;\n\n\t/**\n\t* Callback invoked for each match.\n\t*\n\t* @private\n\t* @param {string} match - matched substring\n\t* @param {string} p1 - first matched capture group substring\n\t* @returns {string} replacement string\n\t*/\n\tfunction wrapped( match, p1 ) {\n\t\treturn format( '[%u,', offset+parseInt( p1, 10 ) );\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Serializes a struct to a layout format.\n*\n* ## Notes\n*\n* - The output format is a multi-column format having the following layout:\n*\n* ```text\n* | ...[byte_offset,byte_length] |\n* ```\n*\n* For example,\n*\n* ```text\n* |[0,8]|[8,1]|[16,16]|[32,8]|\n* ```\n*\n* @private\n* @param {Array} fields - list of normalized fields\n* @returns {string} string representation\n*/\nfunction layoutFormat( fields ) {\n\tvar out;\n\tvar tmp;\n\tvar re;\n\tvar N;\n\tvar o;\n\tvar i;\n\n\tN = fields.length;\n\n\t// Create a new regular expression for matching byte offsets:\n\tre = reByteOffset();\n\n\tout = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// If we are currently processing fields in a union, move along to the next non-union field...\n\t\tif ( i > 0 && ( o.byteOffset === fields[ i-1 ].byteOffset ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t// If the current type is a struct, we need to serialize and then post-process...\n\t\tif ( o.isStructType ) {\n\t\t\tout.push( replace( o.type.layout, re, replacer( o.byteOffset ) ) );\n\t\t\tcontinue;\n\t\t}\n\t\t// Format the field data:\n\t\tout.push( format( '|<%s>[%u,%u]', o.type, o.byteOffset, o.byteLength ) );\n\t}\n\ttmp = format( '%s|', out.join( '' ) );\n\n\t// If we having a trailing `||` due to a nested struct, remove the final `|`:\n\tif ( tmp[ tmp.length-2 ] === '|' ) {\n\t\ttmp = tmp.substring( 0, tmp.length-1 );\n\t}\n\treturn tmp;\n}\n\n\n// EXPORTS //\n\nexport default layoutFormat;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPlainObject from '@stdlib/assert-is-plain-object';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\nimport linearFormat from './format_linear.js';\nimport layoutFormat from './format_layout.js';\n\n\n// VARIABLES //\n\nvar FORMATS = [\n\t'none',\n\t'linear',\n\t'layout'\n];\nvar isFormat = contains( FORMATS );\n\n\n// MAIN //\n\n/**\n* Serializes a struct to a string.\n*\n* @private\n* @param {Function} Struct - struct constructor\n* @param {Array} fields - list of normalized fields\n* @param {Options} options - function options\n* @param {string} [options.format] - serialization format\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {string} string representation\n*/\nfunction toString( Struct, fields, options ) { // eslint-disable-line stdlib/no-redeclare\n\tvar opts;\n\tif ( !isPlainObject( options ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\topts = {\n\t\t'format': 'none'\n\t};\n\tif ( hasOwnProp( options, 'format' ) ) {\n\t\topts.format = options.format;\n\t\tif ( !isFormat( opts.format ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'format', join( FORMATS, ', ' ), options.format ) );\n\t\t}\n\t}\n\tif ( opts.format === 'linear' ) {\n\t\treturn linearFormat( Struct, fields );\n\t}\n\tif ( opts.format === 'layout' ) {\n\t\treturn layoutFormat( fields );\n\t}\n\t// Case: opts.format === 'none'\n\treturn '';\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport floor from '@stdlib/math-base-special-floor';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Serializes a struct to a linear string format.\n*\n* ## Notes\n*\n* - The output format is a three-column format having the following layout:\n*\n* ```text\n* | byte_number | [field|padding] | notes |\n* ```\n*\n* - Nested `struct` instances are intentionally treated as opaque types, as we have limited access to struct internals (e.g., packed versus unpacked, field padding, etc), and we would effectively have to recompute all alignments and associated field data for the purposes of rendering. A user can always separately render a nested `struct` instance to a string in order to better understand its layout independently of its surrounding context in a parent `struct` instance.\n*\n* @private\n* @param {Function} Struct - struct constructor\n* @param {Array} fields - list of normalized fields\n* @returns {string} string representation\n*/\nfunction linearFormat( Struct, fields ) {\n\tvar nbytes;\n\tvar fmt0;\n\tvar fmt1;\n\tvar fmt2;\n\tvar bfmt;\n\tvar ufmt;\n\tvar fmt;\n\tvar tmp;\n\tvar out;\n\tvar flg;\n\tvar ib;\n\tvar c0;\n\tvar c1;\n\tvar c2;\n\tvar w0;\n\tvar w1;\n\tvar w;\n\tvar N;\n\tvar o;\n\tvar f;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tN = fields.length;\n\n\t// Resolve the size of the struct:\n\tnbytes = Struct.byteLength;\n\n\t// Compute the width of the first column:\n\tw0 = ( nbytes-1 ).toString().length;\n\n\t// Define a format string for the first column:\n\tfmt0 = '%'+w0+'s';\n\n\t// Determine the longest field name...\n\tw1 = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// Format: []\n\t\tw = o.name.length + 1 + ( o.byteLength-1 ).toString().length + 1;\n\t\tif ( w > w1 ) {\n\t\t\tw1 = w;\n\t\t}\n\t}\n\t// Define a format string for the second column:\n\tfmt1 = '%'+w1+'s';\n\n\t// Define a format string for the third column:\n\tfmt2 = '// %s';\n\n\t// Define a format string which combines the columns:\n\tfmt = '%s: %s %s';\n\n\t// Initialize a byte counter:\n\tib = 0;\n\n\tout = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// If we are currently processing fields in a union, move along to the next non-union field...\n\t\tif ( i > 0 && ( o.byteOffset === fields[ i-1 ].byteOffset ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t// Check whether this field is the first field of a union...\n\t\tif ( i < N-1 ) {\n\t\t\tflg = ( o.byteOffset === fields[ i+1 ].byteOffset );\n\t\t} else {\n\t\t\tflg = false;\n\t\t}\n\t\tfor ( j = 0; j < o.byteLength; j++ ) {\n\t\t\t// In the first column, render the byte number:\n\t\t\tc0 = format( fmt0, ib.toString() );\n\n\t\t\t// In the second column, render the field name and the byte number relative to the field:\n\t\t\tc1 = format( fmt1, format( '%s[%u]', o.name, j ) );\n\n\t\t\t// If a field type spans multiple bytes, render the byte number:\n\t\t\tif ( o.alignment > 1 ) {\n\t\t\t\tbfmt = ' (byte %u)';\n\t\t\t} else {\n\t\t\t\tbfmt = '';\n\t\t\t}\n\t\t\t// If a field is part of a union, make that explicit:\n\t\t\tif ( flg ) {\n\t\t\t\tufmt = ' => union: %s';\n\t\t\t\ttmp = [];\n\t\t\t\tk = i + 1;\n\t\t\t\twhile ( k < N && o.byteOffset === fields[ k ].byteOffset ) {\n\t\t\t\t\tf = fields[ k ];\n\t\t\t\t\tif ( f.isStructType ) {\n\t\t\t\t\t\tt = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt = f.type;\n\t\t\t\t\t}\n\t\t\t\t\ttmp.push( format( '%s<%s>[%u]', f.name, t, j%f.alignment ) );\n\t\t\t\t\tk += 1;\n\t\t\t\t}\n\t\t\t\tufmt = format( ufmt, tmp.join( ', ' ) );\n\t\t\t} else {\n\t\t\t\tufmt = '';\n\t\t\t}\n\t\t\ttmp = format( bfmt+ufmt, j%o.alignment );\n\n\t\t\t// If a field contains multiple elements (i.e., is an array), render the field type along with the element number:\n\t\t\tif ( o.length ) {\n\t\t\t\tc2 = format( fmt2, format( '%s[%u]%s', o.type, floor( j/o.alignment ), tmp ) );\n\t\t\t}\n\t\t\t// Otherwise, just render the field type:\n\t\t\telse {\n\t\t\t\tc2 = format( fmt2, format( '%s%s', o.type, tmp ) );\n\t\t\t}\n\t\t\t// Render the row string:\n\t\t\tout.push( format( fmt, c0, c1, c2 ) );\n\t\t\tib += 1;\n\t\t}\n\t\tfor ( j = 0; j < o.padding; j++ ) {\n\t\t\tc0 = format( fmt0, ib.toString() );\n\t\t\tc1 = format( fmt1, '--' );\n\t\t\tc2 = format( fmt2, 'padding' );\n\t\t\tout.push( format( fmt, c0, c1, c2 ) );\n\t\t\tib += 1;\n\t\t}\n\t}\n\treturn out.join( '\\n' );\n}\n\n\n// EXPORTS //\n\nexport default linearFormat;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Dummy function.\n*\n* @private\n*/\nfunction foo() {\n\t// No-op...\n}\n\n\n// EXPORTS //\n\nexport default foo;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport hasFunctionNameSupport from '@stdlib/assert-has-function-name-support';\nimport format from '@stdlib/string-format';\nimport { REGEXP as RE } from '@stdlib/regexp-function-name';\n\n\n// VARIABLES //\n\nvar isFunctionNameSupported = hasFunctionNameSupport();\n\n\n// MAIN //\n\n/**\n* Returns the name of a function.\n*\n* @param {Function} fcn - input function\n* @throws {TypeError} must provide a function\n* @returns {string} function name\n*\n* @example\n* var v = functionName( Math.sqrt );\n* // returns 'sqrt'\n*\n* @example\n* var v = functionName( function foo(){} );\n* // returns 'foo'\n*\n* @example\n* var v = functionName( function(){} );\n* // returns '' || 'anonymous'\n*\n* @example\n* var v = functionName( String );\n* // returns 'String'\n*/\nfunction functionName( fcn ) {\n\t// TODO: add support for generator functions?\n\tif ( isFunction( fcn ) === false ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isFunctionNameSupported ) {\n\t\treturn fcn.name;\n\t}\n\treturn RE.exec( fcn.toString() )[ 1 ];\n}\n\n\n// EXPORTS //\n\nexport default functionName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport foo from './foo.js';\n\n\n// MAIN //\n\n/**\n* Tests for native function `name` support.\n*\n* @returns {boolean} boolean indicating if an environment has function `name` support\n*\n* @example\n* var bool = hasFunctionNameSupport();\n* // returns \n*/\nfunction hasFunctionNameSupport() {\n\treturn ( foo.name === 'foo' );\n}\n\n\n// EXPORTS //\n\nexport default hasFunctionNameSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Int8Array from '@stdlib/array-int8';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float32Array from '@stdlib/array-float32';\nimport Float64Array from '@stdlib/array-float64';\n\n\n// MAIN //\n\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\nimport fcnName from '@stdlib/utils-function-name';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport Float64Array from '@stdlib/array-float64';\nimport CTORS from './ctors.js';\nimport NAMES from './names.json';\n\n\n// VARIABLES //\n\n// Abstract `TypedArray` class:\nvar TypedArray = ( hasFloat64ArraySupport() ) ? getPrototypeOf( Float64Array ) : Dummy; // eslint-disable-line max-len\n\n// Ensure abstract typed array class has expected name:\nTypedArray = ( fcnName( TypedArray ) === 'TypedArray' ) ? TypedArray : Dummy;\n\n\n// FUNCTIONS //\n\n/**\n* Dummy constructor.\n*\n* @private\n*/\nfunction Dummy() {} // eslint-disable-line no-empty-function\n\n\n// MAIN //\n\n/**\n* Tests if a value is a typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a typed array\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var bool = isTypedArray( new Int8Array( 10 ) );\n* // returns true\n*/\nfunction isTypedArray( value ) {\n\tvar v;\n\tvar i;\n\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for the abstract class...\n\tif ( value instanceof TypedArray ) {\n\t\treturn true;\n\t}\n\t// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired class...\n\twhile ( value ) {\n\t\tv = ctorName( value );\n\t\tfor ( i = 0; i < NAMES.length; i++ ) {\n\t\t\tif ( NAMES[ i ] === v ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\n\n\n// MAIN //\n\nvar CTORS = [\n\tComplex128Array,\n\tComplex64Array\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.hasInstance` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.hasInstance` support\n*\n* @example\n* var bool = hasHasInstanceSymbolSupport();\n* // returns \n*/\nfunction hasHasInstanceSymbolSupport() { // eslint-disable-line id-length\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'hasInstance' ) &&\n\t\ttypeof Symbol.hasInstance === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasHasInstanceSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasHasInstanceSymbolSupport from '@stdlib/assert-has-has-instance-symbol-support'; // eslint-disable-line id-length\n\n\n// MAIN //\n\n/**\n* Has instance symbol.\n*\n* @name HasInstanceSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* import isArray from '@stdlib/assert-is-array';\n*\n* function ArrayLike() {\n* return {\n* 'length': 3,\n* '0': 1,\n* '1': 2,\n* '2': 3\n* };\n* };\n*\n* ArrayLike[ HasInstanceSymbol ] = isArray;\n*/\nvar HasInstanceSymbol = ( hasHasInstanceSymbolSupport() ) ? Symbol.hasInstance : null; // eslint-disable-line max-len\n\n\n// EXPORTS //\n\nexport default HasInstanceSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasHasInstanceSymbolSupport from '@stdlib/assert-has-has-instance-symbol-support'; // eslint-disable-line id-length\nimport HasInstanceSymbol from '@stdlib/symbol-has-instance';\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar hasSupport = hasHasInstanceSymbolSupport();\n\n\n// MAIN //\n\n/**\n* Tests whether a value has in its prototype chain a specified constructor as a prototype property.\n*\n* @param {*} value - value to test\n* @param {Function} constructor - constructor to test against\n* @throws {TypeError} constructor must be callable\n* @returns {boolean} boolean indicating whether a value is an instance of a provided constructor\n*\n* @example\n* var bool = instanceOf( [], Array );\n* // returns true\n*\n* @example\n* var bool = instanceOf( {}, Object ); // exception\n* // returns true\n*\n* @example\n* var bool = instanceOf( 'beep', String );\n* // returns false\n*\n* @example\n* var bool = instanceOf( null, Object );\n* // returns false\n*\n* @example\n* var bool = instanceOf( 5, Object );\n* // returns false\n*/\nfunction instanceOf( value, constructor ) {\n\t// TODO: replace with `isCallable` check\n\tif (\n\t\ttypeof constructor !== 'function' &&\n\t\t!(\n\t\t\thasSupport &&\n\t\t\ttypeof constructor === 'object' &&\n\t\t\ttypeof constructor[ HasInstanceSymbol ] === 'function'\n\t\t)\n\t) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be callable. Value: `%s`.', constructor ) );\n\t}\n\treturn ( value instanceof constructor );\n}\n\n\n// EXPORTS //\n\nexport default instanceOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Int8Array from '@stdlib/array-int8';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float32Array from '@stdlib/array-float32';\nimport Float64Array from '@stdlib/array-float64';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\nvar CTORS = [\n\t[ Float64Array, 'Float64Array' ],\n\t[ Float32Array, 'Float32Array' ],\n\t[ Int32Array, 'Int32Array' ],\n\t[ Uint32Array, 'Uint32Array' ],\n\t[ Int16Array, 'Int16Array' ],\n\t[ Uint16Array, 'Uint16Array' ],\n\t[ Int8Array, 'Int8Array' ],\n\t[ Uint8Array, 'Uint8Array' ],\n\t[ Uint8ClampedArray, 'Uint8ClampedArray' ],\n\t[ Complex64Array, 'Complex64Array' ],\n\t[ Complex128Array, 'Complex128Array' ],\n\t[ BooleanArray, 'BooleanArray' ]\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport instanceOf from '@stdlib/assert-instance-of';\nimport ctorName from '@stdlib/utils-constructor-name';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport CTORS from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns the typed array type.\n*\n* @private\n* @param {TypedArray} arr - typed array\n* @returns {(string|void)} typed array type\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( 5 );\n* var str = typeName( arr );\n* // returns 'Float64Array'\n*/\nfunction typeName( arr ) {\n\tvar v;\n\tvar i;\n\n\t// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( instanceOf( arr, CTORS[ i ][ 0 ] ) ) {\n\t\t\treturn CTORS[ i ][ 1 ];\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired native class...\n\twhile ( arr ) {\n\t\tv = ctorName( arr );\n\t\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\t\tif ( v === CTORS[ i ][ 1 ] ) {\n\t\t\t\treturn CTORS[ i ][ 1 ];\n\t\t\t}\n\t\t}\n\t\tarr = getPrototypeOf( arr );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default typeName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isTypedArray from '@stdlib/assert-is-typed-array';\nimport isComplexTypedArray from '@stdlib/assert-is-complex-typed-array';\nimport isBooleanArray from '@stdlib/assert-is-booleanarray';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport format from '@stdlib/string-format';\nimport typeName from './type.js';\n\n\n// MAIN //\n\n/**\n* Returns a JSON representation of a typed array.\n*\n* ## Notes\n*\n* - We build a JSON object representing a typed array similar to how Node.js `Buffer` objects are represented. See [Buffer][1].\n*\n* [1]: https://nodejs.org/api/buffer.html#buffer_buf_tojson\n*\n* @param {TypedArray} arr - typed array to serialize\n* @throws {TypeError} first argument must be a typed array\n* @returns {Object} JSON representation\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 5.0, 3.0 ] );\n* var json = typedarray2json( arr );\n* // returns { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }\n*/\nfunction typedarray2json( arr ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tif ( isTypedArray( arr ) ) {\n\t\tdata = arr;\n\t} else if ( isComplexTypedArray( arr ) ) {\n\t\tif ( arr.BYTES_PER_ELEMENT === 8 ) {\n\t\t\tdata = reinterpret64( arr, 0 );\n\t\t} else { // arr.BYTES_PER_ELEMENT === 16\n\t\t\tdata = reinterpret128( arr, 0 );\n\t\t}\n\t} else if ( isBooleanArray( arr ) ) {\n\t\tdata = reinterpretBoolean( arr, 0 );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a typed array. Value: `%s`.', arr ) );\n\t}\n\tout = {\n\t\t'type': typeName( arr ),\n\t\t'data': []\n\t};\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tout.data.push( data[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default typedarray2json;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport BooleanArray from '@stdlib/array-bool';\nimport constructorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a BooleanArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a BooleanArray\n*\n* @example\n* import BooleanArray from '@stdlib/array-bool';\n*\n* var bool = isBooleanArray( new BooleanArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isBooleanArray( [] );\n* // returns false\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\tvalue instanceof BooleanArray ||\n\t\tconstructorName( value ) === 'BooleanArray'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport CTORS from './ctors.js';\nimport NAMES from './names.json';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isComplexTypedArray( new Complex128Array( 10 ) );\n* // returns true\n*/\nfunction isComplexTypedArray( value ) {\n\tvar v;\n\tvar i;\n\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for complex typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired class...\n\twhile ( value ) {\n\t\tv = ctorName( value );\n\t\tfor ( i = 0; i < NAMES.length; i++ ) {\n\t\t\tif ( NAMES[ i ] === v ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isComplexTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, id-length, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setNonEnumerableReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport hasProp from '@stdlib/assert-has-property';\nimport min from '@stdlib/math-base-special-fast-min';\nimport filled from '@stdlib/array-base-filled';\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport DataView from '@stdlib/array-dataview';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport CTOR_NAME from './ctor_name.js';\nimport createPrototypeAccessors from './create_prototype_accessors.js';\nimport isStructInstance from './is_struct_instance.js';\nimport normalize from './normalize_field_list.js';\nimport fieldNames from './field_names.js';\nimport fieldIndex from './field_index.js';\nimport resolveAlignment from './resolve_alignment.js';\nimport byteOffsets from './byte_offsets.js';\nimport partitions from './partitions.js';\nimport flatten from './flatten_fields.js';\nimport struct2string from './to_string.js';\nimport struct2json from './to_json.js';\nimport layoutFormat from './format_layout.js';\n\n\n// MAIN //\n\n/**\n* Returns a constructor for creating a fixed-width composite data type (a.k.a., a `struct`).\n*\n* @param {ObjectArray} fields - structure fields\n* @throws {TypeError} first argument must be an array-like object containing objects\n* @throws {TypeError} field objects must have required properties\n* @throws {TypeError} field objects must have valid fields\n* @throws {TypeError} union types must be array-like objects containing objects\n* @throws {RangeError} union types must contain fields having the same byte length\n* @throws {TypeError} union types cannot contain nested union types\n* @throws {TypeError} union types can only contain one field with a default value\n* @throws {Error} unexpected error\n* @returns {Function} constructor\n*\n* @example\n* var fields = [\n* {\n* 'type': 'union',\n* 'fields': [\n* {\n* 'name': 'double',\n* 'description': 'double-precision floating-point number',\n* 'type': 'float64',\n* 'enumerable': true,\n* 'writable': true,\n* 'castingMode': 'none'\n* },\n* {\n* 'name': 'words',\n* 'description': 'high and low words',\n* 'type': 'uint32',\n* 'length': 2,\n* 'enumerable': true,\n* 'writable': true,\n* 'castingMode': 'none'\n* }\n* ]\n* }\n* ];\n* var Struct = factory( fields );\n*\n* var data = {\n* 'double': 3.14\n* };\n* var s = new Struct( data );\n* // returns \n*\n* var v = s.double;\n* // returns 3.14\n*\n* var w = s.words;\n* // e.g., [ 1374389535, 1074339512 ]\n*/\nfunction factory( fields ) {\n\tvar FIELD_NAMES;\n\tvar BYTE_LENGTH;\n\tvar PARTITIONS;\n\tvar ALIGNMENT;\n\tvar ACCESSORS;\n\tvar FIELDS;\n\tvar tmp;\n\tvar o;\n\tif ( !isCollection( fields ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', fields ) );\n\t}\n\t// Normalize the list of field objects:\n\ttmp = normalize( fields );\n\tif ( tmp instanceof Error ) {\n\t\tthrow tmp;\n\t}\n\tFIELDS = tmp;\n\n\t// Resolve the list of unique field names:\n\ttmp = fieldNames( FIELDS );\n\tif ( tmp instanceof Error ) {\n\t\tthrow tmp;\n\t}\n\tFIELD_NAMES = tmp;\n\n\t// Resolve the struct's alignment requirements:\n\tALIGNMENT = resolveAlignment( FIELDS );\n\n\t// Compute the byte offset for each field:\n\tFIELDS = byteOffsets( FIELDS, ALIGNMENT );\n\n\t// Now that we've finished processing provided field objects, flatten the list, such that union types are implied by field objects having the same byte offset:\n\tFIELDS = flatten( FIELDS );\n\n\t// Compute field \"partitions\" (i.e., non-overlapping views):\n\tPARTITIONS = partitions( FIELDS );\n\n\t// Compute the struct's byte length:\n\to = FIELDS[ FIELDS.length-1 ];\n\tBYTE_LENGTH = o.byteOffset + o.byteLength + o.padding;\n\n\t/**\n\t* Constructor for a composite data type (a.k.a., a `struct`).\n\t*\n\t* @private\n\t* @param {(Object|ArrayBuffer)} [arg] - array buffer or data object\n\t* @param {NonNegativeInteger} [byteOffset=0] - offset, in bytes, to the first byte in a provided buffer for the returned `struct` to reference\n\t* @param {NonNegativeInteger} [byteLength] - maximum number of elements in the byte array\n\t* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n\t* @throws {TypeError} second argument must be a nonnegative integer\n\t* @throws {TypeError} third argument must be a nonnegative integer\n\t* @throws {Error} union types may only be initialized by a single member\n\t* @returns {Struct} struct instance\n\t*/\n\tfunction Struct( arg, byteOffset, byteLength ) {\n\t\tvar values;\n\t\tvar nargs;\n\t\tvar cache;\n\t\tvar view;\n\t\tvar obj;\n\t\tvar o;\n\t\tvar v;\n\t\tvar i;\n\t\tvar j;\n\t\tvar k;\n\n\t\tnargs = arguments.length;\n\t\tif ( !( this instanceof Struct ) ) {\n\t\t\tif ( nargs === 0 ) {\n\t\t\t\treturn new Struct();\n\t\t\t}\n\t\t\tif ( nargs === 1 ) {\n\t\t\t\treturn new Struct( arg );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\treturn new Struct( arg, byteOffset );\n\t\t\t}\n\t\t\treturn new Struct( arg, byteOffset, byteLength );\n\t\t}\n\t\tif ( isArrayBuffer( arg ) ) {\n\t\t\tif ( nargs === 1 ) {\n\t\t\t\tview = new DataView( arg, 0, BYTE_LENGTH );\n\t\t\t} else {\n\t\t\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t\t\t}\n\t\t\t\tif ( nargs === 2 ) {\n\t\t\t\t\tview = new DataView( arg, byteOffset, BYTE_LENGTH );\n\t\t\t\t} else {\n\t\t\t\t\tif ( !isNonNegativeInteger( byteLength ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Byte length must be a nonnegative integer. Value: `%s`.', byteLength ) );\n\t\t\t\t\t}\n\t\t\t\t\tview = new DataView( arg, byteOffset, min( byteLength, BYTE_LENGTH ) ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( view.byteLength < BYTE_LENGTH ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer has insufficient capacity. Minimum capacity: `%u`.', BYTE_LENGTH ) );\n\t\t\t}\n\t\t} else {\n\t\t\tview = new DataView( new ArrayBuffer( BYTE_LENGTH ) );\n\t\t\tif ( nargs > 0 ) {\n\t\t\t\tif ( !isObject( arg ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tobj = arg;\n\t\t\t}\n\t\t}\n\t\t// Bind the byte buffer to the current instance:\n\t\tsetReadOnly( this, PRIVATE_BUFFER, view );\n\n\t\t// If we were provided a data object, set provided fields...\n\t\tif ( obj !== void 0 ) {\n\t\t\t// Initialize an array containing values to set:\n\t\t\tvalues = filled( void 0, FIELDS.length );\n\n\t\t\t// For each field, determine whether a value has been specified...\n\t\t\tcache = {};\n\t\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\t\tk = FIELD_NAMES[ i ];\n\t\t\t\tj = PARTITIONS[ i ];\n\t\t\t\tif ( hasProp( obj, k ) ) {\n\t\t\t\t\t// Check whether a value has already been specified for this view (i.e., via another union member)...\n\t\t\t\t\tif ( cache[ j ] ) {\n\t\t\t\t\t\tthrow new Error( 'invalid argument. Union types may only be initialized by a single member.' );\n\t\t\t\t\t}\n\t\t\t\t\tvalues[ i ] = obj[ k ];\n\t\t\t\t\tcache[ j ] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Perform a second pass over the fields to fill in default initial values...\n\t\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\t\tj = PARTITIONS[ i ];\n\t\t\t\tif ( cache[ j ] ) {\n\t\t\t\t\t// Skip fields already having initial values...\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\to = FIELDS[ i ];\n\t\t\t\tif ( o.default !== void 0 ) {\n\t\t\t\t\tvalues[ i ] = o.default;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Set all fields with initialization values...\n\t\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\t\tv = values[ i ];\n\t\t\t\tif ( v !== void 0 ) {\n\t\t\t\t\tACCESSORS[ FIELD_NAMES[ i ] ][ 1 ].call( this, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t* Constructor name.\n\t*\n\t* @private\n\t* @name name\n\t* @memberof Struct\n\t* @readonly\n\t* @type {string}\n\t* @default 'Struct'\n\t*/\n\tsetReadOnly( Struct, 'name', CTOR_NAME );\n\n\t/**\n\t* Alignment.\n\t*\n\t* @private\n\t* @name alignment\n\t* @memberof Struct\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( Struct, 'alignment', ALIGNMENT );\n\n\t/**\n\t* Size (in bytes) of the `struct`.\n\t*\n\t* @private\n\t* @name byteLength\n\t* @memberof Struct\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( Struct, 'byteLength', BYTE_LENGTH );\n\n\t/**\n\t* Returns a list of `struct` fields.\n\t*\n\t* @private\n\t* @name fields\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Array}\n\t*/\n\tsetNonEnumerableReadOnlyAccessor( Struct, 'fields', function get() {\n\t\treturn FIELD_NAMES.slice();\n\t});\n\n\t/**\n\t* Returns a string corresponding to the `struct` layout.\n\t*\n\t* @private\n\t* @name layout\n\t* @memberof Struct\n\t* @readonly\n\t* @type {string}\n\t*/\n\tsetNonEnumerableReadOnlyAccessor( Struct, 'layout', function get() {\n\t\t// As this is not likely to be a commonly used API, intentionally recompute the layout format in order to avoid consuming memory for what could be a long string...\n\t\treturn layoutFormat( FIELDS );\n\t});\n\n\t/**\n\t* Returns the underlying byte buffer of a `struct`.\n\t*\n\t* @private\n\t* @name bufferOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {Object} obj - struct instance\n\t* @throws {TypeError} must provide a `struct` instance\n\t* @returns {ArrayBuffer} underlying byte buffer\n\t*/\n\tsetReadOnly( Struct, 'bufferOf', function bufferOf( obj ) {\n\t\tif ( !isStructInstance( obj ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a `struct` instance. Value: `%s`.', obj ) );\n\t\t}\n\t\treturn obj[ PRIVATE_BUFFER ].buffer;\n\t});\n\n\t/**\n\t* Returns the length, in bytes, of the value specified by the provided field name.\n\t*\n\t* @private\n\t* @name byteLengthOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {NonNegativeInteger} byte length\n\t*/\n\tsetReadOnly( Struct, 'byteLengthOf', function byteLengthOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].byteLength;\n\t});\n\n\t/**\n\t* Returns the offset, in bytes, from the beginning of a `struct` to the value specified by the provided field name.\n\t*\n\t* @private\n\t* @name byteOffsetOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {NonNegativeInteger} byte offset\n\t*/\n\tsetReadOnly( Struct, 'byteOffsetOf', function byteOffsetOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].byteOffset;\n\t});\n\n\t/**\n\t* Returns the description associated with a provided field name.\n\t*\n\t* @private\n\t* @name descriptionOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {string} description\n\t*/\n\tsetReadOnly( Struct, 'descriptionOf', function descriptionOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].description;\n\t});\n\n\t/**\n\t* Returns a boolean indicating whether a provided value is a `struct` instance.\n\t*\n\t* @private\n\t* @name isStruct\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {*} value - input value\n\t* @returns {boolean} boolean indicating whether a value is a `struct` instance\n\t*/\n\tsetReadOnly( Struct, 'isStruct', function isStruct( value ) {\n\t\treturn (\n\t\t\tvalue instanceof Struct ||\n\t\t\t(\n\t\t\t\tisStructInstance( value ) &&\n\t\t\t\tisStructConstructorLike( value.constructor )\n\t\t\t)\n\t\t);\n\t});\n\n\t/**\n\t* Returns the type associated with a provided field name.\n\t*\n\t* @private\n\t* @name typeOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {(string|Object)} type\n\t*/\n\tsetReadOnly( Struct, 'typeOf', function typeOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].type;\n\t});\n\n\t/**\n\t* Returns the underlying byte buffer of a `struct` as a `DataView`.\n\t*\n\t* @private\n\t* @name viewOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {Object} obj - struct instance\n\t* @throws {TypeError} must provide a `struct` instance\n\t* @returns {DataView} view of underlying byte buffer\n\t*/\n\tsetReadOnly( Struct, 'viewOf', function viewOf( obj ) {\n\t\tvar buf;\n\t\tif ( !isStructInstance( obj ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a `struct` instance. Value: `%s`.', obj ) );\n\t\t}\n\t\tbuf = obj[ PRIVATE_BUFFER ];\n\t\treturn new DataView( buf.buffer, buf.byteOffset, buf.byteLength );\n\t});\n\n\t// Create prototype accessors for getting and setting field values:\n\tACCESSORS = createPrototypeAccessors( Struct.prototype, FIELDS );\n\n\t/**\n\t* Serializes a `struct` to a string.\n\t*\n\t* @private\n\t* @name toString\n\t* @memberof Struct.prototype\n\t* @readonly\n\t* @type {Function}\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.format='none'] - serialization format\n\t* @throws {Error} `this` must be a struct instance\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {string} serialized `struct` instance\n\t*/\n\tsetReadOnly( Struct.prototype, 'toString', function toString() {\n\t\tvar opts;\n\t\tif ( !( this instanceof Struct ) ) {\n\t\t\tthrow new Error( 'invalid invocation. `this` is not a struct instance.' );\n\t\t}\n\t\tif ( arguments.length > 0 ) {\n\t\t\topts = arguments[ 0 ];\n\t\t} else {\n\t\t\topts = {};\n\t\t}\n\t\treturn struct2string( Struct, FIELDS, opts );\n\t});\n\n\t/**\n\t* Serializes a `struct` to JSON.\n\t*\n\t* @private\n\t* @name toJSON\n\t* @memberof Struct.prototype\n\t* @readonly\n\t* @type {Function}\n\t* @throws {Error} `this` must be a struct instance\n\t* @returns {JSON} serialized `struct` instance\n\t*/\n\tsetReadOnly( Struct.prototype, 'toJSON', function toJSON() {\n\t\tif ( !( this instanceof Struct ) ) {\n\t\t\tthrow new Error( 'invalid invocation. `this` is not a struct instance.' );\n\t\t}\n\t\treturn struct2json( this, FIELDS );\n\t});\n\n\treturn Struct;\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert-is-object';\nimport format from '@stdlib/string-format';\nimport FIELD_PROPERTIES from './field_properties.js';\nimport isUnionType from './is_union_type.js';\nimport normalizeField from './normalize_field.js';\nimport normalizeUnion from './normalize_union.js';\n\n\n// MAIN //\n\n/**\n* Normalizes a list of field objects.\n*\n* @private\n* @param {Array} fields - input fields\n* @returns {(Array|Error)} normalized field objects or an error\n*/\nfunction normalize( fields ) {\n\tvar out;\n\tvar tmp;\n\tvar o;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tif ( !isObject( o ) ) {\n\t\t\treturn new TypeError( format( 'invalid argument. First argument must be an array of objects. Value: `%s`. Index: `%d`.', o, i ) );\n\t\t}\n\t\t// Check for a union type which is a collection of nested field objects which all have the same byte length...\n\t\tif ( isUnionType( o ) ) {\n\t\t\ttmp = normalizeUnion( o );\n\t\t\tif ( tmp === null ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. Union types must be an array of objects. Value: `%s`. Index: `%d`.', JSON.stringify( o ), i ) );\n\t\t\t}\n\t\t\tif ( tmp instanceof Error ) {\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t} else {\n\t\t\ttmp = normalizeField( o, FIELD_PROPERTIES );\n\t\t\tif ( tmp instanceof Error ) {\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\nimport isUnionType from './is_union_type.js';\n\n\n// MAIN //\n\n/**\n* Resolves a list of field names.\n*\n* @private\n* @param {Array} fields - list of field objects\n* @returns {(Array|Error)} list of field names or an error\n*/\nfunction fieldNames( fields ) {\n\tvar hash;\n\tvar out;\n\tvar o1;\n\tvar o2;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\thash = {};\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to1 = fields[ i ];\n\t\tk = o1.name;\n\t\tif ( isUnionType( o1 ) ) {\n\t\t\tfor ( j = 0; j < o1.fields.length; j++ ) {\n\t\t\t\to2 = o1.fields[ j ];\n\t\t\t\tk = o2.name;\n\t\t\t\tif ( hash[ k ] === true ) {\n\t\t\t\t\treturn new TypeError( format( 'invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t\t\t}\n\t\t\t\thash[ k ] = true;\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t} else if ( hash[ k ] === true ) {\n\t\t\treturn new TypeError( format( 'invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t} else {\n\t\t\thash[ k ] = true;\n\t\t\tout.push( k );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fieldNames;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUnionType from './is_union_type.js';\n\n\n// MAIN //\n\n/**\n* Flattens a list of field objects.\n*\n* @private\n* @param {Array} fields - list of field objects\n* @returns {Array} new list\n*/\nfunction flatten( fields ) {\n\tvar out;\n\tvar o;\n\tvar i;\n\tvar j;\n\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tif ( isUnionType( o ) ) {\n\t\t\tfor ( j = 0; j < o.fields.length; j++ ) {\n\t\t\t\tout.push( o.fields[ j ] );\n\t\t\t}\n\t\t} else {\n\t\t\tout.push( o );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default flatten;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a list of partition indices.\n*\n* ## Notes\n*\n* - This function partitions field objects according to whether a field object represents a unique \"view\" over an underlying byte buffer. Field objects within a union belong to the same partition.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @returns {NonNegativeIntegerArray} list of indices\n*/\nfunction partitions( fields ) {\n\tvar out;\n\tvar N;\n\tvar o;\n\tvar i;\n\tvar j;\n\n\tN = fields.length;\n\n\tout = [];\n\tj = 0;\n\tfor ( i = 0; i < N-1; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// Check for the start of a union...\n\t\tif ( o.byteOffset === fields[ i+1 ].byteOffset ) {\n\t\t\tout.push( j );\n\t\t\tcontinue;\n\t\t}\n\t\tout.push( j );\n\t\tj += 1;\n\t}\n\t// Set the partition for the last field object:\n\tout.push( j );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default partitions;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable id-length */\n\n'use strict';\n\n// MODULES //\n\nimport setNonEnumerableReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport setNonEnumerableReadWriteAccessor from '@stdlib/utils-define-nonenumerable-read-write-accessor';\nimport setReadOnlyAccessor from '@stdlib/utils-define-read-only-accessor';\nimport setReadWriteAccessor from '@stdlib/utils-define-read-write-accessor';\nimport getter from './getter.js';\nimport setter from './setter.js';\n\n\n// MAIN //\n\n/**\n* Assigns methods for accessing field values to a provided prototype.\n*\n* @private\n* @param {Object} p - prototype\n* @param {Array} fields - field objects\n* @returns {Object} object containing accessors for each field\n*/\nfunction createPrototypeAccessors( p, fields ) {\n\tvar get;\n\tvar set;\n\tvar out;\n\tvar o;\n\tvar i;\n\n\tout = {};\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tget = getter( o );\n\t\tset = setter( o );\n\t\tif ( o.enumerable ) {\n\t\t\tif ( o.writable ) {\n\t\t\t\tsetReadWriteAccessor( p, o.name, get, set );\n\t\t\t} else {\n\t\t\t\tsetReadOnlyAccessor( p, o.name, get );\n\t\t\t}\n\t\t} else if ( o.writable ) {\n\t\t\tsetNonEnumerableReadWriteAccessor( p, o.name, get, set );\n\t\t} else {\n\t\t\tsetNonEnumerableReadOnlyAccessor( p, o.name, get );\n\t\t}\n\t\tout[ o.name ] = [ get, set ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default createPrototypeAccessors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isFunction from '@stdlib/assert-is-function';\nimport typedarray2json from '@stdlib/array-to-json';\nimport isStructInstance from './is_struct_instance.js';\n\n\n// MAIN //\n\n/**\n* Serializes a `struct` instance to JSON.\n*\n* @private\n* @param {Struct} struct - struct instance\n* @param {Array} fields - list of normalized fields\n* @returns {Object} JSON representation\n*/\nfunction toJSON( struct, fields ) {\n\tvar out;\n\tvar o;\n\tvar v;\n\tvar i;\n\n\tout = {};\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tv = struct[ o.name ];\n\t\tif ( isCollection( v ) ) {\n\t\t\tv = typedarray2json( v );\n\t\t} else if ( isStructInstance( v ) ) {\n\t\t\tv = v.toJSON();\n\t\t} else if ( isComplexLike( v ) && isFunction( v.toJSON ) ) {\n\t\t\tv = v.toJSON();\n\t\t}\n\t\tout[ o.name ] = v;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport Uint8Array from '@stdlib/array-uint8';\nimport { ndarray as gcopy } from '@stdlib/blas-base-gcopy';\n\n\n// MAIN //\n\n/**\n* Fills an output ArrayBuffer with array values.\n*\n* @private\n* @param {Function} Struct - struct constructor\n* @param {ArrayBuffer} buf - output data buffer\n* @param {Collection} arr - input array\n* @throws {TypeError} an input array must contain struct instances\n* @throws {TypeError} each element of an input array must be a struct instance having the expected layout\n* @returns {ArrayBuffer} output data buffer\n*/\nfunction fromArray( Struct, buf, arr ) {\n\tvar sbytes;\n\tvar bbytes;\n\tvar offset;\n\tvar layout;\n\tvar sview;\n\tvar opts;\n\tvar len;\n\tvar get;\n\tvar flg;\n\tvar nb;\n\tvar v;\n\tvar i;\n\n\topts = {\n\t\t'format': 'layout'\n\t};\n\n\tlen = arr.length;\n\tif ( arr.get && arr.set ) {\n\t\tget = accessorGetter( 'default' );\n\t} else {\n\t\tget = getter( 'default' );\n\t}\n\tlayout = Struct.layout;\n\tnb = Struct.byteLength;\n\n\t// FIXME: add optimization for when `buf` is a StructArray having the same layout, as can just copy bytes\n\n\tbbytes = new Uint8Array( buf );\n\toffset = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = get( arr, i );\n\t\ttry {\n\t\t\tsview = Struct.viewOf( v ); // note: this should throw if `v` is not a struct\n\t\t\tflg = true;\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\ttry {\n\t\t\t\t// Attempt to convert the input value to a struct instance:\n\t\t\t\tv = new Struct( v ); // note: this should throw if `v` is not an object with valid fields\n\t\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tsview = Struct.viewOf( v );\n\t\t\tflg = false;\n\t\t}\n\t\tif ( flg && v.toString( opts ) !== layout ) {\n\t\t\treturn null;\n\t\t}\n\t\tsbytes = new Uint8Array( sview.buffer, sview.byteOffset, sview.byteLength ); // eslint-disable-line max-len\n\t\tgcopy( nb, sbytes, 1, 0, bbytes, 1, offset );\n\t\toffset += nb;\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this, max-len, max-lines-per-function */\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isFunction from '@stdlib/assert-is-function';\nimport isObject from '@stdlib/assert-is-object';\nimport isPrototypeOf from '@stdlib/assert-is-prototype-of'; // eslint-disable-line stdlib/no-redeclare\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport hasProp from '@stdlib/assert-has-property';\nimport contains from '@stdlib/array-base-assert-contains';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport Uint8Array from '@stdlib/array-uint8';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport { ndarray as gcopy } from '@stdlib/blas-base-gcopy';\nimport structFactory from '@stdlib/dstructs-struct';\nimport format from '@stdlib/string-format';\nimport fromArray from './from_array.js';\nimport fromIterator from './from_iterator.js';\n\n\n// VARIABLES //\n\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\nvar CTOR_NAME = 'StructArray';\n\n\n// MAIN //\n\n/**\n* Returns a constructor for creating arrays having a fixed-width composite data type.\n*\n* @param {(Function|Array)} arg - struct constructor or struct schema\n* @throws {TypeError} first argument must be either a struct constructor or struct schema\n* @returns {Function} constructor\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema1 = [\n* {\n* 'name': 're',\n* 'type': 'float64'\n* },\n* {\n* 'name': 'im',\n* 'type': 'float64'\n* }\n* ];\n*\n* // Create a struct constructor for storing real and imaginary components:\n* var Components = structFactory( schema1 );\n*\n* var schema2 = [\n* {\n* 'type': 'union',\n* 'fields': [\n* {\n* 'name': 'value',\n* 'type': 'complex128'\n* },\n* {\n* 'name': 'components',\n* 'type': Components\n* }\n* ]\n* }\n* ];\n*\n* // Create a struct constructor for storing a double-precision complex number:\n* var Complex128Struct = structFactory( schema2 );\n*\n* // Create an array constructor for storing complex numbers:\n* var Complex128Array = factory( Complex128Struct );\n*\n* // Create a new array:\n* var x = new Complex128Array( 10 );\n* // returns \n*\n* // Retrieve the first element:\n* var v1 = x.get( 0 );\n*\n* // Resolve the complex number stored within the first element:\n* var z1 = v1.value;\n* // returns [ 0.0, 0.0 ]\n*\n* // Resolve the individual real and imaginary components:\n* var z2 = v1.components;\n*\n* var re = z2.re;\n* // returns 0.0\n*\n* var im = z2.im;\n* // returns 0.0\n*\n* // Create a new complex number struct:\n* var z3 = new Complex128Struct({\n* 'value': new Complex128( 3.0, 5.0 )\n* });\n*\n* // Update the first element of the array:\n* x.set( z3, 0 );\n*\n* // As `v1` is a view on same memory as the first element, resolve the complex number stored within the element:\n* var z4 = v1.value;\n* // returns [ 3.0, 5.0 ]\n*/\nfunction factory( arg ) { // eslint-disable-line stdlib/jsdoc-require-throws-tags\n\tvar BYTES_PER_ELEMENT;\n\tvar LAYOUT;\n\tvar FIELDS;\n\tvar Struct;\n\n\t// FIXME: add option support for strict input object validation (e.g., throw whenever non-struct properties are included on an object passed to `set`)\n\n\tif ( isCollection( arg ) ) {\n\t\tStruct = structFactory( arg ); // NOTE: delegate to `structFactory` to perform input validation\n\t} else if ( isStructConstructorLike( arg ) ) {\n\t\tStruct = arg;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either a struct constructor or struct schema. Value: `%s`.', arg ) );\n\t}\n\tBYTES_PER_ELEMENT = Struct.byteLength;\n\tLAYOUT = Struct.layout; // TODO: consider whether to lazily materialize the struct layout, as this could potentially be a long string (hence increased memory consumption) depending on the complexity of the struct\n\tFIELDS = Struct.fields;\n\n\t/**\n\t* Constructor which returns an array having a fixed-width composite data type.\n\t*\n\t* @private\n\t* @constructor\n\t* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n\t* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n\t* @param {NonNegativeInteger} [length] - view length\n\t* @throws {TypeError} must provide a valid first argument\n\t* @throws {TypeError} second argument must be a nonnegative integer\n\t* @throws {TypeError} third argument must be a nonnegative integer\n\t* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n\t* @throws {RangeError} second argument must be a multiple of struct byte length\n\t* @throws {RangeError} second argument must not exceeds the ArrayBuffer bounds\n\t* @throws {TypeError} view length must be a positive multiple of struct byte length\n\t* @throws {TypeError} an input array must contain valid elements\n\t* @returns {StructArray} struct array instance\n\t*/\n\tfunction StructArray( arg, byteOffset, length ) {\n\t\tvar nargs;\n\t\tvar buf;\n\t\tvar len;\n\t\tvar tmp;\n\n\t\tnargs = arguments.length;\n\t\tif ( !( this instanceof StructArray) ) {\n\t\t\tif ( nargs === 0 ) {\n\t\t\t\treturn new StructArray();\n\t\t\t}\n\t\t\tif ( nargs === 1 ) {\n\t\t\t\treturn new StructArray( arg );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\treturn new StructArray( arg, byteOffset );\n\t\t\t}\n\t\t\treturn new StructArray( arg, byteOffset, length );\n\t\t}\n\n\t\t// Case: new StructArray()\n\t\tif ( nargs === 0 ) {\n\t\t\tbuf = new ArrayBuffer( 0 );\n\t\t\tlen = 0;\n\t\t}\n\t\t// Case: new StructArray( arg )\n\t\telse if ( nargs === 1 ) {\n\t\t\t// Case: new StructArray( length )\n\t\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\t\tbuf = new ArrayBuffer( arg*BYTES_PER_ELEMENT );\n\t\t\t\tlen = arg;\n\t\t\t}\n\t\t\t// Case: new StructArray( collection )\n\t\t\telse if ( isCollection( arg ) ) {\n\t\t\t\tlen = arg.length;\n\t\t\t\tbuf = fromArray( Struct, new ArrayBuffer( len*BYTES_PER_ELEMENT ), arg );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of a provided input array must be a valid object or a struct instance having the same layout as elements in the desired output array.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( ArrayBuffer )\n\t\t\telse if ( isArrayBuffer( arg ) ) {\n\t\t\t\tbuf = arg;\n\t\t\t\tlen = buf.byteLength / BYTES_PER_ELEMENT;\n\t\t\t\tif ( !isInteger( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( iterable )\n\t\t\telse if ( isObject( arg ) ) {\n\t\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. First argument must be a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\ttmp = fromIterator( buf );\n\t\t\t\tlen = tmp.length;\n\t\t\t\tbuf = fromArray( Struct, new ArrayBuffer( len*BYTES_PER_ELEMENT ), tmp );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of a provided input iterable must be either a valid object or a struct instance having the same layout as elements in the desired output array.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( ???? )\n\t\t\telse {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t}\n\t\t// Case: new StructArray( ArrayBuffer, byteOffset[, length] )\n\t\telse {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t\t}\n\t\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Second argument must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t\t}\n\t\t\tif ( byteOffset >= buf.byteLength ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds the bounds of the ArrayBuffer. Value: `%s`.', byteOffset ) );\n\t\t\t}\n\t\t\t// Case: new StructArray( ArrayBuffer, byteOffset )\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\tlen = ( buf.byteLength - byteOffset ) / BYTES_PER_ELEMENT;\n\t\t\t\tif ( !isInteger( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength-byteOffset ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( ArrayBuffer, byteOffset, length )\n\t\t\telse {\n\t\t\t\tlen = length;\n\t\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t\t}\n\t\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsetReadOnly( this, '_buffer', buf );\n\t\tsetReadOnly( this, '_byteOffset', byteOffset || 0 );\n\t\tsetReadOnly( this, '_byteLength', len*BYTES_PER_ELEMENT );\n\t\tsetReadOnly( this, '_length', len );\n\t\treturn this;\n\t}\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof StructArray\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( StructArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n\t/**\n\t* Constructor name.\n\t*\n\t* @private\n\t* @name name\n\t* @memberof StructArray\n\t* @readonly\n\t* @type {string}\n\t*/\n\tsetReadOnly( StructArray, 'name', CTOR_NAME );\n\n\t/**\n\t* Element constructor.\n\t*\n\t* @private\n\t* @name struct\n\t* @memberof StructArray\n\t* @readonly\n\t* @type {Function}\n\t*/\n\tsetReadOnly( StructArray, 'struct', Struct );\n\n\t/**\n\t* Pointer to the underlying data buffer.\n\t*\n\t* @private\n\t* @name buffer\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {ArrayBuffer}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'buffer', function get() {\n\t\treturn this._buffer;\n\t});\n\n\t/**\n\t* Size (in bytes) of the array.\n\t*\n\t* @private\n\t* @name byteLength\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'byteLength', function get() {\n\t\treturn this._byteLength;\n\t});\n\n\t/**\n\t* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n\t*\n\t* @private\n\t* @name byteOffset\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'byteOffset', function get() {\n\t\treturn this._byteOffset;\n\t});\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( StructArray.prototype, 'BYTES_PER_ELEMENT', StructArray.BYTES_PER_ELEMENT );\n\n\t/**\n\t* Returns an array element.\n\t*\n\t* @private\n\t* @name get\n\t* @memberof StructArray.prototype\n\t* @type {Function}\n\t* @param {NonNegativeInteger} idx - element index\n\t* @throws {TypeError} `this` must be a struct array instance\n\t* @throws {TypeError} must provide a nonnegative integer\n\t* @returns {(*|void)} array element\n\t*/\n\tsetReadOnly( StructArray.prototype, 'get', function get( idx ) {\n\t\tif ( !isStructArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not a %s.', CTOR_NAME ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\treturn;\n\t\t}\n\t\treturn new Struct( this._buffer, this._byteOffset+( idx*BYTES_PER_ELEMENT ), BYTES_PER_ELEMENT );\n\t});\n\n\t/**\n\t* Number of array elements.\n\t*\n\t* @private\n\t* @name length\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'length', function get() {\n\t\treturn this._length;\n\t});\n\n\t/**\n\t* Sets an array element.\n\t*\n\t* ## Notes\n\t*\n\t* - When provided a struct array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n\t*\n\t* In the other overlapping scenario,\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n\t*\n\t* @private\n\t* @name set\n\t* @memberof StructArray.prototype\n\t* @type {Function}\n\t* @param {(Collection|StructArray|Struct|Object)} value - value(s)\n\t* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n\t* @throws {TypeError} `this` must be a struct array instance\n\t* @throws {TypeError} index argument must be a nonnegative integer\n\t* @throws {RangeError} index argument is out-of-bounds\n\t* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n\t* @throws {TypeError} must provide a valid object or a struct instance having the same layout as elements in the target array\n\t* @returns {void}\n\t*/\n\tsetReadOnly( StructArray.prototype, 'set', function set( value ) {\n\t\tvar bbytes;\n\t\tvar sbytes;\n\t\tvar sbuf;\n\t\tvar opts;\n\t\tvar idx;\n\t\tvar buf;\n\t\tvar tmp;\n\t\tvar get;\n\t\tvar nb;\n\t\tvar N;\n\t\tvar s;\n\t\tvar f;\n\t\tvar i;\n\t\tvar j;\n\t\tif ( !isStructArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not a %s.', CTOR_NAME ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tif ( arguments.length > 1 ) {\n\t\t\tidx = arguments[ 1 ];\n\t\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t\t}\n\t\t} else {\n\t\t\tidx = 0;\n\t\t}\n\t\topts = {\n\t\t\t'format': 'layout'\n\t\t};\n\t\tnb = Struct.byteLength;\n\n\t\tif ( isCollection( value ) && !contains( FIELDS, 'length' ) ) { // note: when one of the fields is 'length', we always assume that a provided value with a 'length' property is a struct and/or data object as there doesn't seem to be a surefire way to distinguish such an object from a regular array-like object (including accessor arrays)\n\t\t\tN = value.length;\n\t\t\tif ( idx+N > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\t\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Check for overlapping memory...\n\t\t\tj = this._byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// FIXME: add optimization when `value` is a StructArray sharing the same buffer and having the same layout; in which case, we can simply copy `src` bytes to a temporary array and then copy those bytes into the target array, without needing to intermediate struct instance materialization\n\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = [];\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\t\tthis.set( get( sbuf, i ), idx ); // note: this likely isn't the most performant approach, but it avoids having to replicate branching logic for handling struct instances vs data objects\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tif ( !isObject( value ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide either a valid object or a struct instance. Value: `%s`.', value ) );\n\t\t}\n\t\t// Check for a struct instance having a matching layout...\n\t\tif ( value.toString( opts ) === LAYOUT ) {\n\t\t\t// Explicitly copy the bytes of the input struct instance to the corresponding array element...\n\t\t\tsbuf = Struct.viewOf( value );\n\t\t\tsbytes = new Uint8Array( sbuf.buffer, sbuf.byteOffset, nb );\n\t\t\tbbytes = new Uint8Array( buf, this._byteOffset+( idx*BYTES_PER_ELEMENT ), nb );\n\t\t\tgcopy( nb, sbytes, 1, 0, bbytes, 1, 0 );\n\t\t\treturn;\n\t\t}\n\t\t// Create a struct instance view for the target element:\n\t\ts = new Struct( buf, this._byteOffset+( idx*BYTES_PER_ELEMENT ), nb );\n\n\t\t// Assign field values from the input object (accounting for both own and inherited properties)...\n\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\tf = FIELDS[ i ];\n\t\t\tif ( hasProp( value, f ) ) {\n\t\t\t\ts[ f ] = value[ f ];\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t* Element constructor.\n\t*\n\t* @private\n\t* @name struct\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {Function}\n\t*/\n\tsetReadOnly( StructArray.prototype, 'struct', Struct );\n\n\treturn StructArray;\n\n\t/**\n\t* Returns a boolean indicating if a value is a struct array.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating if a value is a struct array\n\t*/\n\tfunction isStructArray( value ) {\n\t\treturn (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === CTOR_NAME ||\n\t\t\t\tisPrototypeOf( value, StructArray.prototype )\n\t\t\t) &&\n\t\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t\t);\n\t}\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( v.value );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = require( 'buffer' ).Buffer;\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Buffer constructor.\n*\n* @module @stdlib/buffer-ctor\n*\n* @example\n* import ctor from '@stdlib/buffer-ctor';\n*\n* var b = new ctor( [ 1, 2, 3, 4 ] );\n* // returns \n*/\n\n// MODULES //\n\nimport hasNodeBufferSupport from '@stdlib/assert-has-node-buffer-support';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasNodeBufferSupport() ) {\n\tctor = main;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write (browser) polyfill\n\n// MAIN //\n\n/**\n* Buffer constructor.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Buffer from '@stdlib/buffer-ctor';\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Int16Array from '@stdlib/array-int16';\nimport Int32Array from '@stdlib/array-int32';\nimport Int8Array from '@stdlib/array-int8';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// FUNCTIONS //\n\n/**\n* Throws an error.\n*\n* @private\n* @throws {Error} not implemented\n*/\nfunction notImplemented() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// MAIN //\n\n// Mapping from data types to underlying buffer constructors...\nvar ctors = { // eslint-disable-line vars-on-top\n\t'binary': Buffer,\n\t'float64': Float64Array,\n\t'float32': Float32Array,\n\t'float16': notImplemented, // FIXME: replace with Float16Array constructor once implemented\n\t'generic': Array, // TODO: replace with `stdlib` pkg\n\t'int16': Int16Array,\n\t'int32': Int32Array,\n\t'int8': Int8Array,\n\t'uint16': Uint16Array,\n\t'uint32': Uint32Array,\n\t'uint8': Uint8Array,\n\t'uint8c': Uint8ClampedArray,\n\t'complex32': notImplemented, // FIXME: replace with Complex32Array constructor once implemented\n\t'complex64': Complex64Array,\n\t'complex128': Complex128Array,\n\t'bool': BooleanArray\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport isStructDataType from '@stdlib/ndarray-base-assert-is-struct-data-type';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\nimport structFactory from '@stdlib/array-struct-factory';\nimport table from './ctors.js';\n\n\n// VARIABLES //\n\n// Initialize a cache to storing memoized struct array constructors:\nvar CACHE = {}; // TODO: consider adding/using `@stdlib/array/memoized-struct-factory`; should we need to memoize struct array constructors elsewhere, we should centralize that logic, rather than have multiple caches.\n\n\n// MAIN //\n\n/**\n* Returns an ndarray data buffer constructor.\n*\n* @param {*} dtype - data type\n* @returns {(Function|null)} data buffer constructor or null\n*\n* @example\n* var ctor = ctors( 'float64' );\n* // returns \n*\n* @example\n* var ctor = ctors( 'float' );\n* // returns null\n*/\nfunction ctors( dtype ) {\n\tvar struct;\n\tvar ctor;\n\tvar key;\n\n\t// Case: string || dtype_instance_with_string\n\tif ( !isFunction( dtype ) ) {\n\t\tkey = resolveStr( dtype );\n\t\tctor = table[ key ] || null;\n\t\tif ( ctor ) {\n\t\t\treturn ctor;\n\t\t}\n\t}\n\t// Case: struct_ctor || dtype_instance_with_struct_ctor\n\tif ( isStructDataType( dtype ) ) {\n\t\tif ( key ) {\n\t\t\t// Data type instance (note: we assume that `key === struct.layout`):\n\t\t\tstruct = dtype.value;\n\t\t} else {\n\t\t\t// Struct constructor:\n\t\t\tstruct = dtype;\n\t\t\tkey = struct.layout;\n\t\t}\n\t\tctor = CACHE[ key ];\n\t\tif ( ctor ) {\n\t\t\treturn ctor;\n\t\t}\n\t\tctor = structFactory( struct );\n\t\tCACHE[ key ] = ctor;\n\t\treturn ctor;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Allocate a buffer having a specified number of bytes.\n*\n* @module @stdlib/buffer-alloc-unsafe\n*\n* @example\n* import allocUnsafe from '@stdlib/buffer-alloc-unsafe';\n*\n* var buf = allocUnsafe( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasAllocUnsafe from './has_alloc_unsafe.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar allocUnsafe;\nif ( hasAllocUnsafe ) {\n\tallocUnsafe = main;\n} else {\n\tallocUnsafe = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default allocUnsafe;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport Buffer from '@stdlib/buffer-ctor';\n\n\n// MAIN //\n\nvar bool = isFunction( Buffer.allocUnsafe );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\nimport format from '@stdlib/string-format';\nimport Buffer from '@stdlib/buffer-ctor';\n\n\n// MAIN //\n\n/**\n* Allocates a buffer having a specified number of bytes.\n*\n* ## Notes\n*\n* - The underlying memory of returned `Buffer` instances is not initialized. Memory contents are unknown and may contain sensitive data.\n* - When the size is less than half the pool size (specified on the `Buffer` constructor), memory is allocated from the `Buffer` pool for faster allocation of new `Buffer` instances.\n*\n* @param {NonNegativeInteger} size - number of bytes to allocate\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* var buf = allocUnsafe( 10 );\n* // returns \n*/\nfunction allocUnsafe( size ) {\n\tif ( !isNonNegativeInteger( size ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', size ) );\n\t}\n\treturn Buffer.allocUnsafe( size );\n}\n\n\n// EXPORTS //\n\nexport default allocUnsafe;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\nimport format from '@stdlib/string-format';\nimport Buffer from '@stdlib/buffer-ctor';\n\n\n// MAIN //\n\n/**\n* Allocates a buffer having a specified number of bytes.\n*\n* ## Notes\n*\n* - The underlying memory of returned `Buffer` instances is not initialized. Memory contents are unknown and may contain sensitive data.\n* - When the size is less than half the pool size (specified on the `Buffer` constructor), memory is allocated from the `Buffer` pool for faster allocation of new `Buffer` instances.\n*\n* @param {NonNegativeInteger} size - number of bytes to allocate\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* var buf = allocUnsafe( 10 );\n* // returns \n*/\nfunction allocUnsafe( size ) {\n\tif ( !isNonNegativeInteger( size ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', size ) );\n\t}\n\treturn new Buffer( size );\n}\n\n\n// EXPORTS //\n\nexport default allocUnsafe;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\nimport bufferCtors from '@stdlib/ndarray-base-buffer-ctors';\nimport allocUnsafe from '@stdlib/buffer-alloc-unsafe';\nimport zeros from '@stdlib/array-base-zeros';\nimport fill from '@stdlib/array-base-fill';\n\n\n// FUNCTIONS //\n\n/**\n* Returns a zero-filled binary buffer.\n*\n* @private\n* @param {NonNegativeInteger} size - buffer size\n* @returns {Buffer} zero-filled binary buffer\n*/\nfunction binary( size ) {\n\treturn fill( allocUnsafe( size ), 0, 0, size );\n}\n\n/**\n* Returns a typed array.\n*\n* @private\n* @param {*} dtype - data type\n* @param {NonNegativeInteger} size - buffer size\n* @returns {(TypedArray|null)} typed array\n*/\nfunction typedarray( dtype, size ) {\n\tvar ctor = bufferCtors( dtype );\n\tif ( ctor ) {\n\t\treturn new ctor( size );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a contiguous linear ndarray data buffer.\n*\n* @param {*} dtype - data type\n* @param {NonNegativeInteger} size - buffer size\n* @returns {(Array|TypedArray|Buffer|null)} data buffer\n*\n* @example\n* var buf = buffer( 'float64', 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction buffer( dtype, size ) {\n\tvar dt = resolveStr( dtype );\n\tif ( dt === 'generic' ) {\n\t\treturn zeros( size );\n\t}\n\tif ( dt === 'binary' ) {\n\t\treturn binary( size );\n\t}\n\treturn typedarray( dtype, size );\n}\n\n\n// EXPORTS //\n\nexport default buffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'fill' );\n* // e.g., returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n/**\n* Fills all elements within a portion of an indexed array with a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - fill value\n* @param {integer} start - starting index (inclusive)\n* @param {integer} end - ending index (exclusive)\n* @returns {Array} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = indexed( x, 5, 1, 3 );\n* // returns [ 1, 5, 5, 4 ]\n*/\nfunction indexed( x, value, start, end ) {\n\tvar i;\n\tfor ( i = start; i < end; i++ ) {\n\t\tx[ i ] = value;\n\t}\n\treturn x;\n}\n\n/**\n* Fills all elements within a portion of an accessor array with a specified value.\n*\n* @private\n* @param {Object} x - input array object\n* @param {*} value - fill value\n* @param {integer} start - starting index (inclusive)\n* @param {integer} end - ending index (exclusive)\n* @returns {AccessorArray} modified input array\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n*\n* var x = toAccessorArray( [ 1, 2, 3, 4 ] );\n* var obj = arraylike2object( x );\n*\n* var out = accessors( obj, 5, 1, 3 );\n* // returns \n*\n* var v = x.get( 0 );\n* // returns 1\n*\n* v = x.get( 1 );\n* // returns 5\n*\n* v = x.get( 2 );\n* // returns 5\n*\n* v = x.get( 3 );\n* // returns 4\n*/\nfunction accessors( x, value, start, end ) {\n\tvar data;\n\tvar set;\n\tvar i;\n\n\tdata = x.data;\n\tset = x.accessors[ 1 ];\n\tfor ( i = start; i < end; i++ ) {\n\t\tset( data, i, value );\n\t}\n\treturn data;\n}\n\n\n// MAIN //\n\n/**\n* Fills all elements within a portion of an array with a specified value.\n*\n* @param {Collection} x - input array\n* @param {*} value - fill value\n* @param {integer} start - starting index (inclusive)\n* @param {integer} end - ending index (exclusive)\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = fill( x, 5, 1, 3 );\n* // returns [ 1, 5, 5, 4 ]\n*\n* var bool = ( out === x );\n* // returns true\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var x = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var out = fill( x, 5, 1, 3 );\n* // returns [ 1, 5, 5, 4 ]\n*\n* var bool = ( out === x );\n* // returns true\n*/\nfunction fill( x, value, start, end ) {\n\tvar obj;\n\tif ( hasMethod( x, 'fill' ) ) {\n\t\treturn x.fill( value, start, end );\n\t}\n\tif ( start < 0 ) {\n\t\tstart += x.length;\n\t\tif ( start < 0 ) {\n\t\t\tstart = 0;\n\t\t}\n\t}\n\tif ( end < 0 ) {\n\t\tend += x.length; // if `end` is still negative, that is fine, as `x` will be returned un-mutated\n\t} else if ( end > x.length ) {\n\t\tend = x.length;\n\t}\n\tobj = arraylike2object( x );\n\tif ( obj.accessorProtocol ) {\n\t\treturn accessors( obj, value, start, end );\n\t}\n\treturn indexed( x, value, start, end );\n}\n\n\n// EXPORTS //\n\nexport default fill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport buffer from '@stdlib/ndarray-base-buffer';\nimport zeros from '@stdlib/array-base-zeros';\n\n\n// MAIN //\n\n/**\n* Returns an empty n-dimensional ndarray.\n*\n* @private\n* @param {Function} ctor - ndarray constructor\n* @param {string} dtype - array data type\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - layout order\n* @param {boolean} readonly - boolean indicating whether a returned array should be read-only\n* @returns {ndarray} empty ndarray\n*/\nfunction empty( ctor, dtype, shape, order, readonly ) {\n\tvar strides;\n\tvar ndims;\n\n\tndims = shape.length;\n\tif ( ndims === 0 ) {\n\t\tstrides = [ 0 ];\n\t} else {\n\t\tstrides = zeros( ndims );\n\t}\n\treturn new ctor( dtype, buffer( dtype, 0 ), shape, strides, 0, order, {\n\t\t'readonly': readonly\n\t});\n}\n\n\n// EXPORTS //\n\nexport default empty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\nimport nonreducedDimensions from '@stdlib/slice-base-nonreduced-dimensions';\nimport sliceShape from '@stdlib/slice-base-shape';\nimport take from '@stdlib/array-base-take-indexed';\nimport zeros from '@stdlib/array-base-zeros';\nimport numel from '@stdlib/ndarray-base-numel';\nimport getDType from '@stdlib/ndarray-base-dtype';\nimport getShape from '@stdlib/ndarray-base-shape';\nimport getStrides from '@stdlib/ndarray-base-strides';\nimport getOffset from '@stdlib/ndarray-base-offset';\nimport getOrder from '@stdlib/ndarray-base-order';\nimport getData from '@stdlib/ndarray-base-data-buffer';\nimport format from '@stdlib/string-format';\nimport sliceStart from './slice_start.js';\nimport slice2strides from './slice_strides.js';\nimport empty from './empty.js';\n\n\n// MAIN //\n\n/**\n* Returns a view of an input ndarray.\n*\n* @param {ndarray} x - input array\n* @param {MultiSlice} s - multi-slice object\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @param {boolean} writable - boolean indicating whether a returned array should be writable\n* @throws {RangeError} number of slice dimensions must match the number of array dimensions\n* @throws {RangeError} slice exceeds array bounds\n* @returns {ndarray} ndarray view\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import ndarray from '@stdlib/ndarray-ctor';\n* import ndarray2array from '@stdlib/ndarray-to-array';\n*\n* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n* var shape = [ 3, 2 ];\n* var strides = [ 2, 1 ];\n* var offset = 0;\n*\n* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var sh = x.shape;\n* // returns [ 3, 2 ]\n*\n* var arr = ndarray2array( x );\n* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*\n* var s = new MultiSlice( new Slice( null, null, -2 ), new Slice( null, null, -1 ) );\n* // returns \n*\n* var y = slice( x, s, false, false );\n* // returns \n*\n* sh = y.shape;\n* // returns [ 2, 2 ]\n*\n* arr = ndarray2array( y );\n* // returns [ [ 6.0, 5.0 ], [ 2.0, 1.0 ] ]\n*/\nfunction slice( x, s, strict, writable ) {\n\tvar strides;\n\tvar offset;\n\tvar dtype;\n\tvar shape;\n\tvar order;\n\tvar sdims;\n\tvar ndims;\n\tvar ctor;\n\tvar sh;\n\tvar ns;\n\n\t// Retrieve array meta data:\n\tdtype = getDType( x );\n\tshape = getShape( x, true );\n\tstrides = getStrides( x, true );\n\toffset = getOffset( x );\n\torder = getOrder( x );\n\tndims = shape.length;\n\n\t// Ensure that the number of array dimensions matches the number of slices:\n\tif ( s.ndims !== ndims ) {\n\t\tthrow new RangeError( format( 'invalid argument. Number of slice dimensions does not match the number of array dimensions. Array shape: (%s). Slice dimensions: %u.', shape.join( ',' ), s.ndims ) );\n\t}\n\t// Resolve the output array constructor:\n\tctor = x.constructor;\n\n\t// If provided a zero-dimensional input array, return a zero-dimensional array view...\n\tif ( ndims === 0 ) {\n\t\treturn new ctor( dtype, getData( x ), shape, strides, offset, order, {\n\t\t\t'readonly': !writable\n\t\t});\n\t}\n\t// Resolve the indices of the non-reduced dimensions:\n\tsdims = nonreducedDimensions( s );\n\n\t// Normalize the slice object based on the array shape:\n\tns = normalizeMultiSlice( s, shape, true );\n\n\t// Check whether the slice exceeds array bounds...\n\tif ( ns.code ) {\n\t\tif ( strict ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Slice exceeds array bounds. Array shape: (%s).', shape.join( ',' ) ) );\n\t\t}\n\t\t// Normalize again, this time allowing for out-of-bounds indices:\n\t\tns = normalizeMultiSlice( s, shape, false );\n\n\t\t// Compute the slice shape:\n\t\tsh = sliceShape( ns );\n\n\t\t// If the non-reduced dimensions contain elements, this means that at least one reduced dimension exceeded array bounds; in which case, we generate a shape containing zeros:\n\t\tif ( numel( take( sh, sdims ) ) > 0 ) {\n\t\t\tsh = zeros( sh.length );\n\t\t}\n\t} else {\n\t\t// Compute the slice shape:\n\t\tsh = sliceShape( ns );\n\t}\n\t// If the slice does not contain any elements, return an empty array...\n\tif ( numel( sh ) === 0 ) {\n\t\treturn empty( ctor, dtype, take( sh, sdims ), order, !writable );\n\t}\n\t// Resolve the index offset of the first element indexed by the slice:\n\toffset = sliceStart( ns, strides, offset ); // TODO: @stdlib/ndarray/base/sind2bind\n\n\t// Remove reduced dimensions from the slice shape:\n\tsh = take( sh, sdims );\n\n\t// If all dimensions were reduced, return a zero-dimensional array...\n\tif ( sh.length === 0 ) {\n\t\treturn new ctor( dtype, getData( x ), [], [ 0 ], offset, order, {\n\t\t\t'readonly': !writable\n\t\t});\n\t}\n\t// Update strides according to slice steps:\n\tstrides = slice2strides( ns, strides, sdims ); // TODO: @stdlib/ndarray/base/slice2strides???\n\n\t// Return a slice view:\n\treturn new ctor( dtype, getData( x ), sh, strides, offset, order, {\n\t\t'readonly': !writable\n\t});\n}\n\n\n// EXPORTS //\n\nexport default slice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the data type of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {string} data type\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var dt = dtype( x );\n* // returns 'float64'\n*/\nfunction dtype( x ) {\n\treturn x.dtype;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// MAIN //\n\n/**\n* Returns the shape of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `shape` property\n* @returns {NonNegativeIntegerArray} shape\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = shape( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 3, 3, 3 ]\n*/\nfunction shape( x, copy ) {\n\tvar sh = x.shape;\n\tif ( copy ) {\n\t\treturn copyIndexed( sh );\n\t}\n\treturn sh;\n}\n\n\n// EXPORTS //\n\nexport default shape;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport strides2offset from '@stdlib/ndarray-base-strides2offset';\n\n\n// MAIN //\n\n/**\n* Returns the index offset specifying the underlying buffer index of the first iterated ndarray element.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {NonNegativeInteger} index offset\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var n = offset( zeros( [ 3, 3, 3 ] ) );\n* // returns 0\n*/\nfunction offset( x ) {\n\tvar st;\n\tvar sh;\n\tvar o;\n\n\to = x.offset;\n\tif ( isNumber( o ) ) {\n\t\treturn o;\n\t}\n\tsh = x.shape;\n\tif ( sh.length === 0 ) {\n\t\treturn 0;\n\t}\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn 0;\n\t}\n\treturn strides2offset( sh, st );\n}\n\n\n// EXPORTS //\n\nexport default offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a multidimensional array based on a stride array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var shape = [ 2, 3, 10 ];\n* var strides = [ 30, -10, 1 ];\n*\n* var offset = strides2offset( shape, strides );\n* // returns 20\n*/\nfunction strides2offset( shape, strides ) {\n\tvar offset;\n\tvar ndims;\n\tvar i;\n\n\tndims = shape.length;\n\toffset = 0;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( strides[ i ] < 0 ) {\n\t\t\t// Note that, since the stride is negative, this operation increments, not decrements, the offset...\n\t\t\toffset -= strides[ i ] * ( shape[ i ]-1 );\n\t\t}\n\t}\n\treturn offset;\n}\n\n\n// EXPORTS //\n\nexport default strides2offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a list of non-reduced dimensions in an un-normalized multi-slice.\n*\n* @param {MultiSlice} slice - input slice\n* @returns {NonNegativeIntegerArray} list of non-reduced dimensions\n*\n* @example\n* import MultiSlice from '@stdlib/slice-multi';\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = new MultiSlice( 1, null, 2, void 0, new Slice( 0, 10, 1 ) );\n* // returns \n*\n* var indices = nonreducedDimensions( s );\n* // returns [ 1, 3, 4 ]\n*/\nfunction nonreducedDimensions( slice ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tdata = slice.data;\n\tout = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tif ( typeof data[ i ] !== 'number' ) {\n\t\t\tout.push( i );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nonreducedDimensions;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Resolves the index offset of the first element indexed by a normalized multi-slice.\n*\n* @private\n* @param {MultiSlice} slice - normalized multi-slice object\n* @param {IntegerArray} strides - array strides\n* @param {NonNegativeInteger} offset - array index offset\n* @returns {NonNegativeInteger} index offset of the first element indexed by a normalized multi-slice object\n*/\nfunction sliceStart( slice, strides, offset ) {\n\tvar data;\n\tvar idx;\n\tvar i;\n\n\tdata = slice.data;\n\tidx = offset;\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tidx += strides[ i ] * data[ i ].start;\n\t}\n\treturn idx;\n}\n\n\n// EXPORTS //\n\nexport default sliceStart;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Resolves slice strides for a provided normalized multi-slice object.\n*\n* @private\n* @param {MultiSlice} slice - normalized multi-slice object\n* @param {IntegerArray} strides - array strides\n* @param {NonNegativeIntegerArray} rdims - indices of non-reduced dimensions\n* @returns {IntegerArray} slice strides\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n*\n* var s = new MultiSlice( new Slice( 2, 3, 1 ), new Slice( 10, null, -2 ) );\n* // returns \n*\n* var strides = slice2strides( s, [ 8, 2 ], [ 1 ] );\n* // returns [ -4 ]\n*/\nfunction slice2strides( slice, strides, rdims ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\tvar j;\n\n\tdata = slice.data;\n\tout = [];\n\tfor ( i = 0; i < rdims.length; i++ ) {\n\t\tj = rdims[ i ];\n\t\tout.push( strides[j] * data[j].step );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default slice2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Formats an error message for production.\n*\n* @param {string} code - error code\n* @param {*} ...args - error message arguments\n* @returns {string} formatted error message\n*\n* @example\n* var msg = fmtprodmsg( '3', 'wrong_type' );\n* // returns 'https://stdlib.io/e/3?&arg[]=wrong_type'\n*/\nfunction fmtprodmsg() {\n\tvar a = arguments;\n\tvar c = a[ 0 ];\n\tvar u = 'https://stdlib.io/e/'+c+'?';\n\tvar i;\n\tfor ( i = 1; i < a.length; i++ ) {\n\t\tu += '&arg[]=' + encodeURIComponent( a[ i ] );\n\t}\n\treturn u;\n}\n\n\n// EXPORTS //\n\nexport default fmtprodmsg;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport args2multislice from '@stdlib/slice-base-args2multislice';\nimport Slice from '@stdlib/slice-ctor';\nimport ndims from '@stdlib/ndarray-base-ndims';\nimport slice from '@stdlib/ndarray-base-slice';\nimport normalizeIndex from '@stdlib/ndarray-base-normalize-index';\nimport nulls from '@stdlib/array-base-nulls';\nimport format from '@stdlib/error-tools-fmtprodmsg';\n\n\n// MAIN //\n\n/**\n* Returns a shifted view of an input ndarray along a specified dimension.\n*\n* @param {ndarray} x - input array\n* @param {integer} dim - index of dimension to slice\n* @param {integer} start - starting index (inclusive)\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @param {boolean} writable - boolean indicating whether a returned array should be writable\n* @throws {TypeError} first argument must be an ndarray having one or more dimensions\n* @throws {RangeError} dimension index exceeds the number of dimensions\n* @throws {RangeError} slice exceeds array bounds\n* @returns {ndarray} ndarray view\n*\n* @example\n* import ndarray from '@stdlib/ndarray-ctor';\n* import ndarray2array from '@stdlib/ndarray-to-array';\n*\n* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n* var shape = [ 3, 2 ];\n* var strides = [ 2, 1 ];\n* var offset = 0;\n*\n* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var sh = x.shape;\n* // returns [ 3, 2 ]\n*\n* var arr = ndarray2array( x );\n* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*\n* var y = sliceDimensionFrom( x, 0, 1, false, false );\n* // returns \n*\n* sh = y.shape;\n* // returns [ 2, 2 ]\n*\n* arr = ndarray2array( y );\n* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*/\nfunction sliceDimensionFrom( x, dim, start, strict, writable ) {\n\tvar args;\n\tvar N;\n\tvar d;\n\n\t// Retrieve array meta data:\n\tN = ndims( x );\n\n\t// Check whether we were provided a zero-dimensional array...\n\tif ( N === 0 ) {\n\t\tthrow new TypeError( format( '1lDF7', N ) );\n\t}\n\t// Normalize the dimension index:\n\td = normalizeIndex( dim, N-1 );\n\tif ( d === -1 ) {\n\t\tthrow new RangeError( format( '1lDF8', N, dim ) );\n\t}\n\t// Define a list of slice arguments:\n\targs = nulls( N );\n\targs[ d ] = new Slice( start, null );\n\n\t// Return a new array view:\n\treturn slice( x, args2multislice( args ), strict, writable );\n}\n\n\n// EXPORTS //\n\nexport default sliceDimensionFrom;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Normalizes an index to the interval `[0,max]`.\n*\n* @param {integer} idx - index\n* @param {NonNegativeInteger} max - maximum index\n* @returns {integer} index\n*\n* @example\n* var idx = normalizeIndex( -2, 10 );\n* // returns 9\n*\n* idx = normalizeIndex( 15, 10 );\n* // returns -1\n*\n* idx = normalizeIndex( 5, 10 );\n* // returns 5\n*/\nfunction normalizeIndex( idx, max ) {\n\tif ( idx < 0 ) {\n\t\tidx += max + 1;\n\t\tif ( idx < 0 ) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn idx;\n\t}\n\tif ( idx > max ) {\n\t\treturn -1;\n\t}\n\treturn idx;\n}\n\n\n// EXPORTS //\n\nexport default normalizeIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\n\n\n// MAIN //\n\n/**\n* Returns the number of ndarray dimensions.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {NonNegativeInteger} number of dimensions\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var n = ndims( zeros( [ 3, 3, 3 ] ) );\n* // returns 3\n*/\nfunction ndims( x ) {\n\tvar n = x.ndims; // Note: intentionally cache in case `ndims` is lazily resolved via accessor\n\tif ( isNumber( n ) ) {\n\t\treturn n;\n\t}\n\treturn x.shape.length;\n}\n\n\n// EXPORTS //\n\nexport default ndims;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport filled from '@stdlib/array-base-filled';\n\n\n// MAIN //\n\n/**\n* Returns a \"generic\" array filled with null values.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = nulls( 3 );\n* // returns [ null, null, null ]\n*/\nfunction nulls( len ) {\n\treturn filled( null, len );\n}\n\n\n// EXPORTS //\n\nexport default nulls;\n"],"names":["main","Object","defineProperty","isNumber","value","zeros","n","i","out","zeroPad","str","width","right","negative","pad","length","startsWithMinus","substr","lowercase","String","prototype","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","toString","precision","padRight","sign","alternate","call","charAt","abs","Math","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","f","digits","toExponential","toFixed","toPrecision","spaces","fromCharCode","isArray","Array","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","parseFloat","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","push","format","args","tokenize","interpolate","apply","objectProtoype","toStr","defineGetter","__defineGetter__","defineSetter","__defineSetter__","lookupGetter","__lookupGetter__","lookupSetter","__lookupSetter__","err","hasDefinePropertySupport","builtin","obj","prop","descriptor","hasValue","hasGet","hasSet","__proto__","get","set","defineProperty$1","setNonEnumerableReadOnly","configurable","enumerable","writable","setNonEnumerableReadOnlyAccessor","getter","FLG","Symbol","hasToStringTagSupport","toStringTag","has","hasOwnProperty","hasOwnProp","property","Sym","toStrTag","nativeClass","hasToStringTag","v","isOwn","tag","main$e","Number","test","isPrimitive","isObject","setReadOnly","FLOAT64_PINF","POSITIVE_INFINITY","FLOAT64_NINF","NEGATIVE_INFINITY","floor","isInteger","x","PINF","NINF","isInt","valueOf","isNull","isUndefined","isValid","Slice","nargs","start","stop","step","this","RangeError","_start","_stop","_step","reFunctionName","type","data","RE_FUNCTION_NAME","REGEXP","main$d","arrayfcn","predicate","len","isObjectLike","isBuffer","_isBuffer","constructor","constructorName","name","ctor","isSlice","MultiSlice","proxy","create","_data","args2multislice","normalize","strict","max","code","int2slice","normalizeSlice","normalizeMultiSlice","shape","s","arrayfun","join","toJSON","ceil","sliceLength","inc","x1","x2","sliceShape","take","indices","filled","arr","numel","ndims","copy","isString","isColumnMajorString","shape2strides","order","isColumnMajor","columnmajor","rowmajor","ROW_MAJOR","COLUMN_MAJOR","st","o","strides","column","row","s1","s2","strides2order","isPositiveInteger","isBoolean","Bool","Boolean","self","window","globalThis","getGlobal","codegen","Function","GlobalThis","Self","Win","root","nodeList","document","childNodes","typedarray","Int8Array","ctorName","isFunction","typeOf","isStructConstructorLike","alignment","byteLength","byteLengthOf","byteOffsetOf","bufferOf","isStruct","viewOf","keys","bool","isArguments","bool$b","detect","hasArgumentsClass","isNan","isEnumerableProperty","propertyIsEnumerable","hasStringEnumBug","isEnum","UINT32_MAX","isArguments$1","MAX_LENGTH","MAX_TYPED_ARRAY_LENGTH","isCollection","searchElement","fromIndex","isConstructorPrototype","w","hasAutomationEqualityBug","k","win","EXCLUDED_KEYS","check","HAS_BUILTIN","skipConstructor","skipPrototype","isFcn","p","HAS_ENUM_PROTO_BUG","HAS_NON_ENUM_PROPS_BUG","HAS_WINDOW","error","NON_ENUMERABLE","main$b","getProto","Obj","getPrototypeOf","proto","getProto$1","objectPrototype","isPlainObject","isPrototypeOf","key","ownProps","hash","opts","val","allowDupes","duplicates","objectKeys","objectInverse","int8","uint8","uint8c","int16","uint16","int32","uint32","int64","uint64","float16","float32","float64","complex32","complex64","complex128","binary","generic","notype","userdefined_type","enum2str","dtype","ENUM","str2enum","resolve","t","layout","hasProp","TYPE","isAccessorArray","GETTERS","idx","default","ctor2dtypes","Float32Array","Float64Array","Int16Array","Int32Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","Complex64Array","Complex128Array","BooleanArray","hasFloat64Array","hasFloat64ArraySupport","GlobalFloat64Array","NaN","Float64Array$1","hasFloat32Array","GlobalFloat32Array","hasFloat32ArraySupport","Float32Array$1","hasUint32Array","GlobalUint32Array","hasUint32ArraySupport","Uint32Array$1","hasInt32Array","INT32_MAX","INT32_MIN","GlobalInt32Array","hasInt32ArraySupport","Int32Array$1","hasUint16Array","UINT16_MAX","GlobalUint16Array","hasUint16ArraySupport","Uint16Array$1","hasInt16Array","INT16_MAX","INT16_MIN","GlobalInt16Array","hasInt16ArraySupport","Int16Array$1","hasUint8Array","UINT8_MAX","GlobalUint8Array","hasUint8ArraySupport","Uint8Array$1","hasUint8ClampedArray","GlobalUint8ClampedArray","hasUint8ClampedArraySupport","Uint8ClampedArray$1","hasInt8Array","INT8_MAX","INT8_MIN","GlobalInt8Array","hasInt8ArraySupport","Int8Array$1","isNonNegativeInteger","MAX_ARRAY_LENGTH","isArrayLikeObject","hasArrayBuffer","ArrayBuffer","isArrayBuffer","isPrimitiveArray","isObjectArray","isStringArray","Complex128","real","imag","setEnumerableReadOnly","re","im","fround","FLOAT32_VIEW","float64ToFloat32$1","Complex64","float64ToFloat32","isComplexLike","isEven","BYTES_PER_ELEMENT","isComplex64Array","isComplex128Array","hasIteratorSymbolSupport","iterator","IteratorSymbol","z","reinterpret","offset","buffer","byteOffset","fromIterator","it","next","done","realf","imagf","HAS_ITERATOR_SYMBOL","isComplexArray","_length","_buffer","isComplexArrayConstructor","getComplex64","buf","fromArray","reinterpret64","reinterpret128","ITERATOR_SYMBOL","src","thisArg","clbk","tmp","flg","accessorGetter","fromIteratorMap","target","copyWithin","iter","entries","end","fcn","separator","sep","outbuf","reducer","initialValue","acc","N","sbuf","outlen","compareFcn","sort","begin","locales","options","loc","toLocaleString","values","index","getComplex128","isBooleanArray","isBooleanArrayConstructor","a","b","CTORS","DTYPES","NTYPES","ctor2dtype","contains","dt","factory","search","newval","RE_SUFFIX","TABLE","isDataTypeString","kind","all","dtypes","bytesPerElement","DataType","char","description","byteOrder","isDataType","bfloat16","float128","int128","int256","uint128","uint256","dtype2desc","dtype2char","enum","resolveEnum","dtype2alignment","isStructDataType","isDataTypeObject","_alignment","_byteLength","_byteOrder","_char","_description","_enum","_value","_type","isProtoOf","view","GlobalArrayBuffer","isView","hasArrayBufferSupport","ArrayBuffer$1","SETTERS","setter","arraylike2object","accessorProtocol","accessors","accessorSetter","gcopy","strideX","offsetX","y","strideY","offsetY","xbuf","ybuf","ix","iy","M","ox","oy","m","min","ndarray","hasDataView","DataView","isDataView","GlobalDataView","getFloat64","setFloat64","hasDataViewSupport","DataView$1","PRIVATE_BUFFER","CTOR_NAME","setNonEnumerableReadWriteAccessor","setReadOnlyAccessor","setReadWriteAccessor","uint16view","DATA_VIEW_METHODS","ctors","IS_LITTLE_ENDIAN","table","DEFAULT_CTOR","CMPLX_TO_REAL","getComplex","method","complex","defaults","numeric","floating_point","real_floating_point","complex_floating_point","integer","signed_integer","unsigned_integer","boolean","integer_index","boolean_index","mask_index","DEFAULTS","HASH","DEFAULT_DTYPE","reinterpretBoolean","isStructType","getStructArray","getTypedArray","getBigInt","getBoolean","getStruct","isRealFloatingPointDataType","isSignedIntegerDataType","Global","isBigInt","BigInt","wrap","isSymbol","constantFunction","polyfill","ntypes","dt1","dt2","SAFE_CASTS","generateFullTable","generateTable","safeCasts","CASTS","casts","SAME_KIND_CASTS","sameKindCasts","isAllowedCast","from","to","casting","resolveStr","isSafeCast","isMostlySafeCast","isSameKindCast","FLOAT32_SMALLEST_SUBNORMAL","FLOAT32_MAX_SAFE_INTEGER","FLOAT32_MIN_SAFE_INTEGER","minFloatDataType","minDataType","boolean2number","bigint2number","setNumber","minSignedIntegerDataType","complexDType","castingMode","number2boolean","complex2boolean","setBoolean","bigint2boolean","BigInteger","setBigInt","boolean2bigint","isStructInstance","isComplexFloatingPointDataType","isBooleanDataType","isRealDataType","stride2offset","stride","gfill","alpha","assign","xobj","yobj","xdata","ydata","xget","yset","io","internal","map","hasMethod","complex2number","views","dest","nb","setStructArray","isComplexDataType","reinterpretComplex","setTypedArray","setComplex","setStruct","FIELD_PROPERTIES","isUnionType","fields","isUndefinedOrNull","gjoin","strided","isValidBoolean","ALIGNMENTS","MANDATORY_FIELD_NAMES","VALIDATORS","padding","hasProperties","JSON","stringify","normalizeUnion","dflg","normalizeField","resolveAlignment","resolveGetter","fieldIndex","names","setPadding","replacer","p1","layoutFormat","FORMATS","isFormat","Struct","fmt0","fmt1","fmt2","bfmt","ufmt","fmt","ib","c0","c1","c2","w1","linearFormat","foo","isFunctionNameSupported","TypedArray","Dummy","fcnName","hasHasInstanceSymbolSupport","hasInstance","HasInstanceSymbol","hasSupport","instanceOf","typeName","typedarray2json","NAMES","isTypedArray","isComplexTypedArray","FIELD_NAMES","BYTE_LENGTH","PARTITIONS","ALIGNMENT","ACCESSORS","FIELDS","o1","fieldNames","cache","byteOffsets","flatten","partitions","createPrototypeAccessors","struct2string","struct","struct2json","bbytes","sview","LAYOUT","structFactory","StructArray","_byteOffset","isStructArray","Buffer","notImplemented","CACHE","allocUnsafe$1","allocUnsafe","size","fill","indexed","bufferCtors","empty","readonly","sdims","sh","ns","getDType","copyIndexed","getShape","ord","getStrides","strides2offset","getOffset","getOrder","getData","nonreducedDimensions","sliceStart","rdims","slice2strides","fmtprodmsg","u","encodeURIComponent","dim","d"],"mappings":";mPAsBA,IAAIA,EAA0C,mBAA1BC,OAAOC,eAAkCD,OAAOC,eAAiB,KCiCrF,IAAIA,EAAiBD,OAAOC,eCjB5B,SAASC,EAAUC,GAClB,MAA0B,iBAAVA,CACjB,CCAA,SAASC,EAAOC,GACf,IACIC,EADAC,EAAM,GAEV,IAAMD,EAAI,EAAGA,EAAID,EAAGC,IACnBC,GAAO,IAER,OAAOA,CACR,CAcA,SAASC,EAASC,EAAKC,EAAOC,GAC7B,IAAIC,GAAW,EAC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G/d,IAEzC,OAAOywB,CACR,QC+BA,SAA6B5nB,EAAG8nB,EAAKpnB,EAAO+B,EAAQvE,GACnD,IAAI9B,EACA+X,EACA4T,ECrCoB5b,EAAKzJ,ED2C7B,GAAW,KAHXyR,EExCD,SAAgBnU,GACf,IAAI9I,EAAI8I,EAAE+D,MACV,OAAKhN,EAAUG,GACPA,EAED8I,EAAE+C,MAAMpL,MAChB,CFkCKoM,CAAO/D,IAIV,MAAM,IAAI9E,UAAWiB,GAAQ,QAASgY,IAIvC,GChD6BzR,ED+CJyR,EAAE,GACf,KADZ4T,GC/CwB5b,ED+CJ2b,GC9CT,GACV3b,GAAOzJ,EAAM,GACF,GACF,EAEFyJ,EAEHA,EAAMzJ,GACF,EAEFyJ,GDsCN,MAAM,IAAIrL,WAAY3E,GAAQ,QAASgY,EAAG2T,IAO3C,OAJA1rB,EGrDOwH,GAAQ,KHqDDuQ,IACR4T,GAAM,IAAIvnB,GAAOE,EAAO,MAGvB1E,GAAOgE,EAAGuC,GAAiBnG,GAAQqG,EAAQvE,EACnD","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,463,464,465]} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 2ab577a..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import sliceDimensionFrom from '../docs/types/index'; -export = sliceDimensionFrom; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 2f5466d..0000000 --- a/dist/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict";var v=function(i,r){return function(){return r||i((r={exports:{}}).exports,r),r.exports}};var o=v(function(p,u){"use strict";var l=require("@stdlib/slice-base-args2multislice"),c=require("@stdlib/slice-ctor"),q=require("@stdlib/ndarray-base-ndims"),f=require("@stdlib/ndarray-base-slice"),g=require("@stdlib/ndarray-base-normalize-index"),w=require("@stdlib/array-base-nulls"),s=require("@stdlib/string-format");function b(i,r,m,t,d){var n,e,a;if(e=q(i),e===0)throw new TypeError(s("invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.",e));if(a=g(r,e-1),a===-1)throw new RangeError(s("invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.",e,r));return n=w(e),n[a]=new c(m,null),f(i,l(n),t,d)}u.exports=b});var h=o();module.exports=h; -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 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. -*/ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index 19dddde..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar args2multislice = require( '@stdlib/slice-base-args2multislice' );\nvar Slice = require( '@stdlib/slice-ctor' );\nvar ndims = require( '@stdlib/ndarray-base-ndims' );\nvar slice = require( '@stdlib/ndarray-base-slice' );\nvar normalizeIndex = require( '@stdlib/ndarray-base-normalize-index' );\nvar nulls = require( '@stdlib/array-base-nulls' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns a shifted view of an input ndarray along a specified dimension.\n*\n* @param {ndarray} x - input array\n* @param {integer} dim - index of dimension to slice\n* @param {integer} start - starting index (inclusive)\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @param {boolean} writable - boolean indicating whether a returned array should be writable\n* @throws {TypeError} first argument must be an ndarray having one or more dimensions\n* @throws {RangeError} dimension index exceeds the number of dimensions\n* @throws {RangeError} slice exceeds array bounds\n* @returns {ndarray} ndarray view\n*\n* @example\n* var ndarray = require( '@stdlib/ndarray-ctor' );\n* var ndarray2array = require( '@stdlib/ndarray-to-array' );\n*\n* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n* var shape = [ 3, 2 ];\n* var strides = [ 2, 1 ];\n* var offset = 0;\n*\n* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var sh = x.shape;\n* // returns [ 3, 2 ]\n*\n* var arr = ndarray2array( x );\n* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*\n* var y = sliceDimensionFrom( x, 0, 1, false, false );\n* // returns \n*\n* sh = y.shape;\n* // returns [ 2, 2 ]\n*\n* arr = ndarray2array( y );\n* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*/\nfunction sliceDimensionFrom( x, dim, start, strict, writable ) {\n\tvar args;\n\tvar N;\n\tvar d;\n\n\t// Retrieve array meta data:\n\tN = ndims( x );\n\n\t// Check whether we were provided a zero-dimensional array...\n\tif ( N === 0 ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.', N ) );\n\t}\n\t// Normalize the dimension index:\n\td = normalizeIndex( dim, N-1 );\n\tif ( d === -1 ) {\n\t\tthrow new RangeError( format( 'invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.', N, dim ) );\n\t}\n\t// Define a list of slice arguments:\n\targs = nulls( N );\n\targs[ d ] = new Slice( start, null );\n\n\t// Return a new array view:\n\treturn slice( x, args2multislice( args ), strict, writable );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sliceDimensionFrom;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a shifted view of an input ndarray along a specified dimension.\n*\n* @module @stdlib/ndarray-base-slice-dimension-from\n*\n* @example\n* var ndarray = require( '@stdlib/ndarray-ctor' );\n* var ndarray2array = require( '@stdlib/ndarray-to-array' );\n* var sliceDimensionFrom = require( '@stdlib/ndarray-base-slice-dimension-from' );\n*\n* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n* var shape = [ 3, 2 ];\n* var strides = [ 2, 1 ];\n* var offset = 0;\n*\n* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var sh = x.shape;\n* // returns [ 3, 2 ]\n*\n* var arr = ndarray2array( x );\n* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*\n* var y = sliceDimensionFrom( x, 0, 1, false, false );\n* // returns \n*\n* sh = y.shape;\n* // returns [ 2, 2 ]\n*\n* arr = ndarray2array( y );\n* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAkB,QAAS,oCAAqC,EAChEC,EAAQ,QAAS,oBAAqB,EACtCC,EAAQ,QAAS,4BAA6B,EAC9CC,EAAQ,QAAS,4BAA6B,EAC9CC,EAAiB,QAAS,sCAAuC,EACjEC,EAAQ,QAAS,0BAA2B,EAC5CC,EAAS,QAAS,uBAAwB,EA6C9C,SAASC,EAAoBC,EAAGC,EAAKC,EAAOC,EAAQC,EAAW,CAC9D,IAAIC,EACAC,EACAC,EAMJ,GAHAD,EAAIZ,EAAOM,CAAE,EAGRM,IAAM,EACV,MAAM,IAAI,UAAWR,EAAQ,+GAAgHQ,CAAE,CAAE,EAIlJ,GADAC,EAAIX,EAAgBK,EAAKK,EAAE,CAAE,EACxBC,IAAM,GACV,MAAM,IAAI,WAAYT,EAAQ,6GAA8GQ,EAAGL,CAAI,CAAE,EAGtJ,OAAAI,EAAOR,EAAOS,CAAE,EAChBD,EAAME,CAAE,EAAI,IAAId,EAAOS,EAAO,IAAK,EAG5BP,EAAOK,EAAGR,EAAiBa,CAAK,EAAGF,EAAQC,CAAS,CAC5D,CAKAb,EAAO,QAAUQ,IC7CjB,IAAIS,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "args2multislice", "Slice", "ndims", "slice", "normalizeIndex", "nulls", "format", "sliceDimensionFrom", "x", "dim", "start", "strict", "writable", "args", "N", "d", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index ffc1f03..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,49 +0,0 @@ - -{{alias}}( x, dim, start, strict, writable ) - Returns a shifted view of an input ndarray along a specified dimension. - - Parameters - ---------- - x: ndarray - Input array. - - dim: integer - Index of dimension to slice. If less than zero, the index is resolved - relative to the last dimension, with the last dimension corresponding to - the value `-1`. - - start: integer - Starting index (inclusive). If less than zero, the corresponding element - along the specified dimension is resolved relative to the last element - along that dimension. For negative integers, the last element - corresponds to the value `-1`. - - strict: boolean - Boolean indicating whether to enforce strict bounds checking. - - writable: boolean - Boolean indicating whether a returned ndarray should be writable. This - parameter only applies to ndarray constructors which support read-only - instances. - - Returns - ------- - out: ndarray - Output array view. - - Examples - -------- - > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1, 2 ], [ 3, 4 ] ] ) - - > x.shape - [ 2, 2 ] - > var y = {{alias}}( x, 1, 1, false, false ) - - > y.shape - [ 2, 1 ] - > {{alias:@stdlib/ndarray/to-array}}( y ) - [ [ 2 ], [ 4 ] ] - - See Also - -------- - diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts deleted file mode 100644 index 22f5594..0000000 --- a/docs/types/index.d.ts +++ /dev/null @@ -1,534 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2023 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. -*/ - -// TypeScript Version: 4.1 - -/// - -import { typedndarray, genericndarray, float64ndarray, float32ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, complex128ndarray, complex64ndarray } from '@stdlib/types/ndarray'; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float64' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -*/ -declare function sliceDimensionFrom( x: float64ndarray, dim: number, start: number, strict: boolean, writable: boolean ): float64ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ], 'float32' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'float32', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -*/ -declare function sliceDimensionFrom( x: float32ndarray, dim: number, start: number, strict: boolean, writable: boolean ): float32ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1, 2, 3, 4, 5, 6 ], 'int32' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'int32', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: int32ndarray, dim: number, start: number, strict: boolean, writable: boolean ): int32ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1, 2, 3, 4, 5, 6 ], 'int16' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'int16', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: int16ndarray, dim: number, start: number, strict: boolean, writable: boolean ): int16ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1, 2, 3, 4, 5, 6 ], 'int8' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'int8', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: int8ndarray, dim: number, start: number, strict: boolean, writable: boolean ): int8ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1, 2, 3, 4, 5, 6 ], 'uint32' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'uint32', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: uint32ndarray, dim: number, start: number, strict: boolean, writable: boolean ): uint32ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1, 2, 3, 4, 5, 6 ], 'uint16' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'uint16', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: uint16ndarray, dim: number, start: number, strict: boolean, writable: boolean ): uint16ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1, 2, 3, 4, 5, 6 ], 'uint8' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'uint8', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: uint8ndarray, dim: number, start: number, strict: boolean, writable: boolean ): uint8ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1, 2, 3, 4, 5, 6 ], 'uint8c' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'uint8c', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: uint8cndarray, dim: number, start: number, strict: boolean, writable: boolean ): uint8cndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], 'complex128' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'complex128', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -*/ -declare function sliceDimensionFrom( x: complex128ndarray, dim: number, start: number, strict: boolean, writable: boolean ): complex128ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var typedarray = require( '@stdlib/array-typed' ); -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = typedarray( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], 'complex64' ); -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'complex64', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -*/ -declare function sliceDimensionFrom( x: complex64ndarray, dim: number, start: number, strict: boolean, writable: boolean ): complex64ndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = [ 1, 2, 3, 4, 5, 6 ]; -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: genericndarray, dim: number, start: number, strict: boolean, writable: boolean ): genericndarray; - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param x - input array -* @param dim - index of dimension to slice -* @param start - starting index (inclusive) -* @param strict - boolean indicating whether to enforce strict bounds checking -* @param writable - boolean indicating whether a returned array should be writable -* @returns output array -* -* @example -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = [ 1, 2, 3, 4, 5, 6 ]; -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3, 4 ], [ 5, 6 ] ] -*/ -declare function sliceDimensionFrom( x: typedndarray, dim: number, start: number, strict: boolean, writable: boolean ): typedndarray; - - -// EXPORTS // - -export = sliceDimensionFrom; diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 9dfeaf3..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,164 +0,0 @@ -/* -* @license Apache-2.0 -* -* Copyright (c) 2023 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. -*/ - -import empty = require( '@stdlib/ndarray-base-empty' ); -import sliceDimensionFrom = require( './index' ); - - -// TESTS // - -// The function returns an ndarray... -{ - const order = 'row-major'; - const sh = [ 2, 2 ]; - const s = 0; - - sliceDimensionFrom( empty( 'float64', sh, order ), 1, s, false, false ); // $ExpectType float64ndarray - sliceDimensionFrom( empty( 'float32', sh, order ), 1, s, false, false ); // $ExpectType float32ndarray - sliceDimensionFrom( empty( 'complex128', sh, order ), 1, s, false, false ); // $ExpectType complex128ndarray - sliceDimensionFrom( empty( 'complex64', sh, order ), 1, s, false, false ); // $ExpectType complex64ndarray - sliceDimensionFrom( empty( 'int32', sh, order ), 1, s, false, false ); // $ExpectType int32ndarray - sliceDimensionFrom( empty( 'int16', sh, order ), 1, s, false, false ); // $ExpectType int16ndarray - sliceDimensionFrom( empty( 'int8', sh, order ), 1, s, false, false ); // $ExpectType int8ndarray - sliceDimensionFrom( empty( 'uint32', sh, order ), 1, s, false, false ); // $ExpectType uint32ndarray - sliceDimensionFrom( empty( 'uint16', sh, order ), 1, s, false, false ); // $ExpectType uint16ndarray - sliceDimensionFrom( empty( 'uint8', sh, order ), 1, s, false, false ); // $ExpectType uint8ndarray - sliceDimensionFrom( empty( 'uint8c', sh, order ), 1, s, false, false ); // $ExpectType uint8cndarray - - sliceDimensionFrom( empty( 'float64', sh, order ), 1, s, true, true ); // $ExpectType float64ndarray - sliceDimensionFrom( empty( 'float32', sh, order ), 1, s, true, true ); // $ExpectType float32ndarray - sliceDimensionFrom( empty( 'complex128', sh, order ), 1, s, true, true ); // $ExpectType complex128ndarray - sliceDimensionFrom( empty( 'complex64', sh, order ), 1, s, true, true ); // $ExpectType complex64ndarray - sliceDimensionFrom( empty( 'int32', sh, order ), 1, s, true, true ); // $ExpectType int32ndarray - sliceDimensionFrom( empty( 'int16', sh, order ), 1, s, true, true ); // $ExpectType int16ndarray - sliceDimensionFrom( empty( 'int8', sh, order ), 1, s, true, true ); // $ExpectType int8ndarray - sliceDimensionFrom( empty( 'uint32', sh, order ), 1, s, true, true ); // $ExpectType uint32ndarray - sliceDimensionFrom( empty( 'uint16', sh, order ), 1, s, true, true ); // $ExpectType uint16ndarray - sliceDimensionFrom( empty( 'uint8', sh, order ), 1, s, true, true ); // $ExpectType uint8ndarray - sliceDimensionFrom( empty( 'uint8c', sh, order ), 1, s, true, true ); // $ExpectType uint8cndarray -} - -// The compiler throws an error if the function is provided a first argument which is not an ndarray... -{ - const s = 0; - - sliceDimensionFrom( '10', 1, s, false, false ); // $ExpectError - sliceDimensionFrom( 10, 1, s, false, false ); // $ExpectError - sliceDimensionFrom( false, 1, s, false, false ); // $ExpectError - sliceDimensionFrom( true, 1, s, false, false ); // $ExpectError - sliceDimensionFrom( null, 1, s, false, false ); // $ExpectError - sliceDimensionFrom( [], 1, s, false, false ); // $ExpectError - sliceDimensionFrom( {}, 1, s, false, false ); // $ExpectError - sliceDimensionFrom( ( x: number ): number => x, 1, s, false, false ); // $ExpectError - - sliceDimensionFrom( '10', 1, s, true, true ); // $ExpectError - sliceDimensionFrom( 10, 1, s, true, true ); // $ExpectError - sliceDimensionFrom( false, 1, s, true, true ); // $ExpectError - sliceDimensionFrom( true, 1, s, true, true ); // $ExpectError - sliceDimensionFrom( null, 1, s, true, true ); // $ExpectError - sliceDimensionFrom( [], 1, s, true, true ); // $ExpectError - sliceDimensionFrom( {}, 1, s, true, true ); // $ExpectError - sliceDimensionFrom( ( x: number ): number => x, 1, s, true, true ); // $ExpectError -} - -// The compiler throws an error if the function is provided a second argument which is not a number... -{ - const x = empty( 'float64', [ 2, 2 ], 'row-major' ); - const s = 1; - - sliceDimensionFrom( x, '5', s, false, false ); // $ExpectError - sliceDimensionFrom( x, false, s, false, false ); // $ExpectError - sliceDimensionFrom( x, true, s, false, false ); // $ExpectError - sliceDimensionFrom( x, null, s, false, false ); // $ExpectError - sliceDimensionFrom( x, undefined, s, false, false ); // $ExpectError - sliceDimensionFrom( x, [ '5' ], s, false, false ); // $ExpectError - sliceDimensionFrom( x, {}, s, false, false ); // $ExpectError - sliceDimensionFrom( x, ( x: number ): number => x, s, false, false ); // $ExpectError - - sliceDimensionFrom( x, '5', s, true, true ); // $ExpectError - sliceDimensionFrom( x, false, s, true, true ); // $ExpectError - sliceDimensionFrom( x, true, s, true, true ); // $ExpectError - sliceDimensionFrom( x, null, s, true, true ); // $ExpectError - sliceDimensionFrom( x, undefined, s, true, true ); // $ExpectError - sliceDimensionFrom( x, [ '5' ], s, true, true ); // $ExpectError - sliceDimensionFrom( x, {}, s, true, true ); // $ExpectError - sliceDimensionFrom( x, ( x: number ): number => x, s, true, true ); // $ExpectError -} - -// The compiler throws an error if the function is provided a third argument which is not a number... -{ - const x = empty( 'float64', [ 2, 2 ], 'row-major' ); - - sliceDimensionFrom( x, 1, '5', false, false ); // $ExpectError - sliceDimensionFrom( x, 1, false, false, false ); // $ExpectError - sliceDimensionFrom( x, 1, true, false, false ); // $ExpectError - sliceDimensionFrom( x, 1, null, false, false ); // $ExpectError - sliceDimensionFrom( x, 1, undefined, false, false ); // $ExpectError - sliceDimensionFrom( x, 1, [ '5' ], false, false ); // $ExpectError - sliceDimensionFrom( x, 1, {}, false, false ); // $ExpectError - sliceDimensionFrom( x, 1, ( x: number ): number => x, 1, false, false ); // $ExpectError - - sliceDimensionFrom( x, 1, '5', true, true ); // $ExpectError - sliceDimensionFrom( x, 1, false, true, true ); // $ExpectError - sliceDimensionFrom( x, 1, true, true, true ); // $ExpectError - sliceDimensionFrom( x, 1, null, true, true ); // $ExpectError - sliceDimensionFrom( x, 1, undefined, true, true ); // $ExpectError - sliceDimensionFrom( x, 1, [ '5' ], true, true ); // $ExpectError - sliceDimensionFrom( x, 1, {}, true, true ); // $ExpectError - sliceDimensionFrom( x, 1, ( x: number ): number => x, true, true ); // $ExpectError -} - -// The compiler throws an error if the function is provided a fourth argument which is not a boolean... -{ - const x = empty( 'float64', [ 2, 2 ], 'row-major' ); - const s = 0; - - sliceDimensionFrom( x, 1, s, '5', false ); // $ExpectError - sliceDimensionFrom( x, 1, s, 5, false ); // $ExpectError - sliceDimensionFrom( x, 1, s, null, false ); // $ExpectError - sliceDimensionFrom( x, 1, s, undefined, false ); // $ExpectError - sliceDimensionFrom( x, 1, s, [ '5' ], false ); // $ExpectError - sliceDimensionFrom( x, 1, s, {}, false ); // $ExpectError - sliceDimensionFrom( x, 1, s, ( x: number ): number => x, false ); // $ExpectError -} - -// The compiler throws an error if the function is provided a fifth argument which is not a boolean... -{ - const x = empty( 'float64', [ 2, 2 ], 'row-major' ); - const s = 0; - - sliceDimensionFrom( x, 1, s, false, '5' ); // $ExpectError - sliceDimensionFrom( x, 1, s, false, 5 ); // $ExpectError - sliceDimensionFrom( x, 1, s, false, null ); // $ExpectError - sliceDimensionFrom( x, 1, s, false, undefined ); // $ExpectError - sliceDimensionFrom( x, 1, s, false, [ '5' ] ); // $ExpectError - sliceDimensionFrom( x, 1, s, false, {} ); // $ExpectError - sliceDimensionFrom( x, 1, s, false, ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - const x = empty( 'float64', [ 2, 2 ], 'row-major' ); - const s = 0; - - sliceDimensionFrom( x ); // $ExpectError - sliceDimensionFrom( x, 1 ); // $ExpectError - sliceDimensionFrom( x, 1, s ); // $ExpectError - sliceDimensionFrom( x, 1, s, false ); // $ExpectError - sliceDimensionFrom( x, 1, s, false, false, {} ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index b17162a..0000000 --- a/examples/index.js +++ /dev/null @@ -1,56 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 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'; - -var array = require( '@stdlib/ndarray-array' ); -var ndarray2array = require( '@stdlib/ndarray-to-array' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var sliceDimensionFrom = require( './../lib' ); - -// Create a linear ndarray buffer: -var buf = zeroTo( 27 ); - -// Create an ndarray: -var x = array( buf, { - 'shape': [ 3, 3, 3 ] -}); - -// Get the last two rows of each matrix: -var y1 = sliceDimensionFrom( x, 1, 1, false, false ); -// returns - -var a1 = ndarray2array( y1 ); -console.log( a1 ); -// => [ [ [ 3, 4, 5 ], [ 6, 7, 8 ] ], [ [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] - -// Get the last columns of each matrix: -var y2 = sliceDimensionFrom( x, 2, 1, false, false ); -// returns - -var a2 = ndarray2array( y2 ); -console.log( a2 ); -// => [ [ [ 1, 2 ], [ 4, 5 ], [ 7, 8 ] ], [ [ 10, 11 ], [ 13, 14 ], [ 16, 17 ] ], [ [ 19, 20 ], [ 22, 23 ], [ 25, 26 ] ] ] - -// Get the last two matrices: -var y3 = sliceDimensionFrom( x, 0, 1, false, false ); -// returns - -var a3 = ndarray2array( y3 ); -console.log( a3 ); -// => [ [ [ 9, 10, 11 ], [ 12, 13, 14 ], [ 15, 16, 17 ] ], [ [ 18, 19, 20 ], [ 21, 22, 23 ], [ 24, 25, 26 ] ] ] diff --git a/index.js b/index.js new file mode 100644 index 0000000..5b66137 --- /dev/null +++ b/index.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,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("buffer")):"function"==typeof define&&define.amd?define(["buffer"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).sliceDimensionFrom=n(t.require$$0)}(this,(function(t){"use strict";var n="function"==typeof Object.defineProperty?Object.defineProperty:null;var e=Object.defineProperty;function r(t){return"number"==typeof t}function i(t){var n,e="";for(n=0;n0&&(e-=1),r=t.toExponential(e)):r=t.toPrecision(n.precision),n.alternate||(r=h.call(r,d,"$1e"),r=h.call(r,v,"e"),r=h.call(r,b,""));break;default:throw new Error("invalid double notation. Value: "+n.specifier)}return r=h.call(r,p,"e+0$1"),r=h.call(r,g,"e-0$1"),n.alternate&&(r=h.call(r,y,"$1."),r=h.call(r,m,"$1.e")),t>=0&&n.sign&&(r=n.sign+r),r=n.specifier===c.call(n.specifier)?c.call(r):s.call(r)}function E(t){var n,e="";for(n=0;n127)throw new Error("invalid character code. Value: "+i.arg);i.arg=T(u)?String(i.arg):_(u)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(n||(i.precision=6),c=parseFloat(i.arg),!isFinite(c)){if(!r(i.arg))throw new Error("invalid floating-point number. Value: "+f);c=i.arg,i.padZeros=!1}i.arg=w(c,i);break;default:throw new Error("invalid specifier: "+i.specifier)}i.maxWidth>=0&&i.arg.length>i.maxWidth&&(i.arg=i.arg.substring(0,i.maxWidth)),i.padZeros?i.arg=o(i.arg,i.width||i.precision,i.padRight):i.width&&(i.arg=(g=i.arg,y=i.width,m=i.padRight,b=void 0,(b=y-g.length)<0?g:g=m?g+E(b):E(b)+g)),f+=i.arg||"",s+=1}return f}var S=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function A(t){var n={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]&&(n.precision="1"),n}function j(t){var n,e,r,i;for(e=[],i=0,r=S.exec(t);r;)(n=t.slice(i,S.lastIndex-r[0].length)).length&&e.push(n),"%"===r[6]?e.push("%"):e.push(A(r)),i=S.lastIndex,r=S.exec(t);return(n=t.slice(i)).length&&e.push(n),e}function F(t){var n,e;if("string"!=typeof t)throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",t));for(n=[j(t)],e=1;eet&&it(t)}function at(t){return Y(t)&&ot(t)}function ut(t){return Q(t)&&ot(t.valueOf())}function lt(t){return at(t)||ut(t)}function ft(t){return null===t}function st(t){return void 0===t}function ct(t){return at(t)||ft(t)||st(t)}function ht(){var t,n,e,r;if(0===(t=arguments.length)?(n=null,e=null,r=null):1===t?(n=null,e=arguments[0],r=null):2===t?(n=arguments[0],e=arguments[1],r=null):(n=arguments[0],e=arguments[1],r=arguments[2]),!(this instanceof ht))return new ht(n,e,r);if(!ct(n))throw new TypeError(F("invalid argument. First argument must be an integer, null, or undefined. Value: `%s`.",n));if(!ct(e))throw new TypeError(F("invalid argument. Second argument must be an integer, null, or undefined. Value: `%s`.",e));if(!ct(r))throw new TypeError(F("invalid argument. Third argument must be an integer, null, or undefined. Value: `%s`.",r));if(0===r)throw new RangeError(F("invalid argument. Third argument cannot be zero. Value: `%s`.",r));return this._start=void 0===n?null:n,this._stop=void 0===e?null:e,this._step=void 0===r?null:r,this}function pt(){return/^\s*function\s*([^(]*)/i}P(lt,"isPrimitive",at),P(lt,"isObject",ut),P(ht,"name","Slice"),C(ht.prototype,"start",(function(){return this._start})),C(ht.prototype,"stop",(function(){return this._stop})),C(ht.prototype,"step",(function(){return this._step})),P(ht.prototype,"toString",(function(){return"Slice("+this._start+","+this._stop+","+this.step+")"})),P(ht.prototype,"toJSON",(function(){return{type:"Slice",data:[this._start,this._stop,this._step]}}));var gt=/^\s*function\s*([^(]*)/i;P(pt,"REGEXP",gt);var yt=Array.isArray?Array.isArray:function(t){return"[object Array]"===Z(t)};function mt(t){if("function"!=typeof t)throw new TypeError(F("invalid argument. Must provide a function. Value: `%s`.",t));return function(n){var e,r;if(!yt(n))return!1;if(0===(e=n.length))return!1;for(r=0;r=n?e?{code:"ERR_SLICE_OUT_OF_BOUNDS"}:new ht(n,n,1):t<0&&(t=n+t)<0?e?{code:"ERR_SLICE_OUT_OF_BOUNDS"}:new ht(0,0,1):new ht(t,t+1,1)}(t,n,e):function(t,n,e){var r,i,o;if(r=t.start,i=t.stop,null===(o=t.step)&&(o=1),null===r)r=o>0?0:n-1;else if(r<0){if((r=n+r)<0){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};r=0}}else if(r>=n){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};r=o<0?n-1:n}if(null===i)i=o>0?n:null;else if(i<0){if((i=n+i)<0)if(o>0){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=0}else{if(e&&i<-1)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=null}}else if(i>n){if(e)return{code:"ERR_SLICE_OUT_OF_BOUNDS"};i=n}return new ht(r,i,o)}(t,n,e)}function Tt(t,n,e){var r,i,o,a;for(r=t.data,i=[],a=0;a0&&e>=r||n<0&&e<=r?0:Vt((r-e)/n)}function St(t){var n,e,r;for(n=t.data,e=[],r=0;r=0;i--)e[i]=r,r*=t[i];return e}(t)}P(Ut,"isPrimitive",It),P(Ut,"isObject",Mt),P(Pt,"assign",(function(t,n,e){return Nt(n)?function(t,n){var e,r;for(e=1,r=0;r=0;r--)n[r]=e,e*=t[r];return n}(t,e)}));var Ct="row-major";function Yt(t){return Math.abs(t)}var Dt="row-major",$t="column-major";function Jt(t){var n,e;return It(e=t.order)?e:"object"!=typeof(n=t.strides)||null===n?Dt:(e=function(t){var n,e,r,i,o,a;if(0===(e=t.length))return 0;for(n=!0,r=!0,i=Yt(t[0]),a=1;ai&&(r=!1),!r&&!n)return 0;i=o}return r&&n?3:r?1:2}(n),1===e||3===e?Dt:2===e?$t:0===t.shape.length?Dt:null)}function Wt(t){return t.data}function zt(t){return at(t)&&t>0}function qt(t){return ut(t)&&t.valueOf()>0}function Gt(t){return zt(t)||qt(t)}P(Gt,"isPrimitive",zt),P(Gt,"isObject",qt);var Zt=/./;function Xt(t){return"boolean"==typeof t}var Ht=Boolean,Kt=Boolean.prototype.toString;var Qt=$();function tn(t){return"object"==typeof t&&(t instanceof Ht||(Qt?function(t){try{return Kt.call(t),!0}catch(t){return!1}}(t):"[object Boolean]"===Z(t)))}function nn(t){return Xt(t)||tn(t)}P(nn,"isPrimitive",Xt),P(nn,"isObject",tn);var en="object"==typeof self?self:null,rn="object"==typeof window?window:null,on="object"==typeof global?global:null,an="object"==typeof globalThis?globalThis:null;function un(t){if(arguments.length){if(!Xt(t))throw new TypeError(F("invalid argument. Must provide a boolean. Value: `%s`.",t));if(t)return new Function("return this;")()}if(an)return an;if(en)return en;if(rn)return rn;if(on)return on;throw new Error("unexpected error. Unable to resolve global object.")}var ln=un(),fn=ln.document&&ln.document.childNodes,sn=Int8Array;var cn="function"==typeof Zt||"object"==typeof sn||"function"==typeof fn?function(t){return dt(t).toLowerCase()}:function(t){var n;return null===t?"null":"object"===(n=typeof t)?dt(t).toLowerCase():n};function hn(t){return"function"===cn(t)}function pn(t){return hn(t)&&zt(t.alignment)&&zt(t.byteLength)&&hn(t.byteLengthOf)&&hn(t.byteOffsetOf)&&hn(t.bufferOf)&&hn(t.isStruct)&&hn(t.viewOf)&&z(t,"fields")&&z(t,"layout")}function gn(t){return Object.keys(Object(t))}var yn,mn=void 0!==Object.keys;function bn(t){return"[object Arguments]"===Z(t)}yn=function(){return bn(arguments)}();var vn=yn;function dn(t){return t!=t}function wn(t){return Y(t)&&dn(t)}function En(t){return Q(t)&&dn(t.valueOf())}function _n(t){return wn(t)||En(t)}P(_n,"isPrimitive",wn),P(_n,"isObject",En);var xn=Object.prototype.propertyIsEnumerable;var Tn=!xn.call("beep","0");function Vn(t,n){var e;return null!=t&&(!(e=xn.call(t,n))&&Tn&&Ut(t)?!wn(n=+n)&&at(n)&&n>=0&&n=0&&t.length<=On&&z(t,"callee")&&!Vn(t,"callee")},An=Array.prototype.slice;var jn=Vn((function(){}),"prototype"),Fn=!Vn({toString:null},"toString"),Ln=9007199254740991;function Bn(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=Ln}function In(t,n,e){var r,i;if(!Bn(t)&&!It(t))throw new TypeError(F("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(r=t.length))return-1;if(3===arguments.length){if(!at(e))throw new TypeError(F("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=r)return-1;i=e}else(i=r+e)<0&&(i=0)}else i=0;if(_n(n)){for(;i0&&!z(t,"0"))for(u=0;u1){if(!Zn(n))throw new TypeError(F("invalid argument. Options argument must be an object. Value: `%s`.",n));if(z(n,"duplicates")&&!Xt(f=n.duplicates))throw new TypeError(F("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",f))}if(r=(e=Yn(t)).length,a={},f)for(l=0;l=0}function fr(t){return ut(t)&&t.valueOf()>=0}function sr(t){return lr(t)||fr(t)}P(sr,"isPrimitive",lr),P(sr,"isObject",fr);var cr=4294967295;function hr(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&it(t.length)&&t.length>=0&&t.length<=cr}var pr="function"==typeof ArrayBuffer;function gr(t){return pr&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===Z(t)}var yr=mt(Ut.isPrimitive),mr=mt(Ut.isObject),br=mt(Ut);function vr(t,n,e){N(t,n,{configurable:!1,enumerable:!0,writable:!1,value:e})}function dr(t,n){if(!(this instanceof dr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Y(t))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Y(n))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",n));return vr(this,"re",t),vr(this,"im",n),this}P(br,"primitives",yr),P(br,"objects",mr),P(dr,"name","Complex128"),P(dr,"BYTES_PER_ELEMENT",8),P(dr.prototype,"BYTES_PER_ELEMENT",8),P(dr.prototype,"byteLength",16),P(dr.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),P(dr.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var wr="function"==typeof Math.fround?Math.fround:null,Er=new ve(1);var _r="function"==typeof wr?wr:function(t){return Er[0]=t,Er[0]};function xr(t,n){if(!(this instanceof xr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Y(t))throw new TypeError(F("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Y(n))throw new TypeError(F("invalid argument. Imaginary component must be a number. Value: `%s`.",n));return vr(this,"re",_r(t)),vr(this,"im",_r(n)),this}function Tr(t){return t instanceof dr||t instanceof xr||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function Vr(t){return it(t/2)}P(xr,"name","Complex64"),P(xr,"BYTES_PER_ELEMENT",4),P(xr.prototype,"BYTES_PER_ELEMENT",4),P(xr.prototype,"byteLength",8),P(xr.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),P(xr.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var Or=8;function Sr(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Or}var Ar=16;function jr(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===Ar}function Fr(){return"function"==typeof q&&"symbol"==typeof q("foo")&&z(q,"iterator")&&"symbol"==typeof q.iterator}var Lr=Fr()?Symbol.iterator:null;function Br(t){return t.re}function Ir(t){return t.im}function Rr(t,n){return new ve(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*n,2*(t.length-n))}function kr(t,n){return new pe(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*n,2*(t.length-n))}function Mr(t){var n,e,r;for(n=[];!(e=t.next()).done;)if(hr(r=e.value)&&r.length>=2)n.push(r[0],r[1]);else{if(!Tr(r))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));n.push(Br(r),Ir(r))}return n}var Ur=2*ve.BYTES_PER_ELEMENT,Nr=Fr();function Pr(t){return t instanceof Dr||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Cr(t){return t===Dr||"Complex128Array"===t.name}function Yr(t,n){return new xr(t[n*=2],t[n+1])}function Dr(){var t,n,e,r;if(n=arguments.length,!(this instanceof Dr))return 0===n?new Dr:1===n?new Dr(arguments[0]):2===n?new Dr(arguments[0],arguments[1]):new Dr(arguments[0],arguments[1],arguments[2]);if(0===n)e=new ve(0);else if(1===n)if(lr(arguments[0]))e=new ve(2*arguments[0]);else if(Bn(arguments[0]))if((r=(e=arguments[0]).length)&&yt(e)&&Tr(e[0])){if(e=function(t,n){var e,r,i,o;for(e=n.length,o=0,i=0;ie.byteLength-t)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Ur));e=new ve(e,t,2*r)}}return P(this,"_buffer",e),P(this,"_length",e.length/2),this}function $r(t){return t.re}function Jr(t){return t.im}function Wr(t){var n,e,r;for(n=[];!(e=t.next()).done;)if(hr(r=e.value)&&r.length>=2)n.push(r[0],r[1]);else{if(!Tr(r))return new TypeError(F("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",r));n.push($r(r),Jr(r))}return n}P(Dr,"BYTES_PER_ELEMENT",Ur),P(Dr,"name","Complex64Array"),P(Dr,"from",(function(t){var n,e,r,i,o,a,u,l,f,s,c,h;if(!hn(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Cr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!hn(r=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",r));e>2&&(n=arguments[2])}if(Pr(t)){if(l=t.length,r){for(o=(i=new this(l))._buffer,h=0,c=0;c=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Bn(t)){if(r){for(l=t.length,u=t.get&&t.set?oe("default"):ue("default"),c=0;c=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Dn(t)&&Nr&&hn(t[Lr])){if(!hn((o=t[Lr]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=r?function(t,n,e){var r,i,o,a;for(r=[],a=-1;!(i=t.next()).done;)if(a+=1,hr(o=n.call(e,i.value,a))&&o.length>=2)r.push(o[0],o[1]);else{if(!Tr(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));r.push(Br(o),Ir(o))}return r}(o,r,n):Mr(o),a instanceof Error)throw a;for(o=(i=new this(l=a.length/2))._buffer,c=0;c=this._length))return Yr(this._buffer,t)})),C(Dr.prototype,"buffer",(function(){return this._buffer.buffer})),C(Dr.prototype,"byteLength",(function(){return this._buffer.byteLength})),C(Dr.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(Dr.prototype,"BYTES_PER_ELEMENT",Dr.BYTES_PER_ELEMENT),P(Dr.prototype,"copyWithin",(function(t,n){if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*n):this._buffer.copyWithin(2*t,2*n,2*arguments[2]),this})),P(Dr.prototype,"entries",(function(){var t,n,e,r,i,o;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,e=this._length,o=-1,P(n={},"next",(function(){if(o+=1,i||o>=e)return{done:!0};return{value:[o,Yr(r,o)],done:!1}})),P(n,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(n,Lr,(function(){return t.entries()})),n})),P(Dr.prototype,"every",(function(t,n){var e,r;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));if(n<0&&(n+=i)<0&&(n=0),arguments.length>2){if(!it(e))throw new TypeError(F("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 n=0,e=i;for(a=Br(t),u=Ir(t),l=n;l=0;r--)if(i=Yr(e,r),t.call(n,i,r,this))return i})),P(Dr.prototype,"findLastIndex",(function(t,n){var e,r,i;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=this._length-1;r>=0;r--)if(i=Yr(e,r),t.call(n,i,r,this))return r;return-1})),P(Dr.prototype,"forEach",(function(t,n){var e,r,i;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r=this._length))return Yr(this._buffer,t)})),P(Dr.prototype,"includes",(function(t,n){var e,r,i,o,a;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Tr(t))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=Br(t),o=Ir(t),e=this._buffer,a=n;a1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=Br(t),o=Ir(t),e=this._buffer,a=n;a=e)return{done:!0};return{value:i,done:!1}})),P(n,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(n,Lr,(function(){return t.keys()})),n})),P(Dr.prototype,"lastIndexOf",(function(t,n){var e,r,i,o,a;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Tr(t))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n>=this._length?n=this._length-1:n<0&&(n+=this._length)}else n=this._length-1;for(i=Br(t),o=Ir(t),e=this._buffer,a=n;a>=0;a--)if(i===e[r=2*a]&&o===e[r+1])return a;return-1})),C(Dr.prototype,"length",(function(){return this._length})),P(Dr.prototype,"map",(function(t,n){var e,r,i,o,a;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)r=n,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.");r=Yr(e,0),o=1}for(;o1)r=n,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.");r=Yr(e,i-1),o=i-2}for(;o>=0;o--)r=t(r,Yr(e,o),o,this);return r})),P(Dr.prototype,"reverse",(function(){var t,n,e,r,i,o;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,r=rt(e/2),i=0;i1){if(!lr(e=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Tr(t)){if(e>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return r[e*=2]=Br(t),void(r[e+1]=Ir(t))}if(Pr(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t._buffer,f=r.byteOffset+e*Ur,n.buffer===r.buffer&&n.byteOffsetf){for(i=new ve(n.length),l=0;lthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t,f=r.byteOffset+e*Ur,n.buffer===r.buffer&&n.byteOffsetf){for(i=new ve(a),l=0;lthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,l=0;lu&&(n=u)}}for(e=ti&&(n=i)}}return t>=i?(i=0,e=r.byteLength):t>=n?(i=0,e=r.byteOffset+t*Ur):(i=n-t,e=r.byteOffset+t*Ur),new this.constructor(r.buffer,e,i<0?0:i)})),P(Dr.prototype,"toLocaleString",(function(t,n){var e,r,i,o,a;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!It(t)&&!yr(t))throw new TypeError(F("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)e={};else{if(!Dn(n))throw new TypeError(F("invalid argument. Options argument must be an object. Value: `%s`.",n));e=n}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:Yr(i,o),done:!1}})),P(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(t,Lr,(function(){return n.values()})),t})),P(Dr.prototype,"with",(function(t,n){var e,r,i;if(!Pr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(t))throw new TypeError(F("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(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Tr(n))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",n));return(e=(r=new this.constructor(this._buffer))._buffer)[2*t]=Br(n),e[2*t+1]=Ir(n),r}));var zr=2*pe.BYTES_PER_ELEMENT,qr=Fr();function Gr(t){return t instanceof Hr||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Zr(t){return t===Hr||"Complex64Array"===t.name}function Xr(t,n){return new dr(t[n*=2],t[n+1])}function Hr(){var t,n,e,r;if(n=arguments.length,!(this instanceof Hr))return 0===n?new Hr:1===n?new Hr(arguments[0]):2===n?new Hr(arguments[0],arguments[1]):new Hr(arguments[0],arguments[1],arguments[2]);if(0===n)e=new pe(0);else if(1===n)if(lr(arguments[0]))e=new pe(2*arguments[0]);else if(Bn(arguments[0]))if((r=(e=arguments[0]).length)&&yt(e)&&Tr(e[0])){if(e=function(t,n){var e,r,i,o;for(e=n.length,o=0,i=0;ie.byteLength-t)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*zr));e=new pe(e,t,2*r)}}return P(this,"_buffer",e),P(this,"_length",e.length/2),this}function Kr(t){var n,e;for(n=[];!(e=t.next()).done;)n.push(Ht(e.value));return n}P(Hr,"BYTES_PER_ELEMENT",zr),P(Hr,"name","Complex128Array"),P(Hr,"from",(function(t){var n,e,r,i,o,a,u,l,f,s,c,h;if(!hn(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Zr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!hn(r=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",r));e>2&&(n=arguments[2])}if(Gr(t)){if(l=t.length,r){for(o=(i=new this(l))._buffer,h=0,c=0;c=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Bn(t)){if(r){for(l=t.length,u=t.get&&t.set?oe("default"):ue("default"),c=0;c=2))throw new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[h]=s[0],o[h+1]=s[1]}h+=2}return i}return new this(t)}if(Dn(t)&&qr&&hn(t[Lr])){if(!hn((o=t[Lr]()).next))throw new TypeError(F("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=r?function(t,n,e){var r,i,o,a;for(r=[],a=-1;!(i=t.next()).done;)if(a+=1,hr(o=n.call(e,i.value,a))&&o.length>=2)r.push(o[0],o[1]);else{if(!Tr(o))return new TypeError(F("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));r.push($r(o),Jr(o))}return r}(o,r,n):Wr(o),a instanceof Error)throw a;for(o=(i=new this(l=a.length/2))._buffer,c=0;c=this._length))return Xr(this._buffer,t)})),C(Hr.prototype,"buffer",(function(){return this._buffer.buffer})),C(Hr.prototype,"byteLength",(function(){return this._buffer.byteLength})),C(Hr.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(Hr.prototype,"BYTES_PER_ELEMENT",Hr.BYTES_PER_ELEMENT),P(Hr.prototype,"copyWithin",(function(t,n){if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*n):this._buffer.copyWithin(2*t,2*n,2*arguments[2]),this})),P(Hr.prototype,"entries",(function(){var t,n,e,r,i,o,a;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return n=this,t=this._buffer,r=this._length,o=-1,a=-2,P(e={},"next",(function(){var n;if(o+=1,i||o>=r)return{done:!0};return n=new dr(t[a+=2],t[a+1]),{value:[o,n],done:!1}})),P(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(e,Lr,(function(){return n.entries()})),e})),P(Hr.prototype,"every",(function(t,n){var e,r;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));if(n<0&&(n+=i)<0&&(n=0),arguments.length>2){if(!it(e))throw new TypeError(F("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 n=0,e=i;for(a=$r(t),u=Jr(t),l=n;l=0;r--)if(i=Xr(e,r),t.call(n,i,r,this))return i})),P(Hr.prototype,"findLastIndex",(function(t,n){var e,r,i;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=this._length-1;r>=0;r--)if(i=Xr(e,r),t.call(n,i,r,this))return r;return-1})),P(Hr.prototype,"forEach",(function(t,n){var e,r,i;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r=this._length))return Xr(this._buffer,t)})),C(Hr.prototype,"length",(function(){return this._length})),P(Hr.prototype,"includes",(function(t,n){var e,r,i,o,a;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Tr(t))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=$r(t),o=Jr(t),e=this._buffer,a=n;a1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(i=$r(t),o=Jr(t),e=this._buffer,a=n;a=e)return{done:!0};return{value:i,done:!1}})),P(n,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(n,Lr,(function(){return t.keys()})),n})),P(Hr.prototype,"lastIndexOf",(function(t,n){var e,r,i,o,a;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Tr(t))throw new TypeError(F("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!it(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n>=this._length?n=this._length-1:n<0&&(n+=this._length)}else n=this._length-1;for(i=$r(t),o=Jr(t),e=this._buffer,a=n;a>=0;a--)if(i===e[r=2*a]&&o===e[r+1])return a;return-1})),P(Hr.prototype,"map",(function(t,n){var e,r,i,o,a;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o1)r=n,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.");r=Xr(e,0),o=1}for(;o1)r=n,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.");r=Xr(e,i-1),o=i-2}for(;o>=0;o--)r=t(r,Xr(e,o),o,this);return r})),P(Hr.prototype,"reverse",(function(){var t,n,e,r,i,o;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=this._buffer,r=rt(e/2),i=0;i1){if(!lr(e=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Tr(t)){if(e>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return r[e*=2]=$r(t),void(r[e+1]=Jr(t))}if(Gr(t)){if(e+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t._buffer,f=r.byteOffset+e*zr,n.buffer===r.buffer&&n.byteOffsetf){for(i=new pe(n.length),l=0;lthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=t,f=r.byteOffset+e*zr,n.buffer===r.buffer&&n.byteOffsetf){for(i=new pe(a),l=0;lthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,l=0;lu&&(n=u)}}for(e=ti&&(n=i)}}return t>=i?(i=0,e=r.byteLength):t>=n?(i=0,e=r.byteOffset+t*zr):(i=n-t,e=r.byteOffset+t*zr),new this.constructor(r.buffer,e,i<0?0:i)})),P(Hr.prototype,"toLocaleString",(function(t,n){var e,r,i,o,a;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)r=[];else{if(!Ut(t)&&!yr(t))throw new TypeError(F("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)e={};else{if(!Dn(n))throw new TypeError(F("invalid argument. Options argument must be an object. Value: `%s`.",n));e=n}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:Xr(i,o),done:!1}})),P(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(t,Lr,(function(){return n.values()})),t})),P(Hr.prototype,"with",(function(t,n){var e,r,i;if(!Gr(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(t))throw new TypeError(F("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(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Tr(n))throw new TypeError(F("invalid argument. Second argument must be a complex number. Value: `%s`.",n));return(e=(r=new this.constructor(this._buffer))._buffer)[2*t]=$r(n),e[2*t+1]=Jr(n),r}));var Qr=Ze.BYTES_PER_ELEMENT,ti=Fr();function ni(t){return"object"==typeof t&&null!==t&&"BooleanArray"===t.constructor.name&&t.BYTES_PER_ELEMENT===Qr}function ei(t){return t===ri}function ri(){var t,n,e,r,i;if(n=arguments.length,!(this instanceof ri))return 0===n?new ri:1===n?new ri(arguments[0]):2===n?new ri(arguments[0],arguments[1]):new ri(arguments[0],arguments[1],arguments[2]);if(0===n)e=new Ze(0);else if(1===n)if(lr(i=arguments[0]))e=new Ze(i);else if(Bn(i))e=function(t,n){var e,r;for(e=n.length,r=0;re.byteLength-t)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",r*Qr));e=new Ze(e,t,r)}}return P(this,"_buffer",e),P(this,"_length",e.length),this}P(ri,"BYTES_PER_ELEMENT",Qr),P(ri,"name","BooleanArray"),P(ri,"from",(function(t){var n,e,r,i,o,a,u,l,f;if(!hn(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ei(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((e=arguments.length)>1){if(!hn(r=arguments[1]))throw new TypeError(F("invalid argument. Second argument must be a function. Value: `%s`.",r));e>2&&(n=arguments[2])}if(Bn(t)){if(r){for(l=t.length,u=t.get&&t.set?oe("default"):ue("default"),o=(i=new this(l))._buffer,f=0;f=e))return Ht(n[t])})),C(ri.prototype,"buffer",(function(){return this._buffer.buffer})),C(ri.prototype,"byteLength",(function(){return this._buffer.byteLength})),C(ri.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(ri.prototype,"BYTES_PER_ELEMENT",ri.BYTES_PER_ELEMENT),P(ri.prototype,"copyWithin",(function(t,n){if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(t,n):this._buffer.copyWithin(t,n,arguments[2]),this})),P(ri.prototype,"entries",(function(){var t,n,e,r,i,o;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,r=this._buffer,e=this._length,o=-1,P(n={},"next",(function(){if(o+=1,i||o>=e)return{done:!0};return{value:[o,Ht(r[o])],done:!1}})),P(n,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(n,Lr,(function(){return t.entries()})),n})),P(ri.prototype,"every",(function(t,n){var e,r;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r1){if(!at(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));if(n<0&&(n+=i)<0&&(n=0),arguments.length>2){if(!at(e))throw new TypeError(F("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 n=0,e=i;for(o=t?1:0,a=n;a=0;i--)if(r=Ht(e[i]),t.call(n,r,i,this))return r})),P(ri.prototype,"findLastIndex",(function(t,n){var e,r,i;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,i=this._length-1;i>=0;i--)if(r=Ht(e[i]),t.call(n,r,i,this))return i;return-1})),P(ri.prototype,"forEach",(function(t,n){var e,r;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!hn(t))throw new TypeError(F("invalid argument. First argument must be a function. Value: `%s`.",t));for(e=this._buffer,r=0;r=this._length))return Ht(this._buffer[t])})),P(ri.prototype,"includes",(function(t,n){var e,r;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Xt(t))throw new TypeError(F("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!at(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(e=this._buffer,r=n;r1){if(!at(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0&&(n+=this._length)<0&&(n=0)}else n=0;for(e=this._buffer,r=n;r0){if(!It(t))throw new TypeError(F("invalid argument. First argument must be a string. Value: `%s`.",t))}else t=",";for(n=this._buffer,e=[],r=0;r=e)return{done:!0};return{value:i,done:!1}})),P(n,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(n,Lr,(function(){return t.keys()})),n})),P(ri.prototype,"lastIndexOf",(function(t,n){var e,r;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Xt(t))throw new TypeError(F("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!at(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n>=this._length?n=this._length-1:n<0&&(n+=this._length)}else n=this._length-1;for(e=this._buffer,r=n;r>=0;r--)if(t===Ht(e[r]))return r;return-1})),C(ri.prototype,"length",(function(){return this._length})),P(ri.prototype,"map",(function(t,n){var e,r,i,o;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!hn(t))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",t);for(i=this._buffer,e=(r=new this.constructor(this._length))._buffer,o=0;o1)i=n,o=0;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=Ht(e[0]),o=1}for(;o1)i=n,o=r-1;else{if(0===r)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=Ht(e[r-1]),o=r-2}for(;o>=0;o--)i=t(i,Ht(e[o]),o,this);return i})),P(ri.prototype,"reverse",(function(){var t,n,e,r,i,o;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._buffer,e=this._length,r=rt(e/2),i=0;i1){if(!lr(e=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Bn(t)){if(e+(o=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(n=ni(t)?t._buffer:t,u=r.byteOffset+e*Qr,n.buffer===r.buffer&&n.byteOffsetu){for(i=new Ze(n.length),a=0;a=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));r[e]=t?1:0}})),P(ri.prototype,"slice",(function(t,n){var e,r,i,o,a,u;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(o=this._buffer,a=this._length,0===arguments.length)t=0,n=a;else{if(!at(t))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a)<0&&(t=0),1===arguments.length)n=a;else{if(!at(n))throw new TypeError(F("invalid argument. Second argument must be an integer. Value: `%s`.",n));n<0?(n+=a)<0&&(n=0):n>a&&(n=a)}}for(e=ti&&(n=i)}}return t>=i?(i=0,e=r.byteLength):t>=n?(i=0,e=r.byteOffset+t*Qr):(i=n-t,e=r.byteOffset+t*Qr),new this.constructor(r.buffer,e,i<0?0:i)})),P(ri.prototype,"toLocaleString",(function(t,n){var e,r,i,o,a;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)r=[];else{if(!It(t)&&!yr(t))throw new TypeError(F("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));r=t}if(arguments.length<2)e={};else{if(!Dn(n))throw new TypeError(F("invalid argument. Options argument must be an object. Value: `%s`.",n));e=n}for(o=this._buffer,i=[],a=0;a=e)return{done:!0};return{value:Ht(i[o]),done:!1}})),P(t,"return",(function(t){if(r=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),Lr&&P(t,Lr,(function(){return n.values()})),t})),P(ri.prototype,"with",(function(t,n){var e,r;if(!ni(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!at(t))throw new TypeError(F("invalid argument. First argument must be an integer. Value: `%s`.",t));if(r=this._length,t<0&&(t+=r),t<0||t>=r)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!Xt(n))throw new TypeError(F("invalid argument. Second argument must be a boolean. Value: `%s`.",n));return(e=new this.constructor(this._buffer))._buffer[t]=n?1:0,e}));var ii=[pe,ve,Fe,xe,$e,Me,ur,Ze,tr,Dr,Hr,ri],oi=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],ai=oi.length;function ui(t){var n;if(yt(t))return"generic";if(vt(t))return null;for(n=0;n0&&n.push("generic"),n)}());var bi={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 vi(t){var n;return It(t)?bi[t]||null:Y(t)?bi[Hn(t)]||null:t&&zt(n=t.byteLength)?n:null}function di(t,n){var e,r,i;if(e=arguments.length,!(this instanceof di))return e<2?new di(t):new di(t,n);if(mi(t))r="builtin";else{if(function(t){return t instanceof di||"object"==typeof t&&null!==t&&"DataType"===t.constructor.name&&It(t.char)&&It(t.description)&&It(t.byteOrder)&&ne(t,"value")}(t))return new di(t.value,{description:t.description});if(!pn(t))throw new TypeError(F("invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.",t));r="struct"}if(e>1){if(!Zn(i=n))throw new TypeError(F("invalid argument. Options argument must be an object. Value: `%s`.",i));if(z(i,"description")&&!It(i.description))throw new TypeError(F("invalid option. `%s` option must be a string. Option: `%s`.","description",i.description))}else i={};return P(this,"_value",t),P(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===pi&&(pi={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"}),pi[te(t)]||null)}(t)||""),P(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===gi&&(gi={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"}),gi[te(t)]||null)}(t)||""),P(this,"_enum",function(t){var n=typeof t;return"number"===n?Hn(t)?t:null:"string"===n?Qn(t):"object"===n&&t&&at(t.enum)?t.enum:pn(t)?Qn("userdefined_type"):null}(t)||-1),P(this,"_alignment",function(t){var n;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===yi&&(yi={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?zt(n=t.alignment)?n:yi[te(t)]||null:null)}(t)||-1),P(this,"_byteLength",vi(t)||-1),P(this,"_byteOrder","host"),P(this,"_type",r),this}function wi(t){return hn(t)&&zt(t.alignment)&&zt(t.byteLength)&&hn(t.byteLengthOf)&&hn(t.byteOffsetOf)&&hn(t.bufferOf)&&hn(t.viewOf)||function(t){return t instanceof di||"object"==typeof t&&null!==t&&at(t.alignment)&&at(t.byteLength)&&It(t.byteOrder)&&It(t.char)&&at(t.enum)&&ne(t,"value")}(t)&&wi(t.value)}P(di,"name","DataType"),C(di.prototype,"alignment",(function(){return this._alignment})),C(di.prototype,"byteLength",(function(){return this._byteLength})),C(di.prototype,"byteOrder",(function(){return this._byteOrder})),C(di.prototype,"char",(function(){return this._char})),C(di.prototype,"description",(function(){return this._description})),C(di.prototype,"enum",(function(){return this._enum})),C(di.prototype,"value",(function(){return this._value})),P(di.prototype,"toJSON",(function(){return{type:"DataType",value:this.toString(),byteOrder:this._byteOrder,description:this._description}})),P(di.prototype,"toString",(function(){return"struct"===this._type?this._value.layout:String(this._value)})),P(di.prototype,"valueOf",(function(){return this.toString()}));var Ei=Object.prototype.isPrototypeOf;var _i="function"==typeof ArrayBuffer?ArrayBuffer:null;var xi,Ti="function"==typeof ArrayBuffer?ArrayBuffer:void 0;xi=function(){var t,n,e;if("function"!=typeof _i)return!1;try{(t=gr(e=new _i(16))&&"function"==typeof _i.isView)&&((n=new pe(e))[0]=-3.14,n[1]=NaN,t=t&&_i.isView(n)&&16===e.byteLength&&-3.14===n[0]&&n[1]!=n[1])}catch(n){t=!1}return t}()?Ti:function(){throw new Error("not implemented")};var Vi=xi,Oi={float64:function(t,n,e){t[n]=e},float32:function(t,n,e){t[n]=e},int32:function(t,n,e){t[n]=e},int16:function(t,n,e){t[n]=e},int8:function(t,n,e){t[n]=e},uint32:function(t,n,e){t[n]=e},uint16:function(t,n,e){t[n]=e},uint8:function(t,n,e){t[n]=e},uint8c:function(t,n,e){t[n]=e},generic:function(t,n,e){t[n]=e},default:function(t,n,e){t[n]=e}};function Si(t){var n=Oi[t];return"function"==typeof n?n:Oi.default}var Ai={complex128:function(t,n,e){t.set(e,n)},complex64:function(t,n,e){t.set(e,n)},default:function(t,n,e){t.set(e,n)}};function ji(t){var n=Ai[t];return"function"==typeof n?n:Ai.default}function Fi(t){var n=ui(t);return re(t)?{data:t,dtype:n,accessorProtocol:!0,accessors:[oe(n),ji(n)]}:{data:t,dtype:n,accessorProtocol:!1,accessors:[ue(n),Si(n)]}}function Li(t,n,e,r,i,o,a){var u,l,f,s,c,h,p;for(u=n.data,l=i.data,s=n.accessors[0],f=i.accessors[1],c=r,h=a,p=0;p0)for(s=0;s0)for(h=0;h2){if(r=Qi(to[e]))return new r(t,n);throw new TypeError(F("invalid argument. Must provide a recognized data type. Value: `%s`.",e))}return new no(t,n)}(r,i,eo[t.type])}}var io={float64:pe,float32:ve,int16:$e,int32:Fe,int8:ur,uint16:Me,uint32:xe,uint8:Ze,uint8c:tr,complex64:Dr,complex128:Hr,bool:ri};function oo(t){return io[t]||null}function ao(t,n){return new Ze(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*n,t.length-n)}function uo(){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 lo={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"}},fo={"dtypes.default":lo.dtypes.default,"dtypes.numeric":lo.dtypes.numeric,"dtypes.real":lo.dtypes.real,"dtypes.floating_point":lo.dtypes.floating_point,"dtypes.real_floating_point":lo.dtypes.real_floating_point,"dtypes.complex_floating_point":lo.dtypes.complex_floating_point,"dtypes.integer":lo.dtypes.integer,"dtypes.signed_integer":lo.dtypes.signed_integer,"dtypes.unsigned_integer":lo.dtypes.unsigned_integer,"dtypes.boolean":lo.dtypes.boolean,"dtypes.index":lo.dtypes.index,"dtypes.integer_index":lo.dtypes.integer_index,"dtypes.boolean_index":lo.dtypes.boolean_index,"dtypes.mask_index":lo.dtypes.mask_index};P(uo,"get",(function(t){var n=fo[t];return void 0===n?null:n}));var so=uo.get("dtypes.default"),co=oo("complex64"),ho=oo("complex128"),po=oo("bool");function go(){var t,n,e,r;if(null===(e=oo(n=(t=arguments.length)&&It(arguments[t-1])?arguments[t-=1]:so)))throw new TypeError(F("invalid argument. Must provide a recognized data type. Value: `%s`.",n));return t<=0?new e(0):1===t?((r=arguments[0])instanceof co?r=Rr(r,0):r instanceof ho?r=kr(r,0):r instanceof po&&(r=ao(r,0)),new e(r)):2===t?new e(arguments[0],arguments[1]):new e(arguments[0],arguments[1],arguments[2])}function yo(t){if(t.length)return t.isStructType?function(t){return function(){var n,e,r,i;for(n=(e=this[$i]).byteOffset+t.byteOffset,r=[],i=0;i0&&n.push("generic"),n)}var wo=fi(vo("real_floating_point")),Eo=fi(vo("signed_integer")),_o=un();function xo(t){return"bigint"==typeof t}function To(t){return"object"==typeof t&&"[object BigInt]"===Z(t)&&function(t){try{return"bigint"==typeof t.valueOf()}catch(t){return!1}}(t)}function Vo(t){return xo(t)||To(t)}function Oo(t){return function(){return t}}P(Vo,"isPrimitive",xo),P(Vo,"isObject",To);var So,Ao=Oo(!1),jo=Oo(!1),Fo=Oo(!1);P(Ao,"isPrimitive",jo),P(Ao,"isObject",Fo),So="function"==typeof _o.BigInt&&"function"==typeof BigInt&&"bigint"==typeof _o.BigInt("1")&&"bigint"==typeof BigInt("1")?Vo:Ao;const{isPrimitive:Lo}=So;var Bo,Io={float64:{float64:1,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:0,complex32:0,binary:0,generic:1,bool:0},float32:{float64:1,float32:1,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: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: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:0,complex32:0,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:0,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 Ro=function(t){return 0===arguments.length?function(){var t,n,e,r,i,o,a,u,l;for(e={},n=(t=Yn(Io)).length,l=0;l0}(t,n):"mostly-safe"===e?function(t,n){var e;return(t=te(t))===(n=te(n))||!!(e=Uo[t])&&e[n]>0}(t,n):function(t,n){var e;return(t=te(t))===(n=te(n))||!!(e=Co[t])&&e[n]>0}(t,n)))}var Do=1401298464324817e-60,$o=16777215,Jo=-16777215;function Wo(t){return t!=t||t===nt||t===et?"float32":it(t)?t>=Jo&&t<=$o?"float32":"float64":t>-Do&&t=rr?"int8":t>=Pe?"int16":t>=Oe?"int32":"float64":t<=We?"uint8":t<=Be?"uint16":t<=On?"uint32":"float64":t>-Do&&t=rr?"int8":t>=Pe?"int16":t>=Oe?"int32":"float64":t<=er?"int8":t<=Ne?"int16":t<=Ve?"int32":"float64"}(e):zo(e):na.dtypes.real,i=e):Tr(e)?(r=Ko(e)||("float32"===t.type?"complex64":"complex128"),i=e.re):Xt(e)?(r="bool",i=Qo(e)):Lo(e)?(r="int64",i=ta(e)):(r="generic",i=e);if(!Yo(r,t.type,t.castingMode))throw new TypeError(F("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[$i][n](t.byteOffset,i,Hi)}}function ra(t){return Ht(t)}function ia(t){return Ht(t.re||t.im)}function oa(t,n){return function(e){var r,i;Xt(e)?(r="bool",i=Qo(e)):Y(e)?(r=na.dtypes.real,i=Qo(ra(e))):Lo(e)?(r="int64",i=Qo(function(t){return Ht(t)}(e))):Tr(e)?(r=Ko(e)||na.dtypes.complex,i=Qo(ia(e))):(r="generic",i=Ht(e));if(!Yo(r,t.type,t.castingMode))throw new TypeError(F("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[$i][n](t.byteOffset,i,Hi)}}var aa="function"==typeof BigInt?BigInt:void 0;function ua(t,n){return function(e){var r,i;Lo(e)?(r="int64",i=e):Y(e)?at(e)?(r=zo(e),i=aa(e)):(r=na.dtypes.real,i=aa(rt(e))):Xt(e)?(r="bool",i=function(t){return aa(t?1:0)}(e)):Tr(e)?(r=Ko(e)||na.dtypes.complex,i=aa(rt(e.re))):(r="generic",i=aa(rt(X(i))));if(!Yo(r,t.type,t.castingMode))throw new TypeError(F("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,r));this[$i][n](t.byteOffset,i,Hi)}}function la(t){return Dn(t)&&Ni(t[$i])}var fa=fi(vo("complex_floating_point")),sa=fi(vo("boolean")),ca=fi(vo("real"));function ha(t,n){if(jr(t))return kr(t,n);if(Sr(t))return Rr(t,n);throw new TypeError(F("invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.",t))}function pa(t,n){return n>0?0:(1-t)*n}var ga=8;function ya(t,n,e,r,i){var o,a,u,l;if(t<=0)return e;if((u=Fi(e)).accessorProtocol)return function(t,n,e,r,i){var o,a,u,l;for(o=e.data,a=e.accessors[1],u=i,l=0;l0)for(l=0;l0&&(u+=n),xa(f=a(o,l))||(u+=String(f)),l+=r;return u}(t,n,u,r,i);for(a=i,o="",f=0;f0&&(o+=n),xa(l=e[a])||(o+=String(l)),a+=r;return o}function Va(t,n){return Ta(t.length,n,t,1,0)}function Oa(t,n){return Xt(t)?null:new TypeError(F("invalid argument. `%s` field must be a boolean. Value: `%s`.",n,t))}P((function(t,n,e,r){return Ta(t,n,e,r,pa(t,r))}),"ndarray",Ta);var Sa=["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float32","float64","complex64","complex128","bool"];var Aa,ja={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},Fa=["name","type"],La={name:function(t,n){return It(t)||t.length>0?null:new TypeError(F("invalid argument. `%s` field must be a non-empty string. Value: `%s`.",n,t))},type:function(t){return li(Sa,t)||pn(t)?null:new TypeError(F('invalid argument. `%s` field must be either a struct type or one of the following: "%s". Value: `%s`.',"type",Va(Sa,", "),t))},description:function(t,n){return It(t)?null:new TypeError(F("invalid argument. `%s` field must be a string. Value: `%s`.",n,t))},length:function(t,n){return zt(t)?null:new TypeError(F("invalid argument. `%s` field must be a positive integer. Value: `%s`.",n,t))},enumerable:Oa,writable:Oa,default:Oo(null),castingMode:(Aa=["none","safe","mostly-safe","same-kind","unsafe"],function(t,n){return li(Aa,t)?null:new TypeError(F('invalid argument. `%s` field must be one of the following: "%s". Value: `%s`.',n,Va(Aa,", "),t))})};function Ba(t,n){var e,r,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;an&&(n=e);return n}function Ra(t){var n,e,r,i,o,a,u;if(0===(n=t.fields).length)return null;for(r=[],u=0;u0&&o.byteOffset===t[a-1].byteOffset||(o.isStructType?n.push(si(o.type.layout,r,Pa(o.byteOffset))):n.push(F("|<%s>[%u,%u]",o.type,o.byteOffset,o.byteLength)));return"|"===(e=F("%s|",n.join("")))[e.length-2]&&(e=e.substring(0,e.length-1)),e}var Ya=["none","linear","layout"],Da=fi(Ya);function $a(t,n,e){var r;if(!Zn(e))throw new TypeError(F("invalid argument. Options argument must be an object. Value: `%s`.",e));if(r={format:"none"},z(e,"format")&&(r.format=e.format,!Da(r.format)))throw new TypeError(F('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"format",Va(Ya,", "),e.format));return"linear"===r.format?function(t,n){var e,r,i,o,a,u,l,f,s,c,h,p,g,y,m,b,v,d,w,E,_,x;for(b=n.length,e="%"+(t.byteLength-1).toString().length+"s",y=0,E=0;Ey&&(y=m);for(r="%"+y+"s",i="// %s",u="%s: %s %s",c=0,f=[],E=0;E0&&v.byteOffset===n[E-1].byteOffset)){for(s=E1?" (byte %u)":"",s){for(a=" => union: %s",l=[],x=E+1;x":d.type,l.push(F("%s<%s>[%u]",d.name,w,_%d.alignment)),x+=1;a=F(a,l.join(", "))}else a="";l=F(o+a,_%v.alignment),g=v.length?F(i,F("%s[%u]%s",v.type,rt(_/v.alignment),l)):F(i,F("%s%s",v.type,l)),f.push(F(u,h,p,g)),c+=1}for(_=0;_"}function Ja(){}var Wa="foo"===Ja.name;var za=[pe,ve,Fe,xe,$e,Me,ur,Ze,tr],qa=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],Ga=ce()?qn(pe):Za;function Za(){}Ga="TypedArray"===function(t){if(!1===hn(t))throw new TypeError(F("invalid argument. Must provide a function. Value: `%s`.",t));return Wa?t.name:gt.exec(t.toString())[1]}(Ga)?Ga:Za;var Xa=[Hr,Dr],Ha=["Complex64Array","Complex128Array"];function Ka(){return"function"==typeof q&&"symbol"==typeof q("foo")&&z(q,"hasInstance")&&"symbol"==typeof q.hasInstance}var Qa=Ka()?Symbol.hasInstance:null,tu=Ka();function nu(t,n){if("function"!=typeof n&&(!tu||"object"!=typeof n||"function"!=typeof n[Qa]))throw new TypeError(F("invalid argument. Second argument must be callable. Value: `%s`.",n));return t instanceof n}var eu=[[pe,"Float64Array"],[ve,"Float32Array"],[Fe,"Int32Array"],[xe,"Uint32Array"],[$e,"Int16Array"],[Me,"Uint16Array"],[ur,"Int8Array"],[Ze,"Uint8Array"],[tr,"Uint8ClampedArray"],[Dr,"Complex64Array"],[Hr,"Complex128Array"],[ri,"BooleanArray"]];function ru(t){var n,e;for(e=0;e0){if(!Dn(t))throw new TypeError(F("invalid argument. First argument must be an object. Value: `%s`.",t));p=t}if(P(this,$i,h),void 0!==p){for(l=jt(void 0,a.length),c={},m=0;m0&&((o=t[u-1]).padding=r,_a(a)&&Na(o.fields,r)),a.byteOffset=i,_a(a))for(l=0;l0?arguments[0]:{})})),P(f.prototype,"toJSON",(function(){if(!(this instanceof f))throw new Error("invalid invocation. `this` is not a struct instance.");return function(t,n){var e,r,i,o;for(e={},o=0;o=u.byteLength)throw new RangeError(F("invalid argument. Second argument exceeds the bounds of the ArrayBuffer. Value: `%s`.",e));if(2===a){if(!at(l=(u.byteLength-e)/n))throw new RangeError(F("invalid argument. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",n,u.byteLength-e))}else{if(!lr(l=r))throw new TypeError(F("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",l));if(l*n>u.byteLength-e)throw new RangeError(F("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",l*n))}}return P(this,"_buffer",u),P(this,"_byteOffset",e||0),P(this,"_byteLength",l*n),P(this,"_length",l),this}return n=i.byteLength,e=i.layout,r=i.fields,P(o,"BYTES_PER_ELEMENT",n),P(o,"name",lu),P(o,"struct",i),C(o.prototype,"buffer",(function(){return this._buffer})),C(o.prototype,"byteLength",(function(){return this._byteLength})),C(o.prototype,"byteOffset",(function(){return this._byteOffset})),P(o.prototype,"BYTES_PER_ELEMENT",o.BYTES_PER_ELEMENT),P(o.prototype,"get",(function(t){if(!a(this))throw new TypeError(F("invalid invocation. `this` is not a %s.",lu));if(!lr(t))throw new TypeError(F("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return new i(this._buffer,this._byteOffset+t*n,n)})),C(o.prototype,"length",(function(){return this._length})),P(o.prototype,"set",(function(t){var o,u,l,f,s,c,h,p,g,y,m,b;if(!a(this))throw new TypeError(F("invalid invocation. `this` is not a %s.",lu));if(f=this._buffer,arguments.length>1){if(!lr(l=arguments[1]))throw new TypeError(F("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",l))}else l=0;if(u={format:"layout"},h=i.byteLength,!Bn(t)||li(r,"length")){if(l>=this._length)throw new RangeError(F("invalid argument. Index argument is out-of-bounds. Value: `%u`.",l));if(!Dn(t))throw new TypeError(F("invalid argument. Must provide either a valid object or a struct instance. Value: `%s`.",t));if(t.toString(u)===e)return o=i.viewOf(t),void ki(h,new Ze(o.buffer,o.byteOffset,h),1,0,new Ze(f,this._byteOffset+l*n,h),1,0);for(g=new i(f,this._byteOffset+l*n,h),m=0;mthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(c=(o=t).get&&o.set?oe("default"):ue("default"),b=this._byteOffset+l*n,o.buffer===f&&o.byteOffsetb){for(s=[],m=0;mt.length&&(r=t.length),(i=Fi(t)).accessorProtocol?function(t,n,e,r){var i,o,a;for(i=t.data,o=t.accessors[1],a=e;a0&&(h=Ft(h.length))}else h=St(p);return 0===Lt(h)?wu(c,a,At(h,f),l,!r):(o=function(t,n,e){var r,i,o;for(r=t.data,i=e,o=0;of?-1:l))throw new RangeError(_u("1lDF8",a,n));return(o=jt(null,a))[u]=new ht(e,null),Eu(t,_t(o),r,i)}})); +//# sourceMappingURL=index.js.map diff --git a/index.js.map b/index.js.map new file mode 100644 index 0000000..8604362 --- /dev/null +++ b/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../node_modules/@stdlib/utils-define-property/lib/define_property.js","../node_modules/@stdlib/utils-define-property/lib/builtin.js","../node_modules/@stdlib/string-base-format-interpolate/lib/is_number.js","../node_modules/@stdlib/string-base-format-interpolate/lib/zero_pad.js","../node_modules/@stdlib/string-base-format-interpolate/lib/format_integer.js","../node_modules/@stdlib/string-base-format-interpolate/lib/format_double.js","../node_modules/@stdlib/string-base-format-interpolate/lib/space_pad.js","../node_modules/@stdlib/string-base-format-interpolate/lib/main.js","../node_modules/@stdlib/string-base-format-interpolate/lib/is_string.js","../node_modules/@stdlib/string-base-format-tokenize/lib/main.js","../node_modules/@stdlib/string-format/lib/main.js","../node_modules/@stdlib/string-format/lib/is_string.js","../node_modules/@stdlib/utils-define-property/lib/polyfill.js","../node_modules/@stdlib/utils-define-property/lib/index.js","../node_modules/@stdlib/utils-define-property/lib/has_define_property_support.js","../node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/main.js","../node_modules/@stdlib/utils-define-nonenumerable-read-only-accessor/lib/main.js","../node_modules/@stdlib/assert-is-number/lib/primitive.js","../node_modules/@stdlib/assert-has-tostringtag-support/lib/main.js","../node_modules/@stdlib/assert-has-symbol-support/lib/main.js","../node_modules/@stdlib/utils-native-class/lib/tostring.js","../node_modules/@stdlib/assert-has-own-property/lib/main.js","../node_modules/@stdlib/symbol-ctor/lib/main.js","../node_modules/@stdlib/utils-native-class/lib/tostringtag.js","../node_modules/@stdlib/utils-native-class/lib/index.js","../node_modules/@stdlib/utils-native-class/lib/polyfill.js","../node_modules/@stdlib/utils-native-class/lib/main.js","../node_modules/@stdlib/number-ctor/lib/main.js","../node_modules/@stdlib/assert-is-number/lib/tostring.js","../node_modules/@stdlib/assert-is-number/lib/object.js","../node_modules/@stdlib/assert-is-number/lib/try2serialize.js","../node_modules/@stdlib/assert-is-number/lib/main.js","../node_modules/@stdlib/assert-is-number/lib/index.js","../node_modules/@stdlib/constants-float64-pinf/lib/index.js","../node_modules/@stdlib/constants-float64-ninf/lib/index.js","../node_modules/@stdlib/math-base-special-floor/lib/main.js","../node_modules/@stdlib/math-base-assert-is-integer/lib/main.js","../node_modules/@stdlib/assert-is-integer/lib/integer.js","../node_modules/@stdlib/assert-is-integer/lib/primitive.js","../node_modules/@stdlib/assert-is-integer/lib/object.js","../node_modules/@stdlib/assert-is-integer/lib/main.js","../node_modules/@stdlib/assert-is-null/lib/main.js","../node_modules/@stdlib/assert-is-undefined/lib/main.js","../node_modules/@stdlib/slice-ctor/lib/main.js","../node_modules/@stdlib/regexp-function-name/lib/main.js","../node_modules/@stdlib/assert-is-integer/lib/index.js","../node_modules/@stdlib/regexp-function-name/lib/regexp.js","../node_modules/@stdlib/regexp-function-name/lib/index.js","../node_modules/@stdlib/assert-is-array/lib/main.js","../node_modules/@stdlib/assert-tools-array-function/lib/main.js","../node_modules/@stdlib/assert-is-object-like/lib/main.js","../node_modules/@stdlib/assert-is-buffer/lib/main.js","../node_modules/@stdlib/utils-constructor-name/lib/main.js","../node_modules/@stdlib/slice-multi/lib/main.js","../node_modules/@stdlib/assert-is-slice/lib/main.js","../node_modules/@stdlib/slice-base-args2multislice/lib/main.js","../node_modules/@stdlib/slice-base-normalize-multi-slice/lib/main.js","../node_modules/@stdlib/slice-base-int2slice/lib/main.js","../node_modules/@stdlib/slice-base-int2slice/lib/error_out_of_bounds.js","../node_modules/@stdlib/slice-base-normalize-slice/lib/main.js","../node_modules/@stdlib/slice-base-normalize-slice/lib/error_out_of_bounds.js","../node_modules/@stdlib/assert-is-object-like/lib/index.js","../node_modules/@stdlib/math-base-special-ceil/lib/main.js","../node_modules/@stdlib/slice-base-length/lib/main.js","../node_modules/@stdlib/slice-base-shape/lib/main.js","../node_modules/@stdlib/array-base-take-indexed/lib/main.js","../node_modules/@stdlib/array-base-filled/lib/main.js","../node_modules/@stdlib/array-base-zeros/lib/main.js","../node_modules/@stdlib/ndarray-base-numel/lib/main.js","../node_modules/@stdlib/array-base-copy-indexed/lib/main.js","../node_modules/@stdlib/assert-is-string/lib/primitive.js","../node_modules/@stdlib/assert-is-string/lib/valueof.js","../node_modules/@stdlib/assert-is-string/lib/object.js","../node_modules/@stdlib/assert-is-string/lib/try2valueof.js","../node_modules/@stdlib/assert-is-string/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-column-major-string/lib/main.js","../node_modules/@stdlib/ndarray-base-shape2strides/lib/main.js","../node_modules/@stdlib/assert-is-string/lib/index.js","../node_modules/@stdlib/ndarray-base-shape2strides/lib/index.js","../node_modules/@stdlib/ndarray-base-shape2strides/lib/assign.js","../node_modules/@stdlib/ndarray-base-strides/lib/main.js","../node_modules/@stdlib/math-base-special-abs/lib/main.js","../node_modules/@stdlib/ndarray-base-order/lib/main.js","../node_modules/@stdlib/ndarray-base-strides2order/lib/main.js","../node_modules/@stdlib/ndarray-base-data-buffer/lib/main.js","../node_modules/@stdlib/assert-is-positive-integer/lib/primitive.js","../node_modules/@stdlib/assert-is-positive-integer/lib/object.js","../node_modules/@stdlib/assert-is-positive-integer/lib/main.js","../node_modules/@stdlib/assert-is-positive-integer/lib/index.js","../node_modules/@stdlib/utils-type-of/lib/fixtures/re.js","../node_modules/@stdlib/assert-is-boolean/lib/primitive.js","../node_modules/@stdlib/boolean-ctor/lib/main.js","../node_modules/@stdlib/assert-is-boolean/lib/tostring.js","../node_modules/@stdlib/assert-is-boolean/lib/object.js","../node_modules/@stdlib/assert-is-boolean/lib/try2serialize.js","../node_modules/@stdlib/assert-is-boolean/lib/main.js","../node_modules/@stdlib/assert-is-boolean/lib/index.js","../node_modules/@stdlib/utils-global/lib/self.js","../node_modules/@stdlib/utils-global/lib/window.js","../node_modules/@stdlib/utils-global/lib/global.js","../node_modules/@stdlib/utils-global/lib/global_this.js","../node_modules/@stdlib/utils-global/lib/main.js","../node_modules/@stdlib/utils-global/lib/codegen.js","../node_modules/@stdlib/utils-type-of/lib/fixtures/nodelist.js","../node_modules/@stdlib/utils-type-of/lib/fixtures/typedarray.js","../node_modules/@stdlib/utils-type-of/lib/index.js","../node_modules/@stdlib/utils-type-of/lib/check.js","../node_modules/@stdlib/utils-type-of/lib/polyfill.js","../node_modules/@stdlib/utils-type-of/lib/main.js","../node_modules/@stdlib/assert-is-function/lib/main.js","../node_modules/@stdlib/assert-is-struct-constructor-like/lib/main.js","../node_modules/@stdlib/utils-keys/lib/builtin.js","../node_modules/@stdlib/utils-keys/lib/has_builtin.js","../node_modules/@stdlib/assert-is-arguments/lib/detect.js","../node_modules/@stdlib/assert-is-arguments/lib/main.js","../node_modules/@stdlib/math-base-assert-is-nan/lib/main.js","../node_modules/@stdlib/assert-is-nan/lib/primitive.js","../node_modules/@stdlib/assert-is-nan/lib/object.js","../node_modules/@stdlib/assert-is-nan/lib/main.js","../node_modules/@stdlib/assert-is-nan/lib/index.js","../node_modules/@stdlib/assert-is-enumerable-property/lib/native.js","../node_modules/@stdlib/assert-is-enumerable-property/lib/has_string_enumerability_bug.js","../node_modules/@stdlib/assert-is-enumerable-property/lib/main.js","../node_modules/@stdlib/constants-uint32-max/lib/index.js","../node_modules/@stdlib/assert-is-arguments/lib/index.js","../node_modules/@stdlib/assert-is-arguments/lib/polyfill.js","../node_modules/@stdlib/utils-keys/lib/builtin_wrapper.js","../node_modules/@stdlib/utils-keys/lib/has_enumerable_prototype_bug.js","../node_modules/@stdlib/utils-noop/lib/main.js","../node_modules/@stdlib/utils-keys/lib/has_non_enumerable_properties_bug.js","../node_modules/@stdlib/constants-array-max-typed-array-length/lib/index.js","../node_modules/@stdlib/assert-is-collection/lib/main.js","../node_modules/@stdlib/utils-index-of/lib/main.js","../node_modules/@stdlib/utils-keys/lib/is_constructor_prototype.js","../node_modules/@stdlib/utils-keys/lib/window.js","../node_modules/@stdlib/utils-keys/lib/has_automation_equality_bug.js","../node_modules/@stdlib/utils-keys/lib/has_window.js","../node_modules/@stdlib/utils-keys/lib/main.js","../node_modules/@stdlib/utils-keys/lib/has_arguments_bug.js","../node_modules/@stdlib/utils-keys/lib/polyfill.js","../node_modules/@stdlib/utils-keys/lib/is_constructor_prototype_wrapper.js","../node_modules/@stdlib/assert-is-object/lib/main.js","../node_modules/@stdlib/object-ctor/lib/main.js","../node_modules/@stdlib/utils-get-prototype-of/lib/detect.js","../node_modules/@stdlib/utils-get-prototype-of/lib/native.js","../node_modules/@stdlib/utils-get-prototype-of/lib/polyfill.js","../node_modules/@stdlib/utils-get-prototype-of/lib/proto.js","../node_modules/@stdlib/utils-get-prototype-of/lib/main.js","../node_modules/@stdlib/assert-is-plain-object/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-enum2str/lib/main.js","../node_modules/@stdlib/object-inverse/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-enums/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-str2enum/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-resolve-str/lib/main.js","../node_modules/@stdlib/assert-has-property/lib/main.js","../node_modules/@stdlib/array-base-assert-is-accessor-array/lib/main.js","../node_modules/@stdlib/array-base-accessor-getter/lib/main.js","../node_modules/@stdlib/array-base-getter/lib/main.js","../node_modules/@stdlib/array-dtype/lib/ctor2dtype.js","../node_modules/@stdlib/assert-is-float64array/lib/main.js","../node_modules/@stdlib/assert-has-float64array-support/lib/float64array.js","../node_modules/@stdlib/assert-has-float64array-support/lib/main.js","../node_modules/@stdlib/array-float64/lib/main.js","../node_modules/@stdlib/array-float64/lib/index.js","../node_modules/@stdlib/array-float64/lib/polyfill.js","../node_modules/@stdlib/assert-is-float32array/lib/main.js","../node_modules/@stdlib/assert-has-float32array-support/lib/float32array.js","../node_modules/@stdlib/array-float32/lib/main.js","../node_modules/@stdlib/array-float32/lib/index.js","../node_modules/@stdlib/assert-has-float32array-support/lib/main.js","../node_modules/@stdlib/array-float32/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint32array/lib/main.js","../node_modules/@stdlib/assert-has-uint32array-support/lib/uint32array.js","../node_modules/@stdlib/array-uint32/lib/main.js","../node_modules/@stdlib/array-uint32/lib/index.js","../node_modules/@stdlib/assert-has-uint32array-support/lib/main.js","../node_modules/@stdlib/array-uint32/lib/polyfill.js","../node_modules/@stdlib/assert-is-int32array/lib/main.js","../node_modules/@stdlib/constants-int32-max/lib/index.js","../node_modules/@stdlib/constants-int32-min/lib/index.js","../node_modules/@stdlib/assert-has-int32array-support/lib/int32array.js","../node_modules/@stdlib/array-int32/lib/main.js","../node_modules/@stdlib/array-int32/lib/index.js","../node_modules/@stdlib/assert-has-int32array-support/lib/main.js","../node_modules/@stdlib/array-int32/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint16array/lib/main.js","../node_modules/@stdlib/constants-uint16-max/lib/index.js","../node_modules/@stdlib/assert-has-uint16array-support/lib/uint16array.js","../node_modules/@stdlib/array-uint16/lib/main.js","../node_modules/@stdlib/array-uint16/lib/index.js","../node_modules/@stdlib/assert-has-uint16array-support/lib/main.js","../node_modules/@stdlib/array-uint16/lib/polyfill.js","../node_modules/@stdlib/assert-is-int16array/lib/main.js","../node_modules/@stdlib/constants-int16-max/lib/index.js","../node_modules/@stdlib/constants-int16-min/lib/index.js","../node_modules/@stdlib/assert-has-int16array-support/lib/int16array.js","../node_modules/@stdlib/array-int16/lib/main.js","../node_modules/@stdlib/array-int16/lib/index.js","../node_modules/@stdlib/assert-has-int16array-support/lib/main.js","../node_modules/@stdlib/array-int16/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint8array/lib/main.js","../node_modules/@stdlib/constants-uint8-max/lib/index.js","../node_modules/@stdlib/assert-has-uint8array-support/lib/uint8array.js","../node_modules/@stdlib/array-uint8/lib/main.js","../node_modules/@stdlib/array-uint8/lib/index.js","../node_modules/@stdlib/assert-has-uint8array-support/lib/main.js","../node_modules/@stdlib/array-uint8/lib/polyfill.js","../node_modules/@stdlib/assert-is-uint8clampedarray/lib/main.js","../node_modules/@stdlib/assert-has-uint8clampedarray-support/lib/uint8clampedarray.js","../node_modules/@stdlib/array-uint8c/lib/main.js","../node_modules/@stdlib/array-uint8c/lib/index.js","../node_modules/@stdlib/assert-has-uint8clampedarray-support/lib/main.js","../node_modules/@stdlib/array-uint8c/lib/polyfill.js","../node_modules/@stdlib/assert-is-int8array/lib/main.js","../node_modules/@stdlib/constants-int8-max/lib/index.js","../node_modules/@stdlib/constants-int8-min/lib/index.js","../node_modules/@stdlib/assert-has-int8array-support/lib/int8array.js","../node_modules/@stdlib/array-int8/lib/main.js","../node_modules/@stdlib/array-int8/lib/index.js","../node_modules/@stdlib/assert-has-int8array-support/lib/main.js","../node_modules/@stdlib/array-int8/lib/polyfill.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/primitive.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/object.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/main.js","../node_modules/@stdlib/assert-is-nonnegative-integer/lib/index.js","../node_modules/@stdlib/constants-array-max-array-length/lib/index.js","../node_modules/@stdlib/assert-is-array-like-object/lib/main.js","../node_modules/@stdlib/assert-is-arraybuffer/lib/main.js","../node_modules/@stdlib/assert-is-string-array/lib/index.js","../node_modules/@stdlib/utils-define-read-only-property/lib/main.js","../node_modules/@stdlib/complex-float64-ctor/lib/main.js","../node_modules/@stdlib/complex-float64-ctor/lib/tostring.js","../node_modules/@stdlib/complex-float64-ctor/lib/tojson.js","../node_modules/@stdlib/number-float64-base-to-float32/lib/main.js","../node_modules/@stdlib/number-float64-base-to-float32/lib/polyfill.js","../node_modules/@stdlib/number-float64-base-to-float32/lib/index.js","../node_modules/@stdlib/complex-float32-ctor/lib/main.js","../node_modules/@stdlib/assert-is-complex-like/lib/main.js","../node_modules/@stdlib/math-base-assert-is-even/lib/main.js","../node_modules/@stdlib/complex-float32-ctor/lib/tostring.js","../node_modules/@stdlib/complex-float32-ctor/lib/tojson.js","../node_modules/@stdlib/array-base-assert-is-complex64array/lib/main.js","../node_modules/@stdlib/array-base-assert-is-complex128array/lib/main.js","../node_modules/@stdlib/assert-has-iterator-symbol-support/lib/main.js","../node_modules/@stdlib/symbol-iterator/lib/main.js","../node_modules/@stdlib/complex-float32-real/lib/main.js","../node_modules/@stdlib/complex-float32-imag/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-complex64/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-complex128/lib/main.js","../node_modules/@stdlib/array-complex64/lib/from_iterator.js","../node_modules/@stdlib/array-complex64/lib/main.js","../node_modules/@stdlib/array-complex64/lib/from_array.js","../node_modules/@stdlib/complex-float64-real/lib/main.js","../node_modules/@stdlib/complex-float64-imag/lib/main.js","../node_modules/@stdlib/array-complex128/lib/from_iterator.js","../node_modules/@stdlib/array-complex64/lib/from_iterator_map.js","../node_modules/@stdlib/array-complex128/lib/main.js","../node_modules/@stdlib/array-complex128/lib/from_array.js","../node_modules/@stdlib/array-bool/lib/from_iterator.js","../node_modules/@stdlib/array-complex128/lib/from_iterator_map.js","../node_modules/@stdlib/array-bool/lib/main.js","../node_modules/@stdlib/array-bool/lib/from_array.js","../node_modules/@stdlib/array-bool/lib/from_iterator_map.js","../node_modules/@stdlib/array-dtype/lib/ctors.js","../node_modules/@stdlib/array-dtype/lib/dtypes.js","../node_modules/@stdlib/array-dtype/lib/main.js","../node_modules/@stdlib/array-base-assert-contains/lib/main.js","../node_modules/@stdlib/array-base-assert-contains/lib/factory.js","../node_modules/@stdlib/string-base-replace/lib/main.js","../node_modules/@stdlib/array-base-assert-contains/lib/index.js","../node_modules/@stdlib/ndarray-base-dtype-strings/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-data-type-string/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-desc/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-char/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-alignment/lib/main.js","../node_modules/@stdlib/ndarray-base-bytes-per-element/lib/main.js","../node_modules/@stdlib/ndarray-dtype-ctor/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-desc/lib/table.js","../node_modules/@stdlib/ndarray-base-dtype-char/lib/table.js","../node_modules/@stdlib/ndarray-base-dtype-resolve-enum/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype-alignment/lib/table.js","../node_modules/@stdlib/ndarray-base-assert-is-struct-data-type/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-struct-data-type/node_modules/@stdlib/ndarray-base-assert-is-data-type-object/lib/main.js","../node_modules/@stdlib/assert-is-prototype-of/lib/main.js","../node_modules/@stdlib/assert-has-arraybuffer-support/lib/arraybuffer.js","../node_modules/@stdlib/array-buffer/lib/main.js","../node_modules/@stdlib/array-buffer/lib/index.js","../node_modules/@stdlib/assert-has-arraybuffer-support/lib/main.js","../node_modules/@stdlib/array-buffer/lib/polyfill.js","../node_modules/@stdlib/array-base-setter/lib/main.js","../node_modules/@stdlib/array-base-accessor-setter/lib/main.js","../node_modules/@stdlib/array-base-arraylike2object/lib/main.js","../node_modules/@stdlib/blas-base-gcopy/lib/accessors.js","../node_modules/@stdlib/blas-base-gcopy/lib/main.js","../node_modules/@stdlib/blas-base-gcopy/lib/ndarray.js","../node_modules/@stdlib/math-base-special-fast-min/lib/main.js","../node_modules/@stdlib/blas-base-gcopy/lib/index.js","../node_modules/@stdlib/assert-is-dataview/lib/main.js","../node_modules/@stdlib/assert-has-dataview-support/lib/dataview.js","../node_modules/@stdlib/array-dataview/lib/main.js","../node_modules/@stdlib/array-dataview/lib/index.js","../node_modules/@stdlib/assert-has-dataview-support/lib/main.js","../node_modules/@stdlib/array-dataview/lib/polyfill.js","../node_modules/@stdlib/dstructs-struct/lib/private_buffer.js","../node_modules/@stdlib/dstructs-struct/lib/ctor_name.js","../node_modules/@stdlib/utils-define-nonenumerable-read-write-accessor/lib/main.js","../node_modules/@stdlib/utils-define-read-only-accessor/lib/main.js","../node_modules/@stdlib/utils-define-read-write-accessor/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/data_view_methods.js","../node_modules/@stdlib/assert-is-little-endian/lib/main.js","../node_modules/@stdlib/assert-is-little-endian/lib/ctors.js","../node_modules/@stdlib/complex-ctors/lib/ctors.js","../node_modules/@stdlib/complex-ctors/lib/main.js","../node_modules/@stdlib/complex-cmplx/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/get_complex.js","../node_modules/@stdlib/array-typed-ctors/lib/ctors.js","../node_modules/@stdlib/array-typed-ctors/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-boolean/lib/main.js","../node_modules/@stdlib/array-defaults/lib/main.js","../node_modules/@stdlib/array-defaults/lib/get.js","../node_modules/@stdlib/array-defaults/lib/index.js","../node_modules/@stdlib/array-typed/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/getter.js","../node_modules/@stdlib/dstructs-struct/lib/get_struct_array.js","../node_modules/@stdlib/dstructs-struct/lib/get_typedarray.js","../node_modules/@stdlib/dstructs-struct/lib/get_bigint.js","../node_modules/@stdlib/dstructs-struct/lib/get_boolean.js","../node_modules/@stdlib/dstructs-struct/lib/get_struct.js","../node_modules/@stdlib/array-dtypes/lib/main.js","../node_modules/@stdlib/array-base-assert-is-real-floating-point-data-type/lib/main.js","../node_modules/@stdlib/array-base-assert-is-signed-integer-data-type/lib/main.js","../node_modules/@stdlib/assert-has-bigint-support/lib/main.js","../node_modules/@stdlib/assert-is-bigint/lib/primitive.js","../node_modules/@stdlib/assert-is-bigint/lib/object.js","../node_modules/@stdlib/assert-is-bigint/lib/try2valueof.js","../node_modules/@stdlib/assert-is-bigint/lib/generic.js","../node_modules/@stdlib/utils-constant-function/lib/main.js","../node_modules/@stdlib/assert-is-bigint/lib/main.js","../node_modules/@stdlib/assert-is-bigint/lib/polyfill.js","../node_modules/@stdlib/assert-is-bigint/lib/index.js","../node_modules/@stdlib/ndarray-safe-casts/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-safe-data-type-cast/lib/main.js","../node_modules/@stdlib/ndarray-mostly-safe-casts/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-mostly-safe-data-type-cast/lib/main.js","../node_modules/@stdlib/ndarray-same-kind-casts/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-same-kind-data-type-cast/lib/main.js","../node_modules/@stdlib/ndarray-base-assert-is-allowed-data-type-cast/lib/main.js","../node_modules/@stdlib/constants-float32-smallest-subnormal/lib/index.js","../node_modules/@stdlib/constants-float32-max-safe-integer/lib/index.js","../node_modules/@stdlib/constants-float32-min-safe-integer/lib/index.js","../node_modules/@stdlib/array-min-dtype/lib/main.js","../node_modules/@stdlib/math-base-assert-is-negative-zero/lib/main.js","../node_modules/@stdlib/complex-dtype/lib/ctor2dtype.js","../node_modules/@stdlib/complex-dtype/lib/dtypes.js","../node_modules/@stdlib/complex-dtype/lib/ctors.js","../node_modules/@stdlib/complex-dtypes/lib/main.js","../node_modules/@stdlib/complex-dtype/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/boolean2number.js","../node_modules/@stdlib/dstructs-struct/lib/bigint2number.js","../node_modules/@stdlib/dstructs-struct/lib/set_number.js","../node_modules/@stdlib/array-base-min-signed-integer-dtype/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/number2boolean.js","../node_modules/@stdlib/dstructs-struct/lib/complex2boolean.js","../node_modules/@stdlib/dstructs-struct/lib/set_boolean.js","../node_modules/@stdlib/dstructs-struct/lib/bigint2boolean.js","../node_modules/@stdlib/bigint-ctor/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/set_bigint.js","../node_modules/@stdlib/dstructs-struct/lib/boolean2bigint.js","../node_modules/@stdlib/dstructs-struct/lib/is_struct_instance.js","../node_modules/@stdlib/array-base-assert-is-complex-floating-point-data-type/lib/main.js","../node_modules/@stdlib/array-base-assert-is-boolean-data-type/lib/main.js","../node_modules/@stdlib/array-base-assert-is-real-data-type/lib/main.js","../node_modules/@stdlib/strided-base-reinterpret-complex/lib/main.js","../node_modules/@stdlib/strided-base-stride2offset/lib/main.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/ndarray.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/accessors.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/main.js","../node_modules/@stdlib/array-base-map/lib/assign.js","../node_modules/@stdlib/array-base-map/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/complex2number.js","../node_modules/@stdlib/dstructs-struct/lib/setter.js","../node_modules/@stdlib/dstructs-struct/lib/set_struct_array.js","../node_modules/@stdlib/dstructs-struct/lib/set_typedarray.js","../node_modules/@stdlib/dstructs-struct/lib/set_complex.js","../node_modules/@stdlib/dstructs-struct/lib/set_struct.js","../node_modules/@stdlib/blas-ext-base-gfill/lib/index.js","../node_modules/@stdlib/array-base-map/lib/index.js","../node_modules/@stdlib/dstructs-struct/lib/field_properties.js","../node_modules/@stdlib/dstructs-struct/lib/is_union_type.js","../node_modules/@stdlib/assert-is-undefined-or-null/lib/main.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/ndarray.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/accessors.js","../node_modules/@stdlib/array-base-join/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_boolean.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/index.js","../node_modules/@stdlib/blas-ext-base-gjoin/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/dtypes.js","../node_modules/@stdlib/dstructs-struct/lib/casting_modes.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_one_of.js","../node_modules/@stdlib/dstructs-struct/lib/alignments.js","../node_modules/@stdlib/dstructs-struct/lib/normalize_field.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_nonempty_string.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_type.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_string.js","../node_modules/@stdlib/dstructs-struct/lib/is_valid_positive_integer.js","../node_modules/@stdlib/dstructs-struct/lib/init_field_object.js","../node_modules/@stdlib/dstructs-struct/lib/has_properties.js","../node_modules/@stdlib/dstructs-struct/lib/byte_length.js","../node_modules/@stdlib/dstructs-struct/lib/resolve_alignment.js","../node_modules/@stdlib/dstructs-struct/lib/normalize_union.js","../node_modules/@stdlib/array-base-index-of/lib/main.js","../node_modules/@stdlib/array-base-resolve-getter/lib/main.js","../node_modules/@stdlib/assert-is-accessor-array/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/field_index.js","../node_modules/@stdlib/dstructs-struct/lib/byte_offsets.js","../node_modules/@stdlib/dstructs-struct/lib/format_layout.js","../node_modules/@stdlib/dstructs-struct/lib/to_string.js","../node_modules/@stdlib/dstructs-struct/lib/format_linear.js","../node_modules/@stdlib/assert-has-function-name-support/lib/foo.js","../node_modules/@stdlib/utils-function-name/lib/main.js","../node_modules/@stdlib/assert-has-function-name-support/lib/main.js","../node_modules/@stdlib/assert-is-typed-array/lib/ctors.js","../node_modules/@stdlib/assert-is-typed-array/lib/main.js","../node_modules/@stdlib/assert-is-complex-typed-array/lib/ctors.js","../node_modules/@stdlib/assert-has-has-instance-symbol-support/lib/main.js","../node_modules/@stdlib/symbol-has-instance/lib/main.js","../node_modules/@stdlib/assert-instance-of/lib/main.js","../node_modules/@stdlib/array-to-json/lib/ctors.js","../node_modules/@stdlib/array-to-json/lib/type.js","../node_modules/@stdlib/array-to-json/lib/main.js","../node_modules/@stdlib/assert-is-booleanarray/lib/main.js","../node_modules/@stdlib/assert-is-complex-typed-array/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/main.js","../node_modules/@stdlib/dstructs-struct/lib/normalize_field_list.js","../node_modules/@stdlib/dstructs-struct/lib/field_names.js","../node_modules/@stdlib/dstructs-struct/lib/flatten_fields.js","../node_modules/@stdlib/dstructs-struct/lib/partitions.js","../node_modules/@stdlib/dstructs-struct/lib/create_prototype_accessors.js","../node_modules/@stdlib/dstructs-struct/lib/to_json.js","../node_modules/@stdlib/array-struct-factory/lib/from_array.js","../node_modules/@stdlib/array-struct-factory/lib/main.js","../node_modules/@stdlib/array-struct-factory/lib/from_iterator.js","../node_modules/@stdlib/assert-has-node-buffer-support/lib/buffer.js","../node_modules/@stdlib/buffer-ctor/lib/main.js","../node_modules/@stdlib/buffer-ctor/lib/index.js","../node_modules/@stdlib/assert-has-node-buffer-support/lib/main.js","../node_modules/@stdlib/buffer-ctor/lib/polyfill.js","../node_modules/@stdlib/ndarray-base-buffer-ctors/lib/ctors.js","../node_modules/@stdlib/ndarray-base-buffer-ctors/lib/main.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/index.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/has_alloc_unsafe.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/main.js","../node_modules/@stdlib/buffer-alloc-unsafe/lib/polyfill.js","../node_modules/@stdlib/ndarray-base-buffer/lib/main.js","../node_modules/@stdlib/array-base-fill/lib/main.js","../node_modules/@stdlib/ndarray-base-slice/lib/empty.js","../node_modules/@stdlib/ndarray-base-slice/lib/main.js","../node_modules/@stdlib/ndarray-base-dtype/lib/main.js","../node_modules/@stdlib/ndarray-base-shape/lib/main.js","../node_modules/@stdlib/ndarray-base-offset/lib/main.js","../node_modules/@stdlib/ndarray-base-strides2offset/lib/main.js","../node_modules/@stdlib/slice-base-nonreduced-dimensions/lib/main.js","../node_modules/@stdlib/ndarray-base-slice/lib/slice_start.js","../node_modules/@stdlib/ndarray-base-slice/lib/slice_strides.js","../node_modules/@stdlib/error-tools-fmtprodmsg/lib/main.js","../lib/main.js","../node_modules/@stdlib/ndarray-base-normalize-index/lib/main.js","../node_modules/@stdlib/ndarray-base-ndims/lib/main.js","../node_modules/@stdlib/array-base-nulls/lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Object.defineProperty === 'function' ) ? Object.defineProperty : null;\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @name defineProperty\n* @type {Function}\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nvar defineProperty = Object.defineProperty;\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' ); // NOTE: we inline the `isNumber.isPrimitive` function from `@stdlib/assert/is-number` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Tests if a string starts with a minus sign (`-`).\n*\n* @private\n* @param {string} str - input string\n* @returns {boolean} boolean indicating if a string starts with a minus sign (`-`)\n*/\nfunction startsWithMinus( str ) {\n\treturn str[ 0 ] === '-';\n}\n\n/**\n* Returns a string of `n` zeros.\n*\n* @private\n* @param {number} n - number of zeros\n* @returns {string} string of zeros\n*/\nfunction zeros( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += '0';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with zeros to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction zeroPad( str, width, right ) {\n\tvar negative = false;\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tif ( startsWithMinus( str ) ) {\n\t\tnegative = true;\n\t\tstr = str.substr( 1 );\n\t}\n\tstr = ( right ) ?\n\t\tstr + zeros( pad ) :\n\t\tzeros( pad ) + str;\n\tif ( negative ) {\n\t\tstr = '-' + str;\n\t}\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default zeroPad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNumber from './is_number.js';\nimport zeroPad from './zero_pad.js';\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as an integer.\n*\n* @private\n* @param {Object} token - token object\n* @throws {Error} must provide a valid integer\n* @returns {string} formatted token argument\n*/\nfunction formatInteger( token ) {\n\tvar base;\n\tvar out;\n\tvar i;\n\n\tswitch ( token.specifier ) {\n\tcase 'b':\n\t\t// Case: %b (binary)\n\t\tbase = 2;\n\t\tbreak;\n\tcase 'o':\n\t\t// Case: %o (octal)\n\t\tbase = 8;\n\t\tbreak;\n\tcase 'x':\n\tcase 'X':\n\t\t// Case: %x, %X (hexadecimal)\n\t\tbase = 16;\n\t\tbreak;\n\tcase 'd':\n\tcase 'i':\n\tcase 'u':\n\tdefault:\n\t\t// Case: %d, %i, %u (decimal)\n\t\tbase = 10;\n\t\tbreak;\n\t}\n\tout = token.arg;\n\ti = parseInt( out, 10 );\n\tif ( !isFinite( i ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\tif ( !isNumber( out ) ) {\n\t\t\tthrow new Error( 'invalid integer. Value: ' + out );\n\t\t}\n\t\ti = 0;\n\t}\n\tif ( i < 0 && ( token.specifier === 'u' || base !== 10 ) ) {\n\t\ti = 0xffffffff + i + 1;\n\t}\n\tif ( i < 0 ) {\n\t\tout = ( -i ).toString( base );\n\t\tif ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tout = '-' + out;\n\t} else {\n\t\tout = i.toString( base );\n\t\tif ( !i && !token.precision ) {\n\t\t\tout = '';\n\t\t} else if ( token.precision ) {\n\t\t\tout = zeroPad( out, token.precision, token.padRight );\n\t\t}\n\t\tif ( token.sign ) {\n\t\t\tout = token.sign + out;\n\t\t}\n\t}\n\tif ( base === 16 ) {\n\t\tif ( token.alternate ) {\n\t\t\tout = '0x' + out;\n\t\t}\n\t\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\t\tuppercase.call( out ) :\n\t\t\tlowercase.call( out );\n\t}\n\tif ( base === 8 ) {\n\t\tif ( token.alternate && out.charAt( 0 ) !== '0' ) {\n\t\t\tout = '0' + out;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\n// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.\nvar abs = Math.abs; // eslint-disable-line stdlib/no-builtin-math\nvar lowercase = String.prototype.toLowerCase;\nvar uppercase = String.prototype.toUpperCase;\nvar replace = String.prototype.replace;\n\n\n// VARIABLES //\n\nvar RE_EXP_POS_DIGITS = /e\\+(\\d)$/;\nvar RE_EXP_NEG_DIGITS = /e-(\\d)$/;\nvar RE_ONLY_DIGITS = /^(\\d+)$/;\nvar RE_DIGITS_BEFORE_EXP = /^(\\d+)e/;\nvar RE_TRAILING_PERIOD_ZERO = /\\.0$/;\nvar RE_PERIOD_ZERO_EXP = /\\.0*e/;\nvar RE_ZERO_BEFORE_EXP = /(\\..*[^0])0*e/;\n\n\n// MAIN //\n\n/**\n* Formats a token object argument as a floating-point number.\n*\n* @private\n* @param {number} f - parsed number\n* @param {Object} token - token object\n* @throws {Error} must provide a valid floating-point number\n* @returns {string} formatted token argument\n*/\nfunction formatDouble( f, token ) {\n\tvar digits;\n\tvar out;\n\n\tswitch ( token.specifier ) {\n\tcase 'e':\n\tcase 'E':\n\t\tout = f.toExponential( token.precision );\n\t\tbreak;\n\tcase 'f':\n\tcase 'F':\n\t\tout = f.toFixed( token.precision );\n\t\tbreak;\n\tcase 'g':\n\tcase 'G':\n\t\tif ( abs( f ) < 0.0001 ) {\n\t\t\tdigits = token.precision;\n\t\t\tif ( digits > 0 ) {\n\t\t\t\tdigits -= 1;\n\t\t\t}\n\t\t\tout = f.toExponential( digits );\n\t\t} else {\n\t\t\tout = f.toPrecision( token.precision );\n\t\t}\n\t\tif ( !token.alternate ) {\n\t\t\tout = replace.call( out, RE_ZERO_BEFORE_EXP, '$1e' );\n\t\t\tout = replace.call( out, RE_PERIOD_ZERO_EXP, 'e' );\n\t\t\tout = replace.call( out, RE_TRAILING_PERIOD_ZERO, '' );\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tthrow new Error( 'invalid double notation. Value: ' + token.specifier );\n\t}\n\tout = replace.call( out, RE_EXP_POS_DIGITS, 'e+0$1' );\n\tout = replace.call( out, RE_EXP_NEG_DIGITS, 'e-0$1' );\n\tif ( token.alternate ) {\n\t\tout = replace.call( out, RE_ONLY_DIGITS, '$1.' );\n\t\tout = replace.call( out, RE_DIGITS_BEFORE_EXP, '$1.e' );\n\t}\n\tif ( f >= 0 && token.sign ) {\n\t\tout = token.sign + out;\n\t}\n\tout = ( token.specifier === uppercase.call( token.specifier ) ) ?\n\t\tuppercase.call( out ) :\n\t\tlowercase.call( out );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatDouble;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\n/**\n* Returns `n` spaces.\n*\n* @private\n* @param {number} n - number of spaces\n* @returns {string} string of spaces\n*/\nfunction spaces( n ) {\n\tvar out = '';\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tout += ' ';\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Pads a token with spaces to the specified width.\n*\n* @private\n* @param {string} str - token argument\n* @param {number} width - token width\n* @param {boolean} [right=false] - boolean indicating whether to pad to the right\n* @returns {string} padded token argument\n*/\nfunction spacePad( str, width, right ) {\n\tvar pad = width - str.length;\n\tif ( pad < 0 ) {\n\t\treturn str;\n\t}\n\tstr = ( right ) ?\n\t\tstr + spaces( pad ) :\n\t\tspaces( pad ) + str;\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default spacePad;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport formatInteger from './format_integer.js';\nimport isString from './is_string.js';\nimport isNumber from './is_number.js';\nimport formatDouble from './format_double.js';\nimport spacePad from './space_pad.js';\nimport zeroPad from './zero_pad.js';\n\n\n// VARIABLES //\n\nvar fromCharCode = String.fromCharCode;\nvar isArray = Array.isArray; // NOTE: We use the global `Array.isArray` function here instead of `@stdlib/assert/is-array` to avoid circular dependencies.\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating whether a value is `NaN`.\n*\n* @private\n* @param {*} value - input value\n* @returns {boolean} boolean indicating whether a value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 4 );\n* // returns false\n*/\nfunction isnan( value ) { // explicitly define a function here instead of `@stdlib/math/base/assert/is-nan` in order to avoid circular dependencies\n\treturn ( value !== value );\n}\n\n/**\n* Initializes token object with properties of supplied format identifier object or default values if not present.\n*\n* @private\n* @param {Object} token - format identifier object\n* @returns {Object} token object\n*/\nfunction initialize( token ) {\n\tvar out = {};\n\tout.specifier = token.specifier;\n\tout.precision = ( token.precision === void 0 ) ? 1 : token.precision;\n\tout.width = token.width;\n\tout.flags = token.flags || '';\n\tout.mapping = token.mapping;\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates string from a token array by interpolating values.\n*\n* @param {Array} tokens - string parts and format identifier objects\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be an array\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var tokens = [ 'beep ', { 'specifier': 's' } ];\n* var out = formatInterpolate( tokens, 'boop' );\n* // returns 'beep boop'\n*/\nfunction formatInterpolate( tokens ) {\n\tvar hasPeriod;\n\tvar flags;\n\tvar token;\n\tvar flag;\n\tvar num;\n\tvar out;\n\tvar pos;\n\tvar f;\n\tvar i;\n\tvar j;\n\n\tif ( !isArray( tokens ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be an array. Value: `' + tokens + '`.' );\n\t}\n\tout = '';\n\tpos = 1;\n\tfor ( i = 0; i < tokens.length; i++ ) {\n\t\ttoken = tokens[ i ];\n\t\tif ( isString( token ) ) {\n\t\t\tout += token;\n\t\t} else {\n\t\t\thasPeriod = token.precision !== void 0;\n\t\t\ttoken = initialize( token );\n\t\t\tif ( !token.specifier ) {\n\t\t\t\tthrow new TypeError( 'invalid argument. Token is missing `specifier` property. Index: `'+ i +'`. Value: `' + token + '`.' );\n\t\t\t}\n\t\t\tif ( token.mapping ) {\n\t\t\t\tpos = token.mapping;\n\t\t\t}\n\t\t\tflags = token.flags;\n\t\t\tfor ( j = 0; j < flags.length; j++ ) {\n\t\t\t\tflag = flags.charAt( j );\n\t\t\t\tswitch ( flag ) {\n\t\t\t\tcase ' ':\n\t\t\t\t\ttoken.sign = ' ';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '+':\n\t\t\t\t\ttoken.sign = '+';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-':\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0':\n\t\t\t\t\ttoken.padZeros = flags.indexOf( '-' ) < 0; // NOTE: We use built-in `Array.prototype.indexOf` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.\n\t\t\t\t\tbreak;\n\t\t\t\tcase '#':\n\t\t\t\t\ttoken.alternate = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'invalid flag: ' + flag );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( token.width === '*' ) {\n\t\t\t\ttoken.width = parseInt( arguments[ pos ], 10 );\n\t\t\t\tpos += 1;\n\t\t\t\tif ( isnan( token.width ) ) {\n\t\t\t\t\tthrow new TypeError( 'the argument for * width at position ' + pos + ' is not a number. Value: `' + token.width + '`.' );\n\t\t\t\t}\n\t\t\t\tif ( token.width < 0 ) {\n\t\t\t\t\ttoken.padRight = true;\n\t\t\t\t\ttoken.width = -token.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( hasPeriod ) {\n\t\t\t\tif ( token.precision === '*' ) {\n\t\t\t\t\ttoken.precision = parseInt( arguments[ pos ], 10 );\n\t\t\t\t\tpos += 1;\n\t\t\t\t\tif ( isnan( token.precision ) ) {\n\t\t\t\t\t\tthrow new TypeError( 'the argument for * precision at position ' + pos + ' is not a number. Value: `' + token.precision + '`.' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( token.precision < 0 ) {\n\t\t\t\t\t\ttoken.precision = 1;\n\t\t\t\t\t\thasPeriod = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttoken.arg = arguments[ pos ];\n\t\t\tswitch ( token.specifier ) {\n\t\t\tcase 'b':\n\t\t\tcase 'o':\n\t\t\tcase 'x':\n\t\t\tcase 'X':\n\t\t\tcase 'd':\n\t\t\tcase 'i':\n\t\t\tcase 'u':\n\t\t\t\t// Case: %b (binary), %o (octal), %x, %X (hexadecimal), %d, %i (decimal), %u (unsigned decimal)\n\t\t\t\tif ( hasPeriod ) {\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatInteger( token );\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\t// Case: %s (string)\n\t\t\t\ttoken.maxWidth = ( hasPeriod ) ? token.precision : -1;\n\t\t\t\ttoken.arg = String( token.arg );\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t// Case: %c (character)\n\t\t\t\tif ( !isnan( token.arg ) ) {\n\t\t\t\t\tnum = parseInt( token.arg, 10 );\n\t\t\t\t\tif ( num < 0 || num > 127 ) {\n\t\t\t\t\t\tthrow new Error( 'invalid character code. Value: ' + token.arg );\n\t\t\t\t\t}\n\t\t\t\t\ttoken.arg = ( isnan( num ) ) ? String( token.arg ) : fromCharCode( num ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\t// Case: %e, %E (scientific notation), %f, %F (decimal floating point), %g, %G (uses the shorter of %e/E or %f/F)\n\t\t\t\tif ( !hasPeriod ) {\n\t\t\t\t\ttoken.precision = 6;\n\t\t\t\t}\n\t\t\t\tf = parseFloat( token.arg );\n\t\t\t\tif ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.\n\t\t\t\t\tif ( !isNumber( token.arg ) ) {\n\t\t\t\t\t\tthrow new Error( 'invalid floating-point number. Value: ' + out );\n\t\t\t\t\t}\n\t\t\t\t\t// Case: NaN, Infinity, or -Infinity\n\t\t\t\t\tf = token.arg;\n\t\t\t\t\ttoken.padZeros = false;\n\t\t\t\t}\n\t\t\t\ttoken.arg = formatDouble( f, token );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'invalid specifier: ' + token.specifier );\n\t\t\t}\n\t\t\t// Fit argument into field width...\n\t\t\tif ( token.maxWidth >= 0 && token.arg.length > token.maxWidth ) {\n\t\t\t\ttoken.arg = token.arg.substring( 0, token.maxWidth );\n\t\t\t}\n\t\t\tif ( token.padZeros ) {\n\t\t\t\ttoken.arg = zeroPad( token.arg, token.width || token.precision, token.padRight ); // eslint-disable-line max-len\n\t\t\t} else if ( token.width ) {\n\t\t\t\ttoken.arg = spacePad( token.arg, token.width, token.padRight );\n\t\t\t}\n\t\t\tout += token.arg || '';\n\t\t\tpos += 1;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default formatInterpolate;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar RE = /%(?:([1-9]\\d*)\\$)?([0 +\\-#]*)(\\*|\\d+)?(?:(\\.)(\\*|\\d+)?)?[hlL]?([%A-Za-z])/g;\n\n\n// FUNCTIONS //\n\n/**\n* Parses a delimiter.\n*\n* @private\n* @param {Array} match - regular expression match\n* @returns {Object} delimiter token object\n*/\nfunction parse( match ) {\n\tvar token = {\n\t\t'mapping': ( match[ 1 ] ) ? parseInt( match[ 1 ], 10 ) : void 0,\n\t\t'flags': match[ 2 ],\n\t\t'width': match[ 3 ],\n\t\t'precision': match[ 5 ],\n\t\t'specifier': match[ 6 ]\n\t};\n\tif ( match[ 4 ] === '.' && match[ 5 ] === void 0 ) {\n\t\ttoken.precision = '1';\n\t}\n\treturn token;\n}\n\n\n// MAIN //\n\n/**\n* Tokenizes a string into an array of string parts and format identifier objects.\n*\n* @param {string} str - input string\n* @returns {Array} tokens\n*\n* @example\n* var tokens = formatTokenize( 'Hello %s!' );\n* // returns [ 'Hello ', {...}, '!' ]\n*/\nfunction formatTokenize( str ) {\n\tvar content;\n\tvar tokens;\n\tvar match;\n\tvar prev;\n\n\ttokens = [];\n\tprev = 0;\n\tmatch = RE.exec( str );\n\twhile ( match ) {\n\t\tcontent = str.slice( prev, RE.lastIndex - match[ 0 ].length );\n\t\tif ( content.length ) {\n\t\t\ttokens.push( content );\n\t\t}\n\t\t// Check for an escaped percent sign `%%`...\n\t\tif ( match[ 6 ] === '%' ) {\n\t\t\ttokens.push( '%' );\n\t\t} else {\n\t\t\ttokens.push( parse( match ) );\n\t\t}\n\t\tprev = RE.lastIndex;\n\t\tmatch = RE.exec( str );\n\t}\n\tcontent = str.slice( prev );\n\tif ( content.length ) {\n\t\ttokens.push( content );\n\t}\n\treturn tokens;\n}\n\n\n// EXPORTS //\n\nexport default formatTokenize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport interpolate from '@stdlib/string-base-format-interpolate';\nimport tokenize from '@stdlib/string-base-format-tokenize';\nimport isString from './is_string.js';\n\n\n// MAIN //\n\n/**\n* Inserts supplied variable values into a format string.\n*\n* @param {string} str - input string\n* @param {Array} ...args - variable values\n* @throws {TypeError} first argument must be a string\n* @throws {Error} invalid flags\n* @returns {string} formatted string\n*\n* @example\n* var str = format( 'Hello %s!', 'world' );\n* // returns 'Hello world!'\n*\n* @example\n* var str = format( 'Pi: ~%.2f', 3.141592653589793 );\n* // returns 'Pi: ~3.14'\n*/\nfunction format( str ) {\n\tvar args;\n\tvar i;\n\n\tif ( !isString( str ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );\n\t}\n\targs = [ tokenize( str ) ];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn interpolate.apply( null, args );\n}\n\n\n// EXPORTS //\n\nexport default format;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' ); // NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-underscore-dangle, no-proto */\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar objectProtoype = Object.prototype;\nvar toStr = objectProtoype.toString;\nvar defineGetter = objectProtoype.__defineGetter__;\nvar defineSetter = objectProtoype.__defineSetter__;\nvar lookupGetter = objectProtoype.__lookupGetter__;\nvar lookupSetter = objectProtoype.__lookupSetter__;\n\n\n// MAIN //\n\n/**\n* Defines (or modifies) an object property.\n*\n* ## Notes\n*\n* - Property descriptors come in two flavors: **data descriptors** and **accessor descriptors**. A data descriptor is a property that has a value, which may or may not be writable. An accessor descriptor is a property described by a getter-setter function pair. A descriptor must be one of these two flavors and cannot be both.\n*\n* @param {Object} obj - object on which to define the property\n* @param {string} prop - property name\n* @param {Object} descriptor - property descriptor\n* @param {boolean} [descriptor.configurable=false] - boolean indicating if property descriptor can be changed and if the property can be deleted from the provided object\n* @param {boolean} [descriptor.enumerable=false] - boolean indicating if the property shows up when enumerating object properties\n* @param {boolean} [descriptor.writable=false] - boolean indicating if the value associated with the property can be changed with an assignment operator\n* @param {*} [descriptor.value] - property value\n* @param {(Function|void)} [descriptor.get=undefined] - function which serves as a getter for the property, or, if no getter, undefined. When the property is accessed, a getter function is called without arguments and with the `this` context set to the object through which the property is accessed (which may not be the object on which the property is defined due to inheritance). The return value will be used as the property value.\n* @param {(Function|void)} [descriptor.set=undefined] - function which serves as a setter for the property, or, if no setter, undefined. When assigning a property value, a setter function is called with one argument (the value being assigned to the property) and with the `this` context set to the object through which the property is assigned.\n* @throws {TypeError} first argument must be an object\n* @throws {TypeError} third argument must be an object\n* @throws {Error} property descriptor cannot have both a value and a setter and/or getter\n* @returns {Object} object with added property\n*\n* @example\n* var obj = {};\n*\n* defineProperty( obj, 'foo', {\n* 'value': 'bar'\n* });\n*\n* var str = obj.foo;\n* // returns 'bar'\n*/\nfunction defineProperty( obj, prop, descriptor ) {\n\tvar prototype;\n\tvar hasValue;\n\tvar hasGet;\n\tvar hasSet;\n\n\tif ( typeof obj !== 'object' || obj === null || toStr.call( obj ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', obj ) );\n\t}\n\tif ( typeof descriptor !== 'object' || descriptor === null || toStr.call( descriptor ) === '[object Array]' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Property descriptor must be an object. Value: `%s`.', descriptor ) );\n\t}\n\thasValue = ( 'value' in descriptor );\n\tif ( hasValue ) {\n\t\tif (\n\t\t\tlookupGetter.call( obj, prop ) ||\n\t\t\tlookupSetter.call( obj, prop )\n\t\t) {\n\t\t\t// Override `__proto__` to avoid touching inherited accessors:\n\t\t\tprototype = obj.__proto__;\n\t\t\tobj.__proto__ = objectProtoype;\n\n\t\t\t// Delete property as existing getters/setters prevent assigning value to specified property:\n\t\t\tdelete obj[ prop ];\n\t\t\tobj[ prop ] = descriptor.value;\n\n\t\t\t// Restore original prototype:\n\t\t\tobj.__proto__ = prototype;\n\t\t} else {\n\t\t\tobj[ prop ] = descriptor.value;\n\t\t}\n\t}\n\thasGet = ( 'get' in descriptor );\n\thasSet = ( 'set' in descriptor );\n\n\tif ( hasValue && ( hasGet || hasSet ) ) {\n\t\tthrow new Error( 'invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.' );\n\t}\n\n\tif ( hasGet && defineGetter ) {\n\t\tdefineGetter.call( obj, prop, descriptor.get );\n\t}\n\tif ( hasSet && defineSetter ) {\n\t\tdefineSetter.call( obj, prop, descriptor.set );\n\t}\n\treturn obj;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Define (or modify) an object property.\n*\n* @module @stdlib/utils-define-property\n*\n* @example\n* import defineProperty from '@stdlib/utils-define-property';\n*\n* var obj = {};\n* defineProperty( obj, 'foo', {\n* 'value': 'bar',\n* 'writable': false,\n* 'configurable': false,\n* 'enumerable': false\n* });\n* obj.foo = 'boop'; // => throws\n*/\n\n// MODULES //\n\nimport hasDefinePropertySupport from './has_define_property_support.js';\nimport builtin from './builtin.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar defineProperty;\nif ( hasDefinePropertySupport() ) {\n\tdefineProperty = builtin;\n} else {\n\tdefineProperty = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default defineProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from './define_property.js';\n\n\n// MAIN //\n\n/**\n* Tests for `Object.defineProperty` support.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment has `Object.defineProperty` support\n*\n* @example\n* var bool = hasDefinePropertySupport();\n* // returns \n*/\nfunction hasDefinePropertySupport() {\n\t// Test basic support...\n\ttry {\n\t\tdefineProperty( {}, 'x', {} );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default hasDefinePropertySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setNonEnumerableReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setNonEnumerableReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setNonEnumerableReadOnlyAccessor( obj, prop, getter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadOnlyAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( typeof value === 'number' );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasSymbols from '@stdlib/assert-has-symbol-support';\n\n\n// VARIABLES //\n\nvar FLG = hasSymbols();\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.toStringTag` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.toStringTag` support\n*\n* @example\n* var bool = hasToStringTagSupport();\n* // returns \n*/\nfunction hasToStringTagSupport() {\n\treturn ( FLG && typeof Symbol.toStringTag === 'symbol' );\n}\n\n\n// EXPORTS //\n\nexport default hasToStringTagSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests for native `Symbol` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol` support\n*\n* @example\n* var bool = hasSymbolSupport();\n* // returns \n*/\nfunction hasSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar toStr = Object.prototype.toString;\n\n\n// EXPORTS //\n\nexport default toStr;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// FUNCTIONS //\n\nvar has = Object.prototype.hasOwnProperty;\n\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasOwnProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasOwnProp( value, property ) {\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\treturn has.call( value, property );\n}\n\n\n// EXPORTS //\n\nexport default hasOwnProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar Sym = ( typeof Symbol === 'function' ) ? Symbol : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Sym;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\nvar toStrTag = ( typeof Symbol === 'function' ) ? Symbol.toStringTag : '';\n\n\n// EXPORTS //\n\nexport default toStrTag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string value indicating a specification defined classification of an object.\n*\n* @module @stdlib/utils-native-class\n*\n* @example\n* import nativeClass from '@stdlib/utils-native-class';\n*\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* function Beep() {\n* return this;\n* }\n* str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main;\nif ( hasToStringTag() ) {\n\tmain = polyfill;\n} else {\n\tmain = builtin;\n}\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport toStringTag from './tostringtag.js';\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification of an object in environments supporting `Symbol.toStringTag`.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\tvar isOwn;\n\tvar tag;\n\tvar out;\n\n\tif ( v === null || v === void 0 ) {\n\t\treturn toStr.call( v );\n\t}\n\ttag = v[ toStringTag ];\n\tisOwn = hasOwnProp( v, toStringTag );\n\n\t// Attempt to override the `toStringTag` property. For built-ins having a `Symbol.toStringTag` property (e.g., `JSON`, `Math`, etc), the `Symbol.toStringTag` property is read-only (e.g., , so we need to wrap in a `try/catch`.\n\ttry {\n\t\tv[ toStringTag ] = void 0;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn toStr.call( v );\n\t}\n\tout = toStr.call( v );\n\n\tif ( isOwn ) {\n\t\tv[ toStringTag ] = tag;\n\t} else {\n\t\tdelete v[ toStringTag ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toStr from './tostring.js';\n\n\n// MAIN //\n\n/**\n* Returns a string value indicating a specification defined classification (via the internal property `[[Class]]`) of an object.\n*\n* @param {*} v - input value\n* @returns {string} string value indicating a specification defined classification of the input value\n*\n* @example\n* var str = nativeClass( 'a' );\n* // returns '[object String]'\n*\n* @example\n* var str = nativeClass( 5 );\n* // returns '[object Number]'\n*\n* @example\n* function Beep() {\n* return this;\n* }\n* var str = nativeClass( new Beep() );\n* // returns '[object Object]'\n*/\nfunction nativeClass( v ) {\n\treturn toStr.call( v );\n}\n\n\n// EXPORTS //\n\nexport default nativeClass;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nexport default Number; // eslint-disable-line stdlib/require-globals\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Number.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Number from '@stdlib/number-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\nfunction isNumber( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Number ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Number]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a number\n*\n* @example\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* @example\n* var bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* @example\n* var bool = isNumber( NaN );\n* // returns true\n*\n* @example\n* var bool = isNumber( null );\n* // returns false\n*/\nfunction isNumber( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a number.\n*\n* @module @stdlib/assert-is-number\n*\n* @example\n* import isNumber from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns true\n*\n* bool = isNumber( NaN );\n* // returns true\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNumber } from '@stdlib/assert-is-number';\n*\n* var bool = isNumber( 3.14 );\n* // returns false\n*\n* bool = isNumber( new Number( 3.14 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* @module @stdlib/constants-float64-pinf\n* @type {number}\n*\n* @example\n* import FLOAT64_PINF from '@stdlib/constants-float64-pinf';\n* // returns Infinity\n*/\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point positive infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point positive infinity has the bit sequence\n*\n* ```binarystring\n* 0 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.POSITIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_PINF = Number.POSITIVE_INFINITY; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default FLOAT64_PINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* @module @stdlib/constants-float64-ninf\n* @type {number}\n*\n* @example\n* import FLOAT64_NINF from '@stdlib/constants-float64-ninf';\n* // returns -Infinity\n*/\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Double-precision floating-point negative infinity.\n*\n* ## Notes\n*\n* Double-precision floating-point negative infinity has the bit sequence\n*\n* ```binarystring\n* 1 11111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {number}\n* @default Number.NEGATIVE_INFINITY\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT64_NINF = Number.NEGATIVE_INFINITY;\n\n\n// EXPORTS //\n\nexport default FLOAT64_NINF;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward negative infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = floor( -4.2 );\n* // returns -5.0\n*\n* @example\n* var v = floor( 9.99999 );\n* // returns 9.0\n*\n* @example\n* var v = floor( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = floor( NaN );\n* // returns NaN\n*/\nvar floor = Math.floor; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default floor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport floor from '@stdlib/math-base-special-floor';\n\n\n// MAIN //\n\n/**\n* Tests if a finite double-precision floating-point number is an integer.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an integer\n*\n* @example\n* var bool = isInteger( 1.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( 3.14 );\n* // returns false\n*/\nfunction isInteger( x ) {\n\treturn (floor(x) === x);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport isInt from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a number primitive is an integer value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a number primitive is an integer value\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tvalue < PINF &&\n\t\tvalue > NINF &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having an integer value\n*\n* @example\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isInt from './integer.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having an integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having an integer value\n*\n* @example\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isInteger( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisInt( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an integer\n*\n* @example\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isInteger( -3.14 );\n* // returns false\n*\n* @example\n* var bool = isInteger( null );\n* // returns false\n*/\nfunction isInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is `null`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is null\n*\n* @example\n* var bool = isNull( null );\n* // returns true\n*\n* bool = isNull( true );\n* // returns false\n*/\nfunction isNull( value ) {\n\treturn value === null;\n}\n\n\n// EXPORTS //\n\nexport default isNull;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is `undefined`.\n*\n* ## Notes\n*\n* - In older browsers, `undefined` is a global which can be overridden. `void`, however, is an operator which **cannot** be overridden. Consequently, better to use `void` to check for `undefined`. See [Stack Overflow][1].\n*\n* [1]: http://stackoverflow.com/a/19369078/2225624\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is undefined\n*\n* @example\n* var bool = isUndefined( undefined );\n* // returns true\n*\n* bool = isUndefined( null );\n* // returns false\n*/\nfunction isUndefined( value ) {\n\treturn value === void 0;\n}\n\n\n// EXPORTS //\n\nexport default isUndefined;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isNull from '@stdlib/assert-is-null';\nimport isUndefined from '@stdlib/assert-is-undefined';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an input argument is valid.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether the argument is valid\n*\n* @example\n* var bool = isValid( 3 );\n* // returns true\n*\n* bool = isValid( null );\n* // returns true\n*\n* bool = isValid( void 0 );\n* // returns true\n*\n* bool = isValid( '3' );\n* // returns false\n*/\nfunction isValid( value ) {\n\treturn ( isInteger( value ) || isNull( value ) || isUndefined( value ) );\n}\n\n\n// MAIN //\n\n/**\n* Slice constructor.\n*\n* @constructor\n* @param {(integer|null|void)} [start] - starting index (inclusive)\n* @param {(integer|null|void)} stop - ending index (exclusive)\n* @param {(integer|null|void)} [step] - index increment\n* @throws {TypeError} first argument must be an integer, null, or undefined\n* @throws {TypeError} second argument must be an integer, null, or undefined\n* @throws {TypeError} third argument must be an integer, null, or undefined\n* @throws {RangeError} third argument cannot be zero\n* @returns {Slice} Slice instance\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var start = s.start;\n* // returns null\n*\n* var stop = s.stop;\n* // returns 10\n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*\n* var stop = s.stop;\n* // returns 10\n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*\n* var stop = s.stop;\n* // returns 10\n*\n* var step = s.step;\n* // returns 2\n*/\nfunction Slice() {\n\tvar nargs;\n\tvar start;\n\tvar stop;\n\tvar step;\n\n\tnargs = arguments.length;\n\tif ( nargs === 0 ) {\n\t\tstart = null;\n\t\tstop = null;\n\t\tstep = null;\n\t} else if ( nargs === 1 ) {\n\t\tstart = null;\n\t\tstop = arguments[ 0 ];\n\t\tstep = null;\n\t} else if ( nargs === 2 ) {\n\t\tstart = arguments[ 0 ];\n\t\tstop = arguments[ 1 ];\n\t\tstep = null;\n\t} else {\n\t\tstart = arguments[ 0 ];\n\t\tstop = arguments[ 1 ];\n\t\tstep = arguments[ 2 ];\n\t}\n\tif ( !( this instanceof Slice ) ) {\n\t\treturn new Slice( start, stop, step );\n\t}\n\tif ( !isValid( start ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer, null, or undefined. Value: `%s`.', start ) );\n\t}\n\tif ( !isValid( stop ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer, null, or undefined. Value: `%s`.', stop ) );\n\t}\n\tif ( !isValid( step ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer, null, or undefined. Value: `%s`.', step ) );\n\t} else if ( step === 0 ) {\n\t\tthrow new RangeError( format( 'invalid argument. Third argument cannot be zero. Value: `%s`.', step ) );\n\t}\n\tthis._start = ( start === void 0 ) ? null : start;\n\tthis._stop = ( stop === void 0 ) ? null : stop;\n\tthis._step = ( step === void 0 ) ? null : step;\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Slice\n* @readonly\n* @type {string}\n* @default 'Slice'\n*\n* @example\n* var str = Slice.name;\n* // returns 'Slice'\n*/\nsetReadOnly( Slice, 'name', 'Slice' );\n\n/**\n* Returns the slice's starting index.\n*\n* @name start\n* @memberof Slice.prototype\n* @readonly\n* @type {(integer|null)}\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var start = s.start;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var start = s.start;\n* // returns 3\n*/\nsetReadOnlyAccessor( Slice.prototype, 'start', function get() {\n\treturn this._start;\n});\n\n/**\n* Returns the slice's ending index.\n*\n* @name stop\n* @memberof Slice.prototype\n* @readonly\n* @type {(integer|null)}\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var stop = s.stop;\n* // returns 10\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var stop = s.stop;\n* // returns 10\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var stop = s.stop;\n* // returns 10\n*/\nsetReadOnlyAccessor( Slice.prototype, 'stop', function get() {\n\treturn this._stop;\n});\n\n/**\n* Returns the slice's index increment.\n*\n* @name step\n* @memberof Slice.prototype\n* @readonly\n* @type {(integer|null)}\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var step = s.step;\n* // returns null\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var step = s.step;\n* // returns 2\n*/\nsetReadOnlyAccessor( Slice.prototype, 'step', function get() {\n\treturn this._step;\n});\n\n/**\n* Serializes a slice to a string.\n*\n* @name toString\n* @memberof Slice.prototype\n* @type {Function}\n* @returns {string} serialized Slice\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var str = s.toString();\n* // returns 'Slice(null,10,null)'\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var str = s.toString();\n* // returns 'Slice(3,10,null)'\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var str = s.toString();\n* // returns 'Slice(3,10,2)'\n*/\nsetReadOnly( Slice.prototype, 'toString', function toString() {\n\treturn 'Slice('+this._start+','+this._stop+','+this.step+')';\n});\n\n/**\n* Serializes a slice as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Slice` instance.\n*\n* @name toJSON\n* @memberof Slice.prototype\n* @type {Function}\n* @returns {Object} serialized Slice\n*\n* @example\n* var s = new Slice( 10 );\n* // returns \n*\n* var o = s.toJSON();\n* // returns { 'type': 'Slice', 'data': [ null, 10, null ] }\n*\n* @example\n* var s = new Slice( 3, 10 );\n* // returns \n*\n* var o = s.toJSON();\n* // returns { 'type': 'Slice', 'data': [ 3, 10, null ] }\n*\n* @example\n* var s = new Slice( 3, 10, 2 );\n* // returns \n*\n* var o = s.toJSON();\n* // returns { 'type': 'Slice', 'data': [ 3, 10, 2 ] }\n*/\nsetReadOnly( Slice.prototype, 'toJSON', function toJSON() {\n\treturn {\n\t\t'type': 'Slice',\n\t\t'data': [\n\t\t\tthis._start,\n\t\t\tthis._stop,\n\t\t\tthis._step\n\t\t]\n\t};\n});\n\n\n// EXPORTS //\n\nexport default Slice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\nfunction reFunctionName() {\n\treturn /^\\s*function\\s*([^(]*)/i;\n}\n\n\n// EXPORTS //\n\nexport default reFunctionName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an integer.\n*\n* @module @stdlib/assert-is-integer\n*\n* @example\n* import isInteger from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 5.0 );\n* // returns true\n*\n* bool = isInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isInteger( -3.14 );\n* // returns false\n*\n* bool = isInteger( null );\n* // returns false\n*\n* @example\n* // Use interface to check for integer primitives...\n* import { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( -3.0 );\n* // returns true\n*\n* bool = isInteger( new Number( -3.0 ) );\n* // returns false\n*\n* @example\n* // Use interface to check for integer objects...\n* import { isObject as isInteger } from '@stdlib/assert-is-integer';\n*\n* var bool = isInteger( 3.0 );\n* // returns false\n*\n* bool = isInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport reFunctionName from './main.js';\n\n\n// MAIN //\n\n/**\n* Captures everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* Regular expression: `/^\\s*function\\s*([^(]*)/i`\n*\n* - `/^\\s*`\n* - Match zero or more spaces at beginning\n*\n* - `function`\n* - Match the word `function`\n*\n* - `\\s*`\n* - Match zero or more spaces after the word `function`\n*\n* - `()`\n* - Capture\n*\n* - `[^(]*`\n* - Match anything except a left parenthesis `(` zero or more times\n*\n* - `/i`\n* - ignore case\n*\n* @constant\n* @type {RegExp}\n* @default /^\\s*function\\s*([^(]*)/i\n*/\nvar RE_FUNCTION_NAME = reFunctionName();\n\n\n// EXPORTS //\n\nexport default RE_FUNCTION_NAME;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @module @stdlib/regexp-function-name\n*\n* @example\n* import reFunctionName from '@stdlib/regexp-function-name';\n* var RE_FUNCTION_NAME = reFunctionName();\n*\n* function fname( fcn ) {\n* return RE_FUNCTION_NAME.exec( fcn.toString() )[ 1 ];\n* }\n*\n* var fn = fname( Math.sqrt );\n* // returns 'sqrt'\n*\n* fn = fname( Int8Array );\n* // returns 'Int8Array'\n*\n* fn = fname( Object.prototype.toString );\n* // returns 'toString'\n*\n* fn = fname( function(){} );\n* // returns ''\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport REGEXP from './regexp.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'REGEXP', REGEXP );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar f;\n\n\n// FUNCTIONS //\n\n/**\n* Tests if a value is an array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an array\n*\n* @example\n* var bool = isArray( [] );\n* // returns true\n*\n* @example\n* var bool = isArray( {} );\n* // returns false\n*/\nfunction isArray( value ) {\n\treturn ( nativeClass( value ) === '[object Array]' );\n}\n\n\n// MAIN //\n\nif ( Array.isArray ) {\n\tf = Array.isArray;\n} else {\n\tf = isArray;\n}\n\n\n// EXPORTS //\n\nexport default f;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from '@stdlib/assert-is-array';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function which tests if every element in an array passes a test condition.\n*\n* @param {Function} predicate - function to apply\n* @throws {TypeError} must provide a function\n* @returns {Function} an array function\n*\n* @example\n* import isOdd from '@stdlib/assert-is-odd';\n*\n* var arr1 = [ 1, 3, 5, 7 ];\n* var arr2 = [ 3, 5, 8 ];\n*\n* var validate = arrayfcn( isOdd );\n*\n* var bool = validate( arr1 );\n* // returns true\n*\n* bool = validate( arr2 );\n* // returns false\n*/\nfunction arrayfcn( predicate ) {\n\tif ( typeof predicate !== 'function' ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', predicate ) );\n\t}\n\treturn every;\n\n\t/**\n\t* Tests if every element in an array passes a test condition.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating whether a value is an array for which all elements pass a test condition\n\t*/\n\tfunction every( value ) {\n\t\tvar len;\n\t\tvar i;\n\t\tif ( !isArray( value ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tlen = value.length;\n\t\tif ( len === 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( predicate( value[ i ] ) === false ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default arrayfcn;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is object-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is object-like\n*\n* @example\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( [] );\n* // returns true\n*\n* @example\n* var bool = isObjectLike( null );\n* // returns false\n*/\nfunction isObjectLike( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObjectLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObjectLike from '@stdlib/assert-is-object-like';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Buffer instance.\n*\n* @param {*} value - value to validate\n* @returns {boolean} boolean indicating if a value is a Buffer instance\n*\n* @example\n* var v = isBuffer( new Buffer( 'beep' ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( new Buffer( [1,2,3,4] ) );\n* // returns true\n*\n* @example\n* var v = isBuffer( {} );\n* // returns false\n*\n* @example\n* var v = isBuffer( [] );\n* // returns false\n*/\nfunction isBuffer( value ) {\n\treturn (\n\t\tisObjectLike( value ) &&\n\t\t(\n\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\tvalue._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)\n\t\t\t(\n\t\t\t\tvalue.constructor &&\n\n\t\t\t\t// WARNING: `typeof` is not a foolproof check, as certain envs consider RegExp and NodeList instances to be functions\n\t\t\t\ttypeof value.constructor.isBuffer === 'function' &&\n\t\t\t\tvalue.constructor.isBuffer( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\nimport { REGEXP as RE } from '@stdlib/regexp-function-name';\nimport isBuffer from '@stdlib/assert-is-buffer';\n\n\n// MAIN //\n\n/**\n* Determines the name of a value's constructor.\n*\n* @param {*} v - input value\n* @returns {string} name of a value's constructor\n*\n* @example\n* var v = constructorName( 'a' );\n* // returns 'String'\n*\n* @example\n* var v = constructorName( 5 );\n* // returns 'Number'\n*\n* @example\n* var v = constructorName( null );\n* // returns 'Null'\n*\n* @example\n* var v = constructorName( undefined );\n* // returns 'Undefined'\n*\n* @example\n* var v = constructorName( function noop() {} );\n* // returns 'Function'\n*/\nfunction constructorName( v ) {\n\tvar match;\n\tvar name;\n\tvar ctor;\n\tname = nativeClass( v ).slice( 8, -1 );\n\tif ( (name === 'Object' || name === 'Error') && v.constructor ) {\n\t\tctor = v.constructor;\n\t\tif ( typeof ctor.name === 'string' ) {\n\t\t\treturn ctor.name;\n\t\t}\n\t\tmatch = RE.exec( ctor.toString() );\n\t\tif ( match ) {\n\t\t\treturn match[ 1 ];\n\t\t}\n\t}\n\tif ( isBuffer( v ) ) {\n\t\treturn 'Buffer';\n\t}\n\treturn name;\n}\n\n\n// EXPORTS //\n\nexport default constructorName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isNull from '@stdlib/assert-is-null';\nimport isUndefined from '@stdlib/assert-is-undefined';\nimport isSlice from '@stdlib/assert-is-slice';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an input argument is valid.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether the argument is valid\n*\n* @example\n* var bool = isValid( 3 );\n* // returns true\n*\n* bool = isValid( null );\n* // returns true\n*\n* bool = isValid( void 0 );\n* // returns true\n*\n* bool = isValid( '3' );\n* // returns false\n*/\nfunction isValid( value ) {\n\treturn (\n\t\tisInteger( value ) ||\n\t\tisNull( value ) ||\n\t\tisUndefined( value ) ||\n\t\tisSlice( value )\n\t);\n}\n\n\n// MAIN //\n\n/**\n* Multi-slice constructor.\n*\n* @constructor\n* @param {...(Slice|integer|null)} slice - slice\n* @throws {TypeError} a provided argument must be either a Slice, integer, null, or undefined\n* @returns {MultiSlice} MultiSlice instance\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*/\nfunction MultiSlice() {\n\tvar nargs;\n\tvar proxy;\n\tvar args;\n\tvar v;\n\tvar i;\n\n\tnargs = arguments.length;\n\tif ( !( this instanceof MultiSlice ) ) {\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ] ); // eslint-disable-line max-len\n\t\t}\n\t\tif ( nargs === 4 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ] ); // eslint-disable-line max-len\n\t\t}\n\t\tif ( nargs === 5 ) {\n\t\t\treturn new MultiSlice( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ], arguments[ 4 ] ); // eslint-disable-line max-len\n\t\t}\n\t\targs = [];\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\targs.push( arguments[ i ] );\n\t\t}\n\t\t// Use a workaround for being unable to combine `.apply` with the `new` operator:\n\t\tproxy = Object.create( MultiSlice.prototype );\n\t\treturn MultiSlice.apply( proxy, args );\n\t}\n\tthis._data = [];\n\tfor ( i = 0; i < nargs; i++ ) {\n\t\tv = arguments[ i ];\n\t\tif ( !isValid( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Provided arguments must be either a Slice, integer, null, or undefined. Argument: `%d`. Value: `%s`.', i, String( v ) ) );\n\t\t}\n\t\tthis._data.push( ( v === void 0 ) ? null : v );\n\t}\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof MultiSlice\n* @readonly\n* @type {string}\n* @default 'MultiSlice'\n*\n* @example\n* var str = MultiSlice.name;\n* // returns 'MultiSlice'\n*/\nsetReadOnly( MultiSlice, 'name', 'MultiSlice' );\n\n/**\n* Returns the number of slice dimensions.\n*\n* @name ndims\n* @memberof MultiSlice.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var ndims = ms.ndims;\n* // returns 4\n*/\nsetReadOnlyAccessor( MultiSlice.prototype, 'ndims', function get() {\n\treturn this._data.length;\n});\n\n/**\n* Returns multi-slice data.\n*\n* @name data\n* @memberof MultiSlice.prototype\n* @readonly\n* @type {Array}\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var data = ms.data;\n* // returns [...]\n*\n* var v = data[ 0 ];\n* // returns null\n*\n* v = data[ 1 ];\n* // returns \n*\n* v = data[ 2 ];\n* // returns \n*\n* v = data[ 3 ];\n* // returns 2\n*/\nsetReadOnlyAccessor( MultiSlice.prototype, 'data', function get() {\n\treturn this._data.slice();\n});\n\n/**\n* Serializes a multi-slice to a string.\n*\n* @name toString\n* @memberof MultiSlice.prototype\n* @type {Function}\n* @returns {string} serialized MultiSlice\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var str = ms.toString();\n* // returns 'MultiSlice(null,Slice(0,10,1),Slice(2,12,2),2)'\n*/\nsetReadOnly( MultiSlice.prototype, 'toString', function toString() {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tdata = this._data;\n\tout = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tout.push( String( data[ i ] ) );\n\t}\n\treturn 'MultiSlice('+out.join( ',' )+')';\n});\n\n/**\n* Serializes a multi-slice as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `MultiSlice` instance.\n*\n* @name toJSON\n* @memberof MultiSlice.prototype\n* @type {Function}\n* @returns {Object} serialized MultiSlice\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s1 = new Slice( 0, 10, 1 );\n* var s2 = new Slice( 2, 12, 2 );\n*\n* var ms = new MultiSlice( null, s1, s2, 2 );\n* // returns \n*\n* var o = ms.toJSON();\n* // returns { 'type': 'MultiSlice', 'data': [ null, { 'type': 'Slice', 'data': [ 0, 10, 1 ] }, { 'type': 'Slice', 'data': [ 2, 12, 2 ] }, 2 ] }\n*/\nsetReadOnly( MultiSlice.prototype, 'toJSON', function toJSON() {\n\tvar data;\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tdata = this._data;\n\tout = {\n\t\t'type': 'MultiSlice',\n\t\t'data': []\n\t};\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tv = data[ i ];\n\t\tout.data.push( ( v && typeof v.toJSON === 'function' ) ? v.toJSON() : v );\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default MultiSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Slice from '@stdlib/slice-ctor';\nimport constructorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Slice object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a Slice object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = new Slice( 0, 10, 2 );\n*\n* var bool = isSlice( s );\n* // returns true\n*/\nfunction isSlice( value ) {\n\treturn (\n\t\tvalue instanceof Slice ||\n\t\tconstructorName( value ) === 'Slice'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable max-len */\n\n'use strict';\n\n// MODULES //\n\nimport MultiSlice from '@stdlib/slice-multi';\n\n\n// MAIN //\n\n/**\n* Creates a MultiSlice object from a list of MultiSlice constructor arguments.\n*\n* @param {(Slice|integer|null|void)} args - constructor arguments\n* @returns {MultiSlice} MultiSlice object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ void 0, new Slice( 0, 10, 1 ) ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ null, ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ new Slice( 0, 10, 1 ), void 0 ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ , null ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ new Slice( 0, 10, 1 ), void 0, void 0, new Slice( 0, 10, 1 ) ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ , null, null, ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = args2multislice( [ void 0, new Slice( 0, 10, 1 ), null, void 0, new Slice( 2, 9, 2 ), null, void 0 ] );\n* // returns \n*\n* var data = s.data;\n* // returns [ null, , null, null, , null, null ]\n*/\nfunction args2multislice( args ) {\n\tswitch ( args.length ) {\n\tcase 0:\n\t\treturn new MultiSlice();\n\tcase 1:\n\t\treturn new MultiSlice( args[ 0 ] );\n\tcase 2:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ] );\n\tcase 3:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ] );\n\tcase 4:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ] );\n\tcase 5:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ] );\n\tcase 6:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ] );\n\tcase 7:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ] );\n\tcase 8:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ], args[ 7 ] );\n\tcase 9:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ], args[ 7 ], args[ 8 ] );\n\tcase 10:\n\t\treturn new MultiSlice( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], args[ 6 ], args[ 7 ], args[ 8 ], args[ 9 ] );\n\tdefault:\n\t\treturn MultiSlice.apply( null, args );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default args2multislice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport args2multislice from '@stdlib/slice-base-args2multislice';\nimport Slice from '@stdlib/slice-ctor';\nimport normalizeSlice from '@stdlib/slice-base-normalize-slice';\nimport int2slice from '@stdlib/slice-base-int2slice';\n\n\n// FUNCTIONS //\n\n/**\n* Normalizes an individual MultiSlice element.\n*\n* @private\n* @param {(Slice|integer|null)} value - input slice\n* @param {NonNegativeInteger} len - maximum number of elements which are allowed in a slice\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {Slice} slice object\n*/\nfunction normalize( value, len, strict ) {\n\t// Case: null\n\tif ( value === null ) {\n\t\t// Create a slice with default extents and a default increment:\n\t\treturn new Slice( 0, len, 1 );\n\t}\n\t// Case: integer\n\tif ( typeof value === 'number' ) {\n\t\treturn int2slice( value, len, strict );\n\t}\n\t// Case: slice\n\treturn normalizeSlice( value, len, strict );\n}\n\n\n// MAIN //\n\n/**\n* Returns a normalized MultiSlice object.\n*\n* @param {MultiSlice} slice - input slice\n* @param {NonNegativeIntegerArray} shape - maximum allowed slice shape\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {(MultiSlice|ErrorObject)} multi-slice object or an error object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n*\n* var shape = [ 10, 10, 10 ];\n*\n* var s1 = new MultiSlice( new Slice( 2, null, 2 ), null, -4 );\n* var s2 = normalizeMultiSlice( s1, shape, false );\n* // returns \n*\n* var d = s2.data;\n* // returns [ , , ]\n*\n* var v = d[ 0 ];\n* // returns \n*\n* var start = v.start;\n* // returns 2\n*\n* var stop = v.stop;\n* // returns 10\n*\n* var step = v.step;\n* // returns 2\n*\n* v = d[ 1 ];\n* // returns \n*\n* start = v.start;\n* // returns 0\n*\n* stop = v.stop;\n* // returns 10\n*\n* step = v.step;\n* // returns 1\n*\n* v = d[ 2 ];\n* // returns \n*\n* start = v.start;\n* // returns 6\n*\n* stop = v.stop;\n* // returns 7\n*\n* step = v.step;\n* // returns 1\n*/\nfunction normalizeMultiSlice( slice, shape, strict ) {\n\tvar data;\n\tvar args;\n\tvar s;\n\tvar i;\n\n\tdata = slice.data;\n\targs = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\ts = normalize( data[ i ], shape[ i ], strict );\n\t\tif ( s.code !== void 0 ) {\n\t\t\treturn s;\n\t\t}\n\t\targs.push( s );\n\t}\n\n\t// Return a normalized slice:\n\treturn args2multislice( args );\n}\n\n\n// EXPORTS //\n\nexport default normalizeMultiSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Slice from '@stdlib/slice-ctor';\nimport eOutOfBounds from './error_out_of_bounds.js';\n\n\n// MAIN //\n\n/**\n* Converts an integer to a Slice object.\n*\n* @param {integer} value - input value\n* @param {NonNegativeInteger} max - index upper bound\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {(Slice|Object)} Slice object or an error object\n*\n* @example\n* var s = int2slice( -4, 10, false );\n* // returns \n*\n* var start = s.start;\n* // returns 6\n*\n* var stop = s.stop;\n* // returns 7\n*\n* var step = s.step;\n* // returns 1\n*/\nfunction int2slice( value, max, strict ) {\n\t// If a value exceeds the last possible index, create an \"empty\" slice...\n\tif ( value >= max ) {\n\t\tif ( strict ) {\n\t\t\treturn eOutOfBounds();\n\t\t}\n\t\treturn new Slice( max, max, 1 );\n\t}\n\t// Check whether we need to resolve a slice relative to the last possible index...\n\tif ( value < 0 ) {\n\t\tvalue = max + value;\n\n\t\t// If a value exceeds the first index, create an \"empty\" slice...\n\t\tif ( value < 0 ) {\n\t\t\tif ( strict ) {\n\t\t\t\treturn eOutOfBounds();\n\t\t\t}\n\t\t\treturn new Slice( 0, 0, 1 );\n\t\t}\n\t\treturn new Slice( value, value+1, 1 ); // e.g., Slice( 2, 3, 1 ), which is the slice equivalent of only selecting the second row\n\t}\n\t// 0 <= s < N\n\treturn new Slice( value, value+1, 1 );\n}\n\n\n// EXPORTS //\n\nexport default int2slice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an error object for a slice which exceeds index bounds.\n*\n* @private\n* @returns {Object} error object\n*/\nfunction error() {\n\treturn {\n\t\t'code': 'ERR_SLICE_OUT_OF_BOUNDS'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default error;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Slice from '@stdlib/slice-ctor';\nimport eOutOfBounds from './error_out_of_bounds.js';\n\n\n// MAIN //\n\n/**\n* Returns a normalized Slice object.\n*\n* @param {Slice} slice - input slice\n* @param {NonNegativeInteger} len - maximum number of elements allowed in a slice\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @returns {(Slice|ErrorObject)} slice object or an error object\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice(), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 0\n*\n* v = s.stop;\n* // returns 10\n*\n* v = s.step;\n* // returns 1\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice( null, 20, 2 ), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 0\n*\n* v = s.stop;\n* // returns 10\n*\n* v = s.step;\n* // returns 2\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice( -5, -1, 1 ), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 5\n*\n* v = s.stop;\n* // returns 9\n*\n* v = s.step;\n* // returns 1\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = normalizeSlice( new Slice( -5, null, -1 ), 10, false );\n* // returns \n*\n* var v = s.start;\n* // returns 5\n*\n* v = s.stop;\n* // returns null\n*\n* v = s.step;\n* // returns -1\n*/\nfunction normalizeSlice( slice, len, strict ) {\n\tvar start;\n\tvar stop;\n\tvar step;\n\n\tstart = slice.start;\n\tstop = slice.stop;\n\tstep = slice.step;\n\n\t// If necessary, set the default increment...\n\tif ( step === null ) {\n\t\tstep = 1;\n\t}\n\n\t// Case: start is not specified\n\tif ( start === null ) {\n\t\t// If the step is positive, we default to the first index...\n\t\tif ( step > 0 ) {\n\t\t\tstart = 0;\n\t\t}\n\t\t// If the step is negative, we default to the last index (inclusive)...\n\t\telse {\n\t\t\tstart = len - 1;\n\t\t}\n\t}\n\t// Case: start is negative and should be resolved relative to the last index\n\telse if ( start < 0 ) {\n\t\tstart = len + start;\n\n\t\t// Check whether start still exceeds the index bounds...\n\t\tif ( start < 0 ) {\n\t\t\tif ( strict ) {\n\t\t\t\treturn eOutOfBounds();\n\t\t\t}\n\t\t\t// Clamp to the first index (inclusive):\n\t\t\tstart = 0;\n\t\t}\n\t}\n\t// Case: start exceeds index bounds\n\telse if ( start >= len ) {\n\t\tif ( strict ) {\n\t\t\treturn eOutOfBounds();\n\t\t}\n\t\t// If the increment is negative, clamp to the last index (inclusive)...\n\t\tif ( step < 0 ) {\n\t\t\tstart = len - 1;\n\t\t}\n\t\t// If the increment is positive, clamp to the \"index\" following the last index...\n\t\telse {\n\t\t\tstart = len;\n\t\t}\n\t}\n\n\t// Case: stop is not specified\n\tif ( stop === null ) {\n\t\t// If the step is positive, we default to just beyond the last index, as the stopping index is exclusive...\n\t\tif ( step > 0 ) {\n\t\t\tstop = len;\n\t\t}\n\t\t// If the step is negative, we default to a sentinel value indicating that one should iterate through the first index when decrementing...\n\t\telse {\n\t\t\tstop = null;\n\t\t}\n\t}\n\t// Case: stop is negative and should be resolved relative to the last index\n\telse if ( stop < 0 ) {\n\t\tstop = len + stop;\n\n\t\t// Check whether stop still exceeds the index bounds...\n\t\tif ( stop < 0 ) {\n\t\t\t// If the step is positive, we should clamp to the first index, as Slice(x,0,step) is an empty slice regardless of `x`...\n\t\t\tif ( step > 0 ) {\n\t\t\t\tif ( strict ) {\n\t\t\t\t\treturn eOutOfBounds();\n\t\t\t\t}\n\t\t\t\tstop = 0;\n\t\t\t}\n\t\t\t// If the step is negative, we default to just beyond the first index (using a sentinel value), as the stopping index is exclusive, thus indicating to iterate through the first index when decrementing...\n\t\t\telse {\n\t\t\t\tif ( strict && stop < -1 ) {\n\t\t\t\t\treturn eOutOfBounds();\n\t\t\t\t}\n\t\t\t\tstop = null;\n\t\t\t}\n\t\t}\n\t}\n\t// Case: stop exceeds index bounds\n\telse if ( stop > len ) {\n\t\tif ( strict ) {\n\t\t\treturn eOutOfBounds();\n\t\t}\n\t\t// Clamp to just beyond the last index, as the stopping index is exclusive:\n\t\tstop = len;\n\t}\n\n\t// Return a normalized slice:\n\treturn new Slice( start, stop, step );\n}\n\n\n// EXPORTS //\n\nexport default normalizeSlice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an error object for a slice which exceeds index bounds.\n*\n* @private\n* @returns {Object} error object\n*/\nfunction error() {\n\treturn {\n\t\t'code': 'ERR_SLICE_OUT_OF_BOUNDS'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default error;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is object-like.\n*\n* @module @stdlib/assert-is-object-like\n*\n* @example\n* import isObjectLike from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( {} );\n* // returns true\n*\n* bool = isObjectLike( [] );\n* // returns true\n*\n* bool = isObjectLike( null );\n* // returns false\n*\n* @example\n* import { isObjectLikeArray as isObjectLike } from '@stdlib/assert-is-object-like';\n*\n* var bool = isObjectLike( [ {}, [] ] );\n* // returns true\n*\n* bool = isObjectLike( [ {}, '3.0' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport main from './main.js';\n\n\n// VARIABLES //\n\nvar isObjectLikeArray = arrayfun( main );\n\n\n// MAIN //\n\nsetReadOnly( main, 'isObjectLikeArray', isObjectLikeArray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: implementation (?)\n\n/**\n* Rounds a double-precision floating-point number toward positive infinity.\n*\n* @param {number} x - input value\n* @returns {number} rounded value\n*\n* @example\n* var v = ceil( -4.2 );\n* // returns -4.0\n*\n* @example\n* var v = ceil( 9.99999 );\n* // returns 10.0\n*\n* @example\n* var v = ceil( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = ceil( NaN );\n* // returns NaN\n*/\nvar ceil = Math.ceil; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default ceil;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ceil from '@stdlib/math-base-special-ceil';\n\n\n// MAIN //\n\n/**\n* Returns the number of elements in a normalized slice.\n*\n* @param {Slice} slice - normalized Slice object\n* @returns {NonNegativeInteger} number of elements\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 2, null, 1 );\n* // returns \n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 8\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 9\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 3\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 2, null, 2 );\n* // returns \n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 4\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 5\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 2\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( -1, null, -2 );\n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 5\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 6\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 3\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 3, 5, -1 );\n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 0\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import normalizeSlice from '@stdlib/slice-base-normalize-slice';\n*\n* var s = new Slice( 5, 3, 1 );\n*\n* var v = sliceLength( normalizeSlice( s, 10, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 11, false ) );\n* // returns 0\n*\n* v = sliceLength( normalizeSlice( s, 5, false ) );\n* // returns 0\n*/\nfunction sliceLength( slice ) {\n\tvar inc;\n\tvar x1;\n\tvar x2;\n\n\tx1 = slice.start;\n\tx2 = slice.stop;\n\tinc = slice.step;\n\n\t// For a normalized slice, stop should only be `null` when the increment is negative...\n\tif ( x2 === null ) {\n\t\tx2 = -1; // set to -1 to ensure that the first element is included\n\t}\n\tif (\n\t\t// If the increment is positive, the slice is empty whenever the starting index is greater than or equal to the stopping index:\n\t\t( inc > 0 && x1 >= x2 ) ||\n\n\t\t// If the increment is negative, the slice is empty whenever the starting index is less than or equal to the stopping index:\n\t\t( inc < 0 && x1 <= x2 )\n\t) {\n\t\treturn 0;\n\t}\n\treturn ceil( ( x2 - x1 ) / inc );\n}\n\n\n// EXPORTS //\n\nexport default sliceLength;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport sliceLength from '@stdlib/slice-base-length';\n\n\n// MAIN //\n\n/**\n* Returns the shape of a normalized multi-slice.\n*\n* @param {MultiSlice} slice - normalized MultiSlice object\n* @returns {NonNegativeIntegerArray} slice shape\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\n*\n* var s = new MultiSlice( new Slice( 2, null, 1 ), null, 10 );\n*\n* var v = sliceShape( normalizeMultiSlice( s, [ 10, 5, 20 ], false ) );\n* // returns [ 8, 5, 1 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 11, 3, 12 ], false ) );\n* // returns [ 9, 3, 1 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 5, 10, 15 ], false ) );\n* // returns [ 3, 10, 1 ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\n*\n* var s = new MultiSlice( null, new Slice( -1, 3, -2 ) );\n*\n* var v = sliceShape( normalizeMultiSlice( s, [ 10, 5 ], false ) );\n* // returns [ 10, 1 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 11, 10 ], false ) );\n* // returns [ 11, 3 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 5, 15 ], false ) );\n* // returns [ 5, 6 ]\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\n*\n* var s = new MultiSlice( 1, new Slice( 0, 0, 1 ) );\n*\n* var v = sliceShape( normalizeMultiSlice( s, [ 10, 5 ], false ) );\n* // returns [ 1, 0 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 11, 10 ], false ) );\n* // returns [ 1, 0 ]\n*\n* v = sliceShape( normalizeMultiSlice( s, [ 5, 15 ], false ) );\n* // returns [ 1, 0 ]\n*/\nfunction sliceShape( slice ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tdata = slice.data;\n\tout = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tout.push( sliceLength( data[ i ] ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default sliceShape;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Takes elements from an indexed array.\n*\n* @param {Collection} x - input array\n* @param {NonNegativeIntegerArray} indices - list of indices\n* @returns {Array} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n* var indices = [ 3, 1, 2, 0 ];\n*\n* var y = take( x, indices );\n* // returns [ 4, 2, 3, 1 ]\n*/\nfunction take( x, indices ) {\n\tvar out;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < indices.length; i++ ) {\n\t\tout.push( x[ indices[ i ] ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default take;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a filled \"generic\" array.\n*\n* @param {*} value - fill value\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} filled array\n*\n* @example\n* var out = filled( 0.0, 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = filled( 'beep', 3 );\n* // returns [ 'beep', 'beep', 'beep' ]\n*/\nfunction filled( value, len ) {\n\tvar arr;\n\tvar i;\n\n\t// Manually push elements in order to ensure \"fast\" elements...\n\tarr = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tarr.push( value );\n\t}\n\treturn arr;\n}\n\n\n// EXPORTS //\n\nexport default filled;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport filled from '@stdlib/array-base-filled';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled \"generic\" array.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = zeros( 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction zeros( len ) {\n\treturn filled( 0.0, len );\n}\n\n\n// EXPORTS //\n\nexport default zeros;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the number of elements in an array.\n*\n* @param {(NonNegativeIntegerArray|EmptyArray)} shape - array shape\n* @returns {NonNegativeInteger} number of elements\n*\n* @example\n* var n = numel( [ 3, 3, 3 ] );\n* // returns 27\n*/\nfunction numel( shape ) {\n\tvar ndims;\n\tvar n;\n\tvar i;\n\n\tndims = shape.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0;\n\t}\n\tn = 1;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tn *= shape[ i ];\n\t}\n\treturn n;\n}\n\n\n// EXPORTS //\n\nexport default numel;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies the elements of an indexed array-like object to a new \"generic\" array.\n*\n* @param {Collection} x - input array\n* @returns {Array} output array\n*\n* @example\n* var out = copy( [ 1, 2, 3 ] );\n* // returns [ 1, 2, 3 ]\n*/\nfunction copy( x ) {\n\tvar out;\n\tvar len;\n\tvar i;\n\n\tlen = x.length;\n\tout = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout.push( x[ i ] ); // use `Array#push` to ensure \"fast\" elements\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default copy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a string primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string primitive\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns false\n*/\nfunction isString( value ) {\n\treturn ( typeof value === 'string' );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar valueOf = String.prototype.valueOf; // non-generic\n\n\n// EXPORTS //\n\nexport default valueOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport test from './try2valueof.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a string object\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns false\n*/\nfunction isString( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof String ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object String]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport valueOf from './valueof.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to extract a string value.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a string can be extracted\n*/\nfunction test( value ) {\n\ttry {\n\t\tvalueOf.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a string.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a string\n*\n* @example\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* @example\n* var bool = isString( 'beep' );\n* // returns true\n*/\nfunction isString( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests whether an input value is the string representing column-major order.\n*\n* @param {*} v - value to test\n* @returns {boolean} boolean result\n*\n* @example\n* var bool = isColumnMajorString( 'column-major' );\n* // returns true\n*\n* bool = isColumnMajorString( 'row-major' );\n* // returns false\n*\n* bool = isColumnMajorString( 'foo' );\n* // returns false\n*/\nfunction isColumnMajorString( v ) {\n\treturn ( v === 'column-major' );\n}\n\n\n// EXPORTS //\n\nexport default isColumnMajorString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction rowmajor( shape ) {\n\tvar ndims;\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\tout = [];\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tout.push( 0 );\n\t}\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} array strides\n*/\nfunction columnmajor( shape ) {\n\tvar out;\n\tvar s;\n\tvar i;\n\n\tout = [];\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout.push( s );\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @returns {Array} array strides\n*\n* @example\n* var s = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* s = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape );\n\t}\n\treturn rowmajor( shape );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a string.\n*\n* @module @stdlib/assert-is-string\n*\n* @example\n* import isString from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 5 );\n* // returns false\n*\n* @example\n* import { isObject as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( new String( 'beep' ) );\n* // returns true\n*\n* bool = isString( 'beep' );\n* // returns false\n*\n* @example\n* import { isPrimitive as isString } from '@stdlib/assert-is-string';\n*\n* var bool = isString( 'beep' );\n* // returns true\n*\n* bool = isString( new String( 'beep' ) );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Generate a stride array from an array shape.\n*\n* @module @stdlib/ndarray-base-shape2strides\n*\n* @example\n* import shape2strides from '@stdlib/ndarray-base-shape2strides';\n*\n* var strides = shape2strides( [ 3, 2 ], 'row-major' );\n* // returns [ 2, 1 ]\n*\n* strides = shape2strides( [ 3, 2 ], 'column-major' );\n* // returns [ 1, 3 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isColumnMajor from '@stdlib/ndarray-base-assert-is-column-major-string';\n\n\n// FUNCTIONS //\n\n/**\n* Generates a stride array from an array shape (row-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction rowmajor( shape, out ) {\n\tvar ndims;\n\tvar s;\n\tvar i;\n\n\tndims = shape.length;\n\ts = 1;\n\tfor ( i = ndims-1; i >= 0; i-- ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n/**\n* Generates a stride array from an array shape (column-major).\n*\n* @private\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*/\nfunction columnmajor( shape, out ) {\n\tvar s;\n\tvar i;\n\n\ts = 1;\n\tfor ( i = 0; i < shape.length; i++ ) {\n\t\tout[ i ] = s;\n\t\ts *= shape[ i ];\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Generates a stride array from an array shape.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - specifies whether an array is row-major (C-style) or column-major (Fortran-style)\n* @param {(Array|TypedArray|Object)} out - output object\n* @returns {(Array|TypedArray|Object)} array strides\n*\n* @example\n* var strides = [ 0, 0 ];\n*\n* var out = shape2strides( [ 3, 2 ], 'row-major', strides );\n* // returns [ 2, 1 ]\n*\n* var bool = ( out === strides );\n* // returns true\n*\n* out = shape2strides( [ 3, 2 ], 'column-major', strides );\n* // returns [ 1, 3 ]\n*/\nfunction shape2strides( shape, order, out ) {\n\tif ( isColumnMajor( order ) ) {\n\t\treturn columnmajor( shape, out );\n\t}\n\treturn rowmajor( shape, out );\n}\n\n\n// EXPORTS //\n\nexport default shape2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport shape2strides from '@stdlib/ndarray-base-shape2strides';\nimport copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\n\n\n// MAIN //\n\n/**\n* Returns the strides of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `strides` property\n* @returns {IntegerArray} strides\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = strides( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 9, 3, 1 ]\n*/\nfunction strides( x, copy ) {\n\tvar ord;\n\tvar sh;\n\tvar st;\n\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\tsh = x.shape;\n\t\tif ( sh.length === 0 ) {\n\t\t\treturn [ 0 ];\n\t\t}\n\t\tord = x.order;\n\t\tif ( !isString( ord ) ) {\n\t\t\tord = ROW_MAJOR;\n\t\t}\n\t\treturn shape2strides( sh, ord );\n\t}\n\tif ( copy ) {\n\t\treturn copyIndexed( st );\n\t}\n\treturn st;\n}\n\n\n// EXPORTS //\n\nexport default strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Computes the absolute value of a double-precision floating-point number `x`.\n*\n* @param {number} x - input value\n* @returns {number} absolute value\n*\n* @example\n* var v = abs( -1.0 );\n* // returns 1.0\n*\n* @example\n* var v = abs( 2.0 );\n* // returns 2.0\n*\n* @example\n* var v = abs( 0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( -0.0 );\n* // returns 0.0\n*\n* @example\n* var v = abs( NaN );\n* // returns NaN\n*/\nfunction abs( x ) {\n\treturn Math.abs( x ); // eslint-disable-line stdlib/no-builtin-math\n}\n\n\n// EXPORTS //\n\nexport default abs;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport strides2order from '@stdlib/ndarray-base-strides2order';\n\n\n// VARIABLES //\n\nvar ROW_MAJOR = 'row-major';\nvar COLUMN_MAJOR = 'column-major';\n\n\n// MAIN //\n\n/**\n* Returns the layout order of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {(string|null)} layout order\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'order': 'row-major'\n* });\n*\n* var out = order( x );\n* // returns 'row-major'\n*/\nfunction order( x ) {\n\tvar st;\n\tvar o;\n\n\to = x.order;\n\tif ( isString( o ) ) {\n\t\treturn o;\n\t}\n\t// Try to infer the layout order from the strides array...\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn ROW_MAJOR; // WARNING: default to row-major for ndarray-like objects lacking strides. This may or may not be accurate, and we're defaulting to row-major here based on the belief that row-major is more likely given that, e.g., JavaScript arrays are similar to C arrays (i.e., stored in row-major order).\n\t}\n\to = strides2order( st );\n\tif ( o === 1 || o === 3 ) {\n\t\treturn ROW_MAJOR; // for o == 3 (both row- and column-major; e.g., one-dimensional ndarrays), default to row-major\n\t}\n\tif ( o === 2 ) {\n\t\treturn COLUMN_MAJOR;\n\t}\n\t// o === 0\n\tif ( x.shape.length === 0 ) {\n\t\treturn ROW_MAJOR; // default to row-major for zero-dimensional ndarrays\n\t}\n\t// Case: mixed strides (e.g., [ 2, 3, 1 ] )\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default order;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport abs from '@stdlib/math-base-special-abs';\n\n\n// MAIN //\n\n/**\n* Determines the order of a multidimensional array based on a provided stride array.\n*\n* @param {IntegerArray} strides - stride array\n* @returns {integer} order\n*\n* @example\n* var order = strides2order( [ 2, 1 ] );\n* // returns 1\n*\n* order = strides2order( [ 1, 2 ] );\n* // returns 2\n*\n* order = strides2order( [ 1, 1, 1 ] );\n* // returns 3\n*\n* order = strides2order( [ 2, 3, 1 ] );\n* // returns 0\n*/\nfunction strides2order( strides ) {\n\tvar column;\n\tvar ndims;\n\tvar row;\n\tvar s1;\n\tvar s2;\n\tvar i;\n\n\tndims = strides.length;\n\tif ( ndims === 0 ) {\n\t\treturn 0|0; // 'none'\n\t}\n\tcolumn = true;\n\trow = true;\n\n\ts1 = abs( strides[ 0 ] );\n\tfor ( i = 1; i < ndims; i++ ) {\n\t\ts2 = abs( strides[ i ] );\n\t\tif ( column && s2 < s1 ) {\n\t\t\tcolumn = false;\n\t\t} else if ( row && s2 > s1 ) {\n\t\t\trow = false;\n\t\t}\n\t\tif ( row || column ) {\n\t\t\ts1 = s2;\n\t\t} else {\n\t\t\treturn 0|0; // 'none'\n\t\t}\n\t}\n\tif ( row && column ) {\n\t\treturn 3|0; // 'both'\n\t}\n\tif ( row ) {\n\t\treturn 1|0; // 'row-major'\n\t}\n\treturn 2|0; // 'column-major'\n}\n\n\n// EXPORTS //\n\nexport default strides2order;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the underlying data buffer of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {Collection} underlying data buffer\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var out = data( x );\n* // returns \n*/\nfunction data( x ) {\n\treturn x.data;\n}\n\n\n// EXPORTS //\n\nexport default data;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a positive integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a positive integer value\n*\n* @example\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isPositiveInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() > 0.0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a positive integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a positive integer\n*\n* @example\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isPositiveInteger( 0.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isPositiveInteger( null );\n* // returns false\n*/\nfunction isPositiveInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a positive integer.\n*\n* @module @stdlib/assert-is-positive-integer\n*\n* @example\n* import isPositiveInteger from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 5.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isPositiveInteger( -5.0 );\n* // returns false\n*\n* bool = isPositiveInteger( 3.14 );\n* // returns false\n*\n* bool = isPositiveInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns true\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\n*\n* var bool = isPositiveInteger( 3.0 );\n* // returns false\n*\n* bool = isPositiveInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar RE = /./;\n\n\n// EXPORTS //\n\nexport default RE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a boolean primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean primitive\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns false\n*/\nfunction isBoolean( value ) {\n\treturn ( typeof value === 'boolean' );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a boolean.\n*\n* @name Boolean\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {(boolean|Boolean)} boolean\n*\n* @example\n* var b = Boolean( null );\n* // returns false\n*\n* b = Boolean( [] );\n* // returns true\n*\n* b = Boolean( {} );\n* // returns true\n*\n* @example\n* var b = new Boolean( false );\n* // returns \n*/\nvar Bool = Boolean; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// eslint-disable-next-line stdlib/no-redeclare\nvar toString = Boolean.prototype.toString; // non-generic\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasToStringTag from '@stdlib/assert-has-tostringtag-support';\nimport nativeClass from '@stdlib/utils-native-class';\nimport Boolean from '@stdlib/boolean-ctor';\nimport test from './try2serialize.js';\n\n\n// VARIABLES //\n\nvar FLG = hasToStringTag();\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean object\n*\n* @example\n* var bool = isBoolean( true );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\tif ( typeof value === 'object' ) {\n\t\tif ( value instanceof Boolean ) {\n\t\t\treturn true;\n\t\t}\n\t\tif ( FLG ) {\n\t\t\treturn test( value );\n\t\t}\n\t\treturn ( nativeClass( value ) === '[object Boolean]' );\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport toString from './tostring.js'; // eslint-disable-line stdlib/no-redeclare\n\n\n// MAIN //\n\n/**\n* Attempts to serialize a value to a string.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value can be serialized\n*/\nfunction test( value ) {\n\ttry {\n\t\ttoString.call( value );\n\t\treturn true;\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a boolean.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a boolean\n*\n* @example\n* var bool = isBoolean( false );\n* // returns true\n*\n* @example\n* var bool = isBoolean( true );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n*\n* var bool = isBoolean( new Boolean( true ) );\n* // returns true\n*/\nfunction isBoolean( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a boolean.\n*\n* @module @stdlib/assert-is-boolean\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import isBoolean from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( false );\n* // returns true\n*\n* bool = isBoolean( new Boolean( true ) );\n* // returns false\n*\n* @example\n* import Boolean from '@stdlib/boolean-ctor';\n* import { isObject as isBoolean } from '@stdlib/assert-is-boolean';\n*\n* var bool = isBoolean( true );\n* // returns false\n*\n* bool = isBoolean( new Boolean( false ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof self === 'object' ) ? self : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof window === 'object' ) ? window : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof global === 'object' ) ? global : null;\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar obj = ( typeof globalThis === 'object' ) ? globalThis : null; // eslint-disable-line no-undef\n\n\n// EXPORTS //\n\nexport default obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport format from '@stdlib/string-format';\nimport getThis from './codegen.js';\nimport Self from './self.js';\nimport Win from './window.js';\nimport Global from './global.js';\nimport GlobalThis from './global_this.js';\n\n\n// MAIN //\n\n/**\n* Returns the global object.\n*\n* ## Notes\n*\n* - Using code generation is the **most** reliable way to resolve the global object; however, doing so is likely to violate content security policies (CSPs) in, e.g., Chrome Apps and elsewhere.\n*\n* @param {boolean} [codegen=false] - boolean indicating whether to use code generation to resolve the global object\n* @throws {TypeError} must provide a boolean\n* @throws {Error} unable to resolve global object\n* @returns {Object} global object\n*\n* @example\n* var g = getGlobal();\n* // returns {...}\n*/\nfunction getGlobal( codegen ) {\n\tif ( arguments.length ) {\n\t\tif ( !isBoolean( codegen ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a boolean. Value: `%s`.', codegen ) );\n\t\t}\n\t\tif ( codegen ) {\n\t\t\treturn getThis();\n\t\t}\n\t\t// Fall through...\n\t}\n\t// Case: 2020 revision of ECMAScript standard\n\tif ( GlobalThis ) {\n\t\treturn GlobalThis;\n\t}\n\t// Case: browsers and web workers\n\tif ( Self ) {\n\t\treturn Self;\n\t}\n\t// Case: browsers\n\tif ( Win ) {\n\t\treturn Win;\n\t}\n\t// Case: Node.js\n\tif ( Global ) {\n\t\treturn Global;\n\t}\n\t// Case: unknown\n\tthrow new Error( 'unexpected error. Unable to resolve global object.' );\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the global object using code generation.\n*\n* @private\n* @returns {Object} global object\n*/\nfunction getGlobal() {\n\treturn new Function( 'return this;' )(); // eslint-disable-line no-new-func, stdlib/require-globals\n}\n\n\n// EXPORTS //\n\nexport default getGlobal;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getGlobal from '@stdlib/utils-global';\n\n\n// MAIN //\n\nvar root = getGlobal();\nvar nodeList = root.document && root.document.childNodes;\n\n\n// EXPORTS //\n\nexport default nodeList;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar typedarray = Int8Array; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default typedarray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Determine a value's type.\n*\n* @module @stdlib/utils-type-of\n*\n* @example\n* import typeOf from '@stdlib/utils-type-of';\n*\n* var str = typeOf( 'a' );\n* // returns 'string'\n*\n* str = typeOf( 5 );\n* // returns 'number'\n*/\n\n// MODULES //\n\nimport usePolyfill from './check.js';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar main = ( usePolyfill() ) ? polyfill : builtin;\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport RE from './fixtures/re.js';\nimport nodeList from './fixtures/nodelist.js';\nimport typedarray from './fixtures/typedarray.js';\n\n\n// MAIN //\n\n/**\n* Checks whether a polyfill is needed when using the `typeof` operator.\n*\n* @private\n* @returns {boolean} boolean indicating whether a polyfill is needed\n*/\nfunction check() {\n\tif (\n\t\t// Chrome 1-12 returns 'function' for regular expression instances (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof):\n\t\ttypeof RE === 'function' ||\n\n\t\t// Safari 8 returns 'object' for typed array and weak map constructors (underscore #1929):\n\t\ttypeof typedarray === 'object' ||\n\n\t\t// PhantomJS 1.9 returns 'function' for `NodeList` instances (underscore #2236):\n\t\ttypeof nodeList === 'function'\n\t) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default check;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\treturn ctorName( v ).toLowerCase();\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\n\n\n// NOTES //\n\n/*\n* Built-in `typeof` operator behavior:\n*\n* ```text\n* typeof null => 'object'\n* typeof undefined => 'undefined'\n* typeof 'a' => 'string'\n* typeof 5 => 'number'\n* typeof NaN => 'number'\n* typeof true => 'boolean'\n* typeof false => 'boolean'\n* typeof {} => 'object'\n* typeof [] => 'object'\n* typeof function foo(){} => 'function'\n* typeof function* foo(){} => 'object'\n* typeof Symbol() => 'symbol'\n* ```\n*\n*/\n\n\n// MAIN //\n\n/**\n* Determines a value's type.\n*\n* @param {*} v - input value\n* @returns {string} string indicating the value's type\n*/\nfunction typeOf( v ) {\n\tvar type;\n\n\t// Address `typeof null` => `object` (see http://wiki.ecmascript.org/doku.php?id=harmony:typeof_null):\n\tif ( v === null ) {\n\t\treturn 'null';\n\t}\n\ttype = typeof v;\n\n\t// If the `typeof` operator returned something other than `object`, we are done. Otherwise, we need to check for an internal class name or search for a constructor.\n\tif ( type === 'object' ) {\n\t\treturn ctorName( v ).toLowerCase();\n\t}\n\treturn type;\n}\n\n\n// EXPORTS //\n\nexport default typeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport typeOf from '@stdlib/utils-type-of';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a function.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a function\n*\n* @example\n* function beep() {\n* return 'beep';\n* }\n*\n* var bool = isFunction( beep );\n* // returns true\n*/\nfunction isFunction( value ) {\n\t// Note: cannot use `typeof` directly, as various browser engines incorrectly return `'function'` when operating on non-function objects, such as regular expressions and NodeLists.\n\treturn ( typeOf( value ) === 'function' );\n}\n\n\n// EXPORTS //\n\nexport default isFunction;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport isFunction from '@stdlib/assert-is-function';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\n\n\n// MAIN //\n\n/**\n* Tests if a value is struct constructor-like.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is struct constructor-like\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema = [\n* {\n* 'name': 'foo',\n* 'type': 'float64'\n* }\n* ];\n* var Struct = structFactory( schema );\n*\n* var bool = isStructConstructorLike( Struct );\n* // returns true\n*\n* bool = isStructConstructorLike( [] );\n* // returns false\n*/\nfunction isStructConstructorLike( value ) {\n\treturn (\n\t\tisFunction( value ) &&\n\t\tisPositiveInteger( value.alignment ) &&\n\t\tisPositiveInteger( value.byteLength ) &&\n\t\tisFunction( value.byteLengthOf ) &&\n\t\tisFunction( value.byteOffsetOf ) &&\n\t\tisFunction( value.bufferOf ) &&\n\t\tisFunction( value.isStruct ) &&\n\t\tisFunction( value.viewOf ) &&\n\t\thasOwnProp( value, 'fields' ) &&\n\t\thasOwnProp( value, 'layout' )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isStructConstructorLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* ## Notes\n*\n* - In contrast to the built-in `Object.keys()`, this function returns an empty array if provided `undefined` or `null`, rather than throwing an error.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\treturn Object.keys( Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof Object.keys !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArguments from './main.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment returns the expected internal class of the `arguments` object.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment behaves as expected\n*\n* @example\n* var bool = detect();\n* // returns \n*/\nfunction detect() {\n\treturn isArguments( arguments );\n}\n\n\n// MAIN //\n\nbool = detect();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn ( nativeClass( value ) === '[object Arguments]' );\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is `NaN`.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 7.0 );\n* // returns false\n*/\nfunction isnan( x ) {\n\treturn ( x !== x );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a `NaN` number primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `NaN` number primitive\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isNumber } from '@stdlib/assert-is-number';\nimport isNan from '@stdlib/math-base-assert-is-nan';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a value of `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a value of `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns false\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*/\nfunction isnan( value ) {\n\treturn (\n\t\tisNumber( value ) &&\n\t\tisNan( value.valueOf() )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is `NaN`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is `NaN`\n*\n* @example\n* var bool = isnan( NaN );\n* // returns true\n*\n* @example\n* var bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* @example\n* var bool = isnan( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isnan( null );\n* // returns false\n*/\nfunction isnan( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isnan;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is `NaN`.\n*\n* @module @stdlib/assert-is-nan\n*\n* @example\n* import isnan from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns true\n*\n* bool = isnan( 3.14 );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns false\n*\n* @example\n* import { isObject as isnan } from '@stdlib/assert-is-nan';\n*\n* var bool = isnan( NaN );\n* // returns false\n*\n* bool = isnan( new Number( NaN ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @private\n* @name isEnumerableProperty\n* @type {Function}\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty.call( beep, 'hasOwnProperty' );\n* // returns false\n*/\nvar isEnumerableProperty = Object.prototype.propertyIsEnumerable;\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnum from './native.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Detects whether an environment has a bug where String indices are not detected as \"enumerable\" properties. Observed in Node v0.10.\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment has the bug\n*/\nfunction detect() {\n\treturn !isEnum.call( 'beep', '0' );\n}\n\n\n// MAIN //\n\nbool = detect();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isString from '@stdlib/assert-is-string';\nimport { isPrimitive as isnan } from '@stdlib/assert-is-nan';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isEnum from './native.js';\nimport hasStringEnumBug from './has_string_enumerability_bug.js';\n\n\n// MAIN //\n\n/**\n* Tests if an object's own property is enumerable.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object property is enumerable\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = isEnumerableProperty( beep, 'hasOwnProperty' );\n* // returns false\n*/\nfunction isEnumerableProperty( value, property ) {\n\tvar bool;\n\tif (\n\t\tvalue === void 0 ||\n\t\tvalue === null\n\t) {\n\t\treturn false;\n\t}\n\tbool = isEnum.call( value, property );\n\tif ( !bool && hasStringEnumBug && isString( value ) ) {\n\t\t// Note: we only check for indices, as properties attached to a `String` object are properly detected as enumerable above.\n\t\tproperty = +property;\n\t\treturn (\n\t\t\t!isnan( property ) &&\n\t\t\tisInteger( property ) &&\n\t\t\tproperty >= 0 &&\n\t\t\tproperty < value.length\n\t\t);\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default isEnumerableProperty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* @module @stdlib/constants-uint32-max\n* @type {uinteger32}\n*\n* @example\n* import UINT32_MAX from '@stdlib/constants-uint32-max';\n* // returns 4294967295\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar UINT32_MAX = 4294967295;\n\n\n// EXPORTS //\n\nexport default UINT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an `arguments` object.\n*\n* @module @stdlib/assert-is-arguments\n*\n* @example\n* import isArguments from '@stdlib/assert-is-arguments';\n*\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* bool = isArguments( [] );\n* // returns false\n*/\n\n// MODULES //\n\nimport hasArgumentsClass from './detect.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar isArguments;\nif ( hasArgumentsClass ) {\n\tisArguments = main;\n} else {\n\tisArguments = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport isArray from '@stdlib/assert-is-array';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-uint32-max';\n\n\n// MAIN //\n\n/**\n* Tests whether a value is an `arguments` object.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an `arguments` object\n*\n* @example\n* function foo() {\n* return arguments;\n* }\n*\n* var bool = isArguments( foo() );\n* // returns true\n*\n* @example\n* var bool = isArguments( [] );\n* // returns false\n*/\nfunction isArguments( value ) {\n\treturn (\n\t\tvalue !== null &&\n\t\ttypeof value === 'object' &&\n\t\t!isArray( value ) &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH &&\n\t\thasOwnProp( value, 'callee' ) &&\n\t\t!isEnumerableProperty( value, 'callee' )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArguments;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArguments from '@stdlib/assert-is-arguments';\nimport builtin from './builtin.js';\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tif ( isArguments( value ) ) {\n\t\treturn builtin( slice.call( value ) );\n\t}\n\treturn builtin( value );\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\nimport noop from '@stdlib/utils-noop';\n\n\n// MAIN //\n\n// Note: certain environments treat an object's prototype as enumerable, which, as a matter of convention, it shouldn't be...\nvar bool = isEnumerableProperty( noop, 'prototype' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* No operation.\n*\n* @example\n* noop();\n* // ...does nothing.\n*/\nfunction noop() {\n\t// Empty function...\n}\n\n\n// EXPORTS //\n\nexport default noop;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isEnumerableProperty from '@stdlib/assert-is-enumerable-property';\n\n\n// VARIABLES //\n\nvar obj = {\n\t'toString': null\n};\n\n\n// MAIN //\n\n// Note: certain environments don't allow enumeration of overwritten properties which are considered non-enumerable...\nvar bool = !isEnumerableProperty( obj, 'toString' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a typed array.\n*\n* @module @stdlib/constants-array-max-typed-array-length\n*\n* @example\n* import MAX_TYPED_ARRAY_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n* // returns 9007199254740991\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a typed array.\n*\n* ```tex\n* 2^{53} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 9007199254740991\n*/\nvar MAX_TYPED_ARRAY_LENGTH = 9007199254740991;\n\n\n// EXPORTS //\n\nexport default MAX_TYPED_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-typed-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a collection.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a collection\n*\n* @example\n* var bool = isCollection( [] );\n* // returns true\n*\n* @example\n* var bool = isCollection( {} );\n* // returns false\n*/\nfunction isCollection( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isCollection;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isnan from '@stdlib/assert-is-nan';\nimport isCollection from '@stdlib/assert-is-collection';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @param {ArrayLike} arr - array-like object\n* @param {*} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (if negative, the start index is determined relative to last element)\n* @throws {TypeError} must provide an array-like object\n* @throws {TypeError} third argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 3 );\n* // returns 1\n*\n* @example\n* var arr = [ 4, 3, 2, 1 ];\n* var idx = indexOf( arr, 5 );\n* // returns -1\n*\n* @example\n* // Using a `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, 3 );\n* // returns 5\n*\n* @example\n* // `fromIndex` which exceeds `array` length:\n* var arr = [ 1, 2, 3, 4, 2, 5 ];\n* var idx = indexOf( arr, 2, 10 );\n* // returns -1\n*\n* @example\n* // Negative `fromIndex`:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6, 2 ];\n* var idx = indexOf( arr, 2, -4 );\n* // returns 5\n*\n* idx = indexOf( arr, 2, -1 );\n* // returns 7\n*\n* @example\n* // Negative `fromIndex` exceeding input `array` length:\n* var arr = [ 1, 2, 3, 4, 5, 2, 6 ];\n* var idx = indexOf( arr, 2, -10 );\n* // returns 1\n*\n* @example\n* // Array-like objects:\n* var str = 'bebop';\n* var idx = indexOf( str, 'o' );\n* // returns 3\n*/\nfunction indexOf( arr, searchElement, fromIndex ) {\n\tvar len;\n\tvar i;\n\tif ( !isCollection( arr ) && !isString( arr ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', arr ) );\n\t}\n\tlen = arr.length;\n\tif ( len === 0 ) {\n\t\treturn -1;\n\t}\n\tif ( arguments.length === 3 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= 0 ) {\n\t\t\tif ( fromIndex >= len ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti = fromIndex;\n\t\t} else {\n\t\t\ti = len + fromIndex;\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\ti = 0;\n\t}\n\t// Check for `NaN`...\n\tif ( isnan( searchElement ) ) {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( isnan( arr[i] ) ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( arr[ i ] === searchElement ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// EXPORTS //\n\nexport default indexOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests whether a value equals the prototype of its constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction isConstructorPrototype( value ) {\n\treturn ( value.constructor && value.constructor.prototype === value );\n}\n\n\n// EXPORTS //\n\nexport default isConstructorPrototype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar w = ( typeof window === 'undefined' ) ? void 0 : window;\n\n\n// EXPORTS //\n\nexport default w;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport indexOf from '@stdlib/utils-index-of';\nimport typeOf from '@stdlib/utils-type-of';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport EXCLUDED_KEYS from './excluded_keys.json';\nimport win from './window.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Determines whether an environment throws when comparing to the prototype of a value's constructor (e.g., [IE9][1]).\n*\n* [1]: https://stackoverflow.com/questions/7688070/why-is-comparing-the-constructor-property-of-two-windows-unreliable\n*\n* @private\n* @returns {boolean} boolean indicating whether an environment is buggy\n*/\nfunction check() {\n\tvar k;\n\tif ( typeOf( win ) === 'undefined' ) {\n\t\treturn false;\n\t}\n\tfor ( k in win ) { // eslint-disable-line guard-for-in\n\t\ttry {\n\t\t\tif (\n\t\t\t\tindexOf( EXCLUDED_KEYS, k ) === -1 &&\n\t\t\t\thasOwnProp( win, k ) &&\n\t\t\t\twin[ k ] !== null &&\n\t\t\t\ttypeOf( win[ k ] ) === 'object'\n\t\t\t) {\n\t\t\t\tisConstructorPrototype( win[ k ] );\n\t\t\t}\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// MAIN //\n\nbool = check();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar bool = ( typeof window !== 'undefined' );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasArgumentsBug from './has_arguments_bug.js';\nimport HAS_BUILTIN from './has_builtin.js';\nimport builtin from './builtin.js';\nimport wrapper from './builtin_wrapper.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @name keys\n* @type {Function}\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nvar keys;\nif ( HAS_BUILTIN ) {\n\tif ( hasArgumentsBug() ) {\n\t\tkeys = wrapper;\n\t} else {\n\t\tkeys = builtin;\n\t}\n} else {\n\tkeys = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport keys from './builtin.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests the built-in `Object.keys()` implementation when provided `arguments`.\n*\n* @private\n* @returns {boolean} boolean indicating whether the built-in implementation returns the expected number of keys\n*/\nfunction test() {\n\treturn ( keys( arguments ) || '' ).length !== 2;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether the built-in `Object.keys()` implementation supports providing `arguments` as an input value.\n*\n* ## Notes\n*\n* - Safari 5.0 does **not** support `arguments` as an input value.\n*\n* @private\n* @returns {boolean} boolean indicating whether a built-in implementation supports `arguments`\n*/\nfunction check() {\n\treturn test( 1, 2 );\n}\n\n\n// EXPORTS //\n\nexport default check;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObjectLike from '@stdlib/assert-is-object-like';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport isArguments from '@stdlib/assert-is-arguments';\nimport HAS_ENUM_PROTO_BUG from './has_enumerable_prototype_bug.js';\nimport HAS_NON_ENUM_PROPS_BUG from './has_non_enumerable_properties_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype_wrapper.js';\nimport NON_ENUMERABLE from './non_enumerable.json';\n\n\n// MAIN //\n\n/**\n* Returns an array of an object's own enumerable property names.\n*\n* @private\n* @param {*} value - input object\n* @returns {Array} a list of own enumerable property names\n*\n* @example\n* var obj = {\n* 'beep': 'boop',\n* 'foo': 3.14\n* };\n*\n* var k = keys( obj );\n* // e.g., returns [ 'beep', 'foo' ]\n*/\nfunction keys( value ) {\n\tvar skipConstructor;\n\tvar skipPrototype;\n\tvar isFcn;\n\tvar out;\n\tvar k;\n\tvar p;\n\tvar i;\n\n\tout = [];\n\tif ( isArguments( value ) ) {\n\t\t// Account for environments which treat `arguments` differently...\n\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\tout.push( i.toString() );\n\t\t}\n\t\t// Note: yes, we are precluding the `arguments` array-like object from having other enumerable properties; however, this should (1) be very rare and (2) not be encouraged (e.g., doing something like `arguments.a = 'b'`; in certain engines directly manipulating the `arguments` value results in automatic de-optimization).\n\t\treturn out;\n\t}\n\tif ( typeof value === 'string' ) {\n\t\t// Account for environments which do not treat string character indices as \"own\" properties...\n\t\tif ( value.length > 0 && !hasOwnProp( value, '0' ) ) {\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\tout.push( i.toString() );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tisFcn = ( typeof value === 'function' );\n\t\tif ( isFcn === false && !isObjectLike( value ) ) {\n\t\t\treturn out;\n\t\t}\n\t\tskipPrototype = ( HAS_ENUM_PROTO_BUG && isFcn );\n\t}\n\tfor ( k in value ) {\n\t\tif ( !( skipPrototype && k === 'prototype' ) && hasOwnProp( value, k ) ) {\n\t\t\tout.push( String( k ) );\n\t\t}\n\t}\n\tif ( HAS_NON_ENUM_PROPS_BUG ) {\n\t\tskipConstructor = isConstructorPrototype( value );\n\t\tfor ( i = 0; i < NON_ENUMERABLE.length; i++ ) {\n\t\t\tp = NON_ENUMERABLE[ i ];\n\t\t\tif ( !( skipConstructor && p === 'constructor' ) && hasOwnProp( value, p ) ) {\n\t\t\t\tout.push( String( p ) );\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default keys;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasAutomationEqualityBug from './has_automation_equality_bug.js';\nimport isConstructorPrototype from './is_constructor_prototype.js';\nimport HAS_WINDOW from './has_window.js';\n\n\n// MAIN //\n\n/**\n* Wraps the test for constructor prototype equality to accommodate buggy environments (e.g., environments which throw when testing equality).\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value equals the prototype of its constructor\n*/\nfunction wrapper( value ) {\n\tif ( HAS_WINDOW === false && !hasAutomationEqualityBug ) {\n\t\treturn isConstructorPrototype( value );\n\t}\n\ttry {\n\t\treturn isConstructorPrototype( value );\n\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrapper;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArray from '@stdlib/assert-is-array';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an object; e.g., `{}`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an object\n*\n* @example\n* var bool = isObject( {} );\n* // returns true\n*\n* @example\n* var bool = isObject( null );\n* // returns false\n*/\nfunction isObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t!isArray( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object.\n*\n* @name Object\n* @constructor\n* @type {Function}\n* @param {*} value - input value\n* @returns {Object} object\n*\n* @example\n* var o = new Object( null );\n* // returns {}\n*\n* @example\n* var o = new Object( 5.0 );\n* // returns \n*\n* @example\n* var o = new Object( 'beep' );\n* // returns \n*\n* @example\n* var o1 = {};\n*\n* var o2 = new Object( o1 );\n* // returns {}\n*\n* var bool = ( o1 === o2 );\n* // returns true\n*/\nvar Obj = Object; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default Obj;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport builtin from './native.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar getProto;\nif ( isFunction( Object.getPrototypeOf ) ) {\n\tgetProto = builtin;\n} else {\n\tgetProto = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar getProto = Object.getPrototypeOf;\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\nimport Object from '@stdlib/object-ctor';\nimport getProto from './proto.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {(Object|null)} prototype\n*/\nfunction getPrototypeOf( obj ) {\n\tvar proto = getProto( obj );\n\tif ( proto || proto === null ) {\n\t\treturn proto;\n\t}\n\tif ( nativeClass( obj.constructor ) === '[object Function]' ) {\n\t\t// May break if the constructor has been tampered with...\n\t\treturn obj.constructor.prototype;\n\t}\n\tif ( obj instanceof Object ) {\n\t\treturn Object.prototype;\n\t}\n\t// Return `null` for objects created via `Object.create( null )`. Also return `null` for cross-realm objects on browsers that lack `__proto__` support, such as IE < 11.\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the value of the `__proto__` property.\n*\n* @private\n* @param {Object} obj - input object\n* @returns {*} value of `__proto__` property\n*/\nfunction getProto( obj ) {\n\t// eslint-disable-next-line no-proto\n\treturn obj.__proto__;\n}\n\n\n// EXPORTS //\n\nexport default getProto;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Object from '@stdlib/object-ctor';\nimport getProto from './detect.js';\n\n\n// MAIN //\n\n/**\n* Returns the prototype of a provided object.\n*\n* @param {*} value - input value\n* @returns {(Object|null)} prototype\n*\n* @example\n* var proto = getPrototypeOf( {} );\n* // returns {}\n*/\nfunction getPrototypeOf( value ) {\n\tif (\n\t\tvalue === null ||\n\t\tvalue === void 0\n\t) {\n\t\treturn null;\n\t}\n\t// In order to ensure consistent ES5/ES6 behavior, cast input value to an object (strings, numbers, booleans); ES5 `Object.getPrototypeOf` throws when provided primitives and ES6 `Object.getPrototypeOf` casts:\n\tvalue = Object( value );\n\n\treturn getProto( value );\n}\n\n\n// EXPORTS //\n\nexport default getPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar objectPrototype = Object.prototype;\n\n\n// FUNCTIONS //\n\n/**\n* Tests that an object only has own properties.\n*\n* @private\n* @param {Object} obj - value to test\n* @returns {boolean} boolean indicating if an object only has own properties\n*/\nfunction ownProps( obj ) {\n\tvar key;\n\n\t// NOTE: possibility of perf boost if key enumeration order is known (see http://stackoverflow.com/questions/18531624/isplainobject-thing).\n\tfor ( key in obj ) {\n\t\tif ( !hasOwnProp( obj, key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// MAIN //\n\n/**\n* Tests if a value is a plain object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a plain object\n*\n* @example\n* var bool = isPlainObject( {} );\n* // returns true\n*\n* @example\n* var bool = isPlainObject( null );\n* // returns false\n*/\nfunction isPlainObject( value ) {\n\tvar proto;\n\n\t// Screen for obvious non-objects...\n\tif ( !isObject( value ) ) {\n\t\treturn false;\n\t}\n\t// Objects with no prototype (e.g., `Object.create( null )`) are plain...\n\tproto = getPrototypeOf( value );\n\tif ( !proto ) {\n\t\treturn true;\n\t}\n\t// Objects having a prototype are plain if and only if they are constructed with a global `Object` function and the prototype points to the prototype of a plain object...\n\treturn (\n\t\t// Cannot have own `constructor` property:\n\t\t!hasOwnProp( value, 'constructor' ) &&\n\n\t\t// Prototype `constructor` property must be a function (see also https://bugs.jquery.com/ticket/9897 and http://stackoverflow.com/questions/18531624/isplainobject-thing):\n\t\thasOwnProp( proto, 'constructor' ) &&\n\t\tisFunction( proto.constructor ) &&\n\t\tnativeClass( proto.constructor ) === '[object Function]' &&\n\n\t\t// Test for object-specific method:\n\t\thasOwnProp( proto, 'isPrototypeOf' ) &&\n\t\tisFunction( proto.isPrototypeOf ) &&\n\n\t\t(\n\t\t\t// Test if the prototype matches the global `Object` prototype (same realm):\n\t\t\tproto === objectPrototype ||\n\n\t\t\t// Test that all properties are own properties (cross-realm; *most* likely a plain object):\n\t\t\townProps( value )\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isPlainObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport objectInverse from '@stdlib/object-inverse';\nimport dtypeEnums from '@stdlib/ndarray-base-dtype-enums';\n\n\n// VARIABLES //\n\nvar hash = objectInverse( dtypeEnums(), {\n\t'duplicates': false\n});\n\n\n// MAIN //\n\n/**\n* Returns the data type string associated with an ndarray data type enumeration constant.\n*\n* @param {integer} dtype - data type enumeration constant\n* @returns {(string|null)} data type string or null\n*\n* @example\n* import str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n*\n* var v = str2enum( 'float64' );\n* // returns \n*\n* var dt = enum2str( v );\n* // returns 'float64'\n*/\nfunction enum2str( dtype ) {\n\tvar v = hash[ dtype ];\n\treturn ( isString( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain\n}\n\n\n// EXPORTS //\n\nexport default enum2str;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport isArray from '@stdlib/assert-is-array';\nimport isObject from '@stdlib/assert-is-plain-object';\nimport isObjectLike from '@stdlib/assert-is-object-like';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Inverts an object, such that keys become values and values become keys.\n*\n* @param {ObjectLike} obj - input object\n* @param {Options} [opts] - function options\n* @param {boolean} [opts.duplicates=true] - boolean indicating whether to store duplicate keys\n* @throws {TypeError} first argument must be object-like\n* @throws {TypeError} second argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Object} inverted object\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'boop'\n* });\n* // returns { 'beep': 'a', 'boop': 'b' }\n*\n* @example\n* var out = invert({\n* 'a': 'beep',\n* 'b': 'beep'\n* });\n* // returns { 'beep': [ 'a', 'b' ] }\n*\n* @example\n* var obj = {};\n* obj.a = 'beep';\n* obj.b = 'boop';\n* obj.c = 'beep'; // inserted after `a`\n*\n* var out = invert( obj, {\n* 'duplicates': false\n* });\n* // returns { 'beep': 'c', 'boop': 'b' }\n*/\nfunction invert( obj, opts ) {\n\tvar allowDupes = true;\n\tvar keys;\n\tvar len;\n\tvar key;\n\tvar val;\n\tvar out;\n\tvar v;\n\tvar i;\n\tif ( !isObjectLike( obj ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object (except null). Value: `%s`.', obj ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'duplicates' ) ) {\n\t\t\tallowDupes = opts.duplicates;\n\t\t\tif ( !isBoolean( allowDupes ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'duplicates', allowDupes ) );\n\t\t\t}\n\t\t}\n\t}\n\tkeys = objectKeys( obj );\n\tlen = keys.length;\n\tout = {};\n\tif ( allowDupes ) {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tval = obj[ key ];\n\t\t\tif ( !hasOwnProp( out, val ) ) {\n\t\t\t\tout[ val ] = key;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tv = out[ val ];\n\t\t\tif ( isArray( v ) ) {\n\t\t\t\tout[ val ].push( key );\n\t\t\t} else {\n\t\t\t\tout[ val ] = [ v, key ];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tkey = keys[ i ];\n\t\t\tout[ obj[ key ] ] = key;\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default invert;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable stdlib/empty-line-before-comment */\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping supported data type strings to enumeration constants.\n*\n* ## Notes\n*\n* - Downstream consumers of this mapping should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the object should be used in an opaque manner.\n* - The main purpose of this function is JavaScript and C inter-operation of ndarray objects.\n*\n* @returns {Object} object mapping supported data type strings to enumeration constants\n*\n* @example\n* var table = dtypeEnums();\n* // returns {...}\n*/\nfunction dtypeEnums() {\n\t// NOTE: the following should match the C enumeration in `@stdlib/ndarray/dtypes`!!!!\n\treturn {\n\t\t// Boolean data types:\n\t\t'bool': 0,\n\n\t\t// Integer data types:\n\t\t'int8': 1,\n\t\t'uint8': 2,\n\t\t'uint8c': 3,\n\t\t'int16': 4,\n\t\t'uint16': 5,\n\t\t'int32': 6,\n\t\t'uint32': 7,\n\t\t'int64': 8,\n\t\t'uint64': 9,\n\t\t// 'int128': 10, // uncomment once supported\n\t\t// 'uint128': 11,\n\t\t// 'int256': 12,\n\t\t// 'uint256': 13,\n\n\t\t// Floating-point data types:\n\t\t'float16': 10,\n\t\t// 'bfloat16': 15,\n\t\t'float32': 11,\n\t\t'float64': 12,\n\t\t// 'float128': 18, // uncomment once supported\n\n\t\t// Complex floating-point number data types:\n\t\t'complex32': 13,\n\t\t'complex64': 14,\n\t\t'complex128': 15,\n\n\t\t// Data type for \"binary\" data (i.e., data stored in a Node.js `Buffer` object):\n\t\t'binary': 16,\n\n\t\t// Data type for \"generic\" JavaScript values (objects):\n\t\t'generic': 17,\n\n\t\t// Define a signaling value which is guaranteed not to be a valid type enumeration value:\n\t\t'notype': 18,\n\n\t\t// Indicate the start of user defined type numbers (leaving room for type growth above):\n\t\t'userdefined_type': 256\n\t};\n}\n\n\n// EXPORTS //\n\nexport default dtypeEnums;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport dtypeEnums from '@stdlib/ndarray-base-dtype-enums';\n\n\n// VARIABLES //\n\nvar ENUM = dtypeEnums();\n\n\n// MAIN //\n\n/**\n* Returns the enumeration constant associated with an ndarray data type string.\n*\n* ## Notes\n*\n* - Downstream consumers of this function should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the function should be used in an opaque manner.\n*\n* @param {string} dtype - data type string\n* @returns {(integer|null)} integer value or null\n*\n* @example\n* var v = str2enum( 'int8' );\n* // returns \n*/\nfunction str2enum( dtype ) {\n\tvar v = ENUM[ dtype ];\n\treturn ( isNumber( v ) ) ? v : null; // note: we include this guard to prevent walking the prototype chain\n}\n\n\n// EXPORTS //\n\nexport default str2enum;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n\n\n// MAIN //\n\n/**\n* Returns the data type string associated with a supported ndarray data type value.\n*\n* @param {*} dtype - data type value\n* @returns {(string|null)} data type string or null\n*\n* @example\n* import str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n*\n* var v = resolve( str2enum( 'float64' ) );\n* // returns 'float64'\n*/\nfunction resolve( dtype ) {\n\tvar t = ( typeof dtype );\n\tif ( t === 'string' ) {\n\t\treturn ( str2enum( dtype ) === null ) ? null : dtype;\n\t}\n\tif ( t === 'number' ) {\n\t\treturn enum2str( dtype );\n\t}\n\tif ( t === 'object' && dtype ) {\n\t\treturn String( dtype );\n\t}\n\tif ( isStructConstructorLike( dtype ) ) {\n\t\treturn dtype.layout;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default resolve;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Tests if an object has a specified property, either own or inherited.\n*\n* @param {*} value - value to test\n* @param {*} property - property to test\n* @returns {boolean} boolean indicating if an object has a specified property\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasProp( beep, 'boop' );\n* // returns true\n*\n* @example\n* var beep = {\n* 'boop': true\n* };\n*\n* var bool = hasProp( beep, 'bap' );\n* // returns false\n*/\nfunction hasProp( value, property ) {\n\tif ( value === void 0 || value === null ) {\n\t\treturn false;\n\t}\n\tif ( typeof property === 'symbol' ) {\n\t\treturn property in Object( value );\n\t}\n\treturn ( String( property ) in Object( value ) );\n}\n\n\n// EXPORTS //\n\nexport default hasProp;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar TYPE = 'function';\n\n\n// MAIN //\n\n/**\n* Tests if an array-like object supports the accessor (get/set) protocol.\n*\n* @param {Object} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn ( typeof value.get === TYPE && typeof value.set === TYPE ); // eslint-disable-line valid-typeof\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'complex128': getComplex128,\n\t'complex64': getComplex64,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex128( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex128( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getComplex64( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getComplex64( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n/**\n* Returns an element from an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr.get( idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 1 );\n* // returns [ 3.0, 4.0 ]\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar GETTERS = {\n\t'float64': getFloat64,\n\t'float32': getFloat32,\n\t'int32': getInt32,\n\t'int16': getInt16,\n\t'int8': getInt8,\n\t'uint32': getUint32,\n\t'uint16': getUint16,\n\t'uint8': getUint8,\n\t'uint8c': getUint8c,\n\t'generic': getGeneric,\n\t'default': getArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Returns an element from a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat64( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat64( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getFloat32( arr, 2 );\n* // returns 3.0\n*/\nfunction getFloat32( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt32( arr, 2 );\n* // returns 3\n*/\nfunction getInt32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt16( arr, 2 );\n* // returns 3\n*/\nfunction getInt16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getInt8( arr, 2 );\n* // returns 3\n*/\nfunction getInt8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint32( arr, 2 );\n* // returns 3\n*/\nfunction getUint32( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint16( arr, 2 );\n* // returns 3\n*/\nfunction getUint16( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8( arr, 2 );\n* // returns 3\n*/\nfunction getUint8( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {number} element value\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( [ 1, 2, 3, 4 ] );\n*\n* var v = getUint8c( arr, 2 );\n* // returns 3\n*/\nfunction getUint8c( arr, idx ) { // eslint-disable-line stdlib/jsdoc-doctest-decimal-point\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getGeneric( arr, 2 );\n* // returns 3\n*/\nfunction getGeneric( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n/**\n* Returns an element from an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @returns {*} element value\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var v = getArrayLike( arr, 2 );\n* // returns 3\n*/\nfunction getArrayLike( arr, idx ) {\n\treturn arr[ idx ];\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = getter( dtype( arr ) );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction getter( dtype ) {\n\tvar f = GETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn GETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from array constructors to data types...\nvar ctor2dtypes = {\n\t'Float32Array': 'float32',\n\t'Float64Array': 'float64',\n\t'Array': 'generic',\n\t'Int16Array': 'int16',\n\t'Int32Array': 'int32',\n\t'Int8Array': 'int8',\n\t'Uint16Array': 'uint16',\n\t'Uint32Array': 'uint32',\n\t'Uint8Array': 'uint8',\n\t'Uint8ClampedArray': 'uint8c',\n\t'Complex64Array': 'complex64',\n\t'Complex128Array': 'complex128',\n\t'BooleanArray': 'bool'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasFloat64Array = ( typeof Float64Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float64Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float64Array\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var bool = isFloat64Array( new Float64Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat64Array( [] );\n* // returns false\n*/\nfunction isFloat64Array( value ) {\n\treturn (\n\t\t( hasFloat64Array && value instanceof Float64Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float64Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float64Array === 'function' ) ? Float64Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat64Array from '@stdlib/assert-is-float64array';\nimport GlobalFloat64Array from './float64array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float64Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float64Array` support\n*\n* @example\n* var bool = hasFloat64ArraySupport();\n* // returns \n*/\nfunction hasFloat64ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat64Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat64Array( [ 1.0, 3.14, -3.14, NaN ] );\n\t\tbool = (\n\t\t\tisFloat64Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.14 &&\n\t\t\tarr[ 2 ] === -3.14 &&\n\t\t\tarr[ 3 ] !== arr[ 3 ]\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat64ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float64Array === 'function' ) ? Float64Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float64\n*\n* @example\n* import ctor from '@stdlib/array-float64';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat64ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of double-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasFloat32Array = ( typeof Float32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Float32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Float32Array\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var bool = isFloat32Array( new Float32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isFloat32Array( [] );\n* // returns false\n*/\nfunction isFloat32Array( value ) {\n\treturn (\n\t\t( hasFloat32Array && value instanceof Float32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Float32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isFloat32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Float32Array === 'function' ) ? Float32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Float32Array === 'function' ) ? Float32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of single-precision floating-point numbers in the platform byte order.\n*\n* @module @stdlib/array-float32\n*\n* @example\n* import ctor from '@stdlib/array-float32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasFloat32ArraySupport from '@stdlib/assert-has-float32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasFloat32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFloat32Array from '@stdlib/assert-is-float32array';\nimport PINF from '@stdlib/constants-float64-pinf';\nimport GlobalFloat32Array from './float32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Float32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Float32Array` support\n*\n* @example\n* var bool = hasFloat32ArraySupport();\n* // returns \n*/\nfunction hasFloat32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalFloat32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalFloat32Array( [ 1.0, 3.14, -3.14, 5.0e40 ] );\n\t\tbool = (\n\t\t\tisFloat32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1.0 &&\n\t\t\tarr[ 1 ] === 3.140000104904175 &&\n\t\t\tarr[ 2 ] === -3.140000104904175 &&\n\t\t\tarr[ 3 ] === PINF\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasFloat32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of single-precision floating-point numbers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint32Array = ( typeof Uint32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint32Array\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var bool = isUint32Array( new Uint32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint32Array( [] );\n* // returns false\n*/\nfunction isUint32Array( value ) {\n\treturn (\n\t\t( hasUint32Array && value instanceof Uint32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint32Array === 'function' ) ? Uint32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint32Array === 'function' ) ? Uint32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 32-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint32\n*\n* @example\n* import ctor from '@stdlib/array-uint32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint32ArraySupport from '@stdlib/assert-has-uint32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint32Array from '@stdlib/assert-is-uint32array';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\nimport GlobalUint32Array from './uint32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint32Array` support\n*\n* @example\n* var bool = hasUint32ArraySupport();\n* // returns \n*/\nfunction hasUint32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT32_MAX+1, UINT32_MAX+2 ];\n\t\tarr = new GlobalUint32Array( arr );\n\t\tbool = (\n\t\t\tisUint32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT32_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 32-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt32Array = ( typeof Int32Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int32Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int32Array\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var bool = isInt32Array( new Int32Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt32Array( [] );\n* // returns false\n*/\nfunction isInt32Array( value ) {\n\treturn (\n\t\t( hasInt32Array && value instanceof Int32Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int32Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt32Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 32-bit integer.\n*\n* @module @stdlib/constants-int32-max\n* @type {integer32}\n*\n* @example\n* import INT32_MAX from '@stdlib/constants-int32-max';\n* // returns 2147483647\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{31} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111111111111111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 2147483647\n*/\nvar INT32_MAX = 2147483647|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 32-bit integer.\n*\n* @module @stdlib/constants-int32-min\n* @type {integer32}\n*\n* @example\n* import INT32_MIN from '@stdlib/constants-int32-min';\n* // returns -2147483648\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 32-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{31})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000000000000000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -2147483648\n*/\nvar INT32_MIN = -2147483648|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT32_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int32Array === 'function' ) ? Int32Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int32Array === 'function' ) ? Int32Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int32\n*\n* @example\n* import ctor from '@stdlib/array-int32';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt32ArraySupport from '@stdlib/assert-has-int32array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt32ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt32Array from '@stdlib/assert-is-int32array';\nimport INT32_MAX from '@stdlib/constants-int32-max';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport GlobalInt32Array from './int32array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int32Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int32Array` support\n*\n* @example\n* var bool = hasInt32ArraySupport();\n* // returns \n*/\nfunction hasInt32ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt32Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt32Array( [ 1, 3.14, -3.14, INT32_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt32Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT32_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt32ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 32-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint16Array = ( typeof Uint16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint16Array\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var bool = isUint16Array( new Uint16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint16Array( [] );\n* // returns false\n*/\nfunction isUint16Array( value ) {\n\treturn (\n\t\t( hasUint16Array && value instanceof Uint16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* @module @stdlib/constants-uint16-max\n* @type {integer32}\n*\n* @example\n* import UINT16_MAX from '@stdlib/constants-uint16-max';\n* // returns 65535\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{16} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 1111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 65535\n*/\nvar UINT16_MAX = 65535|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint16Array === 'function' ) ? Uint16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint16Array === 'function' ) ? Uint16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 16-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint16\n*\n* @example\n* import ctor from '@stdlib/array-uint16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint16ArraySupport from '@stdlib/assert-has-uint16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint16Array from '@stdlib/assert-is-uint16array';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport GlobalUint16Array from './uint16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint16Array` support\n*\n* @example\n* var bool = hasUint16ArraySupport();\n* // returns \n*/\nfunction hasUint16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT16_MAX+1, UINT16_MAX+2 ];\n\t\tarr = new GlobalUint16Array( arr );\n\t\tbool = (\n\t\t\tisUint16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT16_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 16-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt16Array = ( typeof Int16Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int16Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int16Array\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var bool = isInt16Array( new Int16Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt16Array( [] );\n* // returns false\n*/\nfunction isInt16Array( value ) {\n\treturn (\n\t\t( hasInt16Array && value instanceof Int16Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int16Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt16Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 16-bit integer.\n*\n* @module @stdlib/constants-int16-max\n* @type {integer32}\n*\n* @example\n* import INT16_MAX from '@stdlib/constants-int16-max';\n* // returns 32767\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{15} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0111111111111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 32767\n*/\nvar INT16_MAX = 32767|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 16-bit integer.\n*\n* @module @stdlib/constants-int16-min\n* @type {integer32}\n*\n* @example\n* import INT16_MIN from '@stdlib/constants-int16-min';\n* // returns -32768\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 16-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* -(2^{15})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 1000000000000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -32768\n*/\nvar INT16_MIN = -32768|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT16_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int16Array === 'function' ) ? Int16Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int16Array === 'function' ) ? Int16Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int16\n*\n* @example\n* import ctor from '@stdlib/array-int16';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt16ArraySupport from '@stdlib/assert-has-int16array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt16ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt16Array from '@stdlib/assert-is-int16array';\nimport INT16_MAX from '@stdlib/constants-int16-max';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport GlobalInt16Array from './int16array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int16Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int16Array` support\n*\n* @example\n* var bool = hasInt16ArraySupport();\n* // returns \n*/\nfunction hasInt16ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt16Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt16Array( [ 1, 3.14, -3.14, INT16_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt16Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT16_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt16ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 16-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint8Array = ( typeof Uint8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8Array\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var bool = isUint8Array( new Uint8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8Array( [] );\n* // returns false\n*/\nfunction isUint8Array( value ) {\n\treturn (\n\t\t( hasUint8Array && value instanceof Uint8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* @module @stdlib/constants-uint8-max\n* @type {integer32}\n*\n* @example\n* import UINT8_MAX from '@stdlib/constants-uint8-max';\n* // returns 255\n*/\n\n\n// MAIN //\n\n/**\n* Maximum unsigned 8-bit integer.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* 2^{8} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 11111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 255\n*/\nvar UINT8_MAX = 255|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default UINT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8Array === 'function' ) ? Uint8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8Array === 'function' ) ? Uint8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order.\n*\n* @module @stdlib/array-uint8\n*\n* @example\n* import ctor from '@stdlib/array-uint8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ArraySupport from '@stdlib/assert-has-uint8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8Array from '@stdlib/assert-is-uint8array';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport GlobalUint8Array from './uint8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8Array` support\n*\n* @example\n* var bool = hasUint8ArraySupport();\n* // returns \n*/\nfunction hasUint8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = [ 1, 3.14, -3.14, UINT8_MAX+1, UINT8_MAX+2 ];\n\t\tarr = new GlobalUint8Array( arr );\n\t\tbool = (\n\t\t\tisUint8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === UINT8_MAX-2 && // truncation and wrap around\n\t\t\tarr[ 3 ] === 0 && // wrap around\n\t\t\tarr[ 4 ] === 1 // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasUint8ClampedArray = ( typeof Uint8ClampedArray === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a Uint8ClampedArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a Uint8ClampedArray\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var bool = isUint8ClampedArray( new Uint8ClampedArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isUint8ClampedArray( [] );\n* // returns false\n*/\nfunction isUint8ClampedArray( value ) {\n\treturn (\n\t\t( hasUint8ClampedArray && value instanceof Uint8ClampedArray ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Uint8ClampedArray]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isUint8ClampedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Uint8ClampedArray === 'function' ) ? Uint8ClampedArray : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @module @stdlib/array-uint8c\n*\n* @example\n* import ctor from '@stdlib/array-uint8c';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasUint8ClampedArraySupport from '@stdlib/assert-has-uint8clampedarray-support'; // eslint-disable-line id-length\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasUint8ClampedArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUint8ClampedArray from '@stdlib/assert-is-uint8clampedarray';\nimport GlobalUint8ClampedArray from './uint8clampedarray.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Uint8ClampedArray` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Uint8ClampedArray` support\n*\n* @example\n* var bool = hasUint8ClampedArraySupport();\n* // returns \n*/\nfunction hasUint8ClampedArraySupport() { // eslint-disable-line id-length\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalUint8ClampedArray !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalUint8ClampedArray( [ -1, 0, 1, 3.14, 4.99, 255, 256 ] );\n\t\tbool = (\n\t\t\tisUint8ClampedArray( arr ) &&\n\t\t\tarr[ 0 ] === 0 && // clamped\n\t\t\tarr[ 1 ] === 0 &&\n\t\t\tarr[ 2 ] === 1 &&\n\t\t\tarr[ 3 ] === 3 && // round to nearest\n\t\t\tarr[ 4 ] === 5 && // round to nearest\n\t\t\tarr[ 5 ] === 255 &&\n\t\t\tarr[ 6 ] === 255 // clamped\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasUint8ClampedArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of 8-bit unsigned integers in the platform byte order clamped to 0-255.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasInt8Array = ( typeof Int8Array === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an Int8Array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an Int8Array\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var bool = isInt8Array( new Int8Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isInt8Array( [] );\n* // returns false\n*/\nfunction isInt8Array( value ) {\n\treturn (\n\t\t( hasInt8Array && value instanceof Int8Array ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object Int8Array]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isInt8Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum signed 8-bit integer.\n*\n* @module @stdlib/constants-int8-max\n* @type {integer32}\n*\n* @example\n* import INT8_MAX from '@stdlib/constants-int8-max';\n* // returns 127\n*/\n\n\n// MAIN //\n\n/**\n* Maximum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* 2^{7} - 1\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 01111111\n* ```\n*\n* @constant\n* @type {integer32}\n* @default 127\n*/\nvar INT8_MAX = 127|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MAX;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum signed 8-bit integer.\n*\n* @module @stdlib/constants-int8-min\n* @type {integer32}\n*\n* @example\n* import INT8_MIN from '@stdlib/constants-int8-min';\n* // returns -128\n*/\n\n\n// MAIN //\n\n/**\n* Minimum signed 8-bit integer.\n*\n* ## Notes\n*\n* The number is given by\n*\n* ```tex\n* -(2^{7})\n* ```\n*\n* which corresponds to the two's complement bit sequence\n*\n* ```binarystring\n* 10000000\n* ```\n*\n* @constant\n* @type {integer32}\n* @default -128\n*/\nvar INT8_MIN = -128|0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default INT8_MIN;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Int8Array === 'function' ) ? Int8Array : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof Int8Array === 'function' ) ? Int8Array : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Typed array constructor which returns a typed array representing an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @module @stdlib/array-int8\n*\n* @example\n* import ctor from '@stdlib/array-int8';\n*\n* var arr = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasInt8ArraySupport from '@stdlib/assert-has-int8array-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasInt8ArraySupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInt8Array from '@stdlib/assert-is-int8array';\nimport INT8_MAX from '@stdlib/constants-int8-max';\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport GlobalInt8Array from './int8array.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Int8Array` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Int8Array` support\n*\n* @example\n* var bool = hasInt8ArraySupport();\n* // returns \n*/\nfunction hasInt8ArraySupport() {\n\tvar bool;\n\tvar arr;\n\n\tif ( typeof GlobalInt8Array !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tarr = new GlobalInt8Array( [ 1, 3.14, -3.14, INT8_MAX+1 ] );\n\t\tbool = (\n\t\t\tisInt8Array( arr ) &&\n\t\t\tarr[ 0 ] === 1 &&\n\t\t\tarr[ 1 ] === 3 && // truncation\n\t\t\tarr[ 2 ] === -3 && // truncation\n\t\t\tarr[ 3 ] === INT8_MIN // wrap around\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasInt8ArraySupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Typed array which represents an array of twos-complement 8-bit signed integers in the platform byte order.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number primitive having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number primitive having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isObject as isInteger } from '@stdlib/assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a number object having a nonnegative integer value.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a number object having a nonnegative integer value\n*\n* @example\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn (\n\t\tisInteger( value ) &&\n\t\tvalue.valueOf() >= 0\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a nonnegative integer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a nonnegative integer\n*\n* @example\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* @example\n* var bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* @example\n* var bool = isNonNegativeInteger( null );\n* // returns false\n*/\nfunction isNonNegativeInteger( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isNonNegativeInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a nonnegative integer.\n*\n* @module @stdlib/assert-is-nonnegative-integer\n*\n* @example\n* import isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 5.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 5.0 ) );\n* // returns true\n*\n* bool = isNonNegativeInteger( -5.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( 3.14 );\n* // returns false\n*\n* bool = isNonNegativeInteger( null );\n* // returns false\n*\n* @example\n* import { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns true\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns false\n*\n* @example\n* import { isObject as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\n*\n* var bool = isNonNegativeInteger( 3.0 );\n* // returns false\n*\n* bool = isNonNegativeInteger( new Number( 3.0 ) );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'isPrimitive', isPrimitive );\nsetReadOnly( main, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum length of a generic array.\n*\n* @module @stdlib/constants-array-max-array-length\n*\n* @example\n* import MAX_ARRAY_LENGTH from '@stdlib/constants-array-max-array-length';\n* // returns 4294967295\n*/\n\n// MAIN //\n\n/**\n* Maximum length of a generic array.\n*\n* ```tex\n* 2^{32} - 1\n* ```\n*\n* @constant\n* @type {uinteger32}\n* @default 4294967295\n*/\nvar MAX_ARRAY_LENGTH = 4294967295>>>0; // asm type annotation\n\n\n// EXPORTS //\n\nexport default MAX_ARRAY_LENGTH;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport MAX_LENGTH from '@stdlib/constants-array-max-array-length';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is an array-like object\n*\n* @example\n* var bool = isArrayLikeObject( [] );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( { 'length': 10 } );\n* // returns true\n*\n* @example\n* var bool = isArrayLikeObject( 'beep' );\n* // returns false\n*/\nfunction isArrayLikeObject( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.length === 'number' &&\n\t\tisInteger( value.length ) &&\n\t\tvalue.length >= 0 &&\n\t\tvalue.length <= MAX_LENGTH\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayLikeObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasArrayBuffer = ( typeof ArrayBuffer === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is an ArrayBuffer.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is an ArrayBuffer\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var bool = isArrayBuffer( new ArrayBuffer( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isArrayBuffer( [] );\n* // returns false\n*/\nfunction isArrayBuffer( value ) {\n\treturn (\n\t\t( hasArrayBuffer && value instanceof ArrayBuffer ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object ArrayBuffer]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isArrayBuffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is an array of strings.\n*\n* @module @stdlib/assert-is-string-array\n*\n* @example\n* import isStringArray from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', 123 ] );\n* // returns false\n*\n* @example\n* import { primitives as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ 'abc', 'def' ] );\n* // returns true\n*\n* bool = isStringArray( [ 'abc', new String( 'def' ) ] );\n* // returns false\n*\n* @example\n* import { objects as isStringArray } from '@stdlib/assert-is-string-array';\n*\n* var bool = isStringArray( [ new String( 'abc' ), new String( 'def' ) ] );\n* // returns true\n*\n* bool = isStringArray( [ new String( 'abc' ), 'def' ] );\n* // returns false\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport arrayfun from '@stdlib/assert-tools-array-function';\nimport isString from '@stdlib/assert-is-string';\n\n\n// VARIABLES //\n\nvar isPrimitiveArray = arrayfun( isString.isPrimitive );\nvar isObjectArray = arrayfun( isString.isObject );\n\n\n// MAIN //\n\nvar isStringArray = arrayfun( isString );\nsetReadOnly( isStringArray, 'primitives', isPrimitiveArray );\nsetReadOnly( isStringArray, 'objects', isObjectArray );\n\n\n// EXPORTS //\n\nexport default isStringArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a read-only property.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {*} value - value to set\n*\n* @example\n* var obj = {};\n*\n* setReadOnly( obj, 'foo', 'bar' );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnly( obj, prop, value ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'writable': false,\n\t\t'value': value\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadOnly;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport setEnumerableReadOnly from '@stdlib/utils-define-read-only-property';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport format from '@stdlib/string-format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 128-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex128} 128-bit complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex128( real, imag ) {\n\tif ( !( this instanceof Complex128 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', real );\n\tsetEnumerableReadOnly( this, 'im', imag );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128\n* @readonly\n* @type {string}\n* @default 'Complex128'\n*\n* @example\n* var name = Complex128.name;\n* // returns 'Complex128'\n*/\nsetReadOnly( Complex128, 'name', 'Complex128' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex128.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex128.prototype, 'BYTES_PER_ELEMENT', 8 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex128.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 16\n*/\nsetReadOnly( Complex128.prototype, 'byteLength', 16 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex128.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex128` instance.\n*\n* @name toJSON\n* @memberof Complex128.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex128', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex128.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex128;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex128';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar fround = ( typeof Math.fround === 'function' ) ? Math.fround : null; // eslint-disable-line stdlib/no-builtin-math\n\n\n// EXPORTS //\n\nexport default fround;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float32Array from '@stdlib/array-float32';\n\n\n// VARIABLES //\n\nvar FLOAT32_VIEW = new Float32Array( 1 );\n\n\n// MAIN //\n\n/**\n* Converts a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @param {number} x - double-precision floating-point number\n* @returns {number} nearest single-precision floating-point number\n*\n* @example\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\nfunction float64ToFloat32( x ) {\n\tFLOAT32_VIEW[ 0 ] = x;\n\treturn FLOAT32_VIEW[ 0 ];\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Convert a double-precision floating-point number to the nearest single-precision floating-point number.\n*\n* @module @stdlib/number-float64-base-to-float32\n*\n* @example\n* import float64ToFloat32 from '@stdlib/number-float64-base-to-float32';\n*\n* var y = float64ToFloat32( 1.337 );\n* // returns 1.3370000123977661\n*/\n\n// MODULES //\n\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar float64ToFloat32;\nif ( typeof builtin === 'function' ) {\n\tfloat64ToFloat32 = builtin;\n} else {\n\tfloat64ToFloat32 = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default float64ToFloat32;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport setEnumerableReadOnly from '@stdlib/utils-define-read-only-property';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport float64ToFloat32 from '@stdlib/number-float64-base-to-float32';\nimport format from '@stdlib/string-format';\nimport toStr from './tostring.js';\nimport toJSON from './tojson.js';\n\n\n// MAIN //\n\n/**\n* 64-bit complex number constructor.\n*\n* @constructor\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @throws {TypeError} must invoke using the `new` keyword\n* @throws {TypeError} real component must be a number\n* @throws {TypeError} imaginary component must be a number\n* @returns {Complex64} 64-bit complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n* // returns \n*/\nfunction Complex64( real, imag ) {\n\tif ( !( this instanceof Complex64 ) ) {\n\t\tthrow new TypeError( 'invalid invocation. Constructor must be called with the `new` keyword.' );\n\t}\n\tif ( !isNumber( real ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Real component must be a number. Value: `%s`.', real ) );\n\t}\n\tif ( !isNumber( imag ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Imaginary component must be a number. Value: `%s`.', imag ) );\n\t}\n\tsetEnumerableReadOnly( this, 're', float64ToFloat32( real ) );\n\tsetEnumerableReadOnly( this, 'im', float64ToFloat32( imag ) );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64\n* @readonly\n* @type {string}\n* @default 'Complex64'\n*\n* @example\n* var name = Complex64.name;\n* // returns 'Complex64'\n*/\nsetReadOnly( Complex64, 'name', 'Complex64' );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var nbytes = Complex64.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Size (in bytes) of each component.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} size of each component\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.BYTES_PER_ELEMENT;\n* // returns 4\n*/\nsetReadOnly( Complex64.prototype, 'BYTES_PER_ELEMENT', 4 );\n\n/**\n* Length (in bytes) of a complex number.\n*\n* @name byteLength\n* @memberof Complex64.prototype\n* @type {integer}\n* @returns {integer} byte length\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var nbytes = z.byteLength;\n* // returns 8\n*/\nsetReadOnly( Complex64.prototype, 'byteLength', 8 );\n\n/**\n* Serializes a complex number as a string.\n*\n* @name toString\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {string} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var str = z.toString();\n* // returns '5 + 3i'\n*/\nsetReadOnly( Complex64.prototype, 'toString', toStr );\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `Complex64` instance.\n*\n* @name toJSON\n* @memberof Complex64.prototype\n* @type {Function}\n* @returns {Object} serialized complex number\n*\n* @example\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var obj = z.toJSON();\n* // returns { 'type': 'Complex64', 're': 5.0, 'im': 3.0 }\n*/\nsetReadOnly( Complex64.prototype, 'toJSON', toJSON );\n\n\n// EXPORTS //\n\nexport default Complex64;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex128 from '@stdlib/complex-float64-ctor';\nimport Complex64 from '@stdlib/complex-float32-ctor';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex number-like object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex number-like object.\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var x = new Complex128( 4.0, 2.0 );\n* var bool = isComplexLike( x );\n* // returns true\n*\n* x = new Complex64( 4.0, 2.0 );\n* bool = isComplexLike( x );\n* // returns true\n*/\nfunction isComplexLike( value ) {\n\tif ( value instanceof Complex128 || value instanceof Complex64 ) {\n\t\treturn true;\n\t}\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof value.re === 'number' &&\n\t\ttypeof value.im === 'number'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplexLike;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isInteger from '@stdlib/math-base-assert-is-integer';\n\n\n// MAIN //\n\n/**\n* Tests if a finite numeric value is an even number.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is an even number\n*\n* @example\n* var bool = isEven( 5.0 );\n* // returns false\n*\n* @example\n* var bool = isEven( -2.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( 0.0 );\n* // returns true\n*\n* @example\n* var bool = isEven( NaN );\n* // returns false\n*/\nfunction isEven( x ) {\n\treturn isInteger( x/2.0 );\n}\n\n\n// EXPORTS //\n\nexport default isEven;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a string.\n*\n* @private\n* @returns {string} serialized complex number\n*/\nfunction toString() { // eslint-disable-line stdlib/no-redeclare\n\t/* eslint-disable no-invalid-this */\n\tvar str = '' + this.re;\n\tif ( this.im < 0 ) {\n\t\tstr += ' - ' + (-this.im);\n\t} else {\n\t\tstr += ' + ' + this.im;\n\t}\n\tstr += 'i';\n\treturn str;\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Serializes a complex number as a JSON object.\n*\n* @private\n* @returns {Object} JSON representation\n*/\nfunction toJSON() {\n\t/* eslint-disable no-invalid-this */\n\tvar out = {};\n\tout.type = 'Complex64';\n\tout.re = this.re;\n\tout.im = this.im;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 8; // 4 bytes per float32 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex64Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex64Array`\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var bool = isComplex64Array( new Complex64Array( 10 ) );\n* // returns true\n*\n* bool = isComplex64Array( [] );\n* // returns false\n*/\nfunction isComplex64Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex64Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex64array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex64Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = 16; // 8 bytes per float64 x (1 real + 1 imag component)\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `Complex128Array`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `Complex128Array`\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isComplex128Array( new Complex128Array( 10 ) );\n* // returns true\n*\n* bool = isComplex128Array( [] );\n* // returns false\n*/\nfunction isComplex128Array( value ) {\n\t// Note: the following is not robust and that is intentional. In this case, we are seeking a lower cost way to reasonably determine whether an input value is a `Complex128Array` in order to avoid walking the prototype chain and resolving constructors, which is necessary for robust identification of cross-realm instances. For more robust validation, see `@stdlib/assert/is-complex128array`.\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'Complex128Array' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isComplex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.iterator` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.iterator` support\n*\n* @example\n* var bool = hasIteratorSymbolSupport();\n* // returns \n*/\nfunction hasIteratorSymbolSupport() {\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'iterator' ) &&\n\t\ttypeof Symbol.iterator === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasIteratorSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\n\n\n// MAIN //\n\n/**\n* Iterator symbol.\n*\n* @name IteratorSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* function iterator() {\n* var it;\n* var i;\n*\n* i = -1;\n*\n* it = {};\n* it.next = next;\n* it.return = done;\n*\n* if ( IteratorSymbol ) {\n* it[ IteratorSymbol ] = iterator;\n* }\n* return it;\n*\n* function next() {\n* i += 1;\n* return {\n* 'value': i,\n* 'done': false\n* };\n* }\n*\n* function done( value ) {\n* if ( arguments.length === 0 ) {\n* return {\n* 'done': true\n* };\n* }\n* return {\n* 'value': value,\n* 'done': true\n* };\n* }\n* }\n*\n* var obj = iterator();\n*/\nvar IteratorSymbol = ( hasIteratorSymbolSupport() ) ? Symbol.iterator : null;\n\n\n// EXPORTS //\n\nexport default IteratorSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a single-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var z = new Complex64( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float32Array from '@stdlib/array-float32';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex64Array` as a `Float32Array`.\n*\n* @param {Complex64Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float32Array} `Float32Array` view\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float32Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `Complex128Array` as a `Float64Array`.\n*\n* @param {Complex128Array} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Float64Array} `Float64Array` view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), 2*(x.length-offset) ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float32Array from '@stdlib/array-float32';\nimport Complex64 from '@stdlib/complex-float32-ctor';\nimport format from '@stdlib/string-format';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float32Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex64Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex64Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex128Array...\n\t\tvalue.name === 'Complex128Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float32Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex64} complex number\n*/\nfunction getComplex64( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex64( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 64-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `8`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `8`\n* @throws {TypeError} view length must be a positive multiple of `8`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} complex number array\n*\n* @example\n* var arr = new Complex64Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex64Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex64Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Complex64Array( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex64Array( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex64Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex64Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex64Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex64Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex64Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex64Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float32Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float32Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float32Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float32Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float32Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) ); // FIXME: `buf` is what is returned from above, NOT the original value\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float32Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Complex64Array.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex64Array\n* @readonly\n* @type {string}\n* @default 'Complex64Array'\n*\n* @example\n* var str = Complex64Array.name;\n* // returns 'Complex64Array'\n*/\nsetReadOnly( Complex64Array, 'name', 'Complex64Array' );\n\n/**\n* Creates a new 64-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex64Array\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function clbk( v ) {\n* return new Complex64( realf(v)*2.0, imagf(v)*2.0 );\n* }\n*\n* var arr = Complex64Array.from( [ new Complex64( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex64Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.', 2, len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = realf( v );\n\t\t\t\t\tbuf[ j+1 ] = imagf( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 64-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex64Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} 64-bit complex number array\n*\n* @example\n* var arr = Complex64Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex64Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = realf( z );\n* // returns 9.0\n*\n* im = imagf( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Complex64Array.prototype, 'BYTES_PER_ELEMENT', Complex64Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} modified array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex64( 1.0, 1.0 ), 0 );\n* arr.set( new Complex64( 2.0, 2.0 ), 1 );\n* arr.set( new Complex64( 3.0, 3.0 ), 2 );\n* arr.set( new Complex64( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = [\n* new Complex64( 1.0, 1.0 ),\n* new Complex64( 2.0, 2.0 ),\n* new Complex64( 3.0, 3.0 )\n* ];\n* arr = new Complex64Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, getComplex64( buf, i ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex64Array} modified array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.fill( new Complex64( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = realf( value );\n\tim = imagf( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2.0\n*\n* var im = imagf( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex64Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex64Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex64|void)} array element or undefined\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex64( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex64Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex64( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex64|void)} array element\n*\n* @example\n* var arr = new Complex64Array( 10 );\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex64Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex64( this._buffer, idx );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex64( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex64( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex64( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 10 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex64( 4.0, -4.0 ), -3 );\n* // returns -1\n*/\nsetReadOnly( Complex64Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex64( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex64( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex64( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex64Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = realf( searchElement );\n\tim = imagf( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex64Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex64Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex64Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function scale( v, i ) {\n* return new Complex64( 2.0*realf( v ), 2.0*imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 2\n*\n* var im = imagf( z );\n* // returns -2\n*/\nsetReadOnly( Complex64Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex64( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = realf( v );\n\t\t\toutbuf[ (2*i)+1 ] = imagf( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import caddf from '@stdlib/complex-float32-base-add';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( caddf );\n* // returns \n*\n* var re = realf( z );\n* // returns 6.0\n*\n* var im = imagf( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex64( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex64( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 0.0\n*\n* var im = imagf( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = realf( value );\n\t\tbuf[ idx+1 ] = imagf( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float32Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float32Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = realf( v );\n\t\t\tbuf[ idx+1 ] = imagf( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} complex number array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function predicate( v ) {\n* return ( realf( v ) === imagf( v ) );\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex64( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = realf( tmp[i] );\n\t\tbuf[ j+1 ] = imagf( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 5.0\n*\n* im = imagf( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + (begin*BYTES_PER_ELEMENT);\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex64Array} reversed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 3.0\n*\n* var im = imagf( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 1.0\n*\n* im = imagf( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex64Array} sorted array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = realf( a );\n* re2 = realf( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imagf( a );\n* im2 = imagf( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 1.0\n*\n* var im = imagf( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = realf( z );\n* // returns 2.0\n*\n* im = imagf( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = realf( z );\n* // returns 3.0\n*\n* im = imagf( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex64Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex64( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex64Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex64Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex64( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* var arr = new Complex64Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = realf( v );\n* // returns 1.0\n*\n* var im = imagf( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = realf( v );\n* // returns 2.0\n*\n* im = imagf( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex64Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex64( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex64Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex64Array} new typed array\n*\n* @example\n* import realf from '@stdlib/complex-float32-real';\n* import imagf from '@stdlib/complex-float32-imag';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex64( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = realf( z );\n* // returns 4.0\n*\n* var im = imagf( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex64Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = realf( value );\n\tbuf[ (2*index)+1 ] = imagf( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex64Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float32Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float32Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = realf( v );\n\t\tbuf[ j+1 ] = imagf( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the real component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} real component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var re = real( z );\n* // returns 5.0\n*/\nfunction real( z ) {\n\treturn z.re;\n}\n\n\n// EXPORTS //\n\nexport default real;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Returns the imaginary component of a double-precision complex floating-point number.\n*\n* @param {Complex} z - complex number\n* @returns {number} imaginary component\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var z = new Complex128( 5.0, 3.0 );\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nfunction imag( z ) {\n\treturn z.im;\n}\n\n\n// EXPORTS //\n\nexport default imag;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tz = v.value;\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport realf from '@stdlib/complex-float32-real';\nimport imagf from '@stdlib/complex-float32-imag';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( realf( z ), imagf( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/* eslint-disable no-restricted-syntax, max-lines, no-invalid-this */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isArray from '@stdlib/assert-is-array';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport isString from '@stdlib/assert-is-string';\nimport isFunction from '@stdlib/assert-is-function';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isEven from '@stdlib/math-base-assert-is-even';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Float64Array from '@stdlib/array-float64';\nimport Complex128 from '@stdlib/complex-float64-ctor';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\nimport floor from '@stdlib/math-base-special-floor';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Float64Array.BYTES_PER_ELEMENT * 2;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a complex typed array.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*/\nfunction isComplexArray( value ) {\n\treturn (\n\t\tvalue instanceof Complex128Array ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === 'Complex64Array' ||\n\t\t\t\tvalue.constructor.name === 'Complex128Array'\n\t\t\t) &&\n\t\t\ttypeof value._length === 'number' && // eslint-disable-line no-underscore-dangle\n\n\t\t\t// NOTE: we don't perform a more rigorous test here for a typed array for performance reasons, as robustly checking for a typed array instance could require walking the prototype tree and performing relatively expensive constructor checks...\n\t\t\ttypeof value._buffer === 'object' // eslint-disable-line no-underscore-dangle\n\t\t)\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a complex typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array constructor\n*/\nfunction isComplexArrayConstructor( value ) {\n\treturn (\n\t\tvalue === Complex128Array ||\n\n\t\t// NOTE: weaker test in order to avoid a circular dependency with Complex64Array...\n\t\tvalue.name === 'Complex64Array'\n\t);\n}\n\n/**\n* Retrieves a complex number from a complex number array buffer.\n*\n* @private\n* @param {Float64Array} buf - array buffer\n* @param {NonNegativeInteger} idx - element index\n* @returns {Complex128} complex number\n*/\nfunction getComplex128( buf, idx ) {\n\tidx *= 2;\n\treturn new Complex128( buf[ idx ], buf[ idx+1 ] );\n}\n\n\n// MAIN //\n\n/**\n* 128-bit complex number array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {RangeError} ArrayBuffer byte length must be a multiple of `16`\n* @throws {RangeError} array-like object and typed array input arguments must have a length which is a multiple of two\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} byte offset must be a multiple of `16`\n* @throws {TypeError} view length must be a positive multiple of `16`\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} complex number array\n*\n* @example\n* var arr = new Complex128Array();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Complex128Array( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Complex128Array( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Complex128Array( buf, 16 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 64 );\n* var arr = new Complex128Array( buf, 16, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Complex128Array() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Complex128Array) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new Complex128Array();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new Complex128Array( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Complex128Array( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new Complex128Array( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Float64Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\tif ( isNonNegativeInteger( arguments[0] ) ) {\n\t\t\tbuf = new Float64Array( arguments[0]*2 );\n\t\t} else if ( isCollection( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tlen = buf.length;\n\n\t\t\t// If provided a \"generic\" array, peak at the first value, and, if the value is a complex number, try to process as an array of complex numbers, falling back to \"normal\" typed array initialization if we fail and ensuring consistency if the first value had not been a complex number...\n\t\t\tif ( len && isArray( buf ) && isComplexLike( buf[0] ) ) {\n\t\t\t\tbuf = fromArray( new Float64Array( len*2 ), buf );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\t// We failed and we are now forced to allocate a new array :-(\n\t\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t\t}\n\t\t\t\t\t// We failed, so fall back to directly setting values...\n\t\t\t\t\tbuf = new Float64Array( arguments[0] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( isComplex64Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret64( buf, 0 );\n\t\t\t\t} else if ( isComplex128Array( buf ) ) {\n\t\t\t\t\tbuf = reinterpret128( buf, 0 );\n\t\t\t\t} else if ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tbuf = new Float64Array( buf );\n\t\t\t}\n\t\t} else if ( isArrayBuffer( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isInteger( buf.byteLength/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else if ( isObject( arguments[0] ) ) {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tif ( !isFunction( buf[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = buf[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', buf ) );\n\t\t\t}\n\t\t\tbuf = fromIterator( buf );\n\t\t\tif ( buf instanceof Error ) {\n\t\t\t\tthrow buf;\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arguments[0] ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Byte offset must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tlen = buf.byteLength - byteOffset;\n\t\t\tif ( !isInteger( len/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, len ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Float64Array( buf, byteOffset, len*2 );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length/2 );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var nbytes = Complex128Array.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Complex128Array\n* @readonly\n* @type {string}\n* @default 'Complex128Array'\n*\n* @example\n* var name = Complex128Array.name;\n* // returns 'Complex128Array'\n*/\nsetReadOnly( Complex128Array, 'name', 'Complex128Array' );\n\n/**\n* Creates a new 128-bit complex number array from an array-like object or an iterable.\n*\n* @name from\n* @memberof Complex128Array\n* @type {Function}\n* @param {(Collection|Object)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {TypeError} an iterator must return either a two element array containing real and imaginary components or a complex number\n* @throws {TypeError} when provided an iterator, a callback must return either a two element array containing real and imaginary components or a complex number\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.from( [ 1.0, -1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function clbk( v ) {\n* return new Complex128( real(v)*2.0, imag(v)*2.0 );\n* }\n*\n* var arr = Complex128Array.from( [ new Complex128( 1.0, 1.0 ) ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*/\nsetReadOnly( Complex128Array, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar flg;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isComplexArray( src ) ) {\n\t\tlen = src.length;\n\t\tif ( clbk ) {\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, src.get( i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\t// Note: array contents affect how we iterate over a provided data source. If only complex number objects, we can extract real and imaginary components. Otherwise, for non-complex number arrays (e.g., `Float64Array`, etc), we assume a strided array where real and imaginary components are interleaved. In the former case, we expect a callback to return real and imaginary components (possibly as a complex number). In the latter case, we expect a callback to return *either* a real or imaginary component.\n\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Detect whether we've been provided an array which returns complex number objects...\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tif ( !isComplexLike( get( src, i ) ) ) {\n\t\t\t\t\tflg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If an array does not contain only complex number objects, then we assume interleaved real and imaginary components...\n\t\t\tif ( flg ) {\n\t\t\t\tif ( !isEven( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.', len ) );\n\t\t\t\t}\n\t\t\t\tout = new this( len/2 );\n\t\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tbuf[ i ] = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t}\n\t\t\t// If an array contains only complex number objects, then we need to extract real and imaginary components...\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tv = clbk.call( thisArg, get( src, i ), i );\n\t\t\t\tif ( isComplexLike( v ) ) {\n\t\t\t\t\tbuf[ j ] = real( v );\n\t\t\t\t\tbuf[ j+1 ] = imag( v );\n\t\t\t\t} else if ( isArrayLikeObject( v ) && v.length >= 2 ) {\n\t\t\t\t\tbuf[ j ] = v[ 0 ];\n\t\t\t\t\tbuf[ j+1 ] = v[ 1 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tif ( tmp instanceof Error ) {\n\t\t\tthrow tmp;\n\t\t}\n\t\tlen = tmp.length / 2;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new 128-bit complex number array from a variable number of arguments.\n*\n* @name of\n* @memberof Complex128Array\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} 128-bit complex number array\n*\n* @example\n* var arr = Complex128Array.of( 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Complex128Array, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isComplexArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide an integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.at( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 9.0, -9.0 ], 9 );\n*\n* z = arr.at( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.at( -1 );\n* // returns \n*\n* re = real( z );\n* // returns 9.0\n*\n* im = imag( z );\n* // returns -9.0\n*\n* z = arr.at( 100 );\n* // returns undefined\n*\n* z = arr.at( -100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'at', function at( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx < 0 ) {\n\t\tidx += this._length;\n\t}\n\tif ( idx < 0 || idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 160\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 16\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 16\n*/\nsetReadOnly( Complex128Array.prototype, 'BYTES_PER_ELEMENT', Complex128Array.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} modified array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 4 );\n*\n* // Set the array elements:\n* arr.set( new Complex128( 1.0, 1.0 ), 0 );\n* arr.set( new Complex128( 2.0, 2.0 ), 1 );\n* arr.set( new Complex128( 3.0, 3.0 ), 2 );\n* arr.set( new Complex128( 4.0, 4.0 ), 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* // Get the last array element:\n* var z = arr.get( 3 );\n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target*2, start*2 );\n\t} else {\n\t\tthis._buffer.copyWithin( target*2, start*2, arguments[2]*2 );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = [\n* new Complex128( 1.0, 1.0 ),\n* new Complex128( 2.0, 2.0 ),\n* new Complex128( 3.0, 3.0 )\n* ];\n* arr = new Complex128Array( arr );\n*\n* // Create an iterator:\n* var it = arr.entries();\n*\n* // Iterate over the key-value pairs...\n* var v = it.next().value;\n* // returns [ 0, ]\n*\n* v = it.next().value;\n* // returns [ 1, ]\n*\n* v = it.next().value;\n* // returns [ 2, ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'entries', function entries() {\n\tvar buffer;\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuffer = this._buffer;\n\tlen = this._length;\n\n\t// Initialize the iteration indices:\n\ti = -1;\n\tj = -2;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\tvar z;\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tj += 2;\n\t\tz = new Complex128( buffer[ j ], buffer[ j+1 ] );\n\t\treturn {\n\t\t\t'value': [ i, z ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {Complex128Array} modified array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.fill( new Complex128( 1.0, 1.0 ), 1 );\n*\n* var z = arr.get( 1 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*\n* z = arr.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tre = real( value );\n\tim = imag( value );\n\tfor ( i = start; i < end; i++ ) {\n\t\tidx = 2*i;\n\t\tbuf[ idx ] = re;\n\t\tbuf[ idx+1 ] = im;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 1\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns 2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\tout.push( z );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.find( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var idx = arr.findIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( Complex128Array.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {(Complex128|void)} array element or undefined\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.findLast( predicate );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn z;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var idx = arr.findLastIndex( predicate );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tz = getComplex128( buf, i );\n\t\tif ( predicate.call( thisArg, z, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( Complex128Array.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\tvar z;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tz = getComplex128( buf, i );\n\t\tfcn.call( thisArg, z, i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(Complex128|void)} array element\n*\n* @example\n* var arr = new Complex128Array( 10 );\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*\n* z = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Complex128Array.prototype, 'get', function get( idx ) {\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn getComplex128( this._buffer, idx );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Complex128Array.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Complex128Array( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Complex128Array.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a provided value\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var bool = arr.includes( new Complex128( 3.0, -3.0 ) );\n* // returns true\n*\n* bool = arr.includes( new Complex128( 3.0, -3.0 ), 3 );\n* // returns false\n*\n* bool = arr.includes( new Complex128( 4.0, -4.0 ), -3 );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var idx = arr.indexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 2\n*\n* idx = arr.indexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns -1\n*\n* idx = arr.indexOf( new Complex128( 4.0, -4.0 ), -3 );\n* // returns 3\n*/\nsetReadOnly( Complex128Array.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.join();\n* // returns '1 + 1i,2 + 2i'\n*\n* str = arr.join( '/' );\n* // returns '1 + 1i/2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'join', function join( separator ) {\n\tvar out;\n\tvar buf;\n\tvar sep;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tsep = ',';\n\t} else if ( isString( separator ) ) {\n\t\tsep = separator;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( sep );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {ComplexLike} searchElement - element to find\n* @param {integer} [fromIndex] - index at which to start searching backward (inclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a complex number\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 3.0, -3.0 ], 4 );\n*\n* var idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ) );\n* // returns 4\n*\n* idx = arr.lastIndexOf( new Complex128( 3.0, -3.0 ), 3 );\n* // returns 2\n*\n* idx = arr.lastIndexOf( new Complex128( 5.0, -5.0 ), 3 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( new Complex128( 2.0, -2.0 ), -3 );\n* // returns 1\n*/\nsetReadOnly( Complex128Array.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar idx;\n\tvar re;\n\tvar im;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isComplexLike( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a complex number. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tre = real( searchElement );\n\tim = imag( searchElement );\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tidx = 2 * i;\n\t\tif ( re === buf[ idx ] && im === buf[ idx+1 ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function scale( v, i ) {\n* return new Complex128( 2.0*real( v ), 2.0*imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var out = arr.map( scale );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 2.0\n*\n* var im = imag( z );\n* // returns -2.0\n*/\nsetReadOnly( Complex128Array.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = fcn.call( thisArg, getComplex128( buf, i ), i, this );\n\t\tif ( isComplexLike( v ) ) {\n\t\t\toutbuf[ 2*i ] = real( v );\n\t\t\toutbuf[ (2*i)+1 ] = imag( v );\n\t\t} else if ( isArrayLikeObject( v ) && v.length === 2 ) {\n\t\t\toutbuf[ 2*i ] = v[ 0 ];\n\t\t\toutbuf[ (2*i)+1 ] = v[ 1 ];\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', v ) );\n\t\t}\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduce( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, 0 );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import cadd from '@stdlib/complex-float64-base-add';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var z = arr.reduceRight( cadd );\n* // returns \n*\n* var re = real( z );\n* // returns 6.0\n*\n* var im = imag( z );\n* // returns 6.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar acc;\n\tvar len;\n\tvar v;\n\tvar i;\n\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len-1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = getComplex128( buf, len-1 );\n\t\ti = len-2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tv = getComplex128( buf, i );\n\t\tacc = reducer( acc, v, i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ (2*i) ];\n\t\tbuf[ (2*i) ] = buf[ (2*j) ];\n\t\tbuf[ (2*j) ] = tmp;\n\t\ttmp = buf[ (2*i)+1 ];\n\t\tbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t\tbuf[ (2*j)+1 ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, real or complex, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values as intended.\n*\n* @name set\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be either a complex number, an array-like object, or a complex number array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} array-like objects must have a length which is a multiple of two\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 10 );\n*\n* var z = arr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 0.0\n*\n* var im = imag( z );\n* // returns 0.0\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n*\n* z = arr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns -1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'set', function set( value ) {\n\t/* eslint-disable no-underscore-dangle */\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar flg;\n\tvar N;\n\tvar v;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isComplexLike( value ) ) {\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tidx *= 2;\n\t\tbuf[ idx ] = real( value );\n\t\tbuf[ idx+1 ] = imag( value );\n\t\treturn;\n\t}\n\tif ( isComplexArray( value ) ) {\n\t\tN = value._length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value._buffer;\n\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Float64Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tidx *= 2;\n\t\tj = 0;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\tidx += 2; // stride\n\t\t\tj += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tif ( isCollection( value ) ) {\n\t\t// Detect whether we've been provided an array of complex numbers...\n\t\tN = value.length;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tif ( !isComplexLike( value[ i ] ) ) {\n\t\t\t\tflg = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// If an array does not contain only complex numbers, then we assume interleaved real and imaginary components...\n\t\tif ( flg ) {\n\t\t\tif ( !isEven( N ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.', N ) );\n\t\t\t}\n\t\t\tif ( idx+(N/2) > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\n\t\t\t// Check for overlapping memory...\n\t\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = new Float64Array( N );\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp[ i ] = sbuf[ i ];\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t}\n\t\t\tidx *= 2;\n\t\t\tN /= 2;\n\t\t\tj = 0;\n\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\tbuf[ idx ] = sbuf[ j ];\n\t\t\t\tbuf[ idx+1 ] = sbuf[ j+1 ];\n\t\t\t\tidx += 2; // stride\n\t\t\t\tj += 2; // stride\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// If an array contains only complex numbers, then we need to extract real and imaginary components...\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tidx *= 2;\n\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\tv = value[ i ];\n\t\t\tbuf[ idx ] = real( v );\n\t\t\tbuf[ idx+1 ] = imag( v );\n\t\t\tidx += 2; // stride\n\t\t}\n\t\treturn;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.', value ) );\n\n\t/* eslint-enable no-underscore-dangle */\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex128Array} complex number array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* z = out.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'slice', function slice( start, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar idx;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tstart = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( start < end ) {\n\t\toutlen = end - start;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\tidx = 2*(i+start);\n\t\toutbuf[ 2*i ] = buf[ idx ];\n\t\toutbuf[ (2*i)+1 ] = buf[ idx+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function predicate( v ) {\n* return ( real( v ) === imag( v ) );\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, getComplex128( buf, i ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'sort', function sort( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = 2 * i;\n\t\tbuf[ j ] = real( tmp[i] );\n\t\tbuf[ j+1 ] = imag( tmp[i] );\n\t}\n\treturn this;\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {Complex64Array} subarray\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 5 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n* arr.set( [ 3.0, -3.0 ], 2 );\n* arr.set( [ 4.0, -4.0 ], 3 );\n* arr.set( [ 5.0, -5.0 ], 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var z = subarr.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 5.0\n*\n* im = imag( z );\n* // returns -5.0\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* z = subarr.get( 0 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = subarr.get( len-1 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toLocaleString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Complex128Array} reversed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 3.0\n*\n* var im = imag( z );\n* // returns 3.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns 2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 1.0\n*\n* im = imag( z );\n* // returns 1.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\tvar j;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\tj = len - i - 1;\n\t\toutbuf[ (2*i) ] = buf[ (2*j) ];\n\t\toutbuf[ (2*i)+1 ] = buf[ (2*j)+1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {Function} compareFcn - comparison function\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be a function\n* @returns {Complex128Array} sorted array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* function compare( a, b ) {\n* var re1;\n* var re2;\n* var im1;\n* var im2;\n* re1 = real( a );\n* re2 = real( b );\n* if ( re1 < re2 ) {\n* return -1;\n* }\n* if ( re1 > re2 ) {\n* return 1;\n* }\n* im1 = imag( a );\n* im2 = imag( b );\n* if ( im1 < im2 ) {\n* return -1;\n* }\n* if ( im1 > im2 ) {\n* return 1;\n* }\n* return 0;\n* }\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 3.0, -3.0 ], 0 );\n* arr.set( [ 1.0, -1.0 ], 1 );\n* arr.set( [ 2.0, -2.0 ], 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 1.0\n*\n* var im = imag( z );\n* // returns -1.0\n*\n* z = out.get( 1 );\n* // returns \n*\n* re = real( z );\n* // returns 2.0\n*\n* im = imag( z );\n* // returns -2.0\n*\n* z = out.get( 2 );\n* // returns \n*\n* re = real( z );\n* // returns 3.0\n*\n* im = imag( z );\n* // returns -3.0\n*/\nsetReadOnly( Complex128Array.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar tmp;\n\tvar buf;\n\tvar len;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\ttmp = [];\n\tfor ( i = 0; i < len; i++ ) {\n\t\ttmp.push( getComplex128( buf, i ) );\n\t}\n\ttmp.sort( compareFcn );\n\treturn new Complex128Array( tmp );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {string} string representation\n*\n* @example\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n*\n* var str = arr.toString();\n* // returns '1 + 1i,2 + 2i'\n*/\nsetReadOnly( Complex128Array.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( getComplex128( buf, i ).toString() );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a complex number array\n* @returns {Iterator} iterator\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n*\n* var arr = new Complex128Array( 2 );\n*\n* arr.set( [ 1.0, -1.0 ], 0 );\n* arr.set( [ 2.0, -2.0 ], 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns \n*\n* var re = real( v );\n* // returns 1.0\n*\n* var im = imag( v );\n* // returns -1.0\n*\n* v = iter.next().value;\n* // returns \n*\n* re = real( v );\n* // returns 2.0\n*\n* im = imag( v );\n* // returns -2.0\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( Complex128Array.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': getComplex128( buf, i ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof Complex128Array.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {ComplexLike} value - new value\n* @throws {TypeError} `this` must be a complex number array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a complex number\n* @returns {Complex128Array} new typed array\n*\n* @example\n* import real from '@stdlib/complex-float64-real';\n* import imag from '@stdlib/complex-float64-imag';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( 3 );\n*\n* arr.set( [ 1.0, 1.0 ], 0 );\n* arr.set( [ 2.0, 2.0 ], 1 );\n* arr.set( [ 3.0, 3.0 ], 2 );\n*\n* var out = arr.with( 0, new Complex128( 4.0, 4.0 ) );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns \n*\n* var re = real( z );\n* // returns 4.0\n*\n* var im = imag( z );\n* // returns 4.0\n*/\nsetReadOnly( Complex128Array.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\tif ( !isComplexArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a complex number array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isComplexLike( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a complex number. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tbuf[ 2*index ] = real( value );\n\tbuf[ (2*index)+1 ] = imag( value );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default Complex128Array;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns a strided array of real and imaginary components.\n*\n* @private\n* @param {Float64Array} buf - output array\n* @param {Array} arr - array containing complex numbers\n* @returns {(Float64Array|null)} output array or null\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar v;\n\tvar i;\n\tvar j;\n\n\tlen = arr.length;\n\tj = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = arr[ i ];\n\t\tif ( !isComplexLike( v ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tbuf[ j ] = real( v );\n\t\tbuf[ j+1 ] = imag( v );\n\t\tj += 2; // stride\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( Boolean( v.value ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayLikeObject from '@stdlib/assert-is-array-like-object';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport format from '@stdlib/string-format';\nimport real from '@stdlib/complex-float64-real';\nimport imag from '@stdlib/complex-float64-imag';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {(Array|TypeError)} array or an error\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar z;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tz = clbk.call( thisArg, v.value, i );\n\t\tif ( isArrayLikeObject( z ) && z.length >= 2 ) {\n\t\t\tout.push( z[ 0 ], z[ 1 ] );\n\t\t} else if ( isComplexLike( z ) ) {\n\t\t\tout.push( real( z ), imag( z ) );\n\t\t} else {\n\t\t\treturn new TypeError( format( 'invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.', z ) );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport isFunction from '@stdlib/assert-is-function';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { primitives as isStringArray } from '@stdlib/assert-is-string-array';\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Boolean from '@stdlib/boolean-ctor';\nimport getter from '@stdlib/array-base-getter';\nimport floor from '@stdlib/math-base-special-floor';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport format from '@stdlib/string-format';\nimport fromIterator from './from_iterator.js';\nimport fromIteratorMap from './from_iterator_map.js';\nimport fromArray from './from_array.js';\n\n\n// VARIABLES //\n\nvar BYTES_PER_ELEMENT = Uint8Array.BYTES_PER_ELEMENT;\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `BooleanArray`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `BooleanArray`\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\tvalue.constructor.name === 'BooleanArray' &&\n\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t);\n}\n\n/**\n* Returns a boolean indicating if a value is a boolean typed array constructor.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a boolean typed array constructor\n*/\nfunction isBooleanArrayConstructor( value ) {\n\treturn ( value === BooleanArray );\n}\n\n\n// MAIN //\n\n/**\n* Boolean array constructor.\n*\n* @constructor\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} if provided only a single argument, must provide a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray();\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new BooleanArray( 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new BooleanArray( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 16\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new BooleanArray( buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 8\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new BooleanArray( buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction BooleanArray() {\n\tvar byteOffset;\n\tvar nargs;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof BooleanArray) ) {\n\t\tif ( nargs === 0 ) {\n\t\t\treturn new BooleanArray();\n\t\t}\n\t\tif ( nargs === 1 ) {\n\t\t\treturn new BooleanArray( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new BooleanArray( arguments[0], arguments[1] );\n\t\t}\n\t\treturn new BooleanArray( arguments[0], arguments[1], arguments[2] );\n\t}\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new Uint8Array( 0 ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new Uint8Array( arg.length ), arg );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new Uint8Array( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( fromIterator( buf ) );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 0 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new Uint8Array( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 2 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t}\n\t\t\tbuf = new Uint8Array( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.length );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var nbytes = BooleanArray.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof BooleanArray\n* @readonly\n* @type {string}\n* @default 'BooleanArray'\n*\n* @example\n* var str = BooleanArray.name;\n* // returns 'BooleanArray'\n*/\nsetReadOnly( BooleanArray, 'name', 'BooleanArray' );\n\n/**\n* Creates a new boolean array from an array-like object or an iterable.\n*\n* @name from\n* @memberof BooleanArray\n* @type {Function}\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an array-like object or an iterable\n* @throws {TypeError} second argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.from( [ true, false ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return !v;\n* }\n*\n* var arr = BooleanArray.from( [ true, false ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( BooleanArray, 'from', function from( src ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar clbk;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tclbk = arguments[ 1 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 2 ) {\n\t\t\tthisArg = arguments[ 2 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf[ i ] = Boolean( clbk.call( thisArg, get( src, i ), i ) );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { // eslint-disable-line max-len\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf[ i ] = tmp[ i ];\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new boolean array from a variable number of arguments.\n*\n* @name of\n* @memberof BooleanArray\n* @type {Function}\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = BooleanArray.of( true, true, true, true );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( BooleanArray, 'of', function of() {\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isBooleanArrayConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\targs = [];\n\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( args );\n});\n\n/**\n* Returns an array element located at integer position (index) `i`, with support for both nonnegative and negative integer indices.\n*\n* @name at\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide an integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.at( 0 );\n* // returns true\n*\n* v = arr.at( -1 );\n* // returns true\n*\n* v = arr.at( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'at', function at( idx ) {\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an integer. Value: `%s`.', idx ) );\n\t}\n\tlen = this._length;\n\tbuf = this._buffer;\n\tif ( idx < 0 ) {\n\t\tidx += len;\n\t}\n\tif ( idx < 0 || idx >= len ) {\n\t\treturn;\n\t}\n\treturn Boolean( buf[ idx ] );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 1\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 1\n*/\nsetReadOnly( BooleanArray.prototype, 'BYTES_PER_ELEMENT', BooleanArray.BYTES_PER_ELEMENT );\n\n/**\n* Copies a sequence of elements within the array to the position starting at `target`.\n*\n* @name copyWithin\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} target - index at which to start copying elements\n* @param {integer} start - source index at which to copy elements from\n* @param {integer} [end] - source index at which to stop copying elements from\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 4 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n* arr.set( true, 3 );\n*\n* // Copy the first two elements to the last two elements:\n* arr.copyWithin( 2, 0, 2 );\n*\n* var v = arr.get( 2 );\n* // returns true\n*\n* v = arr.get( 3 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'copyWithin', function copyWithin( target, start ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\t// FIXME: prefer a functional `copyWithin` implementation which addresses lack of universal browser support (e.g., IE11 and Safari) or ensure that typed arrays are polyfilled\n\tif ( arguments.length === 2 ) {\n\t\tthis._buffer.copyWithin( target, start );\n\t} else {\n\t\tthis._buffer.copyWithin( target, start, arguments[2] );\n\t}\n\treturn this;\n});\n\n/**\n* Returns an iterator for iterating over array key-value pairs.\n*\n* @name entries\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var it = arr.entries();\n*\n* var v = it.next().value;\n* // returns [ 0, true ]\n*\n* v = it.next().value;\n* // returns [ 1, false ]\n*\n* v = it.next().value;\n* // returns [ 2, true ]\n*\n* var bool = it.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'entries', function entries() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar buf;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': [ i, Boolean( buf[ i ] ) ],\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.entries();\n\t}\n});\n\n/**\n* Tests whether all elements in an array pass a test implemented by a predicate function.\n*\n* @name every\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether all elements pass a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n*\n* var bool = arr.every( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'every', function every( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( !predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n});\n\n/**\n* Returns a modified typed array filled with a fill value.\n*\n* @name fill\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} value - fill value\n* @param {integer} [start=0] - starting index (inclusive)\n* @param {integer} [end] - ending index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean\n* @throws {TypeError} second argument must be an integer\n* @throws {TypeError} third argument must be an integer\n* @returns {BooleanArray} modified array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.fill( true, 1 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'fill', function fill( value, start, end ) {\n\tvar buf;\n\tvar len;\n\tvar val;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( start ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', start ) );\n\t\t}\n\t\tif ( start < 0 ) {\n\t\t\tstart += len;\n\t\t\tif ( start < 0 ) {\n\t\t\t\tstart = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t} else {\n\t\t\tend = len;\n\t\t}\n\t} else {\n\t\tstart = 0;\n\t\tend = len;\n\t}\n\tif ( value ) {\n\t\tval = 1;\n\t} else {\n\t\tval = 0;\n\t}\n\tfor ( i = start; i < end; i++ ) {\n\t\tbuf[ i ] = val;\n\t}\n\treturn this;\n});\n\n/**\n* Returns a new array containing the elements of an array which pass a test implemented by a predicate function.\n*\n* @name filter\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - test function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} boolean array\n*\n* @example\n* function predicate( v ) {\n* return ( v === true );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.filter( predicate );\n* // returns \n*\n* var len = out.length;\n* // returns 2\n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'filter', function filter( predicate, thisArg ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\tvar v;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\tout.push( v );\n\t\t}\n\t}\n\treturn new this.constructor( out );\n});\n\n/**\n* Returns the first element in an array for which a predicate function returns a truthy value.\n*\n* @name find\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.find( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'find', function find( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the first element in an array for which a predicate function returns a truthy value.\n*\n* @name findIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findIndex( predicate );\n* // returns 0\n*/\nsetReadOnly( BooleanArray.prototype, 'findIndex', function findIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLast\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {(boolean|void)} array element or undefined\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLast( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'findLast', function findLast( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n});\n\n/**\n* Returns the index of the last element in an array for which a predicate function returns a truthy value.\n*\n* @name findLastIndex\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {integer} index or -1\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var v = arr.findLastIndex( predicate );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'findLastIndex', function findLastIndex( predicate, thisArg ) {\n\tvar buf;\n\tvar v;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = this._length-1; i >= 0; i-- ) {\n\t\tv = Boolean( buf[ i ] );\n\t\tif ( predicate.call( thisArg, v, i, this ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Invokes a function once for each array element.\n*\n* @name forEach\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - function to invoke\n* @param {*} [thisArg] - function invocation context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n*\n* @example\n* function log( v, i ) {\n* console.log( '%s: %s', i, v.toString() );\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.forEach( log );\n*/\nsetReadOnly( BooleanArray.prototype, 'forEach', function forEach( fcn, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', fcn ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tfcn.call( thisArg, Boolean( buf[ i ] ), i, this );\n\t}\n});\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(boolean|void)} array element\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( BooleanArray.prototype, 'get', function get( idx ) {\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn Boolean( this._buffer[ idx ] );\n});\n\n/**\n* Returns a boolean indicating whether an array includes a provided value.\n*\n* @name includes\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - search element\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {boolean} boolean indicating whether an array includes a value\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var bool = arr.includes( true );\n* // returns true\n*\n* bool = arr.includes( false, 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'includes', function includes( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Returns the first index at which a given element can be found.\n*\n* @name indexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex=0] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( true, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.indexOf( true );\n* // returns 0\n*\n* idx = arr.indexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.indexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'indexOf', function indexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t\tif ( fromIndex < 0 ) {\n\t\t\t\tfromIndex = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfromIndex = 0;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i < this._length; i++ ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Returns a new string by concatenating all array elements.\n*\n* @name join\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {string} [separator=','] - element separator\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.join();\n* // returns 'true,false,true'\n*\n* str = arr.join( '|' );\n* // returns 'true|false|true'\n*/\nsetReadOnly( BooleanArray.prototype, 'join', function join( separator ) {\n\tvar buf;\n\tvar out;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isString( separator ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', separator ) );\n\t\t}\n\t} else {\n\t\tseparator = ',';\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( separator );\n});\n\n/**\n* Returns an iterator for iterating over each index key in a typed array.\n*\n* @name keys\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.keys();\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 1\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'keys', function keys() {\n\tvar self;\n\tvar iter;\n\tvar len;\n\tvar FLG;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': i,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.keys();\n\t}\n});\n\n/**\n* Returns the last index at which a given element can be found.\n*\n* @name lastIndexOf\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {boolean} searchElement - element to find\n* @param {integer} [fromIndex] - starting index (inclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a boolean value\n* @throws {TypeError} second argument must be an integer\n* @returns {integer} index or -1\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( true, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var idx = arr.lastIndexOf( true );\n* // returns 4\n*\n* idx = arr.lastIndexOf( false, 2 );\n* // returns -1\n*\n* idx = arr.lastIndexOf( false, -3 );\n* // returns -1\n*/\nsetReadOnly( BooleanArray.prototype, 'lastIndexOf', function lastIndexOf( searchElement, fromIndex ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isBoolean( searchElement ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a boolean. Value: `%s`.', searchElement ) );\n\t}\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isInteger( fromIndex ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', fromIndex ) );\n\t\t}\n\t\tif ( fromIndex >= this._length ) {\n\t\t\tfromIndex = this._length - 1;\n\t\t} else if ( fromIndex < 0 ) {\n\t\t\tfromIndex += this._length;\n\t\t}\n\t} else {\n\t\tfromIndex = this._length - 1;\n\t}\n\tbuf = this._buffer;\n\tfor ( i = fromIndex; i >= 0; i-- ) {\n\t\tif ( searchElement === Boolean( buf[ i ] ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof BooleanArray.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( BooleanArray.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Returns a new array with each element being the result of a provided callback function.\n*\n* @name map\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} new boolean array\n*\n* @example\n* function invert( v ) {\n* return !v;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.map( invert );\n* // returns \n*\n* var z = out.get( 0 );\n* // returns false\n*\n* z = out.get( 1 );\n* // returns true\n*\n* z = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'map', function map( fcn, thisArg ) {\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( fcn ) ) {\n\t\tthrow new TypeError( 'invalid argument. First argument must be a function. Value: `%s`.', fcn );\n\t}\n\tbuf = this._buffer;\n\tout = new this.constructor( this._length );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\toutbuf[ i ] = Boolean( fcn.call( thisArg, Boolean( buf[ i ] ), i, this ) );\n\t}\n\treturn out;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduce\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduce( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduce', function reduce( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = 0;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ 0 ] );\n\t\ti = 1;\n\t}\n\tfor ( ; i < len; i++ ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Applies a provided callback function to each element of the array, in reverse order, passing in the return value from the calculation on the preceding element and returning the accumulated result upon completion.\n*\n* @name reduceRight\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} reducer - callback function\n* @param {*} [initialValue] - initial value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {Error} if not provided an initial value, the array must have at least one element\n* @returns {*} accumulated result\n*\n* @example\n* function reducer( acc, v ) {\n* if ( v ) {\n* return acc + 1;\n* }\n* return acc;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.reduceRight( reducer, 0 );\n* // returns 2\n*/\nsetReadOnly( BooleanArray.prototype, 'reduceRight', function reduceRight( reducer, initialValue ) {\n\tvar buf;\n\tvar len;\n\tvar acc;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( reducer ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', reducer ) );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length > 1 ) {\n\t\tacc = initialValue;\n\t\ti = len - 1;\n\t} else {\n\t\tif ( len === 0 ) {\n\t\t\tthrow new Error( 'invalid operation. If not provided an initial value, an array must contain at least one element.' );\n\t\t}\n\t\tacc = Boolean( buf[ len-1 ] );\n\t\ti = len - 2;\n\t}\n\tfor ( ; i >= 0; i-- ) {\n\t\tacc = reducer( acc, Boolean( buf[ i ] ), i, this );\n\t}\n\treturn acc;\n});\n\n/**\n* Reverses an array in-place.\n*\n* @name reverse\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.reverse();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'reverse', function reverse() {\n\tvar buf;\n\tvar tmp;\n\tvar len;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tN = floor( len / 2 );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tj = len - i - 1;\n\t\ttmp = buf[ i ];\n\t\tbuf[ i ] = buf[ j ];\n\t\tbuf[ j ] = tmp;\n\t}\n\treturn this;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(Collection|BooleanArray|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new BooleanArray( 10 );\n*\n* var v = arr.get( 0 );\n* // returns false\n*\n* arr.set( [ true, false ], 0 );\n*\n* v = arr.get( 0 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tif ( isBooleanArray( value ) ) {\n\t\t\tsbuf = value._buffer; // eslint-disable-line no-underscore-dangle\n\t\t} else {\n\t\t\tsbuf = value;\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = new Uint8Array( sbuf.length );\n\t\t\tfor ( i = 0; i < sbuf.length; i++ ) {\n\t\t\t\ttmp[ i ] = sbuf[ i ]; // TODO: handle accessor arrays\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf[ idx ] = ( sbuf[ i ] ) ? 1 : 0;\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf[ idx ] = ( value ) ? 1 : 0;\n});\n\n/**\n* Copies a portion of a typed array to a new typed array.\n*\n* @name slice\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be integer\n* @throws {TypeError} second argument must be integer\n* @returns {BooleanArray} boolean array\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var out = arr.slice();\n* // returns \n*\n* var len = out.length;\n* // returns 5\n*\n* var bool = out.get( 0 );\n* // returns true\n*\n* bool = out.get( len-1 );\n* // returns true\n*\n* out = arr.slice( 1, -2 );\n* // returns \n*\n* len = out.length;\n* // returns 2\n*\n* bool = out.get( 0 );\n* // returns false\n*\n* bool = out.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'slice', function slice( begin, end ) {\n\tvar outlen;\n\tvar outbuf;\n\tvar out;\n\tvar buf;\n\tvar len;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin < end ) {\n\t\toutlen = end - begin;\n\t} else {\n\t\toutlen = 0;\n\t}\n\tout = new this.constructor( outlen );\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < outlen; i++ ) {\n\t\toutbuf[ i ] = buf[ i+begin ];\n\t}\n\treturn out;\n});\n\n/**\n* Tests whether at least one element in an array passes a test implemented by a predicate function.\n*\n* @name some\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} predicate - predicate function\n* @param {*} [thisArg] - predicate function execution context\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {boolean} boolean indicating whether at least one element passes a test\n*\n* @example\n* function predicate( v ) {\n* return v === true;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( false, 0 );\n* arr.set( true, 1 );\n* arr.set( false, 2 );\n*\n* var bool = arr.some( predicate );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'some', function some( predicate, thisArg ) {\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isFunction( predicate ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', predicate ) );\n\t}\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( predicate.call( thisArg, Boolean( buf[ i ] ), i, this ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n});\n\n/**\n* Sorts an array in-place.\n*\n* @name sort\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* arr.sort( compare );\n*\n* var v = arr.get( 0 );\n* // returns true\n*\n* v = arr.get( 1 );\n* // returns true\n*\n* v = arr.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'sort', function sort( compareFcn ) {\n\tvar buf;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length === 0 ) {\n\t\tbuf.sort();\n\t\treturn this;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\tbuf.sort( compare );\n\treturn this;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Creates a new typed array view over the same underlying `ArrayBuffer` and with the same underlying data type as the host array.\n*\n* @name subarray\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} [begin] - start index (inclusive)\n* @param {integer} [end] - end index (exclusive)\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {TypeError} second argument must be an integer\n* @returns {BooleanArray} subarray\n*\n* @example\n* var arr = new BooleanArray( 5 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n* arr.set( false, 3 );\n* arr.set( true, 4 );\n*\n* var subarr = arr.subarray();\n* // returns \n*\n* var len = subarr.length;\n* // returns 5\n*\n* var bool = subarr.get( 0 );\n* // returns true\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*\n* subarr = arr.subarray( 1, -2 );\n* // returns \n*\n* len = subarr.length;\n* // returns 2\n*\n* bool = subarr.get( 0 );\n* // returns false\n*\n* bool = subarr.get( len-1 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'subarray', function subarray( begin, end ) {\n\tvar offset;\n\tvar buf;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tbuf = this._buffer;\n\tlen = this._length;\n\tif ( arguments.length === 0 ) {\n\t\tbegin = 0;\n\t\tend = len;\n\t} else {\n\t\tif ( !isInteger( begin ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', begin ) );\n\t\t}\n\t\tif ( begin < 0 ) {\n\t\t\tbegin += len;\n\t\t\tif ( begin < 0 ) {\n\t\t\t\tbegin = 0;\n\t\t\t}\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\tend = len;\n\t\t} else {\n\t\t\tif ( !isInteger( end ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', end ) );\n\t\t\t}\n\t\t\tif ( end < 0 ) {\n\t\t\t\tend += len;\n\t\t\t\tif ( end < 0 ) {\n\t\t\t\t\tend = 0;\n\t\t\t\t}\n\t\t\t} else if ( end > len ) {\n\t\t\t\tend = len;\n\t\t\t}\n\t\t}\n\t}\n\tif ( begin >= len ) {\n\t\tlen = 0;\n\t\toffset = buf.byteLength;\n\t} else if ( begin >= end ) {\n\t\tlen = 0;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t} else {\n\t\tlen = end - begin;\n\t\toffset = buf.byteOffset + ( begin*BYTES_PER_ELEMENT );\n\t}\n\treturn new this.constructor( buf.buffer, offset, ( len < 0 ) ? 0 : len );\n});\n\n/**\n* Serializes an array as a locale-specific string.\n*\n* @name toLocaleString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {(string|Array)} [locales] - locale identifier(s)\n* @param {Object} [options] - configuration options\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a string or an array of strings\n* @throws {TypeError} options argument must be an object\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toLocaleString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toLocaleString', function toLocaleString( locales, options ) {\n\tvar opts;\n\tvar loc;\n\tvar out;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( arguments.length === 0 ) {\n\t\tloc = [];\n\t} else if ( isString( locales ) || isStringArray( locales ) ) {\n\t\tloc = locales;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a string or an array of strings. Value: `%s`.', locales ) );\n\t}\n\tif ( arguments.length < 2 ) {\n\t\topts = {};\n\t} else if ( isObject( options ) ) {\n\t\topts = options;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tbuf = this._buffer;\n\tout = [];\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( Boolean( buf[ i ] ).toLocaleString( loc, opts ) );\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns a new typed array containing the elements in reversed order.\n*\n* @name toReversed\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {BooleanArray} reversed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( false, 2 );\n*\n* var out = arr.toReversed();\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*\n* v = out.get( 1 );\n* // returns false\n*\n* v = out.get( 2 );\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'toReversed', function toReversed() {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ len - i - 1 ];\n\t}\n\treturn out;\n});\n\n/**\n* Returns a new typed array containing the elements in sorted order.\n*\n* @name toSorted\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {Function} [compareFcn] - comparison function\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be a function\n* @returns {BooleanArray} sorted array\n*\n* @example\n* function compare( a, b ) {\n* if ( a === false ) {\n* if ( b === false ) {\n* return 0;\n* }\n* return 1;\n* }\n* if ( b === true ) {\n* return 0;\n* }\n* return -1;\n* }\n*\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.sort( compare );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns true\n*\n* v = out.get( 1 );\n* // returns true\n*\n* v = out.get( 2 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'toSorted', function toSorted( compareFcn ) {\n\tvar outbuf;\n\tvar out;\n\tvar len;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tlen = this._length;\n\tout = new this.constructor( len );\n\tbuf = this._buffer;\n\toutbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tfor ( i = 0; i < len; i++ ) {\n\t\toutbuf[ i ] = buf[ i ];\n\t}\n\tif ( arguments.length === 0 ) {\n\t\toutbuf.sort();\n\t\treturn out;\n\t}\n\tif ( !isFunction( compareFcn ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', compareFcn ) );\n\t}\n\toutbuf.sort( compare );\n\treturn out;\n\n\t/**\n\t* Comparison function for sorting.\n\t*\n\t* @private\n\t* @param {boolean} a - first boolean value for comparison\n\t* @param {boolean} b - second boolean value for comparison\n\t* @returns {number} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn compareFcn( Boolean( a ), Boolean( b ) );\n\t}\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {string} string representation\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var str = arr.toString();\n* // returns 'true,false,true'\n*/\nsetReadOnly( BooleanArray.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tif ( buf[i] ) {\n\t\t\tout.push( 'true' );\n\t\t} else {\n\t\t\tout.push( 'false' );\n\t\t}\n\t}\n\treturn out.join( ',' );\n});\n\n/**\n* Returns an iterator for iterating over each value in a typed array.\n*\n* @name values\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a boolean array\n* @returns {Iterator} iterator\n*\n* @example\n* var arr = new BooleanArray( 2 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n*\n* var iter = arr.values();\n*\n* var v = iter.next().value;\n* // returns true\n*\n* v = iter.next().value;\n* // returns false\n*\n* var bool = iter.next().done;\n* // returns true\n*/\nsetReadOnly( BooleanArray.prototype, 'values', function values() {\n\tvar iter;\n\tvar self;\n\tvar len;\n\tvar FLG;\n\tvar buf;\n\tvar i;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tself = this;\n\tbuf = this._buffer;\n\tlen = this._length;\n\n\t// Initialize an iteration index:\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( ITERATOR_SYMBOL ) {\n\t\tsetReadOnly( iter, ITERATOR_SYMBOL, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i >= len ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': Boolean( buf[ i ] ),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn self.values();\n\t}\n});\n\n/**\n* Returns a new typed array with the element at a provided index replaced with a provided value.\n*\n* @name with\n* @memberof BooleanArray.prototype\n* @type {Function}\n* @param {integer} index - element index\n* @param {boolean} value - new value\n* @throws {TypeError} `this` must be a boolean array\n* @throws {TypeError} first argument must be an integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {TypeError} second argument must be a boolean\n* @returns {BooleanArray} new typed array\n*\n* @example\n* var arr = new BooleanArray( 3 );\n*\n* arr.set( true, 0 );\n* arr.set( false, 1 );\n* arr.set( true, 2 );\n*\n* var out = arr.with( 0, false );\n* // returns \n*\n* var v = out.get( 0 );\n* // returns false\n*/\nsetReadOnly( BooleanArray.prototype, 'with', function copyWith( index, value ) {\n\tvar buf;\n\tvar out;\n\tvar len;\n\n\tif ( !isBooleanArray( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a boolean array.' );\n\t}\n\tif ( !isInteger( index ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', index ) );\n\t}\n\tlen = this._length;\n\tif ( index < 0 ) {\n\t\tindex += len;\n\t}\n\tif ( index < 0 || index >= len ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%s`.', index ) );\n\t}\n\tif ( !isBoolean( value ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a boolean. Value: `%s`.', value ) );\n\t}\n\tout = new this.constructor( this._buffer );\n\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\tif ( value ) {\n\t\tbuf[ index ] = 1;\n\t} else {\n\t\tbuf[ index ] = 0;\n\t}\n\treturn out;\n});\n\n\n// EXPORTS //\n\nexport default BooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Fills an output array with \"boolean\" values.\n*\n* @private\n* @param {Uint8Array} buf - output array\n* @param {Array} arr - input array\n* @returns {Uint8Array} output array\n*/\nfunction fromArray( buf, arr ) {\n\tvar len;\n\tvar i;\n\n\tlen = arr.length;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tbuf[ i ] = Boolean( arr[ i ] );\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( Boolean( clbk.call( thisArg, v.value, i ) ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int8Array from '@stdlib/array-int8';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\n// Note: order should match `dtypes` order\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tComplex64Array,\n\tComplex128Array,\n\tBooleanArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Note: order should match `ctors` order\nvar DTYPES = [\n\t'float64',\n\t'float32',\n\t'int32',\n\t'uint32',\n\t'int16',\n\t'uint16',\n\t'int8',\n\t'uint8',\n\t'uint8c',\n\t'complex64',\n\t'complex128',\n\t'bool'\n];\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from '@stdlib/assert-is-buffer';\nimport isArray from '@stdlib/assert-is-array';\nimport constructorName from '@stdlib/utils-constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of an array.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* var dt = dtype( [ 1, 2, 3 ] );\n* // returns 'generic'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tif ( isArray( value ) ) {\n\t\treturn 'generic';\n\t}\n\tif ( isBuffer( value ) ) {\n\t\treturn null;\n\t}\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport getter from '@stdlib/array-base-getter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @param {*} value - search value\n* @returns {boolean} boolean indicating if an array contains a search value\n*\n* @example\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\nfunction contains( x, value ) {\n\tvar len;\n\tvar get;\n\tvar dt;\n\tvar i;\n\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t} else {\n\t\tget = getter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\t// Loop over the elements...\n\tfor ( i = 0; i < len; i++ ) {\n\t\tif ( get( x, i ) === value ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default contains;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport dtype from '@stdlib/array-dtype';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function to tests if an array contains a provided search value.\n*\n* @param {Collection} x - input array\n* @throws {TypeError} must provide an array-like object\n* @returns {Function} function to test if an array contains a search value\n*\n* @example\n* var contains = factory( [ 1, 2, 3 ] );\n* // returns \n*\n* var bool = contains( 2 );\n* // returns true\n*/\nfunction factory( x ) {\n\tvar get;\n\tvar len;\n\tvar dt;\n\n\tif ( !isCollection( x ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an array-like object. Value: `%s`.', x ) );\n\t}\n\t// Resolve the input array data type:\n\tdt = dtype( x );\n\n\t// Resolve an accessor for retrieving input array elements:\n\tif ( isAccessorArray( x ) ) {\n\t\tget = accessorGetter( dt );\n\t}\n\t// Get the number of elements over which to iterate:\n\tlen = x.length;\n\n\treturn ( get === void 0 ) ? contains : accessors;\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*\n\t* @example\n\t* var out = contains( [ 1, 2, 3 ], 2 );\n\t* // returns true\n\t*/\n\tfunction contains( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( x[ i ] === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t/**\n\t* Tests if an array contains a provided search value.\n\t*\n\t* @private\n\t* @param {*} value - search value\n\t* @returns {boolean} boolean indicating if an array contains a search value\n\t*/\n\tfunction accessors( value ) {\n\t\tvar i;\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tif ( get( x, i ) === value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Replaces search occurrences with a replacement string.\n*\n* @param {string} str - input string\n* @param {RegExp} search - search expression\n* @param {(string|Function)} newval - replacement value or function\n* @returns {string} new string containing replacement(s)\n*\n* @example\n* var str = 'Hello World';\n* var out = replace( str, /world/i, 'Mr. President' );\n* // returns 'Hello Mr. President'\n*\n* @example\n* import capitalize from '@stdlib/string-base-capitalize';\n*\n* var str = 'Oranges and lemons say the bells of St. Clement\\'s';\n*\n* function replacer( match, p1 ) {\n* return capitalize( p1 );\n* }\n*\n* var out = replace( str, /([^\\s]*)/gi, replacer );\n* // returns 'Oranges And Lemons Say The Bells Of St. Clement\\'s'\n*/\nfunction replace( str, search, newval ) {\n\treturn str.replace( search, newval );\n}\n\n\n// EXPORTS //\n\nexport default replace;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if an array contains a provided search value.\n*\n* @module @stdlib/array-base-assert-contains\n*\n* @example\n* import contains from '@stdlib/array-base-assert-contains';\n*\n* var out = contains( [ 1, 2, 3 ], 2 );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport factory from './factory.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"factory\": \"main.factory\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport replace from '@stdlib/string-base-replace';\nimport DTYPES from './dtypes.json';\n\n\n// VARIABLES //\n\nvar RE_SUFFIX = /_and_generic$/;\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data type strings.\n*\n* @param {string} [kind] - data type kind\n* @returns {Array} list of ndarray data type strings\n*\n* @example\n* var list = dtypeStrings();\n* // returns [...]\n*\n* @example\n* var list = dtypeStrings( 'floating_point' );\n* // returns [...]\n*/\nfunction dtypeStrings() {\n\tvar kind;\n\tvar out;\n\tvar FLG;\n\tif ( arguments.length === 0 ) {\n\t\treturn DTYPES.all.slice();\n\t}\n\tFLG = false;\n\tkind = arguments[ 0 ];\n\tif ( RE_SUFFIX.test( kind ) ) {\n\t\tkind = replace( kind, RE_SUFFIX, '' );\n\t\tif ( kind !== 'all' && kind !== 'index' ) {\n\t\t\tFLG = true;\n\t\t}\n\t}\n\tout = DTYPES[ kind ];\n\tout = ( out ) ? out.slice() : [];\n\tif ( FLG && out.length > 0 ) {\n\t\tout.push( 'generic' );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default dtypeStrings;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/ndarray-base-dtype-strings';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported built-in ndarray data type string.\n*\n* @name isDataTypeString\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported built-in ndarray data type string\n*\n* @example\n* var bool = isDataTypeString( 'binary' );\n* // returns true\n*\n* bool = isDataTypeString( 'float32' );\n* // returns true\n*\n* bool = isDataTypeString( 'float64' );\n* // returns true\n*\n* bool = isDataTypeString( 'generic' );\n* // returns true\n*\n* bool = isDataTypeString( 'int16' );\n* // returns true\n*\n* bool = isDataTypeString( 'int32' );\n* // returns true\n*\n* bool = isDataTypeString( 'int8' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint16' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint32' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint8' );\n* // returns true\n*\n* bool = isDataTypeString( 'uint8c' );\n* // returns true\n*\n* bool = isDataTypeString( 'foo' );\n* // returns false\n*/\nvar isDataTypeString = contains( dtypes() );\n\n\n// EXPORTS //\n\nexport default isDataTypeString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport table from './table.js';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// MAIN //\n\n/**\n* Returns the description for a provided data type.\n*\n* @param {*} [dtype] - data type value\n* @returns {(Object|string|null)} description(s)\n*\n* @example\n* var obj = dtypeDesc();\n* // returns {...}\n*\n* @example\n* var desc = dtypeDesc( 'float64' );\n* // returns '...'\n*\n* desc = dtypeDesc( 'generic' );\n* // returns '...'\n*/\nfunction dtypeDesc( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn table();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\tTABLE = table();\n\t}\n\treturn TABLE[ resolve( dtype ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtypeDesc;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport table from './table.js';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// MAIN //\n\n/**\n* Returns the single letter character abbreviation for an underlying array data type.\n*\n* @param {*} [dtype] - data type value\n* @returns {(Object|string|null)} single letter character abbreviation(s)\n*\n* @example\n* var obj = dtypeChar();\n* // returns {...}\n*\n* @example\n* var ch = dtypeChar( 'float64' );\n* // returns 'd'\n*\n* ch = dtypeChar( 'generic' );\n* // returns 'o'\n*/\nfunction dtypeChar( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn table();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\tTABLE = table();\n\t}\n\treturn TABLE[ resolve( dtype ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtypeChar;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport table from './table.js';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// MAIN //\n\n/**\n* Returns the alignment (in bytes) for an underlying array data type.\n*\n* ## Notes\n*\n* - If provided an unrecognized/unsupported data type, the function returns `null`.\n*\n* @param {*} [dtype] - data type value\n* @returns {(Object|number|null)} alignment (in bytes)\n*\n* @example\n* var obj = dtypeAlignment();\n* // returns {...}\n*\n* @example\n* var out = dtypeAlignment( 'float64' );\n* // returns 8\n*\n* out = dtypeAlignment( 'generic' );\n* // returns null\n*/\nfunction dtypeAlignment( dtype ) {\n\tvar v;\n\tif ( arguments.length === 0 ) {\n\t\treturn table();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\tTABLE = table();\n\t}\n\tif ( dtype ) {\n\t\tv = dtype.alignment;\n\t\tif ( isPositiveInteger( v ) ) {\n\t\t\treturn v;\n\t\t}\n\t\treturn TABLE[ resolve( dtype ) ] || null;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default dtypeAlignment;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport BYTES_PER_ELEMENT from './bytes_per_element.json';\n\n\n// MAIN //\n\n/**\n* Returns the number of bytes per element for a provided underlying ndarray data type.\n*\n* @param {*} dtype - data type\n* @returns {(PositiveInteger|null)} number of bytes per element\n*\n* @example\n* var nbytes = bytesPerElement( 'float64' );\n* // returns 8\n*\n* nbytes = bytesPerElement( 'generic' );\n* // returns null\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema = [\n* {\n* 'name': 'value',\n* 'type': 'float64'\n* }\n* ];\n* var Struct = structFactory( schema );\n* // returns \n*\n* var nbytes = bytesPerElement( Struct );\n* // returns 8\n*/\nfunction bytesPerElement( dtype ) {\n\tvar v;\n\tif ( isString( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ dtype ] || null;\n\t}\n\tif ( isNumber( dtype ) ) {\n\t\treturn BYTES_PER_ELEMENT[ enum2str( dtype ) ] || null;\n\t}\n\tif ( dtype ) {\n\t\tv = dtype.byteLength;\n\t\tif ( isPositiveInteger( v ) ) {\n\t\t\treturn v;\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default bytesPerElement;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport isPlainObject from '@stdlib/assert-is-plain-object';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport isDataTypeString from '@stdlib/ndarray-base-assert-is-data-type-string';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport hasProp from '@stdlib/assert-has-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport resolveEnum from '@stdlib/ndarray-base-dtype-resolve-enum';\nimport dtype2desc from '@stdlib/ndarray-base-dtype-desc';\nimport dtype2char from '@stdlib/ndarray-base-dtype-char';\nimport dtype2alignment from '@stdlib/ndarray-base-dtype-alignment';\nimport bytesPerElement from '@stdlib/ndarray-base-bytes-per-element';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if a value is a `DataType`.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `DataType`\n*/\nfunction isDataType( value ) { // NOTE: we do not use `ndarray/base/assert/is-data-type-object` in order to avoid circular dependencies\n\treturn (\n\t\tvalue instanceof DataType ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\tvalue.constructor.name === 'DataType' &&\n\t\t\tisString( value.char ) &&\n\t\t\tisString( value.description ) &&\n\t\t\tisString( value.byteOrder ) &&\n\t\t\thasProp( value, 'value' )\n\t\t)\n\t);\n}\n\n\n// MAIN //\n\n/**\n* Data type constructor.\n*\n* @constructor\n* @param {*} value - data type value\n* @param {Options} [options] - constructor options\n* @param {string} [options.description] - data type description\n* @throws {TypeError} first argument must be a supported data type value\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {DataType} data type instance\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var str = dt.toString();\n* // returns 'float64'\n*/\nfunction DataType( value, options ) {\n\tvar nargs;\n\tvar type;\n\tvar opts;\n\n\tnargs = arguments.length;\n\tif ( !( this instanceof DataType ) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new DataType( value );\n\t\t}\n\t\treturn new DataType( value, options );\n\t}\n\tif ( isDataTypeString( value ) ) {\n\t\ttype = 'builtin';\n\t} else if ( isDataType( value ) ) {\n\t\t// Clone the input data type:\n\t\treturn new DataType( value.value, {\n\t\t\t'description': value.description\n\t\t});\n\t} else if ( isStructConstructorLike( value ) ) {\n\t\ttype = 'struct';\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.', value ) );\n\t}\n\tif ( nargs > 1 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'description' ) && !isString( opts.description ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'description', opts.description ) );\n\t\t}\n\t} else {\n\t\topts = {};\n\t}\n\tsetReadOnly( this, '_value', value );\n\tsetReadOnly( this, '_description', opts.description || ( dtype2desc( value ) || '' ) );\n\tsetReadOnly( this, '_char', dtype2char( value ) || '' );\n\tsetReadOnly( this, '_enum', resolveEnum( value ) || -1 );\n\tsetReadOnly( this, '_alignment', dtype2alignment( value ) || -1 );\n\tsetReadOnly( this, '_byteLength', bytesPerElement( value ) || -1 );\n\tsetReadOnly( this, '_byteOrder', 'host' ); // TODO: consider supporting little-endian and big-endian byte orders\n\tsetReadOnly( this, '_type', type );\n\treturn this;\n}\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof DataType\n* @type {string}\n* @default 'DataType'\n*\n* @example\n* var v = DataType.name;\n* // returns 'DataType'\n*/\nsetReadOnly( DataType, 'name', 'DataType' );\n\n/**\n* Alignment (in bytes) for the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a known alignment, the returned value is `-1`.\n*\n* @name alignment\n* @memberof DataType.prototype\n* @readonly\n* @type {integer}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.alignment;\n* // returns 8\n*/\nsetReadOnlyAccessor( DataType.prototype, 'alignment', function get() {\n\treturn this._alignment;\n});\n\n/**\n* Size (in bytes) of the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a known size, the returned value is `-1`.\n*\n* @name byteLength\n* @memberof DataType.prototype\n* @readonly\n* @type {integer}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.byteLength;\n* // returns 8\n*/\nsetReadOnlyAccessor( DataType.prototype, 'byteLength', function get() {\n\treturn this._byteLength;\n});\n\n/**\n* Data type byte order.\n*\n* ## Notes\n*\n* - Potential values:\n*\n* - **host**: host platform byte order.\n* - **little-endian**: little-endian byte order.\n* - **big-endian**: big-endian byte order.\n*\n* @name byteOrder\n* @memberof DataType.prototype\n* @readonly\n* @type {string}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.byteOrder;\n* // returns 'host'\n*/\nsetReadOnlyAccessor( DataType.prototype, 'byteOrder', function get() {\n\treturn this._byteOrder;\n});\n\n/**\n* Single letter character abbreviation for the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a corresponding single letter character abbreviation, the returned value is an empty string.\n*\n* @name char\n* @memberof DataType.prototype\n* @readonly\n* @type {string}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.char;\n* // returns 'd'\n*/\nsetReadOnlyAccessor( DataType.prototype, 'char', function get() {\n\treturn this._char;\n});\n\n/**\n* Data type description.\n*\n* ## Notes\n*\n* - If a data type does not have an associated description, the returned value is an empty string.\n*\n* @name description\n* @memberof DataType.prototype\n* @readonly\n* @type {string}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.description;\n* // returns \n*/\nsetReadOnlyAccessor( DataType.prototype, 'description', function get() {\n\treturn this._description;\n});\n\n/**\n* Enumeration constant for the data type.\n*\n* ## Notes\n*\n* - If a data type does not have a corresponding known enumeration constant, the returned value is `-1`.\n*\n* @name enum\n* @memberof DataType.prototype\n* @readonly\n* @type {integer}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.enum;\n* // returns \n*/\nsetReadOnlyAccessor( DataType.prototype, 'enum', function get() {\n\treturn this._enum;\n});\n\n/**\n* Raw (original) data type value.\n*\n* @name value\n* @memberof DataType.prototype\n* @readonly\n* @type {*}\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.value;\n* // returns 'float64'\n*/\nsetReadOnlyAccessor( DataType.prototype, 'value', function get() {\n\treturn this._value;\n});\n\n/**\n* Serializes a data type instance as a JSON object.\n*\n* ## Notes\n*\n* - `JSON.stringify()` implicitly calls this method when stringifying a `DataType` instance.\n*\n* @name toJSON\n* @memberof DataType.prototype\n* @type {Function}\n* @returns {Object} serialized instance\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var o = dt.toJSON();\n* // returns {...}\n*/\nsetReadOnly( DataType.prototype, 'toJSON', function toJSON() {\n\treturn {\n\t\t'type': 'DataType',\n\t\t'value': this.toString(),\n\t\t'byteOrder': this._byteOrder,\n\t\t'description': this._description\n\t};\n});\n\n/**\n* Serializes a data type instance to a string.\n*\n* @name toString\n* @memberof DataType.prototype\n* @type {Function}\n* @returns {string} serialized string\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.toString();\n* // returns 'float64'\n*/\nsetReadOnly( DataType.prototype, 'toString', function toString() {\n\treturn ( this._type === 'struct' ) ? this._value.layout : String( this._value );\n});\n\n/**\n* Converts a data type instance to a primitive value.\n*\n* @name valueOf\n* @memberof DataType.prototype\n* @type {Function}\n* @returns {string} primitive value\n*\n* @example\n* var dt = new DataType( 'float64' );\n* // returns \n*\n* var v = dt.valueOf();\n* // returns 'float64'\n*/\nsetReadOnly( DataType.prototype, 'valueOf', function valueOf() {\n\treturn this.toString();\n});\n\n\n// EXPORTS //\n\nexport default DataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping data type strings to descriptions.\n*\n* @private\n* @returns {Object} object mapping data type strings to descriptions\n*/\nfunction table() {\n\treturn {\n\t\t'binary': 'byte',\n\n\t\t'bool': 'boolean',\n\n\t\t'complex32': 'half-precision floating-point complex number',\n\t\t'complex64': 'single-precision floating-point complex number',\n\t\t'complex128': 'double-precision floating-point complex number',\n\n\t\t'float16': 'half-precision floating-point number',\n\t\t'bfloat16': 'brain floating-point number',\n\t\t'float32': 'single-precision floating-point number',\n\t\t'float64': 'double-precision floating-point number',\n\t\t'float128': 'quadruple-precision floating-point number',\n\n\t\t'generic': 'generic array value',\n\n\t\t'int8': 'signed 8-bit integer',\n\t\t'int16': 'signed 16-bit integer',\n\t\t'int32': 'signed 32-bit integer',\n\t\t'int64': 'signed 64-bit integer',\n\t\t'int128': 'signed 128-bit integer',\n\t\t'int256': 'signed 256-bit integer',\n\n\t\t'uint8': 'unsigned 8-bit integer',\n\t\t'uint8c': 'unsigned 8-bit integer (clamped)',\n\t\t'uint16': 'unsigned 16-bit integer',\n\t\t'uint32': 'unsigned 32-bit integer',\n\t\t'uint64': 'unsigned 64-bit integer',\n\t\t'uint128': 'unsigned 128-bit integer',\n\t\t'uint256': 'unsigned 256-bit integer'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default table;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping data type strings to single letter abbreviations.\n*\n* @private\n* @returns {Object} object mapping data type string to single letter abbreviations\n*/\nfunction table() {\n\treturn {\n\t\t'binary': 'r',\n\n\t\t'bool': 'x',\n\n\t\t'complex32': 'j',\n\t\t'complex64': 'c',\n\t\t'complex128': 'z',\n\n\t\t'float16': 'h',\n\t\t'bfloat16': 'e',\n\t\t'float32': 'f',\n\t\t'float64': 'd',\n\t\t'float128': 'g',\n\n\t\t'generic': 'o',\n\n\t\t'int8': 's',\n\t\t'int16': 'k',\n\t\t'int32': 'i',\n\t\t'int64': 'l',\n\t\t'int128': 'm',\n\t\t'int256': 'n',\n\n\t\t'uint8': 'b',\n\t\t'uint8c': 'a',\n\t\t'uint16': 't',\n\t\t'uint32': 'u',\n\t\t'uint64': 'v',\n\t\t'uint128': 'w',\n\t\t'uint256': 'y'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default table;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport enum2str from '@stdlib/ndarray-base-dtype-enum2str';\nimport str2enum from '@stdlib/ndarray-base-dtype-str2enum';\n\n\n// MAIN //\n\n/**\n* Returns the enumeration constant associated with a supported ndarray data type value.\n*\n* ## Notes\n*\n* - Downstream consumers of this function should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the function should be used in an opaque manner.\n*\n* @param {*} dtype - data type value\n* @returns {(integer|null)} enumeration constant or null\n*\n* @example\n* var v = resolve( 'int8' );\n* // returns \n*/\nfunction resolve( dtype ) {\n\tvar t = ( typeof dtype );\n\tif ( t === 'number' ) {\n\t\treturn ( enum2str( dtype ) ) ? dtype : null;\n\t}\n\tif ( t === 'string' ) {\n\t\treturn str2enum( dtype );\n\t}\n\tif ( t === 'object' && dtype && isInteger( dtype.enum ) ) {\n\t\treturn dtype.enum;\n\t}\n\tif ( isStructConstructorLike( dtype ) ) {\n\t\treturn str2enum( 'userdefined_type' );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default resolve;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an object mapping data type strings to alignments (in bytes).\n*\n* @private\n* @returns {Object} object mapping data type string to alignments (in bytes)\n*/\nfunction table() {\n\treturn {\n\t\t'binary': 1,\n\n\t\t'bool': 1,\n\n\t\t'complex32': 2, // same as float16\n\t\t'complex64': 4, // same as float32\n\t\t'complex128': 8, // same as float64\n\n\t\t'float16': 2,\n\t\t'bfloat16': 2,\n\t\t'float32': 4,\n\t\t'float64': 8,\n\t\t'float128': 16,\n\n\t\t'generic': null,\n\n\t\t'int8': 1,\n\t\t'int16': 2,\n\t\t'int32': 4,\n\t\t'int64': 8,\n\t\t'int128': 16,\n\t\t'int256': 32,\n\n\t\t'uint8': 1,\n\t\t'uint8c': 1,\n\t\t'uint16': 2,\n\t\t'uint32': 4,\n\t\t'uint64': 8,\n\t\t'uint128': 16,\n\t\t'uint256': 32\n\t};\n}\n\n\n// EXPORTS //\n\nexport default table;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isDataTypeObject from '@stdlib/ndarray-base-assert-is-data-type-object';\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport isFunction from '@stdlib/assert-is-function';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported ndarray struct data type.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported ndarray struct data type\n*\n* @example\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var Struct = structFactory([\n* {\n* 'name': 'foo',\n* 'type': 'float64'\n* }\n* ]);\n*\n* var bool = isStructDataType( Struct );\n* // returns true\n*\n* bool = isStructDataType( 'binary' );\n* // returns false\n*\n* bool = isStructDataType( 'float32' );\n* // returns false\n*\n* bool = isStructDataType( 'float64' );\n* // returns false\n*\n* bool = isStructDataType( 'generic' );\n* // returns false\n*\n* bool = isStructDataType( 'int16' );\n* // returns false\n*\n* bool = isStructDataType( 'int32' );\n* // returns false\n*\n* bool = isStructDataType( 'int8' );\n* // returns false\n*\n* bool = isStructDataType( 'uint16' );\n* // returns false\n*\n* bool = isStructDataType( 'uint32' );\n* // returns false\n*\n* bool = isStructDataType( 'uint8' );\n* // returns false\n*\n* bool = isStructDataType( 'uint8c' );\n* // returns false\n*\n* bool = isStructDataType( 'foo' );\n* // returns false\n*/\nfunction isStructDataType( value ) {\n\treturn (\n\t\tisFunction( value ) &&\n\t\tisPositiveInteger( value.alignment ) &&\n\t\tisPositiveInteger( value.byteLength ) &&\n\t\tisFunction( value.byteLengthOf ) &&\n\t\tisFunction( value.byteOffsetOf ) &&\n\t\tisFunction( value.bufferOf ) &&\n\t\tisFunction( value.viewOf )\n\t) || (\n\t\tisDataTypeObject( value ) &&\n\t\tisStructDataType( value.value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isStructDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport hasProp from '@stdlib/assert-has-property';\nimport DataType from '@stdlib/ndarray-dtype-ctor';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is an ndarray data type object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether an input value is an ndarray data type object\n*\n* @example\n* import DataType from '@stdlib/ndarray-dtype-ctor';\n*\n* var bool = isDataTypeObject( new DataType( 'float64' ) );\n* // returns true\n*\n* bool = isDataTypeObject( 'float64' );\n* // returns false\n*\n* bool = isDataTypeObject( {} );\n* // returns false\n*/\nfunction isDataTypeObject( value ) {\n\treturn (\n\t\tvalue instanceof DataType ||\n\t\t(\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\tisInteger( value.alignment ) &&\n\t\t\tisInteger( value.byteLength ) &&\n\t\t\tisString( value.byteOrder ) &&\n\t\t\tisString( value.char ) &&\n\t\t\tisInteger( value.enum ) &&\n\t\t\thasProp( value, 'value' )\n\t\t)\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isDataTypeObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar isProtoOf = Object.prototype.isPrototypeOf;\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests if an object's prototype chain contains a provided prototype.\n*\n* @param {*} value - value to test\n* @param {(Object|Function)} proto - prototype\n* @throws {TypeError} second argument must be an object and not null\n* @returns {boolean} boolean indicating if a provided prototype exists in a prototype chain\n*\n* @example\n* import inherit from '@stdlib/utils-inherit';\n*\n* function Foo() {\n* return this;\n* }\n*\n* function Bar() {\n* return this;\n* }\n* inherit( Bar, Foo );\n*\n* var bar = new Bar();\n*\n* var bool = isPrototypeOf( bar, Foo.prototype );\n* // returns true\n*/\nfunction isPrototypeOf( value, proto ) { // eslint-disable-line stdlib/no-redeclare\n\tvar type = typeof proto;\n\tif (\n\t\tproto === null ||\n\t\t(type !== 'object' && type !== 'function')\n\t) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be either an object (except null) or a function. Value: `%s`.', proto ) );\n\t}\n\ttype = typeof value;\n\tif (\n\t\tvalue === null ||\n\t\t(type !== 'object' && type !== 'function')\n\t) {\n\t\treturn false;\n\t}\n\treturn isProtoOf.call( proto, value );\n}\n\n\n// EXPORTS //\n\nexport default isPrototypeOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof ArrayBuffer === 'function' ) ? ArrayBuffer : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @module @stdlib/array-buffer\n*\n* @example\n* import ctor from '@stdlib/array-buffer';\n*\n* var buf = new ctor( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasArrayBufferSupport from '@stdlib/assert-has-arraybuffer-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasArrayBufferSupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport Float64Array from '@stdlib/array-float64';\nimport GlobalArrayBuffer from './arraybuffer.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `ArrayBuffer` support.\n*\n* @returns {boolean} boolean indicating if an environment has `ArrayBuffer` support\n*\n* @example\n* var bool = hasArrayBufferSupport();\n* // returns \n*/\nfunction hasArrayBufferSupport() {\n\tvar bool;\n\tvar view;\n\tvar buf;\n\n\tif ( typeof GlobalArrayBuffer !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tbuf = new GlobalArrayBuffer( 16 );\n\t\tbool = ( isArrayBuffer( buf ) && typeof GlobalArrayBuffer.isView === 'function' );\n\t\tif ( bool ) {\n\t\t\tview = new Float64Array( buf );\n\t\t\tview[ 0 ] = -3.14;\n\t\t\tview[ 1 ] = NaN;\n\t\t\tbool = (\n\t\t\t\tbool &&\n\t\t\t\tGlobalArrayBuffer.isView( view ) &&\n\t\t\t\tbuf.byteLength === 16 &&\n\t\t\t\tview[ 0 ] === -3.14 &&\n\t\t\t\tview[ 1 ] !== view[ 1 ]\n\t\t\t);\n\t\t}\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasArrayBufferSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Constructor which returns an object used to represent a generic, fixed-length raw binary data buffer.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'float64': setFloat64,\n\t'float32': setFloat32,\n\t'int32': setInt32,\n\t'int16': setInt16,\n\t'int8': setInt8,\n\t'uint32': setUint32,\n\t'uint16': setUint16,\n\t'uint8': setUint8,\n\t'uint8c': setUint8c,\n\t'generic': setGeneric,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Float64Array`.\n*\n* @private\n* @param {Float64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( 4 );\n*\n* setFloat64( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat64( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Float32Array`.\n*\n* @private\n* @param {Float32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Float32Array from '@stdlib/array-float32';\n*\n* var arr = new Float32Array( 4 );\n*\n* setFloat32( arr, 2, 3.0 );\n*\n* var v = arr[ 2 ];\n* // returns 3.0\n*/\nfunction setFloat32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int32Array`.\n*\n* @private\n* @param {Int32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var arr = new Int32Array( 4 );\n*\n* setInt32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int16Array`.\n*\n* @private\n* @param {Int16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int16Array from '@stdlib/array-int16';\n*\n* var arr = new Int16Array( 4 );\n*\n* setInt16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an `Int8Array`.\n*\n* @private\n* @param {Int8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var arr = new Int8Array( 4 );\n*\n* setInt8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setInt8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint32Array`.\n*\n* @private\n* @param {Uint32Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint32Array from '@stdlib/array-uint32';\n*\n* var arr = new Uint32Array( 4 );\n*\n* setUint32( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint32( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint16Array`.\n*\n* @private\n* @param {Uint16Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint16Array from '@stdlib/array-uint16';\n*\n* var arr = new Uint16Array( 4 );\n*\n* setUint16( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint16( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8Array`.\n*\n* @private\n* @param {Uint8Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8Array from '@stdlib/array-uint8';\n*\n* var arr = new Uint8Array( 4 );\n*\n* setUint8( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a `Uint8ClampedArray`.\n*\n* @private\n* @param {Uint8ClampedArray} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {number} value - value to set\n*\n* @example\n* import Uint8ClampedArray from '@stdlib/array-uint8c';\n*\n* var arr = new Uint8ClampedArray( 4 );\n*\n* setUint8c( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setUint8c( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in a generic `Array`.\n*\n* @private\n* @param {Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setGeneric( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setGeneric( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n/**\n* Sets an element in an indexed array-like object.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {*} value - value to set\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* setArrayLike( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr[ idx ] = value;\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an indexed array-like object.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 2, 3 );\n*\n* var v = arr[ 2 ];\n* // returns 3\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// VARIABLES //\n\nvar SETTERS = {\n\t'complex128': setComplex128,\n\t'complex64': setComplex64,\n\t'default': setArrayLike\n};\n\n\n// FUNCTIONS //\n\n/**\n* Sets an element in a `Complex128Array`.\n*\n* @private\n* @param {Complex128Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var arr = new Complex128Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex128( arr, 1, new Complex128( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex128( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in a `Complex64Array`.\n*\n* @private\n* @param {Complex64Array} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* setComplex64( arr, 1, new Complex64( 10.0, 11.0 ) );\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setComplex64( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n/**\n* Sets an element in an array-like object supporting the get/set protocol.\n*\n* @private\n* @param {Collection} arr - input array\n* @param {NonNegativeInteger} idx - element index\n* @param {(Collection|Complex|ComplexArray)} value - value(s)\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* function get( idx ) {\n* return arr[ idx ];\n* }\n*\n* function set( value, idx ) {\n* arr[ idx ] = value;\n* }\n*\n* arr.get = get;\n* arr.set = set;\n*\n* setArrayLike( arr, 2, 10 );\n*\n* var v = arr[ 2 ];\n* // returns 10\n*/\nfunction setArrayLike( arr, idx, value ) {\n\tarr.set( value, idx );\n}\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for setting an element in an array-like object supporting the get/set protocol.\n*\n* @param {string} dtype - array dtype\n* @returns {Function} accessor\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import dtype from '@stdlib/array-dtype';\n*\n* var arr = new Complex64Array( [ 1, 2, 3, 4 ] );\n*\n* var set = setter( dtype( arr ) );\n* set( arr, 1, new Complex64( 10.0, 11.0 ) );\n*\n* var v = arr.get( 1 );\n* // returns [ 10.0, 11.0 ]\n*/\nfunction setter( dtype ) {\n\tvar f = SETTERS[ dtype ];\n\tif ( typeof f === 'function' ) {\n\t\treturn f;\n\t}\n\treturn SETTERS.default;\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport getter from '@stdlib/array-base-getter';\nimport setter from '@stdlib/array-base-setter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport accessorSetter from '@stdlib/array-base-accessor-setter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Converts an array-like to an object likely to have the same \"shape\".\n*\n* ## Notes\n*\n* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different \"hidden\" classes. If a function is provided many objects having different \"shapes\", some JavaScript VMs (e.g., V8) will consider the function \"megamorphic\" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the \"shape\" of the object holding array meta data to ensure that internal functions operating on arrays are provided consistent argument \"shapes\".\n*\n* - The returned object has the following properties:\n*\n* - **data**: reference to the input array.\n* - **dtype**: array data type.\n* - **accessorProtocol**: `boolean` indicating whether the input array uses accessors for getting and setting elements.\n* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.\n*\n* @param {Collection} x - array-like object\n* @returns {Object} object containing array meta data\n*\n* @example\n* var obj = arraylike2object( [ 1, 2, 3, 4 ] );\n* // returns {...}\n*/\nfunction arraylike2object( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn {\n\t\t\t'data': x,\n\t\t\t'dtype': dt,\n\t\t\t'accessorProtocol': true,\n\t\t\t'accessors': [\n\t\t\t\taccessorGetter( dt ),\n\t\t\t\taccessorSetter( dt )\n\t\t\t]\n\t\t};\n\t}\n\treturn {\n\t\t'data': x,\n\t\t'dtype': dt,\n\t\t'accessorProtocol': false,\n\t\t'accessors': [\n\t\t\tgetter( dt ),\n\t\t\tsetter( dt )\n\t\t]\n\t};\n}\n\n\n// EXPORTS //\n\nexport default arraylike2object;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Object} y - output array object\n* @param {Collection} y.data - output array data\n* @param {Array} y.accessors - array element accessors\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Object} output array object\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* function getter( data, idx ) {\n* return data.get( idx );\n* }\n*\n* var x = {\n* 'data': new Complex64Array( [ 1.0, 2.0, 3.0, 4.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* var y = {\n* 'data': new Complex64Array( [ 5.0, 6.0, 7.0, 8.0 ] ),\n* 'accessors': [ getter, setter ]\n* };\n*\n* gcopy( x.data.length, x, 1, 0, y, 1, 0 );\n*\n* var view = reinterpret64( y.data, 0 );\n* // view => [ 1.0, 2.0, 3.0, 4.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar xbuf;\n\tvar ybuf;\n\tvar set;\n\tvar get;\n\tvar ix;\n\tvar iy;\n\tvar i;\n\n\t// Cache references to array data:\n\txbuf = x.data;\n\tybuf = y.data;\n\n\t// Cache a reference to the element accessors:\n\tget = x.accessors[ 0 ];\n\tset = y.accessors[ 1 ];\n\n\tix = offsetX;\n\tiy = offsetY;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( ybuf, iy, get( xbuf, ix ) );\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {Collection} y - output array\n* @param {integer} strideY - `y` stride length\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, y, strideY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\tif ( strideX < 0 ) {\n\t\t\tix = (1-N) * strideX;\n\t\t} else {\n\t\t\tix = 0;\n\t\t}\n\t\tif ( strideY < 0 ) {\n\t\t\tiy = (1-N) * strideY;\n\t\t} else {\n\t\t\tiy = 0;\n\t\t}\n\t\taccessors( N, ox, strideX, ix, oy, strideY, iy );\n\t\treturn oy.data;\n\t}\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ i ] = x[ i ];\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ i ] = x[ i ];\n\t\t\ty[ i+1 ] = x[ i+1 ];\n\t\t\ty[ i+2 ] = x[ i+2 ];\n\t\t\ty[ i+3 ] = x[ i+3 ];\n\t\t\ty[ i+4 ] = x[ i+4 ];\n\t\t\ty[ i+5 ] = x[ i+5 ];\n\t\t\ty[ i+6 ] = x[ i+6 ];\n\t\t\ty[ i+7 ] = x[ i+7 ];\n\t\t}\n\t\treturn y;\n\t}\n\tif ( strideX < 0 ) {\n\t\tix = (1-N) * strideX;\n\t} else {\n\t\tix = 0;\n\t}\n\tif ( strideY < 0 ) {\n\t\tiy = (1-N) * strideY;\n\t} else {\n\t\tiy = 0;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Copies values from `x` into `y`.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {Collection} x - input array\n* @param {integer} strideX - `x` stride length\n* @param {NonNegativeInteger} offsetX - starting `x` index\n* @param {Collection} y - output array\n* @param {integer} strideY - `y` stride length\n* @param {NonNegativeInteger} offsetY - starting `y` index\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction gcopy( N, x, strideX, offsetX, y, strideY, offsetY ) {\n\tvar ix;\n\tvar iy;\n\tvar ox;\n\tvar oy;\n\tvar m;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn y;\n\t}\n\tox = arraylike2object( x );\n\toy = arraylike2object( y );\n\tif ( ox.accessorProtocol || oy.accessorProtocol ) {\n\t\taccessors( N, ox, strideX, offsetX, oy, strideY, offsetY );\n\t\treturn oy.data;\n\t}\n\tix = offsetX;\n\tiy = offsetY;\n\n\t// Use unrolled loops if both strides are equal to `1`...\n\tif ( strideX === 1 && strideY === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\ty[ iy ] = x[ ix ];\n\t\t\t\tix += strideX;\n\t\t\t\tiy += strideY;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn y;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\ty[ iy ] = x[ ix ];\n\t\t\ty[ iy+1 ] = x[ ix+1 ];\n\t\t\ty[ iy+2 ] = x[ ix+2 ];\n\t\t\ty[ iy+3 ] = x[ ix+3 ];\n\t\t\ty[ iy+4 ] = x[ ix+4 ];\n\t\t\ty[ iy+5 ] = x[ ix+5 ];\n\t\t\ty[ iy+6 ] = x[ ix+6 ];\n\t\t\ty[ iy+7 ] = x[ ix+7 ];\n\t\t\tix += M;\n\t\t\tiy += M;\n\t\t}\n\t\treturn y;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\ty[ iy ] = x[ ix ];\n\t\tix += strideX;\n\t\tiy += strideY;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default gcopy;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the minimum value.\n*\n* @param {number} x - first number\n* @param {number} y - second number\n* @returns {number} minimum value\n*\n* @example\n* var v = min( 3.14, 4.2 );\n* // returns 3.14\n*\n* @example\n* var v = min( 3.14, NaN );\n* // returns NaN\n*\n* @example\n* var v = min( NaN, 3.14 );\n* // returns 3.14\n*\n* @example\n* var v = min( -0.0, +0.0 );\n* // returns +0.0\n*\n* @example\n* var v = min( +0.0, -0.0 );\n* // returns -0.0\n*/\nfunction min( x, y ) {\n\tif ( x < y ) {\n\t\treturn x;\n\t}\n\treturn y;\n}\n\n\n// EXPORTS //\n\nexport default min;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* BLAS level 1 routine to copy values from `x` into `y`.\n*\n* @module @stdlib/blas-base-gcopy\n*\n* @example\n* import gcopy from '@stdlib/blas-base-gcopy';\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy( x.length, x, 1, y, 1 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*\n* @example\n* import gcopy from '@stdlib/blas-base-gcopy';\n*\n* var x = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];\n* var y = [ 6.0, 7.0, 8.0, 9.0, 10.0 ];\n*\n* gcopy.ndarray( x.length, x, 1, 0, y, 1, 0 );\n* // y => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\n\n\n// VARIABLES //\n\nvar hasDataView = ( typeof DataView === 'function' ); // eslint-disable-line stdlib/require-globals\n\n\n// MAIN //\n\n/**\n* Tests if a value is a `DataView`.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a DataView\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n* import DataView from '@stdlib/array-dataview';\n*\n* var bool = isDataView( new DataView( new ArrayBuffer( 10 ) ) );\n* // returns true\n*\n* @example\n* var bool = isDataView( [] );\n* // returns false\n*/\nfunction isDataView( value ) {\n\treturn (\n\t\t( hasDataView && value instanceof DataView ) || // eslint-disable-line stdlib/require-globals\n\t\tnativeClass( value ) === '[object DataView]'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isDataView;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof DataView === 'function' ) ? DataView : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = ( typeof DataView === 'function' ) ? DataView : void 0; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Constructor which returns a data view representing a provided array buffer.\n*\n* @module @stdlib/array-dataview\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n* import DataView from '@stdlib/array-dataview';\n*\n* var buf = new ArrayBuffer( 10 );\n* // returns \n*\n* var dv = new DataView( buf );\n* // returns \n*/\n\n// MODULES //\n\nimport hasDataViewSupport from '@stdlib/assert-has-dataview-support';\nimport builtin from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasDataViewSupport() ) {\n\tctor = builtin;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isDataView from '@stdlib/assert-is-dataview';\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport GlobalDataView from './dataview.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `DataView` support.\n*\n* @returns {boolean} boolean indicating if an environment has `DataView` support\n*\n* @example\n* var bool = hasDataViewSupport();\n* // returns \n*/\nfunction hasDataViewSupport() {\n\tvar bool;\n\tvar view;\n\tvar buf;\n\n\tif ( typeof GlobalDataView !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tbuf = new ArrayBuffer( 24 );\n\t\tview = new GlobalDataView( buf, 8 );\n\t\tbool = ( isDataView( view ) && typeof view.getFloat64 === 'function' && typeof view.setFloat64 === 'function' );\n\t\tif ( bool ) {\n\t\t\tview.setFloat64( 0, -3.14 );\n\t\t\tview.setFloat64( 8, NaN );\n\t\t\tbool = (\n\t\t\t\tbool &&\n\t\t\t\tview.buffer === buf &&\n\t\t\t\tview.byteLength === 16 &&\n\t\t\t\tview.byteOffset === 8 &&\n\t\t\t\tview.getFloat64( 0 ) === -3.14 &&\n\t\t\t\tview.getFloat64( 8 ) !== view.getFloat64( 8 )\n\t\t\t);\n\t\t}\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasDataViewSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write polyfill\n\n// MAIN //\n\n/**\n* Constructor which returns a data view representing a provided array buffer.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Define a property name which is unlikely to be used in end user code:\nvar PRIVATE_BUFFER = '__@@##$$@@__struct_buffer__@@$$##@@__';\n\n\n// EXPORTS //\n\nexport default PRIVATE_BUFFER;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar CTOR_NAME = 'Struct';\n\n\n// EXPORTS //\n\nexport default CTOR_NAME;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a non-enumerable read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setNonEnumerableReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setNonEnumerableReadWriteAccessor( obj, prop, getter, setter ) { // eslint-disable-line id-length\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': false,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setNonEnumerableReadWriteAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a read-only accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - accessor\n*\n* @example\n* function getter() {\n* return 'bar';\n* }\n*\n* var obj = {};\n*\n* setReadOnlyAccessor( obj, 'foo', getter );\n*\n* try {\n* obj.foo = 'boop';\n* } catch ( err ) {\n* console.error( err.message );\n* }\n*/\nfunction setReadOnlyAccessor( obj, prop, getter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadOnlyAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defineProperty from '@stdlib/utils-define-property';\n\n\n// MAIN //\n\n/**\n* Defines a read-write accessor.\n*\n* @param {Object} obj - object on which to define the property\n* @param {(string|symbol)} prop - property name\n* @param {Function} getter - get accessor\n* @param {Function} setter - set accessor\n*\n* @example\n* function getter() {\n* return name + ' foo';\n* }\n*\n* function setter( v ) {\n* name = v;\n* }\n*\n* var name = 'bar';\n* var obj = {};\n*\n* setReadWriteAccessor( obj, 'foo', getter, setter );\n*\n* var v = obj.foo;\n* // returns 'bar foo'\n*\n* obj.foo = 'beep';\n*\n* v = obj.foo;\n* // returns 'beep foo'\n*/\nfunction setReadWriteAccessor( obj, prop, getter, setter ) {\n\tdefineProperty( obj, prop, {\n\t\t'configurable': false,\n\t\t'enumerable': true,\n\t\t'get': getter,\n\t\t'set': setter\n\t});\n}\n\n\n// EXPORTS //\n\nexport default setReadWriteAccessor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar DATA_VIEW_METHODS = {\n\t'int8': {\n\t\t'get': 'getInt8',\n\t\t'set': 'setInt8'\n\t},\n\t'int16': {\n\t\t'get': 'getInt16',\n\t\t'set': 'setInt16'\n\t},\n\t'int32': {\n\t\t'get': 'getInt32',\n\t\t'set': 'setInt32'\n\t},\n\t'int64': {\n\t\t'get': 'getBigInt64',\n\t\t'set': 'setBigInt64'\n\t},\n\t'uint8': {\n\t\t'get': 'getUint8',\n\t\t'set': 'setUint8'\n\t},\n\t'uint16': {\n\t\t'get': 'getUint16',\n\t\t'set': 'setUint16'\n\t},\n\t'uint32': {\n\t\t'get': 'getUint32',\n\t\t'set': 'setUint32'\n\t},\n\t'uint64': {\n\t\t'get': 'getBigUint64',\n\t\t'set': 'setBigUint64'\n\t},\n\t'float16': {\n\t\t'get': 'getFloat16',\n\t\t'set': 'setFloat16'\n\t},\n\t'float32': {\n\t\t'get': 'getFloat32',\n\t\t'set': 'setFloat32'\n\t},\n\t'float64': {\n\t\t'get': 'getFloat64',\n\t\t'set': 'setFloat64'\n\t},\n\t'complex32': {\n\t\t'get': 'getFloat16',\n\t\t'set': 'setFloat16'\n\t},\n\t'complex64': {\n\t\t'get': 'getFloat32',\n\t\t'set': 'setFloat32'\n\t},\n\t'complex128': {\n\t\t'get': 'getFloat64',\n\t\t'set': 'setFloat64'\n\t},\n\t'bool': {\n\t\t'get': 'getUint8',\n\t\t'set': 'setUint8'\n\t}\n};\n\n\n// EXPORTS //\n\nexport default DATA_VIEW_METHODS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from './ctors.js';\n\n\n// VARIABLES //\n\nvar bool;\n\n\n// FUNCTIONS //\n\n/**\n* Returns a boolean indicating if an environment is little endian.\n*\n* @private\n* @returns {boolean} boolean indicating if an environment is little endian\n*\n* @example\n* var bool = isLittleEndian();\n* // returns \n*/\nfunction isLittleEndian() {\n\tvar uint16view;\n\tvar uint8view;\n\n\tuint16view = new ctors[ 'uint16' ]( 1 );\n\n\t/*\n\t* Set the uint16 view to a value having distinguishable lower and higher order words.\n\t*\n\t* 4660 => 0x1234 => 0x12 0x34 => '00010010 00110100' => (0x12,0x34) == (18,52)\n\t*/\n\tuint16view[ 0 ] = 0x1234;\n\n\t// Create a uint8 view on top of the uint16 buffer:\n\tuint8view = new ctors[ 'uint8' ]( uint16view.buffer );\n\n\t// If little endian, the least significant byte will be first...\n\treturn ( uint8view[ 0 ] === 0x34 );\n}\n\n\n// MAIN //\n\nbool = isLittleEndian();\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint16Array from '@stdlib/array-uint16';\n\n\n// MAIN //\n\nvar ctors = {\n\t'uint16': Uint16Array,\n\t'uint8': Uint8Array\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex64 from '@stdlib/complex-float32-ctor';\nimport Complex128 from '@stdlib/complex-float64-ctor';\n\n\n// MAIN //\n\n// Mapping from data types to constructors...\nvar ctors = {\n\t'complex64': Complex64,\n\t'complex128': Complex128\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport table from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns a complex number constructor.\n*\n* @param {string} dtype - data type\n* @returns {(Function|null)} constructor or null\n*\n* @example\n* var ctor = ctors( 'complex128' );\n* // returns \n*\n* @example\n* var ctor = ctors( 'complex' );\n* // returns null\n*/\nfunction ctors( dtype ) {\n\treturn table[ dtype ] || null;\n}\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from '@stdlib/complex-ctors';\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar TABLE = {\n\t'float64': 'complex128',\n\t'float32': 'complex64'\n};\nvar DEFAULT_CTOR = ctors( TABLE[ 'float64' ] );\n\n\n// MAIN //\n\n/**\n* Creates a complex number.\n*\n* @param {number} real - real component\n* @param {number} imag - imaginary component\n* @param {string} [dtype=\"float64\"] - data type\n* @throws {TypeError} must provide a recognized data type\n* @returns {Complex} complex number\n*\n* @example\n* var z = complex( 5.0, 3.0, 'float64' );\n* // returns \n*/\nfunction complex( real, imag, dtype ) {\n\tvar ctor;\n\tif ( arguments.length > 2 ) {\n\t\tctor = ctors( TABLE[ dtype ] );\n\t\tif ( ctor ) {\n\t\t\treturn new ctor( real, imag );\n\t\t}\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized data type. Value: `%s`.', dtype ) );\n\t}\n\treturn new DEFAULT_CTOR( real, imag );\n}\n\n\n// EXPORTS //\n\nexport default complex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport complex from '@stdlib/complex-cmplx';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// VARIABLES //\n\nvar CMPLX_TO_REAL = {\n\t'complex128': 'float64',\n\t'complex64': 'float32',\n\t'complex32': 'float16'\n};\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for resolving field data\n*/\nfunction getComplex( obj, method ) {\n\treturn getter;\n\n\t/**\n\t* Reads a complex number from an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {Complex} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\tvar re = view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );\n\t\tvar im = view[ method ]( obj.byteOffset+(obj.byteLength/2), IS_LITTLE_ENDIAN );\n\t\treturn complex( re, im, CMPLX_TO_REAL[ obj.type ] );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getComplex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Int16Array from '@stdlib/array-int16';\nimport Int32Array from '@stdlib/array-int32';\nimport Int8Array from '@stdlib/array-int8';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\n// Mapping from data types to constructors...\nvar ctors = {\n\t'float64': Float64Array,\n\t'float32': Float32Array,\n\t'int16': Int16Array,\n\t'int32': Int32Array,\n\t'int8': Int8Array,\n\t'uint16': Uint16Array,\n\t'uint32': Uint32Array,\n\t'uint8': Uint8Array,\n\t'uint8c': Uint8ClampedArray,\n\t'complex64': Complex64Array,\n\t'complex128': Complex128Array,\n\t'bool': BooleanArray\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport table from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns a typed array constructor.\n*\n* @param {string} dtype - data type\n* @returns {(Function|null)} constructor or null\n*\n* @example\n* var ctor = ctors( 'float64' );\n* // returns \n*\n* @example\n* var ctor = ctors( 'float' );\n* // returns null\n*/\nfunction ctors( dtype ) {\n\treturn table[ dtype ] || null;\n}\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\n\n\n// MAIN //\n\n/**\n* Reinterprets a `BooleanArray` as a `Uint8Array`.\n*\n* @param {BooleanArray} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @returns {Uint8Array} `Uint8Array` view\n*\n* @example\n* import BooleanArray from '@stdlib/array-bool';\n*\n* var x = new BooleanArray( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\treturn new Uint8Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default array settings.\n*\n* @returns {Object} defaults\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t// Data types:\n\t\t'dtypes': {\n\t\t\t'default': 'float64',\n\t\t\t'numeric': 'float64',\n\t\t\t'real': 'float64',\n\t\t\t'floating_point': 'float64',\n\t\t\t'real_floating_point': 'float64',\n\t\t\t'complex_floating_point': 'complex128',\n\t\t\t'integer': 'int32',\n\t\t\t'signed_integer': 'int32',\n\t\t\t'unsigned_integer': 'uint32',\n\t\t\t'boolean': 'bool',\n\t\t\t'index': 'int32',\n\t\t\t'integer_index': 'int32',\n\t\t\t'boolean_index': 'bool',\n\t\t\t'mask_index': 'uint8'\n\t\t}\n\t};\n}\n\n\n// EXPORTS //\n\nexport default defaults;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport defaults from './main.js';\n\n\n// VARIABLES //\n\nvar DEFAULTS = defaults();\nvar HASH = {\n\t'dtypes.default': DEFAULTS.dtypes.default,\n\t'dtypes.numeric': DEFAULTS.dtypes.numeric,\n\t'dtypes.real': DEFAULTS.dtypes.real,\n\t'dtypes.floating_point': DEFAULTS.dtypes.floating_point,\n\t'dtypes.real_floating_point': DEFAULTS.dtypes.real_floating_point,\n\t'dtypes.complex_floating_point': DEFAULTS.dtypes.complex_floating_point,\n\t'dtypes.integer': DEFAULTS.dtypes.integer,\n\t'dtypes.signed_integer': DEFAULTS.dtypes.signed_integer,\n\t'dtypes.unsigned_integer': DEFAULTS.dtypes.unsigned_integer,\n\t'dtypes.boolean': DEFAULTS.dtypes.boolean,\n\t'dtypes.index': DEFAULTS.dtypes.index,\n\t'dtypes.integer_index': DEFAULTS.dtypes.integer_index,\n\t'dtypes.boolean_index': DEFAULTS.dtypes.boolean_index,\n\t'dtypes.mask_index': DEFAULTS.dtypes.mask_index\n};\n\n\n// MAIN //\n\n/**\n* Returns a default array setting.\n*\n* @param {string} name - setting name\n* @returns {*} default setting or null\n*\n* @example\n* var v = get( 'dtypes.default' );\n* // returns \n*/\nfunction get( name ) {\n\tvar v = HASH[ name ];\n\treturn ( v === void 0 ) ? null : v;\n}\n\n\n// EXPORTS //\n\nexport default get;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return default array settings.\n*\n* @module @stdlib/array-defaults\n*\n* @example\n* import defaults from '@stdlib/array-defaults';\n*\n* var o = defaults();\n* // returns {...}\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport get from './get.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'get', get );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport ctors from '@stdlib/array-typed-ctors';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport defaults from '@stdlib/array-defaults';\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar DEFAULT_DTYPE = defaults.get( 'dtypes.default' );\nvar Complex64Array = ctors( 'complex64' );\nvar Complex128Array = ctors( 'complex128' );\nvar BooleanArray = ctors( 'bool' );\n\n\n// MAIN //\n\n/**\n* Creates a typed array.\n*\n* @param {(NonNegativeInteger|ComplexArray|TypedArray|ArrayLikeObject|ArrayBuffer)} [arg] - a length, typed array, array-like object, or buffer\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @param {string} [dtype=\"float64\"] - data type\n* @throws {TypeError} must provide a recognized data type\n* @returns {(ComplexArray|TypedArray)} typed array\n*\n* @example\n* var arr = typedarray();\n* // returns \n*\n* @example\n* var arr = typedarray( 2 );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* var arr = typedarray( 2, 'float32' );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* var arr = typedarray( [ 0.5, 0.5 ] );\n* // returns [ 0.5, 0.5 ]\n*\n* @example\n* var arr = typedarray( [ 5, -3 ], 'int32' );\n* // returns [ 5, -3 ]\n*\n* @example\n* var arr1 = typedarray( [ 5, 3 ], 'int32' );\n* var arr2 = typedarray( arr1 );\n* // returns [ 5.0, 3.0 ]\n*\n* @example\n* var arr1 = typedarray( [ 5, 3 ], 'int32' );\n* var arr2 = typedarray( arr1, 'uint32' );\n* // returns [ 5, 3 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf, 'float32' );\n* // returns [ 0.0, 0.0, 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf, 8 );\n* // returns [ 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = typedarray( buf, 8, 'float32' );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = typedarray( buf, 8, 2 );\n* // returns [ 0.0, 0.0 ]\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = typedarray( buf, 8, 2, 'int32' );\n* // returns [ 0, 0 ]\n*/\nfunction typedarray() {\n\tvar nargs;\n\tvar dtype;\n\tvar ctor;\n\tvar arg;\n\n\tnargs = arguments.length;\n\tif ( nargs && isString( arguments[ nargs-1 ] ) ) {\n\t\tnargs -= 1;\n\t\tdtype = arguments[ nargs ];\n\t} else {\n\t\tdtype = DEFAULT_DTYPE;\n\t}\n\tctor = ctors( dtype );\n\tif ( ctor === null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a recognized data type. Value: `%s`.', dtype ) );\n\t}\n\tif ( nargs <= 0 ) {\n\t\treturn new ctor( 0 );\n\t}\n\tif ( nargs === 1 ) {\n\t\targ = arguments[ 0 ];\n\n\t\t// Note: the following checks are not particularly robust, as `instanceof` will fail for cross-realm instances...\n\t\tif ( arg instanceof Complex64Array ) {\n\t\t\targ = reinterpret64( arg, 0 );\n\t\t} else if ( arg instanceof Complex128Array ) {\n\t\t\targ = reinterpret128( arg, 0 );\n\t\t} else if ( arg instanceof BooleanArray ) {\n\t\t\targ = reinterpretBoolean( arg, 0 );\n\t\t}\n\t\treturn new ctor( arg );\n\t}\n\tif ( nargs === 2 ) {\n\t\treturn new ctor( arguments[0], arguments[1] );\n\t}\n\treturn new ctor( arguments[0], arguments[1], arguments[2] );\n}\n\n\n// EXPORTS //\n\nexport default typedarray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\nimport DATA_VIEW_METHODS from './data_view_methods.js';\nimport getNumber from './get_number.js';\nimport getBoolean from './get_boolean.js';\nimport getComplex from './get_complex.js';\nimport getBigInt from './get_bigint.js';\nimport getStruct from './get_struct.js';\nimport getTypedArray from './get_typedarray.js';\nimport getStructArray from './get_struct_array.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @throws {Error} unexpected error\n* @returns {Function} function for resolving field data\n*/\nfunction getter( obj ) {\n\tif ( obj.length ) {\n\t\tif ( obj.isStructType ) {\n\t\t\treturn getStructArray( obj );\n\t\t}\n\t\treturn getTypedArray( obj );\n\t}\n\tswitch ( obj.type ) {\n\tcase 'float64':\n\tcase 'float32':\n\tcase 'float16':\n\tcase 'int8':\n\tcase 'int16':\n\tcase 'int32':\n\tcase 'uint8':\n\tcase 'uint16':\n\tcase 'uint32':\n\t\treturn getNumber( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tcase 'int64':\n\tcase 'uint64':\n\t\treturn getBigInt( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tcase 'bool':\n\t\treturn getBoolean( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tcase 'complex128':\n\tcase 'complex64':\n\tcase 'complex32':\n\t\treturn getComplex( obj, DATA_VIEW_METHODS[ obj.type ].get );\n\n\tdefault:\n\t\tif ( obj.isStructType ) {\n\t\t\treturn getStruct( obj );\n\t\t}\n\t\t// Ensure that we fail loudly if we have failed to add support for newly added data types:\n\t\tthrow new Error( format( 'unexpected error. Unrecognized data type. Value: `%s`.', obj.type ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for resolving field data\n*/\nfunction getStructArray( obj ) {\n\treturn getter;\n\n\t/**\n\t* Returns a list of `struct` views of an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {Array} result\n\t*/\n\tfunction getter() {\n\t\tvar offset;\n\t\tvar view;\n\t\tvar out;\n\t\tvar i;\n\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\toffset = view.byteOffset + obj.byteOffset;\n\t\tout = [];\n\t\tfor ( i = 0; i < obj.length; i++ ) {\n\t\t\tout.push( new obj.type( view.buffer, offset, obj.byteLength ) );\n\t\t\toffset += obj.byteOffset;\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getStructArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport typedarray from '@stdlib/array-typed';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for resolving field data\n*/\nfunction getTypedArray( obj ) {\n\treturn getter;\n\n\t/**\n\t* Returns a typed array view of an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {TypedArray} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn typedarray( view.buffer, view.byteOffset+obj.byteOffset, obj.length, obj.type ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for resolving field data\n*/\nfunction getBigInt( obj, method ) {\n\treturn getter;\n\n\t/**\n\t* Reads a BigInt value from an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {BigInt} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport Boolean from '@stdlib/boolean-ctor';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for resolving field data\n*/\nfunction getBoolean( obj, method ) {\n\treturn getter;\n\n\t/**\n\t* Reads a boolean value from an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {boolean} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn Boolean( view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for resolving field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for resolving field data\n*/\nfunction getStruct( obj ) {\n\treturn getter;\n\n\t/**\n\t* Returns a `struct` view of an underlying byte buffer.\n\t*\n\t* @private\n\t* @returns {Object} result\n\t*/\n\tfunction getter() {\n\t\tvar view = this[ PRIVATE_BUFFER ];\n\t\treturn new obj.type( view.buffer, view.byteOffset+obj.byteOffset, obj.byteLength ); // eslint-disable-line max-len\n\t}\n}\n\n\n// EXPORTS //\n\nexport default getStruct;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport replace from '@stdlib/string-base-replace';\nimport DTYPES from './dtypes.json';\n\n\n// VARIABLES //\n\nvar RE_SUFFIX = /_and_generic$/;\n\n\n// MAIN //\n\n/**\n* Returns a list of array data types.\n*\n* @param {string} [kind] - data type kind\n* @returns {StringArray} list of array data types\n*\n* @example\n* var list = dtypes();\n* // e.g., returns [ 'float32', 'float64', ... ]\n*\n* @example\n* var list = dtypes( 'floating_point' );\n* // returns [...]\n*/\nfunction dtypes() {\n\tvar kind;\n\tvar out;\n\tvar FLG;\n\tif ( arguments.length === 0 ) {\n\t\treturn DTYPES.all.slice();\n\t}\n\tFLG = false;\n\tkind = arguments[ 0 ];\n\tif ( RE_SUFFIX.test( kind ) ) {\n\t\tkind = replace( kind, RE_SUFFIX, '' );\n\t\tif ( kind !== 'all' && kind !== 'index' ) {\n\t\t\tFLG = true;\n\t\t}\n\t}\n\tout = DTYPES[ kind ];\n\tout = ( out ) ? out.slice() : [];\n\tif ( FLG && out.length > 0 ) {\n\t\tout.push( 'generic' );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array real-valued floating-point data type.\n*\n* @name isRealFloatingPointDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array real-valued floating-point data type\n*\n* @example\n* var bool = isRealFloatingPointDataType( 'float32' );\n* // returns true\n*\n* bool = isRealFloatingPointDataType( 'float64' );\n* // returns true\n*\n* bool = isRealFloatingPointDataType( 'generic' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'int16' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'int32' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'int8' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint16' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint32' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint8' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'uint8c' );\n* // returns false\n*\n* bool = isRealFloatingPointDataType( 'foo' );\n* // returns false\n*/\nvar isRealFloatingPointDataType = contains( dtypes( 'real_floating_point' ) ); // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default isRealFloatingPointDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array signed integer data type.\n*\n* @name isSignedIntegerDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array signed integer data type\n*\n* @example\n* var bool = isSignedIntegerDataType( 'float32' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'float64' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'generic' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'int16' );\n* // returns true\n*\n* bool = isSignedIntegerDataType( 'int32' );\n* // returns true\n*\n* bool = isSignedIntegerDataType( 'int8' );\n* // returns true\n*\n* bool = isSignedIntegerDataType( 'uint16' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'uint32' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'uint8' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'uint8c' );\n* // returns false\n*\n* bool = isSignedIntegerDataType( 'foo' );\n* // returns false\n*/\nvar isSignedIntegerDataType = contains( dtypes( 'signed_integer' ) );\n\n\n// EXPORTS //\n\nexport default isSignedIntegerDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getGlobal from '@stdlib/utils-global';\n\n\n// VARIABLES //\n\nvar Global = getGlobal();\n\n\n// MAIN //\n\n/**\n* Tests for native `BigInt` support.\n*\n* @returns {boolean} boolean indicating if an environment has `BigInt` support\n*\n* @example\n* var bool = hasBigIntSupport();\n* // returns \n*/\nfunction hasBigIntSupport() {\n\treturn (\n\t\ttypeof Global.BigInt === 'function' &&\n\t\ttypeof BigInt === 'function' && // eslint-disable-line stdlib/require-globals\n\t\ttypeof Global.BigInt( '1' ) === 'bigint' &&\n\t\ttypeof BigInt( '1' ) === 'bigint' // eslint-disable-line stdlib/require-globals, no-undef, stdlib/no-builtin-big-int\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasBigIntSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is a BigInt primitive.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a BigInt primitive\n*/\nfunction isBigInt( value ) {\n\treturn ( typeof value === 'bigint' );\n}\n\n\n// EXPORTS //\n\nexport default isBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport nativeClass from '@stdlib/utils-native-class';\nimport test from './try2valueof.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a BigInt object.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a BigInt object\n*/\nfunction BigInt( value ) {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tnativeClass( value ) === '[object BigInt]' &&\n\t\ttest( value )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default BigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Attempts to call a `BigInt` method.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if able to call a `BigInt` method\n*/\nfunction test( value ) {\n\ttry {\n\t\treturn (\n\t\t\t// Objects created via `Object.create( null )` have no `valueOf()` method:\n\t\t\ttypeof value.valueOf() === 'bigint'\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default test;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a BigInt.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is a BigInt\n*/\nfunction isBigInt( value ) {\n\treturn ( isPrimitive( value ) || isObject( value ) );\n}\n\n\n// EXPORTS //\n\nexport default isBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Creates a function which always returns the same value.\n*\n* @param {*} [value] - value to always return\n* @returns {Function} constant function\n*\n* @example\n* var fcn = wrap( 3.14 );\n*\n* var v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*\n* v = fcn();\n* // returns 3.14\n*/\nfunction wrap( value ) {\n\treturn constantFunction;\n\n\t/**\n\t* Constant function.\n\t*\n\t* @private\n\t* @returns {*} constant value\n\t*/\n\tfunction constantFunction() {\n\t\treturn value;\n\t}\n}\n\n\n// EXPORTS //\n\nexport default wrap;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport isSymbol from './generic.js';\nimport isPrimitive from './primitive.js';\nimport isObject from './object.js';\n\n\n// MAIN //\n\nsetReadOnly( isSymbol, 'isPrimitive', isPrimitive );\nsetReadOnly( isSymbol, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default isSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport constantFunction from '@stdlib/utils-constant-function';\n\n\n// MAIN //\n\nvar isBigInt = constantFunction( false );\nvar isPrimitive = constantFunction( false );\nvar isObject = constantFunction( false );\n\nsetReadOnly( isBigInt, 'isPrimitive', isPrimitive );\nsetReadOnly( isBigInt, 'isObject', isObject );\n\n\n// EXPORTS //\n\nexport default isBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test if a value is a BigInt.\n*\n* @module @stdlib/assert-is-bigint\n*\n* @example\n* import BigInt from '@stdlib/bigint-ctor';\n* import isBigInt from '@stdlib/assert-is-bigint';\n*\n* var bool = isBigInt( BigInt( '1' ) );\n* // returns true\n*\n* bool = isBigInt( Object( BigInt( '1' ) ) );\n* // returns true\n*\n* bool = isBigInt( {} );\n* // returns false\n*\n* @example\n* import { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\n*\n* var bool = isBigInt( BigInt( '1' ) );\n* // returns true\n*\n* bool = isBigInt( Object( BigInt( '1' ) ) );\n* // returns false\n*\n* bool = isBigInt( {} );\n* // returns false\n*\n* @example\n* import { isObject as isBigIntObject } from '@stdlib/assert-is-bigint';\n*\n* var bool = isBigIntObject( BigInt( '1' ) );\n* // returns false\n*\n* bool = isBigIntObject( Object( BigInt( '1' ) ) );\n* // returns true\n*\n* bool = isBigIntObject( {} );\n* // returns false\n*/\n\n// MODULES //\n\nimport hasBigInts from '@stdlib/assert-has-bigint-support';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar isBigInt;\nif ( hasBigInts() ) {\n\tisBigInt = main;\n} else {\n\tisBigInt = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default isBigInt;\n\n// exports: { \"isPrimitive\": \"isBigInt.isPrimitive\", \"isObject\": \"isBigInt.isObject\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport SAFE_CASTS from './safe_casts.json';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of safe casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAFE_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAFE_CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast.\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = safeCasts( 'float32' );\n* // returns [...]\n*/\nfunction safeCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default safeCasts;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport safeCasts from '@stdlib/ndarray-safe-casts';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// VARIABLES //\n\nvar TABLE = safeCasts();\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be safely cast to another ndarray data type.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @returns {boolean} boolean indicating if a data type can be safely cast to another data type\n*\n* @example\n* var bool = isSafeCast( 'float32', 'float64' );\n* // returns true\n*\n* bool = isSafeCast( 'float64', 'int32' );\n* // returns false\n*/\nfunction isSafeCast( from, to ) {\n\tvar t;\n\tfrom = resolveStr( from );\n\tto = resolveStr( to );\n\tif ( from === to ) { // note: for \"struct\" data types, require strict equality to be considered a safe cast\n\t\treturn true;\n\t}\n\tt = TABLE[ from ];\n\tif ( t ) {\n\t\treturn t[ to ] > 0;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isSafeCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport CASTS from './data.json';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast and, for floating-point data types, can be downcast.\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = mostlySafeCasts( 'float32' );\n* // returns [...]\n*/\nfunction mostlySafeCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default mostlySafeCasts;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport casts from '@stdlib/ndarray-mostly-safe-casts';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// VARIABLES //\n\nvar TABLE = casts();\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be safely cast or, for floating-point data types, downcast to another ndarray data type.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @returns {boolean} boolean indicating if a data type can be cast to another data type\n*\n* @example\n* var bool = isMostlySafeCast( 'float32', 'float64' );\n* // returns true\n*\n* bool = isMostlySafeCast( 'float64', 'int32' );\n* // returns false\n*/\nfunction isMostlySafeCast( from, to ) {\n\tvar t;\n\tfrom = resolveStr( from );\n\tto = resolveStr( to );\n\tif ( from === to ) { // note: for \"struct\" data types, require strict equality to be considered a \"mostly\" safe cast\n\t\treturn true;\n\t}\n\tt = TABLE[ from ];\n\tif ( t ) {\n\t\treturn t[ to ] > 0;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isMostlySafeCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport objectKeys from '@stdlib/utils-keys';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport resolve from '@stdlib/ndarray-base-dtype-resolve-str';\nimport SAME_KIND_CASTS from './same_kind_casts.json';\n\n\n// VARIABLES //\n\nvar TABLE;\n\n\n// FUNCTIONS //\n\n/**\n* Generates a full table of same \"kind\" casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateFullTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAME_KIND_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAME_KIND_CASTS[ dt1 ];\n\t\ttmp = {};\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\ttmp[ dt2 ] = o[ dt2 ];\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n/**\n* Generates a table of same \"kind\" casts for each ndarray data type.\n*\n* @private\n* @returns {Object} table\n*/\nfunction generateTable() {\n\tvar dtypes;\n\tvar ntypes;\n\tvar out;\n\tvar tmp;\n\tvar dt1;\n\tvar dt2;\n\tvar o;\n\tvar j;\n\tvar i;\n\n\tout = {};\n\tdtypes = objectKeys( SAME_KIND_CASTS );\n\tntypes = dtypes.length;\n\tfor ( i = 0; i < ntypes; i++ ) {\n\t\tdt1 = dtypes[ i ];\n\t\to = SAME_KIND_CASTS[ dt1 ];\n\t\ttmp = [];\n\t\tfor ( j = 0; j < ntypes; j++ ) {\n\t\t\tdt2 = dtypes[ j ];\n\t\t\tif ( o[ dt2 ] === 1 ) {\n\t\t\t\ttmp.push( dt2 );\n\t\t\t}\n\t\t}\n\t\tout[ dt1 ] = tmp;\n\t}\n\treturn out;\n}\n\n\n// MAIN //\n\n/**\n* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast or cast within the same \"kind\".\n*\n* @param {*} [dtype] - ndarray data type value\n* @returns {(Object|StringArray|null)} list of ndarray data types or null\n*\n* @example\n* var list = sameKindCasts( 'float32' );\n* // returns [...]\n*/\nfunction sameKindCasts( dtype ) {\n\tif ( arguments.length === 0 ) {\n\t\treturn generateFullTable();\n\t}\n\tif ( TABLE === void 0 ) {\n\t\t// Lazily generate table...\n\t\tTABLE = generateTable();\n\t}\n\tdtype = resolve( dtype );\n\tif ( hasOwnProp( TABLE, dtype ) ) {\n\t\treturn TABLE[ dtype ].slice();\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default sameKindCasts;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport sameKindCasts from '@stdlib/ndarray-same-kind-casts';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// VARIABLES //\n\nvar TABLE = sameKindCasts();\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be safely cast to, or is of the same \"kind\" as, another ndarray data type.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @returns {boolean} boolean indicating if a data type can be cast to another data type\n*\n* @example\n* var bool = isSameKindCast( 'float32', 'float64' );\n* // returns true\n*\n* bool = isSameKindCast( 'uint16', 'int16' );\n* // returns false\n*/\nfunction isSameKindCast( from, to ) {\n\tvar t;\n\tfrom = resolveStr( from );\n\tto = resolveStr( to );\n\tif ( from === to ) { // note: for \"struct\" data types, require strict equality to be considered a safe cast\n\t\treturn true;\n\t}\n\tt = TABLE[ from ];\n\tif ( t ) {\n\t\treturn t[ to ] > 0;\n\t}\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isSameKindCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isSafeCast from '@stdlib/ndarray-base-assert-is-safe-data-type-cast';\nimport isMostlySafeCast from '@stdlib/ndarray-base-assert-is-mostly-safe-data-type-cast';\nimport isSameKindCast from '@stdlib/ndarray-base-assert-is-same-kind-data-type-cast';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a provided ndarray data type can be cast to another ndarray data type according to a specified casting mode.\n*\n* @param {*} from - ndarray data type\n* @param {*} to - ndarray data type\n* @param {string} casting - ndarray casting mode\n* @returns {boolean} boolean indicating if a data type can be cast to another data type\n*\n* @example\n* var bool = isAllowedCast( 'float32', 'float64', 'safe' );\n* // returns true\n*\n* bool = isAllowedCast( 'float64', 'int32', 'safe' );\n* // returns false\n*/\nfunction isAllowedCast( from, to, casting ) {\n\tvar dt1;\n\tvar dt2;\n\n\t// Anything goes for \"unsafe\" casting...\n\tif ( casting === 'unsafe' ) {\n\t\treturn true;\n\t}\n\tdt1 = resolveStr( from );\n\tdt2 = resolveStr( to );\n\n\t// \"Casting\" to the same data type is always allowed, regardless of the casting mode...\n\tif ( dt1 === dt2 ) {\n\t\treturn true;\n\t}\n\t// No casts between different data types are allowed in \"none\" or \"equiv\" casting modes...\n\tif ( casting === 'none' || casting === 'equiv' ) {\n\t\treturn false;\n\t}\n\t// In \"safe\" casting mode, only casts which preserve values are allowed...\n\tif ( casting === 'safe' ) {\n\t\treturn isSafeCast( from, to );\n\t}\n\t// In \"mostly-safe\" casting mode, in addition to \"safe\" casts, for floating-point data types, downcasts are allowed...\n\tif ( casting === 'mostly-safe' ) {\n\t\treturn isMostlySafeCast( from, to );\n\t}\n\t// In \"same-kind\" casting mode, in addition to \"safe\" casts, casts within a \"kind\" (e.g., between signed integers or between floating-point numbers) are allowed...\n\treturn isSameKindCast( from, to );\n}\n\n\n// EXPORTS //\n\nexport default isAllowedCast;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Smallest positive single-precision floating-point subnormal number.\n*\n* @module @stdlib/constants-float32-smallest-subnormal\n* @type {number}\n*\n* @example\n* import FLOAT32_SMALLEST_SUBNORMAL from '@stdlib/constants-float32-smallest-subnormal';\n* // returns 1.401298464324817e-45\n*/\n\n\n// MAIN //\n\n/**\n* Smallest positive single-precision floating-point subnormal number.\n*\n* ## Notes\n*\n* The number has the value\n*\n* ```tex\n* \\frac{1}{2^{127-1} 2^{23}}\n* ```\n*\n* which corresponds to the bit sequence\n*\n* ```binarystring\n* 0 00000000 00000000000000000000001\n* ```\n*\n* @constant\n* @type {number}\n* @default 1.401298464324817e-45\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT32_SMALLEST_SUBNORMAL = 1.401298464324817e-45;\n\n\n// EXPORTS //\n\nexport default FLOAT32_SMALLEST_SUBNORMAL;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Maximum safe single-precision floating-point integer.\n*\n* @module @stdlib/constants-float32-max-safe-integer\n* @type {number}\n*\n* @example\n* import FLOAT32_MAX_SAFE_INTEGER from '@stdlib/constants-float32-max-safe-integer';\n* // returns 16777215\n*/\n\n\n// MAIN //\n\n/**\n* Maximum safe single-precision floating-point integer.\n*\n* ## Notes\n*\n* The maximum safe integer is given by\n*\n* ```tex\n* 2^{24} - 1\n* ```\n*\n* @constant\n* @type {number}\n* @default 16777215\n* @see [Safe Integers]{@link http://www.2ality.com/2013/10/safe-integers.html}\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT32_MAX_SAFE_INTEGER = 16777215;\n\n\n// EXPORTS //\n\nexport default FLOAT32_MAX_SAFE_INTEGER;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Minimum safe single-precision floating-point integer.\n*\n* @module @stdlib/constants-float32-min-safe-integer\n* @type {number}\n*\n* @example\n* import FLOAT32_MIN_SAFE_INTEGER from '@stdlib/constants-float32-min-safe-integer';\n* // returns -16777215\n*/\n\n\n// MAIN //\n\n/**\n* Minimum safe single-precision floating-point integer.\n*\n* ## Notes\n*\n* The minimum safe integer is given by\n*\n* ```tex\n* -(2^{24} - 1)\n* ```\n*\n* @constant\n* @type {number}\n* @default -16777215\n* @see [Safe Integers]{@link http://www.2ality.com/2013/10/safe-integers.html}\n* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}\n*/\nvar FLOAT32_MIN_SAFE_INTEGER = -16777215;\n\n\n// EXPORTS //\n\nexport default FLOAT32_MIN_SAFE_INTEGER;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport isInteger from '@stdlib/math-base-assert-is-integer';\nimport isNegativeZero from '@stdlib/math-base-assert-is-negative-zero';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport PINF from '@stdlib/constants-float64-pinf';\nimport NINF from '@stdlib/constants-float64-ninf';\nimport FLOAT32_SMALLEST_SUBNORMAL from '@stdlib/constants-float32-smallest-subnormal'; // eslint-disable-line id-length\nimport FLOAT32_MAX_SAFE_INTEGER from '@stdlib/constants-float32-max-safe-integer';\nimport FLOAT32_MIN_SAFE_INTEGER from '@stdlib/constants-float32-min-safe-integer';\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport UINT8_MAX from '@stdlib/constants-uint8-max';\nimport UINT16_MAX from '@stdlib/constants-uint16-max';\nimport UINT32_MAX from '@stdlib/constants-uint32-max';\n\n\n// FUNCTIONS //\n\n/**\n* Returns the minimum floating-point array data type of the closest \"kind\" necessary for storing a provided scalar.\n*\n* @private\n* @param {number} value - real value\n* @returns {string} array data type\n*/\nfunction minFloatDataType( value ) {\n\tif ( value !== value || value === PINF || value === NINF ) {\n\t\treturn 'float32';\n\t}\n\tif ( isInteger( value ) ) {\n\t\tif ( value >= FLOAT32_MIN_SAFE_INTEGER && value <= FLOAT32_MAX_SAFE_INTEGER ) { // eslint-disable-line max-len\n\t\t\treturn 'float32';\n\t\t}\n\t\treturn 'float64';\n\t}\n\t// Assume that if we are provided a tiny value, we don't want to underflow to zero by storing as `float32`...\n\tif (\n\t\tvalue > -FLOAT32_SMALLEST_SUBNORMAL &&\n\t\tvalue < FLOAT32_SMALLEST_SUBNORMAL\n\t) {\n\t\treturn 'float64';\n\t}\n\t// Any number which reaches this point is less than the maximum single-precision floating-point number, as floating-point format supports a limited number of decimals (e.g., (1.0+EPS)*10**15 => 1000000000000000.2, which is less than ~3.4e38)...\n\treturn 'float32';\n}\n\n\n// MAIN //\n\n/**\n* Returns the minimum array data type of the closest \"kind\" necessary for storing a provided scalar value.\n*\n* @param {*} value - scalar value\n* @returns {string} array data type\n*\n* @example\n* var dt = minDataType( 3.141592653589793 );\n* // returns 'float32'\n*\n* @example\n* var dt = minDataType( 3 );\n* // returns 'uint8'\n*/\nfunction minDataType( value ) {\n\tif ( !isNumber( value ) ) {\n\t\tif ( isBoolean( value ) ) {\n\t\t\treturn 'bool';\n\t\t}\n\t\tif ( isComplexLike( value ) ) {\n\t\t\tif ( minFloatDataType( value.re ) === 'float64' || minFloatDataType( value.im ) === 'float64' ) {\n\t\t\t\treturn 'complex128';\n\t\t\t}\n\t\t\treturn 'complex64';\n\t\t}\n\t\treturn 'generic';\n\t}\n\tif ( value !== value || value === PINF || value === NINF ) {\n\t\treturn 'float32';\n\t}\n\tif ( isInteger( value ) ) {\n\t\tif ( value === 0 && isNegativeZero( value ) ) {\n\t\t\treturn 'float32';\n\t\t}\n\t\tif ( value < 0 ) {\n\t\t\tif ( value >= INT8_MIN ) {\n\t\t\t\treturn 'int8';\n\t\t\t}\n\t\t\tif ( value >= INT16_MIN ) {\n\t\t\t\treturn 'int16';\n\t\t\t}\n\t\t\tif ( value >= INT32_MIN ) {\n\t\t\t\treturn 'int32';\n\t\t\t}\n\t\t\treturn 'float64';\n\t\t}\n\t\tif ( value <= UINT8_MAX ) {\n\t\t\treturn 'uint8';\n\t\t}\n\t\tif ( value <= UINT16_MAX ) {\n\t\t\treturn 'uint16';\n\t\t}\n\t\tif ( value <= UINT32_MAX ) {\n\t\t\treturn 'uint32';\n\t\t}\n\t\treturn 'float64';\n\t}\n\t// Assume that if we are provided a tiny value, we don't want to underflow to zero by storing as `float32`...\n\tif (\n\t\tvalue > -FLOAT32_SMALLEST_SUBNORMAL &&\n\t\tvalue < FLOAT32_SMALLEST_SUBNORMAL\n\t) {\n\t\treturn 'float64';\n\t}\n\t// Any number which reaches this point is less than the maximum single-precision floating-point number, as floating-point format supports a limited number of decimals (e.g., (1.0+EPS)*10**15 => 1000000000000000.2, which is less than ~3.4e38)...\n\treturn 'float32';\n}\n\n\n// EXPORTS //\n\nexport default minDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport NINF from '@stdlib/constants-float64-ninf';\n\n\n// MAIN //\n\n/**\n* Tests if a double-precision floating-point numeric value is negative zero.\n*\n* @param {number} x - value to test\n* @returns {boolean} boolean indicating whether the value is negative zero\n*\n* @example\n* var bool = isNegativeZero( -0.0 );\n* // returns true\n*\n* @example\n* var bool = isNegativeZero( 0.0 );\n* // returns false\n*/\nfunction isNegativeZero( x ) {\n\treturn (x === 0.0 && 1.0/x === NINF);\n}\n\n\n// EXPORTS //\n\nexport default isNegativeZero;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n// Mapping from complex number constructors to data types...\nvar ctor2dtypes = {\n\t'Complex64': 'complex64',\n\t'Complex128': 'complex128'\n};\n\n\n// EXPORTS //\n\nexport default ctor2dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport dtypes from '@stdlib/complex-dtypes';\n\n\n// MAIN //\n\nvar DTYPES = dtypes();\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctors from '@stdlib/complex-ctors';\nimport DTYPES from './dtypes.js';\n\n\n// MAIN //\n\nvar CTORS = [];\nvar i;\nfor ( i = 0; i < DTYPES.length; i++ ) {\n\tCTORS.push( ctors( DTYPES[ i ] ) );\n}\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport DTYPES from './dtypes.json';\n\n\n// MAIN //\n\n/**\n* Returns a list of complex number data types.\n*\n* @returns {StringArray} list of complex number data types\n*\n* @example\n* var list = dtypes();\n* // e.g., returns [ 'complex64', 'complex128' ]\n*/\nfunction dtypes() {\n\treturn DTYPES.slice();\n}\n\n\n// EXPORTS //\n\nexport default dtypes;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport constructorName from '@stdlib/utils-constructor-name';\nimport ctor2dtype from './ctor2dtype.js';\nimport CTORS from './ctors.js';\nimport DTYPES from './dtypes.js';\n\n\n// VARIABLES //\n\nvar NTYPES = DTYPES.length;\n\n\n// MAIN //\n\n/**\n* Returns the data type of a complex number.\n*\n* @param {*} value - input value\n* @returns {(string|null)} data type\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n*\n* var dt = dtype( new Complex128( 1.0, 2.0 ) );\n* // returns 'complex128'\n*\n* var dt = dtype( 'beep' );\n* // returns null\n*/\nfunction dtype( value ) {\n\tvar i;\n\tfor ( i = 0; i < NTYPES; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn DTYPES[ i ];\n\t\t}\n\t}\n\t// If the above failed, fall back to a more robust (and significantly slower) means for resolving underlying data types:\n\treturn ctor2dtype[ constructorName( value ) ] || null;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Converts a boolean to a number.\n*\n* @private\n* @param {boolean} value - input value\n* @returns {number} result\n*/\nfunction boolean2number( value ) {\n\treturn ( value ) ? 1 : 0;\n}\n\n\n// EXPORTS //\n\nexport default boolean2number;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Number from '@stdlib/number-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a BigInt to a number.\n*\n* @private\n* @param {BigInt} value - input value\n* @returns {number} result\n*/\nfunction bigint2number( value ) {\n\treturn Number( value );\n}\n\n\n// EXPORTS //\n\nexport default bigint2number;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport isRealFloatingPointDataType from '@stdlib/array-base-assert-is-real-floating-point-data-type'; // eslint-disable-line id-length\nimport isSignedIntegerDataType from '@stdlib/array-base-assert-is-signed-integer-data-type';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport minDataType from '@stdlib/array-min-dtype';\nimport minSignedIntegerDataType from '@stdlib/array-base-min-signed-integer-dtype';\nimport complexDType from '@stdlib/complex-dtype';\nimport format from '@stdlib/string-format';\nimport boolean2number from './boolean2number.js';\nimport bigint2number from './bigint2number.js';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport defaults from './defaults.json';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setNumber( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a number value to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar v;\n\t\tif ( isNumber( value ) ) {\n\t\t\tif ( isRealFloatingPointDataType( obj.type ) ) {\n\t\t\t\tdt = obj.type;\n\t\t\t} else if ( !isInteger( value ) ) {\n\t\t\t\tdt = defaults.dtypes.real;\n\t\t\t} else if ( isSignedIntegerDataType( obj.type ) ) {\n\t\t\t\tdt = minSignedIntegerDataType( value );\n\t\t\t} else {\n\t\t\t\tdt = minDataType( value );\n\t\t\t}\n\t\t\tv = value;\n\t\t} else if ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || ( ( obj.type === 'float32' ) ? 'complex64' : 'complex128' );\n\t\t\tv = value.re; // discard imaginary component\n\t\t} else if ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tv = boolean2number( value );\n\t\t} else if ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // note: the specific integer data type (int64 vs uint64) should not matter here\n\t\t\tv = bigint2number( value );\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tv = value;\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setNumber;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport INT8_MIN from '@stdlib/constants-int8-min';\nimport INT16_MIN from '@stdlib/constants-int16-min';\nimport INT32_MIN from '@stdlib/constants-int32-min';\nimport INT8_MAX from '@stdlib/constants-int8-max';\nimport INT16_MAX from '@stdlib/constants-int16-max';\nimport INT32_MAX from '@stdlib/constants-int32-max';\n\n\n// MAIN //\n\n/**\n* Returns the minimum array data type for storing a provided signed integer value.\n*\n* @param {integer} value - scalar value\n* @returns {string} array data type\n*\n* @example\n* var dt = minSignedIntegerDataType( 9999 );\n* // returns 'int16'\n*\n* @example\n* var dt = minSignedIntegerDataType( 3 );\n* // returns 'int8'\n*/\nfunction minSignedIntegerDataType( value ) {\n\tif ( value < 0 ) {\n\t\tif ( value >= INT8_MIN ) {\n\t\t\treturn 'int8';\n\t\t}\n\t\tif ( value >= INT16_MIN ) {\n\t\t\treturn 'int16';\n\t\t}\n\t\tif ( value >= INT32_MIN ) {\n\t\t\treturn 'int32';\n\t\t}\n\t\treturn 'float64';\n\t}\n\tif ( value <= INT8_MAX ) {\n\t\treturn 'int8';\n\t}\n\tif ( value <= INT16_MAX ) {\n\t\treturn 'int16';\n\t}\n\tif ( value <= INT32_MAX ) {\n\t\treturn 'int32';\n\t}\n\treturn 'float64';\n}\n\n\n// EXPORTS //\n\nexport default minSignedIntegerDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a number to a boolean.\n*\n* @private\n* @param {number} value - input value\n* @returns {boolean} result\n*/\nfunction number2boolean( value ) {\n\treturn Boolean( value );\n}\n\n\n// EXPORTS //\n\nexport default number2boolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a complex number to a boolean.\n*\n* @private\n* @param {ComplexLike} value - input value\n* @returns {boolean} result\n*/\nfunction complex2boolean( value ) {\n\treturn Boolean( value.re || value.im );\n}\n\n\n// EXPORTS //\n\nexport default complex2boolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport complexDType from '@stdlib/complex-dtype';\nimport Boolean from '@stdlib/boolean-ctor';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport boolean2number from './boolean2number.js';\nimport number2boolean from './number2boolean.js';\nimport complex2boolean from './complex2boolean.js';\nimport bigint2boolean from './bigint2boolean.js';\nimport defaults from './defaults.json';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setBoolean( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a boolean value to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar v;\n\t\tif ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tv = boolean2number( value );\n\t\t} else if ( isNumber( value ) ) {\n\t\t\tdt = defaults.dtypes.real;\n\t\t\tv = boolean2number( number2boolean( value ) );\n\t\t} else if ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // note: the specific integer data type (int64 vs uint64) should not matter here\n\t\t\tv = boolean2number( bigint2boolean( value ) );\n\t\t} else if ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || defaults.dtypes.complex;\n\t\t\tv = boolean2number( complex2boolean( value ) );\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tv = Boolean( value );\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Boolean from '@stdlib/boolean-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a BigInt to a boolean.\n*\n* @private\n* @param {BigInt} value - input value\n* @returns {boolean} result\n*/\nfunction bigint2boolean( value ) {\n\treturn Boolean( value );\n}\n\n\n// EXPORTS //\n\nexport default bigint2boolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* global BigInt */\n\n'use strict';\n\n// MAIN //\n\nvar BigInteger = ( typeof BigInt === 'function' ) ? BigInt : void 0; // eslint-disable-line stdlib/require-globals, node/no-unsupported-features/es-builtins\n\n\n// EXPORTS //\n\nexport default BigInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport minDataType from '@stdlib/array-min-dtype';\nimport complexDType from '@stdlib/complex-dtype';\nimport BigInt from '@stdlib/bigint-ctor';\nimport Number from '@stdlib/number-ctor';\nimport floor from '@stdlib/math-base-special-floor';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport boolean2bigint from './boolean2bigint.js';\nimport defaults from './defaults.json';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setBigInt( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a number value to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar v;\n\t\tif ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // FIXME: support both int64 and uint64\n\t\t\tv = value;\n\t\t} else if ( isNumber( value ) ) {\n\t\t\tif ( isInteger( value ) ) {\n\t\t\t\tdt = minDataType( value );\n\t\t\t\tv = BigInt( value );\n\t\t\t} else {\n\t\t\t\tdt = defaults.dtypes.real;\n\t\t\t\tv = BigInt( floor( value ) );\n\t\t\t}\n\t\t} else if ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tv = boolean2bigint( value );\n\t\t} else if ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || defaults.dtypes.complex;\n\t\t\tv = BigInt( floor( value.re ) ); // discard imaginary component\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tv = BigInt( floor( Number( v ) ) );\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setBigInt;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport BigInt from '@stdlib/bigint-ctor';\n\n\n// MAIN //\n\n/**\n* Converts a boolean to a BigInt.\n*\n* @private\n* @param {boolean} value - input value\n* @returns {number} result\n*/\nfunction boolean2bigint( value ) {\n\treturn BigInt( ( value ) ? 1 : 0 );\n}\n\n\n// EXPORTS //\n\nexport default boolean2bigint;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isDataView from '@stdlib/assert-is-dataview';\nimport isObject from '@stdlib/assert-is-object';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating if a value is a `struct` instance.\n*\n* @private\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a `struct` instance\n*/\nfunction isStructInstance( value ) {\n\t// NOTE: the following is a relatively weak test, but we cannot use `instanceof` checks, etc, due to the factory nature of the implementation. Regardless, here, we are just trying to sniff out a `struct` type. If calling as a constructor later fails, we punt the responsibility off to the user to handle what should be an edge case. If, in the future, this check proves insufficient, we can add further \"brand\" checks...\n\treturn (\n\t\tisObject( value ) &&\n\t\tisDataView( value[ PRIVATE_BUFFER ] )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isStructInstance;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array complex-valued floating-point data type.\n*\n* @name isComplexFloatingPointDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array complex-valued floating-point data type\n*\n* @example\n* var bool = isComplexFloatingPointDataType( 'complex64' );\n* // returns true\n*\n* bool = isComplexFloatingPointDataType( 'complex128' );\n* // returns true\n*\n* bool = isComplexFloatingPointDataType( 'float32' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'float64' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'generic' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'int16' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'int32' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'int8' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint16' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint32' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint8' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'uint8c' );\n* // returns false\n*\n* bool = isComplexFloatingPointDataType( 'foo' );\n* // returns false\n*/\nvar isComplexFloatingPointDataType = contains( dtypes( 'complex_floating_point' ) ); // eslint-disable-line id-length\n\n\n// EXPORTS //\n\nexport default isComplexFloatingPointDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array boolean data type.\n*\n* @name isBooleanDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array boolean data type\n*\n* @example\n* var bool = isBooleanDataType( 'bool' );\n* // returns true\n*\n* bool = isBooleanDataType( 'complex64' );\n* // returns false\n*\n* bool = isBooleanDataType( 'complex128' );\n* // returns false\n*\n* bool = isBooleanDataType( 'float32' );\n* // returns false\n*\n* bool = isBooleanDataType( 'float64' );\n* // returns false\n*\n* bool = isBooleanDataType( 'generic' );\n* // returns false\n*\n* bool = isBooleanDataType( 'int16' );\n* // returns false\n*\n* bool = isBooleanDataType( 'int32' );\n* // returns false\n*\n* bool = isBooleanDataType( 'int8' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint16' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint32' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint8' );\n* // returns false\n*\n* bool = isBooleanDataType( 'uint8c' );\n* // returns false\n*\n* bool = isBooleanDataType( 'foo' );\n* // returns false\n*/\nvar isBooleanDataType = contains( dtypes( 'boolean' ) );\n\n\n// EXPORTS //\n\nexport default isBooleanDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport dtypes from '@stdlib/array-dtypes';\n\n\n// MAIN //\n\n/**\n* Tests whether an input value is a supported array real-valued data type.\n*\n* @name isRealDataType\n* @type {Function}\n* @param {*} v - value to test\n* @returns {boolean} boolean indicating whether an input value is a supported array real-valued data type\n*\n* @example\n* var bool = isRealDataType( 'float32' );\n* // returns true\n*\n* bool = isRealDataType( 'float64' );\n* // returns true\n*\n* bool = isRealDataType( 'complex128' );\n* // returns false\n*\n* bool = isRealDataType( 'generic' );\n* // returns false\n*\n* bool = isRealDataType( 'int16' );\n* // returns true\n*\n* bool = isRealDataType( 'int32' );\n* // returns true\n*\n* bool = isRealDataType( 'int8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint16' );\n* // returns true\n*\n* bool = isRealDataType( 'uint32' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8' );\n* // returns true\n*\n* bool = isRealDataType( 'uint8c' );\n* // returns true\n*\n* bool = isRealDataType( 'foo' );\n* // returns false\n*/\nvar isRealDataType = contains( dtypes( 'real' ) );\n\n\n// EXPORTS //\n\nexport default isRealDataType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isComplex128Array from '@stdlib/array-base-assert-is-complex128array';\nimport isComplex64Array from '@stdlib/array-base-assert-is-complex64array';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Reinterprets a complex-valued floating-point array as a real-valued floating-point array having the same precision.\n*\n* @param {(Complex128Array|Complex64Array)} x - input array\n* @param {NonNegativeInteger} offset - starting index\n* @throws {TypeError} first argument must be a supported complex-valued floating-point array\n* @returns {(Float64Array|Float32Array)} real-valued floating-point array view\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var x = new Complex128Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n*\n* var x = new Complex64Array( 10 );\n*\n* var out = reinterpret( x, 0 );\n* // returns \n*\n* var bool = ( out.buffer === x.buffer );\n* // returns true\n*/\nfunction reinterpret( x, offset ) {\n\tif ( isComplex128Array( x ) ) {\n\t\treturn reinterpret128( x, offset );\n\t}\n\tif ( isComplex64Array( x ) ) {\n\t\treturn reinterpret64( x, offset );\n\t}\n\t// Note: intentionally throw here to catch the scenario in which we add, e.g., a Complex32Array and need to explicitly add support here...\n\tthrow new TypeError( format( 'invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.', x ) );\n}\n\n\n// EXPORTS //\n\nexport default reinterpret;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a strided array.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {integer} stride - index increment\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var offset = stride2offset( 10, -10 );\n* // returns 90\n*/\nfunction stride2offset( N, stride ) {\n\tif ( stride > 0 ) {\n\t\treturn 0;\n\t}\n\treturn ( 1 - N ) * stride;\n}\n\n\n// EXPORTS //\n\nexport default stride2offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// VARIABLES //\n\nvar M = 8;\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar constant\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {Collection} input array\n*\n* @example\n* var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];\n*\n* gfill( 3, 5.0, x, 1, x.length-3 );\n* // x => [ 1.0, -2.0, 3.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, strideX, offsetX ) {\n\tvar ix;\n\tvar m;\n\tvar o;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn x;\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\taccessors( N, alpha, o, strideX, offsetX );\n\t\treturn o.data;\n\t}\n\tix = offsetX;\n\n\t// Use loop unrolling if the stride is equal to `1`...\n\tif ( strideX === 1 ) {\n\t\tm = N % M;\n\n\t\t// If we have a remainder, run a clean-up loop...\n\t\tif ( m > 0 ) {\n\t\t\tfor ( i = 0; i < m; i++ ) {\n\t\t\t\tx[ ix ] = alpha;\n\t\t\t\tix += strideX;\n\t\t\t}\n\t\t}\n\t\tif ( N < M ) {\n\t\t\treturn x;\n\t\t}\n\t\tfor ( i = m; i < N; i += M ) {\n\t\t\tx[ ix ] = alpha;\n\t\t\tx[ ix+1 ] = alpha;\n\t\t\tx[ ix+2 ] = alpha;\n\t\t\tx[ ix+3 ] = alpha;\n\t\t\tx[ ix+4 ] = alpha;\n\t\t\tx[ ix+5 ] = alpha;\n\t\t\tx[ ix+6 ] = alpha;\n\t\t\tx[ ix+7 ] = alpha;\n\t\t\tix += M;\n\t\t}\n\t\treturn x;\n\t}\n\tfor ( i = 0; i < N; i++ ) {\n\t\tx[ ix ] = alpha;\n\t\tix += strideX;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar constant\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {Object} input array object\n*\n* @example\n* import Complex64Array from '@stdlib/array-complex64';\n* import Complex64 from '@stdlib/complex-float32-ctor';\n* import reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\n*\n* function setter( data, idx, value ) {\n* data.set( value, idx );\n* }\n*\n* var data = new Complex64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] );\n*\n* var x = {\n* 'data': data,\n* 'accessors': [ null, setter ]\n* };\n*\n* var alpha = new Complex64( 5.0, 5.0 );\n*\n* gfill( data.length, alpha, x, 1, 0 );\n*\n* var view = reinterpret64( x.data, 0 );\n* // returns [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, strideX, offsetX ) {\n\tvar xbuf;\n\tvar set;\n\tvar ix;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessor:\n\tset = x.accessors[ 1 ];\n\n\tix = offsetX;\n\tfor ( i = 0; i < N; i++ ) {\n\t\tset( xbuf, ix, alpha );\n\t\tix += strideX;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nexport default gfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport stride2offset from '@stdlib/strided-base-stride2offset';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\n/**\n* Fills a strided array with a specified scalar constant.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {*} alpha - scalar constant\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @returns {Collection} input array\n*\n* @example\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\nfunction gfill( N, alpha, x, strideX ) {\n\treturn ndarray( N, alpha, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nexport default gfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\n\n\n// FUNCTIONS //\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in an output array.\n*\n* @private\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - stride length for output array\n* @param {NonNegativeInteger} offset - starting index for output array\n* @param {Function} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n* var out = internal( x, y, 1, 0, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* var bool = ( out === y );\n* // returns true\n*/\nfunction internal( x, y, stride, offset, fcn, thisArg ) {\n\tvar io;\n\tvar i;\n\n\tio = offset;\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\ty[ io ] = fcn.call( thisArg, x[ i ], i, x );\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in an output array.\n*\n* @private\n* @param {Object} x - input array object\n* @param {Object} y - output array object\n* @param {integer} stride - stride length for output array\n* @param {NonNegativeInteger} offset - starting index for output array\n* @param {Function} fcn - callback function\n* @param {*} thisArg - callback execution context\n* @returns {Object} output array object\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n*\n* var out = accessors( arraylike2object( toAccessorArray( x ) ), arraylike2object( toAccessorArray( y ) ), 1, 0, scale );\n* // y => [ 10.0, 10.0, 10.0, 10.0 ]\n*/\nfunction accessors( x, y, stride, offset, fcn, thisArg ) {\n\tvar xdata;\n\tvar ydata;\n\tvar xget;\n\tvar yset;\n\tvar io;\n\tvar i;\n\n\txdata = x.data;\n\tydata = y.data;\n\txget = x.accessors[ 0 ];\n\tyset = y.accessors[ 1 ];\n\n\tio = offset;\n\tfor ( i = 0; i < xdata.length; i++ ) {\n\t\tyset( ydata, io, fcn.call( thisArg, xget( xdata, i ), i, xdata ) );\n\t\tio += stride;\n\t}\n\treturn y;\n}\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in an output array.\n*\n* @param {Collection} x - input array\n* @param {Collection} y - output array\n* @param {integer} stride - stride length for output array\n* @param {NonNegativeInteger} offset - starting index for output array\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n*\n* var out = assign( x, y, 1, 0, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* var bool = ( out === y );\n* // returns true\n*/\nfunction assign( x, y, stride, offset, fcn, thisArg ) {\n\tvar xobj;\n\tvar yobj;\n\n\txobj = arraylike2object( x );\n\tyobj = arraylike2object( y );\n\tif ( xobj.accessorProtocol || yobj.accessorProtocol ) {\n\t\taccessors( xobj, yobj, stride, offset, fcn, thisArg );\n\t\treturn y;\n\t}\n\treturn internal( x, y, stride, offset, fcn, thisArg );\n}\n\n\n// EXPORTS //\n\nexport default assign;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport zeros from '@stdlib/array-base-zeros';\nimport assign from './assign.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'map' );\n* // returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n\n// MAIN //\n\n/**\n* Applies a callback function to elements in an input array and assigns results to elements in a new output array.\n*\n* @param {Collection} x - input array\n* @param {Function} fcn - callback function\n* @param {*} [thisArg] - callback execution context\n* @returns {Collection} output array\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = map( x, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*/\nfunction map( x, fcn, thisArg ) {\n\tif ( hasMethod( x, 'map' ) ) {\n\t\treturn x.map( fcn, thisArg );\n\t}\n\treturn assign( x, zeros( x.length ), 1, 0, fcn, thisArg );\n}\n\n\n// EXPORTS //\n\nexport default map;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Converts a complex number to a number.\n*\n* @private\n* @param {ComplexLike} value - input value\n* @returns {number} result\n*/\nfunction complex2number( value ) {\n\treturn value.re;\n}\n\n\n// EXPORTS //\n\nexport default complex2number;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\nimport DATA_VIEW_METHODS from './data_view_methods.js';\nimport setNumber from './set_number.js';\nimport setComplex from './set_complex.js';\nimport setBoolean from './set_boolean.js';\nimport setBigInt from './set_bigint.js';\nimport setStruct from './set_struct.js';\nimport setTypedArray from './set_typedarray.js';\nimport setStructArray from './set_struct_array.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for setting field data.\n*\n* @private\n* @param {Object} obj - field object\n* @throws {Error} unexpected error\n* @returns {Function} function for setting field data\n*/\nfunction setter( obj ) {\n\tif ( obj.length ) {\n\t\tif ( obj.isStructType ) {\n\t\t\treturn setStructArray( obj );\n\t\t}\n\t\treturn setTypedArray( obj );\n\t}\n\tswitch ( obj.type ) {\n\tcase 'float64':\n\tcase 'float32':\n\tcase 'float16':\n\tcase 'int8':\n\tcase 'int16':\n\tcase 'int32':\n\tcase 'uint8':\n\tcase 'uint16':\n\tcase 'uint32':\n\t\treturn setNumber( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tcase 'int64':\n\tcase 'uint64':\n\t\treturn setBigInt( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tcase 'bool':\n\t\treturn setBoolean( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tcase 'complex128':\n\tcase 'complex64':\n\tcase 'complex32':\n\t\treturn setComplex( obj, DATA_VIEW_METHODS[ obj.type ].set );\n\n\tdefault:\n\t\tif ( obj.isStructType ) {\n\t\t\treturn setStruct( obj );\n\t\t}\n\t\t// Ensure that we fail loudly if we have failed to add support for newly added data types:\n\t\tthrow new Error( format( 'unexpected error. Unrecognized data type. Value: `%s`.', obj.type ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport Uint8Array from '@stdlib/array-uint8';\nimport gcopy from '@stdlib/blas-base-gcopy';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for writing field data\n*/\nfunction setStructArray( obj ) {\n\treturn setter;\n\n\t/**\n\t* Writes a list of `struct` instances to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {Collection} values - list of `struct` instances\n\t* @throws {TypeError} must provide an array-like object\n\t* @throws {RangeError} must provide an array-like object having an expected length\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( values ) {\n\t\tvar offset;\n\t\tvar views;\n\t\tvar view;\n\t\tvar dest;\n\t\tvar src;\n\t\tvar buf;\n\t\tvar nb;\n\t\tvar i;\n\n\t\tif ( !isCollection( values ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be an array-like object. Value: `%s`.', obj.name, values ) );\n\t\t}\n\t\tif ( values.length !== obj.length ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be an array-like object having length %u.', obj.name, obj.length ) );\n\t\t}\n\t\tif ( obj.casting === 'none' ) {\n\t\t\tfor ( i = 0; i < values.length; i++ ) {\n\t\t\t\tif ( !( values[ i ] instanceof obj.type ) ) { // note: this check will fail for cross-realm `struct` instances\n\t\t\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Value: `%s`.', obj.name, values[ i ] ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Compute the expected number of bytes per struct view:\n\t\tnb = obj.byteLength / obj.length; // note: as a field is expected to have a homogeneous data type, the byte length should be evenly divisible by the number of elements\n\n\t\t// Check that all struct instances have the same byte length...\n\t\tviews = [];\n\t\tfor ( i = 0; i < values.length; i++ ) {\n\t\t\tbuf = this.constructor.viewOf( values[ i ] );\n\t\t\tif ( buf.byteLength !== nb ) {\n\t\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be an array-like object containing `struct` instances having the same byte length.', obj.name ) );\n\t\t\t}\n\t\t\tsrc = new Uint8Array( buf.buffer, buf.byteOffset, nb );\n\t\t\tviews.push( src );\n\t\t}\n\t\t// Write the data for each `struct` to the underlying byte buffer...\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\toffset = view.byteOffset + obj.byteOffset;\n\t\tfor ( i = 0; i < values.length; i++ ) {\n\t\t\tdest = new Uint8Array( view.buffer, offset, nb );\n\t\t\tgcopy( obj.length, views[ i ], 1, dest, 1 );\n\t\t\toffset += nb;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setStructArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport isComplexDataType from '@stdlib/array-base-assert-is-complex-floating-point-data-type';\nimport isBooleanDataType from '@stdlib/array-base-assert-is-boolean-data-type';\nimport isRealDataType from '@stdlib/array-base-assert-is-real-data-type';\nimport typedarray from '@stdlib/array-typed';\nimport dtype from '@stdlib/array-dtype';\nimport reinterpretComplex from '@stdlib/strided-base-reinterpret-complex';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport gcopy from '@stdlib/blas-base-gcopy';\nimport gfill from '@stdlib/blas-ext-base-gfill';\nimport map from '@stdlib/array-base-map';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport isStructInstance from './is_struct_instance.js';\nimport number2boolean from './number2boolean.js';\nimport complex2boolean from './complex2boolean.js';\nimport complex2number from './complex2number.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for writing field data\n*/\nfunction setTypedArray( obj ) {\n\treturn setter;\n\n\t/**\n\t* Writes a list of values to a typed array view of an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {Collection} value - value to set\n\t* @throws {TypeError} must provide an array-like object\n\t* @throws {RangeError} must provide an array-like object having an expected length\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar buf;\n\t\tvar dt;\n\t\tif ( !isCollection( value ) || isStructInstance( value ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be an array-like object. Value: `%s`.', obj.name, value ) );\n\t\t}\n\t\tif ( value.length !== obj.length ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be an array-like object having length %u.', obj.name, obj.length ) );\n\t\t}\n\t\tdt = dtype( value );\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tbuf = this[ PRIVATE_BUFFER ];\n\t\tview = typedarray( buf.buffer, buf.byteOffset+obj.byteOffset, obj.length, obj.type );\n\t\tif ( dt === obj.type ) {\n\t\t\t// Case: complex => complex\n\t\t\tif ( isComplexDataType( dt ) ) {\n\t\t\t\tgcopy( obj.length*2, reinterpretComplex( value, 0 ), 1, reinterpretComplex( view, 0 ), 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: boolean => boolean\n\t\t\tif ( isBooleanDataType( dt ) ) {\n\t\t\t\tgcopy( obj.length, reinterpretBoolean( value, 0 ), 1, reinterpretBoolean( view, 0 ), 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: real => real\n\t\t\tgcopy( obj.length, value, 1, view, 1 );\n\t\t\treturn;\n\t\t}\n\t\t// Case: real => ???\n\t\tif ( isRealDataType( dt ) ) {\n\t\t\t// Case: real => real\n\t\t\tif ( isRealDataType( obj.type ) ) {\n\t\t\t\tgcopy( obj.length, value, 1, view, 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: real => complex\n\t\t\tif ( isComplexDataType( obj.type ) ) {\n\t\t\t\tview = reinterpretComplex( view, 0 );\n\n\t\t\t\t// TODO: consider refactoring to avoid two-passes; may require creating a separate strided utility explicitly aimed at casting real-valued arrays to complex arrays\n\t\t\t\tgcopy( obj.length, view, 2, value, 1 ); // assign to only real-components\n\t\t\t\tgfill.ndarray( obj.length, 0.0, view, 2, 1 ); // fill imaginary components with zeros\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: real => boolean\n\t\t\tmap.assign( value, view, 1, 0, number2boolean );\n\t\t\treturn;\n\t\t}\n\t\t// Case: complex => ???\n\t\tif ( isComplexDataType( dt ) ) {\n\t\t\t// Case: complex => real\n\t\t\tif ( isRealDataType( obj.type ) ) {\n\t\t\t\tmap.assign( value, view, 1, 0, complex2number ); // discard imaginary components\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: complex => complex\n\t\t\tif ( isComplexDataType( obj.type ) ) {\n\t\t\t\tgcopy( obj.length*2, reinterpretComplex( value, 0 ), 1, reinterpretComplex( view, 0 ), 1 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Case: complex => boolean\n\t\t\tmap.assign( value, view, 1, 0, complex2boolean );\n\t\t\treturn;\n\t\t}\n\t\t// Case: boolean => ???\n\n\t\t// Case: boolean => real\n\t\tif ( isRealDataType( obj.type ) ) {\n\t\t\tgcopy( obj.length, reinterpretBoolean( value, 0 ), 1, view, 1 );\n\t\t\treturn;\n\t\t}\n\t\t// Case: boolean => complex\n\t\tview = reinterpretComplex( view, 0 );\n\n\t\t// TODO: consider refactoring to avoid two-passes; may require creating a separate strided utility explicitly aimed at casting real-valued arrays to complex arrays\n\t\tgcopy( obj.length, view, 2, reinterpretBoolean( value, 0 ), 1 ); // assign to only real-components\n\t\tgfill.ndarray( obj.length, 0.0, view, 2, 1 ); // fill imaginary components with zeros\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this, max-len */\n\n'use strict';\n\n// MODULES //\n\nimport IS_LITTLE_ENDIAN from '@stdlib/assert-is-little-endian';\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport { isPrimitive as isBigInt } from '@stdlib/assert-is-bigint';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isAllowedCast from '@stdlib/ndarray-base-assert-is-allowed-data-type-cast';\nimport complexDType from '@stdlib/complex-dtype';\nimport format from '@stdlib/string-format';\nimport boolean2number from './boolean2number.js';\nimport bigint2number from './bigint2number.js';\nimport PRIVATE_BUFFER from './private_buffer.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @param {string} method - data view method name\n* @returns {Function} function for writing field data\n*/\nfunction setComplex( obj, method ) {\n\treturn setter;\n\n\t/**\n\t* Writes a complex number to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {*} value - value to set\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dt;\n\t\tvar re;\n\t\tvar im;\n\t\tif ( isComplexLike( value ) ) {\n\t\t\tdt = complexDType( value ) || obj.type;\n\t\t\tre = value.re;\n\t\t\tim = value.im;\n\t\t} else if ( isNumber( value ) ) {\n\t\t\tdt = ( obj.type === 'complex64' ) ? 'float32' : 'float64';\n\t\t\tre = value;\n\t\t\tim = 0.0;\n\t\t} else if ( isBigInt( value ) ) {\n\t\t\tdt = 'int64'; // note: the specific integer data type (int64 vs uint64) should not matter here\n\t\t\tre = bigint2number( value );\n\t\t\tim = 0.0;\n\t\t} else if ( isBoolean( value ) ) {\n\t\t\tdt = 'bool';\n\t\t\tre = boolean2number( value );\n\t\t\tim = 0.0;\n\t\t} else {\n\t\t\tdt = 'generic';\n\t\t\tre = value;\n\t\t\tim = 0.0;\n\t\t}\n\t\tif ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );\n\t\t}\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tview[ method ]( obj.byteOffset, re, IS_LITTLE_ENDIAN );\n\t\tview[ method ]( obj.byteOffset+(obj.byteLength/2), im, IS_LITTLE_ENDIAN );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setComplex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport Uint8Array from '@stdlib/array-uint8';\nimport gcopy from '@stdlib/blas-base-gcopy';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport isStructInstance from './is_struct_instance.js';\n\n\n// MAIN //\n\n/**\n* Returns a function for writing field data.\n*\n* @private\n* @param {Object} obj - field object\n* @returns {Function} function for writing field data\n*/\nfunction setStruct( obj ) {\n\treturn setter;\n\n\t/**\n\t* Writes `struct` data to an underlying byte buffer.\n\t*\n\t* @private\n\t* @param {Object} value - value to set\n\t* @throws {TypeError} must be a `struct` instance\n\t* @throws {RangeError} must be a `struct` instance having the same byte length\n\t* @throws {TypeError} cannot cast provided values to field data type\n\t*/\n\tfunction setter( value ) {\n\t\tvar view;\n\t\tvar dest;\n\t\tvar src;\n\t\tvar buf;\n\t\tvar nb;\n\t\tif ( !isStructInstance( value ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. `%s` must be a `struct` instance. Value: `%s`.', obj.name, value ) );\n\t\t}\n\t\tif ( obj.casting === 'none' && !( value instanceof obj.type ) ) {\n\t\t\tthrow new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Value: `%s`.', obj.name, value ) );\n\t\t}\n\t\tnb = obj.byteLength;\n\n\t\tbuf = this.constructor.viewOf( value );\n\t\tif ( buf.byteLength !== nb ) {\n\t\t\tthrow new RangeError( format( 'invalid assignment. `%s` must be a `struct` instance having the same byte length.', obj.name ) );\n\t\t}\n\t\tsrc = new Uint8Array( buf.buffer, buf.byteOffset, nb );\n\n\t\tview = this[ PRIVATE_BUFFER ];\n\t\tdest = new Uint8Array( view.buffer, view.byteOffset+obj.byteOffset, nb ); // eslint-disable-line max-len\n\n\t\tgcopy( obj.length, src, 1, dest, 1 );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default setStruct;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill a strided array with a specified scalar constant.\n*\n* @module @stdlib/blas-ext-base-gfill\n*\n* @example\n* import gfill from '@stdlib/blas-ext-base-gfill';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill( x.length, 5.0, x, 1 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*\n* @example\n* import gfill from '@stdlib/blas-ext-base-gfill';\n*\n* var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];\n*\n* gfill.ndarray( x.length, 5.0, x, 1, 0 );\n* // x => [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ]\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Apply a callback function to elements in an input array and assign results to elements in a new output array.\n*\n* @module @stdlib/array-base-map\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import map from '@stdlib/array-base-map';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = map( x, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* @example\n* import ones from '@stdlib/array-base-ones';\n* import zeros from '@stdlib/array-base-zeros';\n* import map from '@stdlib/array-base-map';\n*\n* function scale( x ) {\n* return x * 10.0;\n* }\n*\n* var x = ones( 4 );\n* var y = zeros( x.length );\n*\n* var out = map.assign( x, y, 1, 0, scale );\n* // returns [ 10.0, 10.0, 10.0, 10.0 ]\n*\n* var bool = ( out === y );\n* // returns true\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport assign from './assign.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'assign', assign );\n\n\n// EXPORTS //\n\nexport default main;\n\n// exports: { \"assign\": \"main.assign\" }\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar FIELD_PROPERTIES = [\n\t'name',\n\t'type',\n\t'description',\n\t'length',\n\t'enumerable',\n\t'writable',\n\t'default',\n\t'castingMode'\n];\n\n\n// EXPORTS //\n\nexport default FIELD_PROPERTIES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\n\n\n// MAIN //\n\n/**\n* Returns a boolean indicating whether a field object represents a union type.\n*\n* @private\n* @param {Object} obj - input field object\n* @returns {boolean} result\n*/\nfunction isUnionType( obj ) {\n\treturn obj.type === 'union' && isCollection( obj.fields );\n}\n\n\n// EXPORTS //\n\nexport default isUnionType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Tests if a value is `undefined` or `null`.\n*\n* ## Notes\n*\n* - In older browsers, `undefined` is a global which can be overridden. `void`, however, is an operator which **cannot** be overridden. Consequently, better to use `void` to check for `undefined`. See [Stack Overflow][1].\n*\n* [1]: http://stackoverflow.com/a/19369078/2225624\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether value is undefined\n*\n* @example\n* var bool = isUndefinedOrNull( undefined );\n* // returns true\n*\n* bool = isUndefinedOrNull( null );\n* // returns true\n*\n* bool = isUndefinedOrNull( false );\n* // returns false\n*/\nfunction isUndefinedOrNull( value ) {\n\treturn ( value === void 0 || value === null );\n}\n\n\n// EXPORTS //\n\nexport default isUndefinedOrNull;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUndefinedOrNull from '@stdlib/assert-is-undefined-or-null';\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\nimport accessors from './accessors.js';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'join' );\n* // returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining strided array elements using a specified separator and alternative indexing semantics.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {string} separator - separator\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {string} joined string\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = gjoin( x.length, ',', x, 1, 0 );\n* // returns '1,2,3,4'\n*/\nfunction gjoin( N, separator, x, strideX, offsetX ) {\n\tvar out;\n\tvar ix;\n\tvar o;\n\tvar v;\n\tvar i;\n\n\tif ( N <= 0 ) {\n\t\treturn '';\n\t}\n\t// Check for a contiguous strided array with left-to-right iteration...\n\tif ( strideX === 1 && offsetX === 0 && N === x.length && hasMethod( x, 'join' ) ) {\n\t\treturn x.join( separator );\n\t}\n\to = arraylike2object( x );\n\tif ( o.accessorProtocol ) {\n\t\treturn accessors( N, separator, o, strideX, offsetX );\n\t}\n\tix = offsetX;\n\tout = '';\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( i > 0 ) {\n\t\t\tout += separator;\n\t\t}\n\t\tv = x[ ix ];\n\t\tif ( !isUndefinedOrNull( v ) ) {\n\t\t\tout += String( v );\n\t\t}\n\t\tix += strideX;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default gjoin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUndefinedOrNull from '@stdlib/assert-is-undefined-or-null';\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining strided array elements using a specified separator.\n*\n* @private\n* @param {PositiveInteger} N - number of indexed elements\n* @param {string} separator - separator\n* @param {Object} x - input array object\n* @param {Collection} x.data - input array data\n* @param {Array} x.accessors - array element accessors\n* @param {integer} strideX - stride length\n* @param {NonNegativeInteger} offsetX - starting index\n* @returns {string} joined string\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = gjoin( x.length, ',', arraylike2object( toAccessorArray( x ) ), 1, 0 );\n* // returns '1,2,3,4'\n*/\nfunction gjoin( N, separator, x, strideX, offsetX ) {\n\tvar xbuf;\n\tvar get;\n\tvar out;\n\tvar ix;\n\tvar v;\n\tvar i;\n\n\t// Cache reference to array data:\n\txbuf = x.data;\n\n\t// Cache a reference to the element accessor:\n\tget = x.accessors[ 0 ];\n\n\tix = offsetX;\n\tout = '';\n\tfor ( i = 0; i < N; i++ ) {\n\t\tif ( i > 0 ) {\n\t\t\tout += separator;\n\t\t}\n\t\tv = get( xbuf, ix );\n\t\tif ( !isUndefinedOrNull( v ) ) {\n\t\t\tout += String( v );\n\t\t}\n\t\tix += strideX;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default gjoin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { ndarray as strided } from '@stdlib/blas-ext-base-gjoin';\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining array elements using a specified separator.\n*\n* @param {Collection} x - input array\n* @param {string} separator - separator\n* @returns {string} output string\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = join( x, ',' );\n* // returns '1,2,3,4'\n*\n* @example\n* var x = [ 1, 2, 3, null, undefined, 4 ];\n*\n* var out = join( x, '-' );\n* // returns '1-2-3---4'\n*/\nfunction join( x, separator ) {\n\treturn strided( x.length, separator, x, 1, 0 );\n}\n\n\n// EXPORTS //\n\nexport default join;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isBoolean } from '@stdlib/assert-is-boolean';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid boolean field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidBoolean( value, name ) {\n\tif ( isBoolean( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a boolean. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidBoolean;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a string created by joining strided array elements using a specified separator.\n*\n* @module @stdlib/blas-ext-base-gjoin\n*\n* @example\n* import gjoin from '@stdlib/blas-ext-base-gjoin';\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var str = gjoin( x.length, ',', x, 1 );\n* // returns '1,2,3,4'\n*\n* @example\n* import gjoin from '@stdlib/blas-ext-base-gjoin';\n*\n* var x = [ 1, 2, 3, 4 ];\n*\n* var str = gjoin.ndarray( x.length, ',', x, 1, 0 );\n* // returns '1,2,3,4'\n*/\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport main from './main.js';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport stride2offset from '@stdlib/strided-base-stride2offset';\nimport ndarray from './ndarray.js';\n\n\n// MAIN //\n\n/**\n* Returns a string created by joining strided array elements using a specified separator.\n*\n* @param {PositiveInteger} N - number of indexed elements\n* @param {string} separator - separator\n* @param {Collection} x - input array\n* @param {integer} strideX - stride length\n* @returns {string} joined string\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = gjoin( x.length, ',', x, 1 );\n* // returns '1,2,3,4'\n*/\nfunction gjoin( N, separator, x, strideX ) {\n\treturn ndarray( N, separator, x, strideX, stride2offset( N, strideX ) );\n}\n\n\n// EXPORTS //\n\nexport default gjoin;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar DTYPES = [\n\t'int8',\n\t'int16',\n\t'int32',\n\t'int64',\n\n\t'uint8',\n\t'uint16',\n\t'uint32',\n\t'uint64',\n\n\t// 'float16', // TODO: uncomment once supported\n\n\t'float32',\n\t'float64',\n\n\t// 'complex32', // TODO: uncomment once supported\n\n\t'complex64',\n\t'complex128',\n\n\t'bool'\n];\n\n\n// EXPORTS //\n\nexport default DTYPES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar CASTING_MODES = [\n\t'none',\n\t'safe',\n\t'mostly-safe',\n\t'same-kind',\n\t'unsafe'\n];\n\n\n// EXPORTS //\n\nexport default CASTING_MODES;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport contains from '@stdlib/array-base-assert-contains';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns a function for testing whether a provided value is a valid enumerated field.\n*\n* @private\n* @param {Collection} values - list of possible values\n* @returns {Function} output function\n*/\nfunction isValidOneOf( values ) {\n\treturn isValid;\n\n\t/**\n\t* Tests whether a provided value is a valid enumerated field.\n\t*\n\t* @private\n\t* @param {*} value - input value\n\t* @param {string} name - field name\n\t* @returns {(null|TypeError)} error object or null\n\t*/\n\tfunction isValid( value, name ) {\n\t\tif ( contains( values, value ) ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new TypeError( format( 'invalid argument. `%s` field must be one of the following: \"%s\". Value: `%s`.', name, join( values, ', ' ), value ) );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default isValidOneOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ALIGNMENTS = {\n\t'int8': 1,\n\t'int16': 2,\n\t'int32': 4,\n\t'int64': 8,\n\n\t'uint8': 1,\n\t'uint16': 2,\n\t'uint32': 4,\n\t'uint64': 8,\n\n\t'float16': 2,\n\t'float32': 4,\n\t'float64': 8,\n\n\t'complex32': 2, // same as float16\n\t'complex64': 4, // same as float32\n\t'complex128': 8, // same as float64\n\n\t'bool': 1\n};\n\n\n// EXPORTS //\n\nexport default ALIGNMENTS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport hasProp from '@stdlib/assert-has-property';\nimport join from '@stdlib/array-base-join';\nimport constantFunction from '@stdlib/utils-constant-function';\nimport format from '@stdlib/string-format';\nimport hasProperties from './has_properties.js';\nimport isValidNonEmptyString from './is_valid_nonempty_string.js';\nimport isValidString from './is_valid_string.js';\nimport isValidPositiveInteger from './is_valid_positive_integer.js';\nimport isValidBoolean from './is_valid_boolean.js';\nimport isValidType from './is_valid_type.js';\nimport isValidOneOf from './is_valid_one_of.js';\nimport initFieldObject from './init_field_object.js';\nimport byteLength from './byte_length.js';\nimport CASTING_MODES from './casting_modes.js';\nimport ALIGNMENTS from './alignments.js';\n\n\n// VARIABLES //\n\nvar MANDATORY_FIELD_NAMES = [\n\t'name',\n\t'type'\n];\n\nvar VALIDATORS = {\n\t'name': isValidNonEmptyString,\n\t'type': isValidType,\n\t'description': isValidString,\n\t'length': isValidPositiveInteger,\n\t'enumerable': isValidBoolean,\n\t'writable': isValidBoolean,\n\t'default': constantFunction( null ),\n\t'castingMode': isValidOneOf( CASTING_MODES )\n};\n\n\n// MAIN //\n\n/**\n* Normalizes a provided field object.\n*\n* @private\n* @param {Object} obj - input field object\n* @param {Array} keys - list of keys to standardize\n* @returns {(Object|Error)} output object or an error\n*/\nfunction normalize( obj, keys ) {\n\tvar out;\n\tvar err;\n\tvar v;\n\tvar k;\n\tvar i;\n\n\tout = initFieldObject();\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tk = keys[ i ];\n\t\tif ( hasProp( obj, k ) ) {\n\t\t\tv = obj[ k ];\n\t\t\terr = VALIDATORS[ k ]( v, k );\n\t\t\tif ( err ) {\n\t\t\t\treturn err;\n\t\t\t}\n\t\t\tout[ k ] = v;\n\t\t}\n\t}\n\tif ( !hasProperties( out, MANDATORY_FIELD_NAMES ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Field objects must have the following properties: \"%s\". Value: `%s`.', join( MANDATORY_FIELD_NAMES, ', ' ), JSON.stringify( obj ) ) );\n\t}\n\tout.isStructType = isStructConstructorLike( out.type );\n\tout.byteLength = byteLength( out );\n\tif ( out.isStructType ) {\n\t\tout.alignment = out.type.alignment;\n\t} else {\n\t\tout.alignment = ALIGNMENTS[ out.type ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid string field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidNonEmptyString( value, name ) {\n\tif ( isString( value ) || value.length > 0 ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a non-empty string. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidNonEmptyString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport contains from '@stdlib/array-base-assert-contains';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\nimport DTYPES from './dtypes.js';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid `type` field.\n*\n* @private\n* @param {*} value - input value\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidType( value ) {\n\tif ( contains( DTYPES, value ) || isStructConstructorLike( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be either a struct type or one of the following: \"%s\". Value: `%s`.', 'type', join( DTYPES, ', ' ), value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidType;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isString } from '@stdlib/assert-is-string';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid string field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidString( value, name ) {\n\tif ( isString( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a string. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isPositiveInteger } from '@stdlib/assert-is-positive-integer';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Tests whether a provided value is a valid positive integer field.\n*\n* @private\n* @param {*} value - input value\n* @param {string} name - field name\n* @returns {(null|TypeError)} error object or null\n*/\nfunction isValidPositiveInteger( value, name ) {\n\tif ( isPositiveInteger( value ) ) {\n\t\treturn null;\n\t}\n\treturn new TypeError( format( 'invalid argument. `%s` field must be a positive integer. Value: `%s`.', name, value ) );\n}\n\n\n// EXPORTS //\n\nexport default isValidPositiveInteger;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an initialized field object.\n*\n* @private\n* @returns {Object} initialized field object\n*/\nfunction initFieldObject() {\n\treturn {\n\t\t'isStructType': false,\n\t\t'description': '',\n\t\t'byteLength': 0,\n\t\t'byteOffset': 0,\n\t\t'alignment': 0,\n\t\t'padding': 0,\n\t\t'enumerable': true,\n\t\t'writable': true,\n\t\t'default': void 0, // explicitly set to `undefined`\n\t\t'castingMode': 'none'\n\t};\n}\n\n\n// EXPORTS //\n\nexport default initFieldObject;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasProp from '@stdlib/assert-has-property';\n\n\n// MAIN //\n\n/**\n* Tests whether an object has a list of properties.\n*\n* @private\n* @param {Object} obj - input object\n* @param {Array} keys - list of property names\n* @returns {boolean} result\n*/\nfunction hasProperties( obj, keys ) {\n\tvar i;\n\tfor ( i = 0; i < keys.length; i++ ) {\n\t\tif ( !hasProp( obj, keys[ i ] ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nexport default hasProperties;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport bytesPerElement from '@stdlib/ndarray-base-bytes-per-element';\n\n\n// MAIN //\n\n/**\n* Returns the number of bytes required to store a field value.\n*\n* @private\n* @param {Object} obj - input field object\n* @returns {PositiveInteger} number of bytes\n*/\nfunction byteLength( obj ) {\n\tvar nb;\n\tif ( obj.isStructType ) {\n\t\tnb = obj.type.byteLength;\n\t} else {\n\t\tnb = bytesPerElement( obj.type );\n\t}\n\tif ( obj.length ) {\n\t\tnb *= obj.length;\n\t}\n\treturn nb;\n}\n\n\n// EXPORTS //\n\nexport default byteLength;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Resolves the struct's byte alignment.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @returns {PositiveInteger} alignment\n*/\nfunction alignment( fields ) {\n\tvar max;\n\tvar v;\n\tvar i;\n\n\tmax = 0;\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\tv = fields[ i ].alignment;\n\t\tif ( v > max ) {\n\t\t\tmax = v;\n\t\t}\n\t}\n\treturn max;\n}\n\n\n// EXPORTS //\n\nexport default alignment;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert-is-object';\nimport hasProp from '@stdlib/assert-has-property';\nimport format from '@stdlib/string-format';\nimport isUnionType from './is_union_type.js';\nimport FIELD_PROPERTIES from './field_properties.js';\nimport normalizeField from './normalize_field.js';\nimport resolveAlignment from './resolve_alignment.js';\n\n\n// MAIN //\n\n/**\n* Normalizes a field object representing a union type.\n*\n* @private\n* @param {Object} obj - input field object\n* @returns {(Object|null|Error)} normalized field object or error object\n*/\nfunction normalizeUnion( obj ) {\n\tvar fields;\n\tvar dflg;\n\tvar out;\n\tvar tmp;\n\tvar len;\n\tvar o;\n\tvar i;\n\n\tfields = obj.fields;\n\tif ( fields.length === 0 ) {\n\t\treturn null;\n\t}\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tif ( !isObject( o ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tif ( isUnionType( o ) ) {\n\t\t\treturn new TypeError( format( 'invalid argument. Union types cannot contain nested union types. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t}\n\t\tif ( dflg === void 0 && hasProp( o, 'default' ) ) {\n\t\t\tdflg = true;\n\t\t} else if ( dflg === true && hasProp( o, 'default' ) ) {\n\t\t\treturn new TypeError( format( 'invalid argument. Union types can only contain one field with a default value. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t}\n\t\ttmp = normalizeField( o, FIELD_PROPERTIES );\n\t\tif ( tmp instanceof Error ) {\n\t\t\treturn tmp;\n\t\t}\n\t\tif ( i === 0 ) {\n\t\t\tlen = tmp.byteLength;\n\t\t} else if ( tmp.byteLength !== len ) {\n\t\t\treturn new RangeError( format( 'invalid argument. Union types must contain fields having the same byte length. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn {\n\t\t'type': 'union',\n\t\t'fields': out,\n\t\t'byteLength': len,\n\t\t'byteOffset': 0,\n\t\t'alignment': resolveAlignment( out ),\n\t\t'padding': 0\n\t};\n}\n\n\n// EXPORTS //\n\nexport default normalizeUnion;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/assert-is-accessor-array';\nimport resolveGetter from '@stdlib/array-base-resolve-getter';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'indexOf' );\n* // returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n/**\n* Returns the index of the first element which equals a provided search element.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = internal( x, 2, 0 );\n* // returns 1\n*/\nfunction internal( x, searchElement, fromIndex ) {\n\tvar i;\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( searchElement === x[ i ] ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n* Returns the index of the first element which equals a provided search element.\n*\n* @private\n* @param {Object} x - input array object\n* @param {*} searchElement - search element\n* @param {NonNegativeInteger} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n*\n* var x = toAccessorArray( [ 1, 2, 3, 4 ] );\n*\n* var idx = accessors( x, 2, 0 );\n* // returns 1\n*/\nfunction accessors( x, searchElement, fromIndex ) {\n\tvar get;\n\tvar i;\n\n\tget = resolveGetter( x );\n\tfor ( i = fromIndex; i < x.length; i++ ) {\n\t\tif ( searchElement === get( x, i ) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n// MAIN //\n\n/**\n* Returns the index of the first element which equals a provided search element.\n*\n* ## Notes\n*\n* - If unable to find an element which equals a provided search element, the function returns `-1`.\n*\n* @param {Collection} x - input array\n* @param {*} searchElement - search element\n* @param {integer} fromIndex - starting index (inclusive)\n* @returns {integer} index\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var idx = indexOf( x, 2, 0 );\n* // returns 1\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var x = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var idx = indexOf( x, 2, 0 );\n* // returns 1\n*/\nfunction indexOf( x, searchElement, fromIndex ) {\n\tif ( hasMethod( x, 'indexOf' ) ) {\n\t\treturn x.indexOf( searchElement, fromIndex );\n\t}\n\tif ( fromIndex < 0 ) {\n\t\tfromIndex += x.length;\n\t\tif ( fromIndex < 0 ) {\n\t\t\tfromIndex = 0;\n\t\t}\n\t}\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessors( x, searchElement, fromIndex );\n\t}\n\treturn internal( x, searchElement, fromIndex );\n}\n\n\n// EXPORTS //\n\nexport default indexOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isAccessorArray from '@stdlib/array-base-assert-is-accessor-array';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport getter from '@stdlib/array-base-getter';\nimport dtype from '@stdlib/array-dtype';\n\n\n// MAIN //\n\n/**\n* Returns an accessor function for retrieving an element from an array-like object.\n*\n* @param {Collection} x - input array\n* @returns {Function} accessor\n*\n* @example\n* var arr = [ 1, 2, 3, 4 ];\n*\n* var get = resolveGetter( arr );\n* var v = get( arr, 2 );\n* // returns 3\n*/\nfunction resolveGetter( x ) {\n\tvar dt = dtype( x );\n\tif ( isAccessorArray( x ) ) {\n\t\treturn accessorGetter( dt );\n\t}\n\treturn getter( dt );\n}\n\n\n// EXPORTS //\n\nexport default resolveGetter;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isFunction from '@stdlib/assert-is-function';\n\n\n// MAIN //\n\n/**\n* Tests if a value is an array-like object supporting the accessor (get/set) protocol.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is an accessor array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isAccessorArray( new Complex128Array( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isAccessorArray( [] );\n* // returns false\n*\n* @example\n* var bool = isAccessorArray( {} );\n* // returns false\n*/\nfunction isAccessorArray( value ) {\n\treturn (\n\t\tisCollection( value ) &&\n\t\tisFunction( value.get ) &&\n\t\tisFunction( value.set )\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isAccessorArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport indexOf from '@stdlib/array-base-index-of';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Returns the index of a specified field name in a provided list of field names.\n*\n* @private\n* @param {Array} names - list of field names\n* @param {string} name - field name\n* @throws {Error} struct must have at least one field\n* @throws {TypeError} must provide a recognized field name\n* @returns {(integer|Error)} index or an error object\n*/\nfunction fieldIndex( names, name ) {\n\tvar idx;\n\tif ( names.length === 0 ) {\n\t\treturn new Error( 'invalid operation. struct does not have any fields.' );\n\t}\n\tidx = indexOf( names, name, 0 );\n\tif ( idx < 0 ) {\n\t\treturn new TypeError( format( 'invalid argument. Field name must be one of the following: \"%s\". Value: `%s`.', join( names, ', ' ), name ) );\n\t}\n\treturn idx;\n}\n\n\n// EXPORTS //\n\nexport default fieldIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport min from '@stdlib/math-base-special-fast-min';\nimport isUnionType from './is_union_type.js';\n\n\n// FUNCTIONS //\n\n/**\n* Sets alignment padding for one or more field objects.\n*\n* ## Notes\n*\n* - This function mutates each field object.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @param {NonNegativeInteger} padding - alignment padding\n* @returns {Array} input array\n*/\nfunction setPadding( fields, padding ) {\n\tvar i;\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\tfields[ i ].padding = padding;\n\t}\n\treturn fields;\n}\n\n\n// MAIN //\n\n/**\n* Computes the byte offset for each field.\n*\n* ## Notes\n*\n* - This function mutates each field object.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @param {PositiveInteger} max - maximum alignment\n* @returns {Array} input array\n*/\nfunction byteOffsets( fields, max ) {\n\tvar alignment;\n\tvar padding;\n\tvar offset;\n\tvar tmp;\n\tvar o;\n\tvar i;\n\tvar j;\n\n\toffset = 0;\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// Resolve the alignment requirement for this field:\n\t\talignment = min( o.alignment, max );\n\n\t\t// Align the current offset to the required boundary:\n\t\tpadding = ( alignment-(offset%alignment) ) % alignment;\n\t\toffset += padding;\n\n\t\t// Set the padding for the previous member:\n\t\tif ( i > 0 ) {\n\t\t\ttmp = fields[ i-1 ];\n\t\t\ttmp.padding = padding;\n\t\t\tif ( isUnionType( o ) ) {\n\t\t\t\tsetPadding( tmp.fields, padding );\n\t\t\t}\n\t\t}\n\t\t// Set the offset for the current member:\n\t\to.byteOffset = offset;\n\n\t\t// If the current member is a union type, propagate the offset to its child field objects...\n\t\tif ( isUnionType( o ) ) {\n\t\t\tfor ( j = 0; j < o.fields.length; j++ ) {\n\t\t\t\to.fields[ j ].byteOffset = offset;\n\t\t\t}\n\t\t}\n\t\t// Advance the offset by the size, in bytes, of the member:\n\t\toffset += o.byteLength;\n\t}\n\t// Compute the padding for the last member:\n\tpadding = ( alignment - (offset%alignment) ) % alignment;\n\n\t// Set the padding for the last member:\n\to.padding = padding;\n\n\t// If the last member is a union type, propagate the offset to its child field objects...\n\tif ( isUnionType( o ) ) {\n\t\tsetPadding( o.fields, padding );\n\t}\n\n\treturn fields;\n}\n\n\n// EXPORTS //\n\nexport default byteOffsets;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport replace from '@stdlib/string-base-replace';\nimport format from '@stdlib/string-format';\n\n\n// FUNCTIONS //\n\n/**\n* Returns a new regular expression for matching byte parameters.\n*\n* @private\n* @returns {RegExp} regular expression\n*/\nfunction reByteOffset() {\n\treturn /\\[(\\d{1,}),/g;\n}\n\n/**\n* Returns a function for replacing byte values in a serialized struct.\n*\n* @private\n* @param {NonNegativeInteger} offset - byte offset\n* @returns {Function} replacer function\n*/\nfunction replacer( offset ) {\n\treturn wrapped;\n\n\t/**\n\t* Callback invoked for each match.\n\t*\n\t* @private\n\t* @param {string} match - matched substring\n\t* @param {string} p1 - first matched capture group substring\n\t* @returns {string} replacement string\n\t*/\n\tfunction wrapped( match, p1 ) {\n\t\treturn format( '[%u,', offset+parseInt( p1, 10 ) );\n\t}\n}\n\n\n// MAIN //\n\n/**\n* Serializes a struct to a layout format.\n*\n* ## Notes\n*\n* - The output format is a multi-column format having the following layout:\n*\n* ```text\n* | ...[byte_offset,byte_length] |\n* ```\n*\n* For example,\n*\n* ```text\n* |[0,8]|[8,1]|[16,16]|[32,8]|\n* ```\n*\n* @private\n* @param {Array} fields - list of normalized fields\n* @returns {string} string representation\n*/\nfunction layoutFormat( fields ) {\n\tvar out;\n\tvar tmp;\n\tvar re;\n\tvar N;\n\tvar o;\n\tvar i;\n\n\tN = fields.length;\n\n\t// Create a new regular expression for matching byte offsets:\n\tre = reByteOffset();\n\n\tout = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// If we are currently processing fields in a union, move along to the next non-union field...\n\t\tif ( i > 0 && ( o.byteOffset === fields[ i-1 ].byteOffset ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t// If the current type is a struct, we need to serialize and then post-process...\n\t\tif ( o.isStructType ) {\n\t\t\tout.push( replace( o.type.layout, re, replacer( o.byteOffset ) ) );\n\t\t\tcontinue;\n\t\t}\n\t\t// Format the field data:\n\t\tout.push( format( '|<%s>[%u,%u]', o.type, o.byteOffset, o.byteLength ) );\n\t}\n\ttmp = format( '%s|', out.join( '' ) );\n\n\t// If we having a trailing `||` due to a nested struct, remove the final `|`:\n\tif ( tmp[ tmp.length-2 ] === '|' ) {\n\t\ttmp = tmp.substring( 0, tmp.length-1 );\n\t}\n\treturn tmp;\n}\n\n\n// EXPORTS //\n\nexport default layoutFormat;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isPlainObject from '@stdlib/assert-is-plain-object';\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport { factory as contains } from '@stdlib/array-base-assert-contains';\nimport join from '@stdlib/array-base-join';\nimport format from '@stdlib/string-format';\nimport linearFormat from './format_linear.js';\nimport layoutFormat from './format_layout.js';\n\n\n// VARIABLES //\n\nvar FORMATS = [\n\t'none',\n\t'linear',\n\t'layout'\n];\nvar isFormat = contains( FORMATS );\n\n\n// MAIN //\n\n/**\n* Serializes a struct to a string.\n*\n* @private\n* @param {Function} Struct - struct constructor\n* @param {Array} fields - list of normalized fields\n* @param {Options} options - function options\n* @param {string} [options.format] - serialization format\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {string} string representation\n*/\nfunction toString( Struct, fields, options ) { // eslint-disable-line stdlib/no-redeclare\n\tvar opts;\n\tif ( !isPlainObject( options ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\topts = {\n\t\t'format': 'none'\n\t};\n\tif ( hasOwnProp( options, 'format' ) ) {\n\t\topts.format = options.format;\n\t\tif ( !isFormat( opts.format ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'format', join( FORMATS, ', ' ), options.format ) );\n\t\t}\n\t}\n\tif ( opts.format === 'linear' ) {\n\t\treturn linearFormat( Struct, fields );\n\t}\n\tif ( opts.format === 'layout' ) {\n\t\treturn layoutFormat( fields );\n\t}\n\t// Case: opts.format === 'none'\n\treturn '';\n}\n\n\n// EXPORTS //\n\nexport default toString;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport floor from '@stdlib/math-base-special-floor';\nimport format from '@stdlib/string-format';\n\n\n// MAIN //\n\n/**\n* Serializes a struct to a linear string format.\n*\n* ## Notes\n*\n* - The output format is a three-column format having the following layout:\n*\n* ```text\n* | byte_number | [field|padding] | notes |\n* ```\n*\n* - Nested `struct` instances are intentionally treated as opaque types, as we have limited access to struct internals (e.g., packed versus unpacked, field padding, etc), and we would effectively have to recompute all alignments and associated field data for the purposes of rendering. A user can always separately render a nested `struct` instance to a string in order to better understand its layout independently of its surrounding context in a parent `struct` instance.\n*\n* @private\n* @param {Function} Struct - struct constructor\n* @param {Array} fields - list of normalized fields\n* @returns {string} string representation\n*/\nfunction linearFormat( Struct, fields ) {\n\tvar nbytes;\n\tvar fmt0;\n\tvar fmt1;\n\tvar fmt2;\n\tvar bfmt;\n\tvar ufmt;\n\tvar fmt;\n\tvar tmp;\n\tvar out;\n\tvar flg;\n\tvar ib;\n\tvar c0;\n\tvar c1;\n\tvar c2;\n\tvar w0;\n\tvar w1;\n\tvar w;\n\tvar N;\n\tvar o;\n\tvar f;\n\tvar t;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tN = fields.length;\n\n\t// Resolve the size of the struct:\n\tnbytes = Struct.byteLength;\n\n\t// Compute the width of the first column:\n\tw0 = ( nbytes-1 ).toString().length;\n\n\t// Define a format string for the first column:\n\tfmt0 = '%'+w0+'s';\n\n\t// Determine the longest field name...\n\tw1 = 0;\n\tfor ( i = 0; i < N; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// Format: []\n\t\tw = o.name.length + 1 + ( o.byteLength-1 ).toString().length + 1;\n\t\tif ( w > w1 ) {\n\t\t\tw1 = w;\n\t\t}\n\t}\n\t// Define a format string for the second column:\n\tfmt1 = '%'+w1+'s';\n\n\t// Define a format string for the third column:\n\tfmt2 = '// %s';\n\n\t// Define a format string which combines the columns:\n\tfmt = '%s: %s %s';\n\n\t// Initialize a byte counter:\n\tib = 0;\n\n\tout = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// If we are currently processing fields in a union, move along to the next non-union field...\n\t\tif ( i > 0 && ( o.byteOffset === fields[ i-1 ].byteOffset ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t// Check whether this field is the first field of a union...\n\t\tif ( i < N-1 ) {\n\t\t\tflg = ( o.byteOffset === fields[ i+1 ].byteOffset );\n\t\t} else {\n\t\t\tflg = false;\n\t\t}\n\t\tfor ( j = 0; j < o.byteLength; j++ ) {\n\t\t\t// In the first column, render the byte number:\n\t\t\tc0 = format( fmt0, ib.toString() );\n\n\t\t\t// In the second column, render the field name and the byte number relative to the field:\n\t\t\tc1 = format( fmt1, format( '%s[%u]', o.name, j ) );\n\n\t\t\t// If a field type spans multiple bytes, render the byte number:\n\t\t\tif ( o.alignment > 1 ) {\n\t\t\t\tbfmt = ' (byte %u)';\n\t\t\t} else {\n\t\t\t\tbfmt = '';\n\t\t\t}\n\t\t\t// If a field is part of a union, make that explicit:\n\t\t\tif ( flg ) {\n\t\t\t\tufmt = ' => union: %s';\n\t\t\t\ttmp = [];\n\t\t\t\tk = i + 1;\n\t\t\t\twhile ( k < N && o.byteOffset === fields[ k ].byteOffset ) {\n\t\t\t\t\tf = fields[ k ];\n\t\t\t\t\tif ( f.isStructType ) {\n\t\t\t\t\t\tt = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt = f.type;\n\t\t\t\t\t}\n\t\t\t\t\ttmp.push( format( '%s<%s>[%u]', f.name, t, j%f.alignment ) );\n\t\t\t\t\tk += 1;\n\t\t\t\t}\n\t\t\t\tufmt = format( ufmt, tmp.join( ', ' ) );\n\t\t\t} else {\n\t\t\t\tufmt = '';\n\t\t\t}\n\t\t\ttmp = format( bfmt+ufmt, j%o.alignment );\n\n\t\t\t// If a field contains multiple elements (i.e., is an array), render the field type along with the element number:\n\t\t\tif ( o.length ) {\n\t\t\t\tc2 = format( fmt2, format( '%s[%u]%s', o.type, floor( j/o.alignment ), tmp ) );\n\t\t\t}\n\t\t\t// Otherwise, just render the field type:\n\t\t\telse {\n\t\t\t\tc2 = format( fmt2, format( '%s%s', o.type, tmp ) );\n\t\t\t}\n\t\t\t// Render the row string:\n\t\t\tout.push( format( fmt, c0, c1, c2 ) );\n\t\t\tib += 1;\n\t\t}\n\t\tfor ( j = 0; j < o.padding; j++ ) {\n\t\t\tc0 = format( fmt0, ib.toString() );\n\t\t\tc1 = format( fmt1, '--' );\n\t\t\tc2 = format( fmt2, 'padding' );\n\t\t\tout.push( format( fmt, c0, c1, c2 ) );\n\t\t\tib += 1;\n\t\t}\n\t}\n\treturn out.join( '\\n' );\n}\n\n\n// EXPORTS //\n\nexport default linearFormat;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Dummy function.\n*\n* @private\n*/\nfunction foo() {\n\t// No-op...\n}\n\n\n// EXPORTS //\n\nexport default foo;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport hasFunctionNameSupport from '@stdlib/assert-has-function-name-support';\nimport format from '@stdlib/string-format';\nimport { REGEXP as RE } from '@stdlib/regexp-function-name';\n\n\n// VARIABLES //\n\nvar isFunctionNameSupported = hasFunctionNameSupport();\n\n\n// MAIN //\n\n/**\n* Returns the name of a function.\n*\n* @param {Function} fcn - input function\n* @throws {TypeError} must provide a function\n* @returns {string} function name\n*\n* @example\n* var v = functionName( Math.sqrt );\n* // returns 'sqrt'\n*\n* @example\n* var v = functionName( function foo(){} );\n* // returns 'foo'\n*\n* @example\n* var v = functionName( function(){} );\n* // returns '' || 'anonymous'\n*\n* @example\n* var v = functionName( String );\n* // returns 'String'\n*/\nfunction functionName( fcn ) {\n\t// TODO: add support for generator functions?\n\tif ( isFunction( fcn ) === false ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a function. Value: `%s`.', fcn ) );\n\t}\n\tif ( isFunctionNameSupported ) {\n\t\treturn fcn.name;\n\t}\n\treturn RE.exec( fcn.toString() )[ 1 ];\n}\n\n\n// EXPORTS //\n\nexport default functionName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport foo from './foo.js';\n\n\n// MAIN //\n\n/**\n* Tests for native function `name` support.\n*\n* @returns {boolean} boolean indicating if an environment has function `name` support\n*\n* @example\n* var bool = hasFunctionNameSupport();\n* // returns \n*/\nfunction hasFunctionNameSupport() {\n\treturn ( foo.name === 'foo' );\n}\n\n\n// EXPORTS //\n\nexport default hasFunctionNameSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Int8Array from '@stdlib/array-int8';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float32Array from '@stdlib/array-float32';\nimport Float64Array from '@stdlib/array-float64';\n\n\n// MAIN //\n\nvar CTORS = [\n\tFloat64Array,\n\tFloat32Array,\n\tInt32Array,\n\tUint32Array,\n\tInt16Array,\n\tUint16Array,\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\nimport fcnName from '@stdlib/utils-function-name';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport hasFloat64ArraySupport from '@stdlib/assert-has-float64array-support';\nimport Float64Array from '@stdlib/array-float64';\nimport CTORS from './ctors.js';\nimport NAMES from './names.json';\n\n\n// VARIABLES //\n\n// Abstract `TypedArray` class:\nvar TypedArray = ( hasFloat64ArraySupport() ) ? getPrototypeOf( Float64Array ) : Dummy; // eslint-disable-line max-len\n\n// Ensure abstract typed array class has expected name:\nTypedArray = ( fcnName( TypedArray ) === 'TypedArray' ) ? TypedArray : Dummy;\n\n\n// FUNCTIONS //\n\n/**\n* Dummy constructor.\n*\n* @private\n*/\nfunction Dummy() {} // eslint-disable-line no-empty-function\n\n\n// MAIN //\n\n/**\n* Tests if a value is a typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a typed array\n*\n* @example\n* import Int8Array from '@stdlib/array-int8';\n*\n* var bool = isTypedArray( new Int8Array( 10 ) );\n* // returns true\n*/\nfunction isTypedArray( value ) {\n\tvar v;\n\tvar i;\n\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for the abstract class...\n\tif ( value instanceof TypedArray ) {\n\t\treturn true;\n\t}\n\t// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired class...\n\twhile ( value ) {\n\t\tv = ctorName( value );\n\t\tfor ( i = 0; i < NAMES.length; i++ ) {\n\t\t\tif ( NAMES[ i ] === v ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\n\n\n// MAIN //\n\nvar CTORS = [\n\tComplex128Array,\n\tComplex64Array\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasOwnProp from '@stdlib/assert-has-own-property';\nimport Symbol from '@stdlib/symbol-ctor';\n\n\n// MAIN //\n\n/**\n* Tests for native `Symbol.hasInstance` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Symbol.hasInstance` support\n*\n* @example\n* var bool = hasHasInstanceSymbolSupport();\n* // returns \n*/\nfunction hasHasInstanceSymbolSupport() { // eslint-disable-line id-length\n\treturn (\n\t\ttypeof Symbol === 'function' &&\n\t\ttypeof Symbol( 'foo' ) === 'symbol' &&\n\t\thasOwnProp( Symbol, 'hasInstance' ) &&\n\t\ttypeof Symbol.hasInstance === 'symbol'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default hasHasInstanceSymbolSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasHasInstanceSymbolSupport from '@stdlib/assert-has-has-instance-symbol-support'; // eslint-disable-line id-length\n\n\n// MAIN //\n\n/**\n* Has instance symbol.\n*\n* @name HasInstanceSymbol\n* @constant\n* @type {(symbol|null)}\n*\n* @example\n* import isArray from '@stdlib/assert-is-array';\n*\n* function ArrayLike() {\n* return {\n* 'length': 3,\n* '0': 1,\n* '1': 2,\n* '2': 3\n* };\n* };\n*\n* ArrayLike[ HasInstanceSymbol ] = isArray;\n*/\nvar HasInstanceSymbol = ( hasHasInstanceSymbolSupport() ) ? Symbol.hasInstance : null; // eslint-disable-line max-len\n\n\n// EXPORTS //\n\nexport default HasInstanceSymbol;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport hasHasInstanceSymbolSupport from '@stdlib/assert-has-has-instance-symbol-support'; // eslint-disable-line id-length\nimport HasInstanceSymbol from '@stdlib/symbol-has-instance';\nimport format from '@stdlib/string-format';\n\n\n// VARIABLES //\n\nvar hasSupport = hasHasInstanceSymbolSupport();\n\n\n// MAIN //\n\n/**\n* Tests whether a value has in its prototype chain a specified constructor as a prototype property.\n*\n* @param {*} value - value to test\n* @param {Function} constructor - constructor to test against\n* @throws {TypeError} constructor must be callable\n* @returns {boolean} boolean indicating whether a value is an instance of a provided constructor\n*\n* @example\n* var bool = instanceOf( [], Array );\n* // returns true\n*\n* @example\n* var bool = instanceOf( {}, Object ); // exception\n* // returns true\n*\n* @example\n* var bool = instanceOf( 'beep', String );\n* // returns false\n*\n* @example\n* var bool = instanceOf( null, Object );\n* // returns false\n*\n* @example\n* var bool = instanceOf( 5, Object );\n* // returns false\n*/\nfunction instanceOf( value, constructor ) {\n\t// TODO: replace with `isCallable` check\n\tif (\n\t\ttypeof constructor !== 'function' &&\n\t\t!(\n\t\t\thasSupport &&\n\t\t\ttypeof constructor === 'object' &&\n\t\t\ttypeof constructor[ HasInstanceSymbol ] === 'function'\n\t\t)\n\t) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be callable. Value: `%s`.', constructor ) );\n\t}\n\treturn ( value instanceof constructor );\n}\n\n\n// EXPORTS //\n\nexport default instanceOf;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Int8Array from '@stdlib/array-int8';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Int16Array from '@stdlib/array-int16';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Int32Array from '@stdlib/array-int32';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Float32Array from '@stdlib/array-float32';\nimport Float64Array from '@stdlib/array-float64';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// MAIN //\n\nvar CTORS = [\n\t[ Float64Array, 'Float64Array' ],\n\t[ Float32Array, 'Float32Array' ],\n\t[ Int32Array, 'Int32Array' ],\n\t[ Uint32Array, 'Uint32Array' ],\n\t[ Int16Array, 'Int16Array' ],\n\t[ Uint16Array, 'Uint16Array' ],\n\t[ Int8Array, 'Int8Array' ],\n\t[ Uint8Array, 'Uint8Array' ],\n\t[ Uint8ClampedArray, 'Uint8ClampedArray' ],\n\t[ Complex64Array, 'Complex64Array' ],\n\t[ Complex128Array, 'Complex128Array' ],\n\t[ BooleanArray, 'BooleanArray' ]\n];\n\n\n// EXPORTS //\n\nexport default CTORS;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport instanceOf from '@stdlib/assert-instance-of';\nimport ctorName from '@stdlib/utils-constructor-name';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport CTORS from './ctors.js';\n\n\n// MAIN //\n\n/**\n* Returns the typed array type.\n*\n* @private\n* @param {TypedArray} arr - typed array\n* @returns {(string|void)} typed array type\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( 5 );\n* var str = typeName( arr );\n* // returns 'Float64Array'\n*/\nfunction typeName( arr ) {\n\tvar v;\n\tvar i;\n\n\t// Check for typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( instanceOf( arr, CTORS[ i ][ 0 ] ) ) {\n\t\t\treturn CTORS[ i ][ 1 ];\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired native class...\n\twhile ( arr ) {\n\t\tv = ctorName( arr );\n\t\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\t\tif ( v === CTORS[ i ][ 1 ] ) {\n\t\t\t\treturn CTORS[ i ][ 1 ];\n\t\t\t}\n\t\t}\n\t\tarr = getPrototypeOf( arr );\n\t}\n}\n\n\n// EXPORTS //\n\nexport default typeName;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isTypedArray from '@stdlib/assert-is-typed-array';\nimport isComplexTypedArray from '@stdlib/assert-is-complex-typed-array';\nimport isBooleanArray from '@stdlib/assert-is-booleanarray';\nimport reinterpret64 from '@stdlib/strided-base-reinterpret-complex64';\nimport reinterpret128 from '@stdlib/strided-base-reinterpret-complex128';\nimport reinterpretBoolean from '@stdlib/strided-base-reinterpret-boolean';\nimport format from '@stdlib/string-format';\nimport typeName from './type.js';\n\n\n// MAIN //\n\n/**\n* Returns a JSON representation of a typed array.\n*\n* ## Notes\n*\n* - We build a JSON object representing a typed array similar to how Node.js `Buffer` objects are represented. See [Buffer][1].\n*\n* [1]: https://nodejs.org/api/buffer.html#buffer_buf_tojson\n*\n* @param {TypedArray} arr - typed array to serialize\n* @throws {TypeError} first argument must be a typed array\n* @returns {Object} JSON representation\n*\n* @example\n* import Float64Array from '@stdlib/array-float64';\n*\n* var arr = new Float64Array( [ 5.0, 3.0 ] );\n* var json = typedarray2json( arr );\n* // returns { 'type': 'Float64Array', 'data': [ 5.0, 3.0 ] }\n*/\nfunction typedarray2json( arr ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tif ( isTypedArray( arr ) ) {\n\t\tdata = arr;\n\t} else if ( isComplexTypedArray( arr ) ) {\n\t\tif ( arr.BYTES_PER_ELEMENT === 8 ) {\n\t\t\tdata = reinterpret64( arr, 0 );\n\t\t} else { // arr.BYTES_PER_ELEMENT === 16\n\t\t\tdata = reinterpret128( arr, 0 );\n\t\t}\n\t} else if ( isBooleanArray( arr ) ) {\n\t\tdata = reinterpretBoolean( arr, 0 );\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a typed array. Value: `%s`.', arr ) );\n\t}\n\tout = {\n\t\t'type': typeName( arr ),\n\t\t'data': []\n\t};\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tout.data.push( data[ i ] );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default typedarray2json;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport BooleanArray from '@stdlib/array-bool';\nimport constructorName from '@stdlib/utils-constructor-name';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a BooleanArray.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating whether a value is a BooleanArray\n*\n* @example\n* import BooleanArray from '@stdlib/array-bool';\n*\n* var bool = isBooleanArray( new BooleanArray( 10 ) );\n* // returns true\n*\n* @example\n* var bool = isBooleanArray( [] );\n* // returns false\n*/\nfunction isBooleanArray( value ) {\n\treturn (\n\t\tvalue instanceof BooleanArray ||\n\t\tconstructorName( value ) === 'BooleanArray'\n\t);\n}\n\n\n// EXPORTS //\n\nexport default isBooleanArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport ctorName from '@stdlib/utils-constructor-name';\nimport getPrototypeOf from '@stdlib/utils-get-prototype-of';\nimport CTORS from './ctors.js';\nimport NAMES from './names.json';\n\n\n// MAIN //\n\n/**\n* Tests if a value is a complex typed array.\n*\n* @param {*} value - value to test\n* @returns {boolean} boolean indicating if a value is a complex typed array\n*\n* @example\n* import Complex128Array from '@stdlib/array-complex128';\n*\n* var bool = isComplexTypedArray( new Complex128Array( 10 ) );\n* // returns true\n*/\nfunction isComplexTypedArray( value ) {\n\tvar v;\n\tvar i;\n\n\tif ( typeof value !== 'object' || value === null ) {\n\t\treturn false;\n\t}\n\t// Check for complex typed array objects from the same realm (same Node.js `vm` or same `Window` object)...\n\tfor ( i = 0; i < CTORS.length; i++ ) {\n\t\tif ( value instanceof CTORS[ i ] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\t// Walk the prototype tree until we find an object having a desired class...\n\twhile ( value ) {\n\t\tv = ctorName( value );\n\t\tfor ( i = 0; i < NAMES.length; i++ ) {\n\t\t\tif ( NAMES[ i ] === v ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tvalue = getPrototypeOf( value );\n\t}\n\n\treturn false;\n}\n\n\n// EXPORTS //\n\nexport default isComplexTypedArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, id-length, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setNonEnumerableReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isObject from '@stdlib/assert-is-object';\nimport hasProp from '@stdlib/assert-has-property';\nimport min from '@stdlib/math-base-special-fast-min';\nimport filled from '@stdlib/array-base-filled';\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport DataView from '@stdlib/array-dataview';\nimport format from '@stdlib/string-format';\nimport PRIVATE_BUFFER from './private_buffer.js';\nimport CTOR_NAME from './ctor_name.js';\nimport createPrototypeAccessors from './create_prototype_accessors.js';\nimport isStructInstance from './is_struct_instance.js';\nimport normalize from './normalize_field_list.js';\nimport fieldNames from './field_names.js';\nimport fieldIndex from './field_index.js';\nimport resolveAlignment from './resolve_alignment.js';\nimport byteOffsets from './byte_offsets.js';\nimport partitions from './partitions.js';\nimport flatten from './flatten_fields.js';\nimport struct2string from './to_string.js';\nimport struct2json from './to_json.js';\nimport layoutFormat from './format_layout.js';\n\n\n// MAIN //\n\n/**\n* Returns a constructor for creating a fixed-width composite data type (a.k.a., a `struct`).\n*\n* @param {ObjectArray} fields - structure fields\n* @throws {TypeError} first argument must be an array-like object containing objects\n* @throws {TypeError} field objects must have required properties\n* @throws {TypeError} field objects must have valid fields\n* @throws {TypeError} union types must be array-like objects containing objects\n* @throws {RangeError} union types must contain fields having the same byte length\n* @throws {TypeError} union types cannot contain nested union types\n* @throws {TypeError} union types can only contain one field with a default value\n* @throws {Error} unexpected error\n* @returns {Function} constructor\n*\n* @example\n* var fields = [\n* {\n* 'type': 'union',\n* 'fields': [\n* {\n* 'name': 'double',\n* 'description': 'double-precision floating-point number',\n* 'type': 'float64',\n* 'enumerable': true,\n* 'writable': true,\n* 'castingMode': 'none'\n* },\n* {\n* 'name': 'words',\n* 'description': 'high and low words',\n* 'type': 'uint32',\n* 'length': 2,\n* 'enumerable': true,\n* 'writable': true,\n* 'castingMode': 'none'\n* }\n* ]\n* }\n* ];\n* var Struct = factory( fields );\n*\n* var data = {\n* 'double': 3.14\n* };\n* var s = new Struct( data );\n* // returns \n*\n* var v = s.double;\n* // returns 3.14\n*\n* var w = s.words;\n* // e.g., [ 1374389535, 1074339512 ]\n*/\nfunction factory( fields ) {\n\tvar FIELD_NAMES;\n\tvar BYTE_LENGTH;\n\tvar PARTITIONS;\n\tvar ALIGNMENT;\n\tvar ACCESSORS;\n\tvar FIELDS;\n\tvar tmp;\n\tvar o;\n\tif ( !isCollection( fields ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', fields ) );\n\t}\n\t// Normalize the list of field objects:\n\ttmp = normalize( fields );\n\tif ( tmp instanceof Error ) {\n\t\tthrow tmp;\n\t}\n\tFIELDS = tmp;\n\n\t// Resolve the list of unique field names:\n\ttmp = fieldNames( FIELDS );\n\tif ( tmp instanceof Error ) {\n\t\tthrow tmp;\n\t}\n\tFIELD_NAMES = tmp;\n\n\t// Resolve the struct's alignment requirements:\n\tALIGNMENT = resolveAlignment( FIELDS );\n\n\t// Compute the byte offset for each field:\n\tFIELDS = byteOffsets( FIELDS, ALIGNMENT );\n\n\t// Now that we've finished processing provided field objects, flatten the list, such that union types are implied by field objects having the same byte offset:\n\tFIELDS = flatten( FIELDS );\n\n\t// Compute field \"partitions\" (i.e., non-overlapping views):\n\tPARTITIONS = partitions( FIELDS );\n\n\t// Compute the struct's byte length:\n\to = FIELDS[ FIELDS.length-1 ];\n\tBYTE_LENGTH = o.byteOffset + o.byteLength + o.padding;\n\n\t/**\n\t* Constructor for a composite data type (a.k.a., a `struct`).\n\t*\n\t* @private\n\t* @param {(Object|ArrayBuffer)} [arg] - array buffer or data object\n\t* @param {NonNegativeInteger} [byteOffset=0] - offset, in bytes, to the first byte in a provided buffer for the returned `struct` to reference\n\t* @param {NonNegativeInteger} [byteLength] - maximum number of elements in the byte array\n\t* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n\t* @throws {TypeError} second argument must be a nonnegative integer\n\t* @throws {TypeError} third argument must be a nonnegative integer\n\t* @throws {Error} union types may only be initialized by a single member\n\t* @returns {Struct} struct instance\n\t*/\n\tfunction Struct( arg, byteOffset, byteLength ) {\n\t\tvar values;\n\t\tvar nargs;\n\t\tvar cache;\n\t\tvar view;\n\t\tvar obj;\n\t\tvar o;\n\t\tvar v;\n\t\tvar i;\n\t\tvar j;\n\t\tvar k;\n\n\t\tnargs = arguments.length;\n\t\tif ( !( this instanceof Struct ) ) {\n\t\t\tif ( nargs === 0 ) {\n\t\t\t\treturn new Struct();\n\t\t\t}\n\t\t\tif ( nargs === 1 ) {\n\t\t\t\treturn new Struct( arg );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\treturn new Struct( arg, byteOffset );\n\t\t\t}\n\t\t\treturn new Struct( arg, byteOffset, byteLength );\n\t\t}\n\t\tif ( isArrayBuffer( arg ) ) {\n\t\t\tif ( nargs === 1 ) {\n\t\t\t\tview = new DataView( arg, 0, BYTE_LENGTH );\n\t\t\t} else {\n\t\t\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t\t\t}\n\t\t\t\tif ( nargs === 2 ) {\n\t\t\t\t\tview = new DataView( arg, byteOffset, BYTE_LENGTH );\n\t\t\t\t} else {\n\t\t\t\t\tif ( !isNonNegativeInteger( byteLength ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Byte length must be a nonnegative integer. Value: `%s`.', byteLength ) );\n\t\t\t\t\t}\n\t\t\t\t\tview = new DataView( arg, byteOffset, min( byteLength, BYTE_LENGTH ) ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( view.byteLength < BYTE_LENGTH ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer has insufficient capacity. Minimum capacity: `%u`.', BYTE_LENGTH ) );\n\t\t\t}\n\t\t} else {\n\t\t\tview = new DataView( new ArrayBuffer( BYTE_LENGTH ) );\n\t\t\tif ( nargs > 0 ) {\n\t\t\t\tif ( !isObject( arg ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an object. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tobj = arg;\n\t\t\t}\n\t\t}\n\t\t// Bind the byte buffer to the current instance:\n\t\tsetReadOnly( this, PRIVATE_BUFFER, view );\n\n\t\t// If we were provided a data object, set provided fields...\n\t\tif ( obj !== void 0 ) {\n\t\t\t// Initialize an array containing values to set:\n\t\t\tvalues = filled( void 0, FIELDS.length );\n\n\t\t\t// For each field, determine whether a value has been specified...\n\t\t\tcache = {};\n\t\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\t\tk = FIELD_NAMES[ i ];\n\t\t\t\tj = PARTITIONS[ i ];\n\t\t\t\tif ( hasProp( obj, k ) ) {\n\t\t\t\t\t// Check whether a value has already been specified for this view (i.e., via another union member)...\n\t\t\t\t\tif ( cache[ j ] ) {\n\t\t\t\t\t\tthrow new Error( 'invalid argument. Union types may only be initialized by a single member.' );\n\t\t\t\t\t}\n\t\t\t\t\tvalues[ i ] = obj[ k ];\n\t\t\t\t\tcache[ j ] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Perform a second pass over the fields to fill in default initial values...\n\t\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\t\tj = PARTITIONS[ i ];\n\t\t\t\tif ( cache[ j ] ) {\n\t\t\t\t\t// Skip fields already having initial values...\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\to = FIELDS[ i ];\n\t\t\t\tif ( o.default !== void 0 ) {\n\t\t\t\t\tvalues[ i ] = o.default;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Set all fields with initialization values...\n\t\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\t\tv = values[ i ];\n\t\t\t\tif ( v !== void 0 ) {\n\t\t\t\t\tACCESSORS[ FIELD_NAMES[ i ] ][ 1 ].call( this, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t* Constructor name.\n\t*\n\t* @private\n\t* @name name\n\t* @memberof Struct\n\t* @readonly\n\t* @type {string}\n\t* @default 'Struct'\n\t*/\n\tsetReadOnly( Struct, 'name', CTOR_NAME );\n\n\t/**\n\t* Alignment.\n\t*\n\t* @private\n\t* @name alignment\n\t* @memberof Struct\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( Struct, 'alignment', ALIGNMENT );\n\n\t/**\n\t* Size (in bytes) of the `struct`.\n\t*\n\t* @private\n\t* @name byteLength\n\t* @memberof Struct\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( Struct, 'byteLength', BYTE_LENGTH );\n\n\t/**\n\t* Returns a list of `struct` fields.\n\t*\n\t* @private\n\t* @name fields\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Array}\n\t*/\n\tsetNonEnumerableReadOnlyAccessor( Struct, 'fields', function get() {\n\t\treturn FIELD_NAMES.slice();\n\t});\n\n\t/**\n\t* Returns a string corresponding to the `struct` layout.\n\t*\n\t* @private\n\t* @name layout\n\t* @memberof Struct\n\t* @readonly\n\t* @type {string}\n\t*/\n\tsetNonEnumerableReadOnlyAccessor( Struct, 'layout', function get() {\n\t\t// As this is not likely to be a commonly used API, intentionally recompute the layout format in order to avoid consuming memory for what could be a long string...\n\t\treturn layoutFormat( FIELDS );\n\t});\n\n\t/**\n\t* Returns the underlying byte buffer of a `struct`.\n\t*\n\t* @private\n\t* @name bufferOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {Object} obj - struct instance\n\t* @throws {TypeError} must provide a `struct` instance\n\t* @returns {ArrayBuffer} underlying byte buffer\n\t*/\n\tsetReadOnly( Struct, 'bufferOf', function bufferOf( obj ) {\n\t\tif ( !isStructInstance( obj ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a `struct` instance. Value: `%s`.', obj ) );\n\t\t}\n\t\treturn obj[ PRIVATE_BUFFER ].buffer;\n\t});\n\n\t/**\n\t* Returns the length, in bytes, of the value specified by the provided field name.\n\t*\n\t* @private\n\t* @name byteLengthOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {NonNegativeInteger} byte length\n\t*/\n\tsetReadOnly( Struct, 'byteLengthOf', function byteLengthOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].byteLength;\n\t});\n\n\t/**\n\t* Returns the offset, in bytes, from the beginning of a `struct` to the value specified by the provided field name.\n\t*\n\t* @private\n\t* @name byteOffsetOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {NonNegativeInteger} byte offset\n\t*/\n\tsetReadOnly( Struct, 'byteOffsetOf', function byteOffsetOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].byteOffset;\n\t});\n\n\t/**\n\t* Returns the description associated with a provided field name.\n\t*\n\t* @private\n\t* @name descriptionOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {string} description\n\t*/\n\tsetReadOnly( Struct, 'descriptionOf', function descriptionOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].description;\n\t});\n\n\t/**\n\t* Returns a boolean indicating whether a provided value is a `struct` instance.\n\t*\n\t* @private\n\t* @name isStruct\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {*} value - input value\n\t* @returns {boolean} boolean indicating whether a value is a `struct` instance\n\t*/\n\tsetReadOnly( Struct, 'isStruct', function isStruct( value ) {\n\t\treturn (\n\t\t\tvalue instanceof Struct ||\n\t\t\t(\n\t\t\t\tisStructInstance( value ) &&\n\t\t\t\tisStructConstructorLike( value.constructor )\n\t\t\t)\n\t\t);\n\t});\n\n\t/**\n\t* Returns the type associated with a provided field name.\n\t*\n\t* @private\n\t* @name typeOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {string} name - field name\n\t* @throws {Error} struct must have at least one field\n\t* @throws {TypeError} must provide a recognized field name\n\t* @returns {(string|Object)} type\n\t*/\n\tsetReadOnly( Struct, 'typeOf', function typeOf( name ) {\n\t\tvar idx = fieldIndex( FIELD_NAMES, name );\n\t\tif ( idx instanceof Error ) {\n\t\t\tthrow idx;\n\t\t}\n\t\treturn FIELDS[ idx ].type;\n\t});\n\n\t/**\n\t* Returns the underlying byte buffer of a `struct` as a `DataView`.\n\t*\n\t* @private\n\t* @name viewOf\n\t* @memberof Struct\n\t* @readonly\n\t* @type {Function}\n\t* @param {Object} obj - struct instance\n\t* @throws {TypeError} must provide a `struct` instance\n\t* @returns {DataView} view of underlying byte buffer\n\t*/\n\tsetReadOnly( Struct, 'viewOf', function viewOf( obj ) {\n\t\tvar buf;\n\t\tif ( !isStructInstance( obj ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a `struct` instance. Value: `%s`.', obj ) );\n\t\t}\n\t\tbuf = obj[ PRIVATE_BUFFER ];\n\t\treturn new DataView( buf.buffer, buf.byteOffset, buf.byteLength );\n\t});\n\n\t// Create prototype accessors for getting and setting field values:\n\tACCESSORS = createPrototypeAccessors( Struct.prototype, FIELDS );\n\n\t/**\n\t* Serializes a `struct` to a string.\n\t*\n\t* @private\n\t* @name toString\n\t* @memberof Struct.prototype\n\t* @readonly\n\t* @type {Function}\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.format='none'] - serialization format\n\t* @throws {Error} `this` must be a struct instance\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {string} serialized `struct` instance\n\t*/\n\tsetReadOnly( Struct.prototype, 'toString', function toString() {\n\t\tvar opts;\n\t\tif ( !( this instanceof Struct ) ) {\n\t\t\tthrow new Error( 'invalid invocation. `this` is not a struct instance.' );\n\t\t}\n\t\tif ( arguments.length > 0 ) {\n\t\t\topts = arguments[ 0 ];\n\t\t} else {\n\t\t\topts = {};\n\t\t}\n\t\treturn struct2string( Struct, FIELDS, opts );\n\t});\n\n\t/**\n\t* Serializes a `struct` to JSON.\n\t*\n\t* @private\n\t* @name toJSON\n\t* @memberof Struct.prototype\n\t* @readonly\n\t* @type {Function}\n\t* @throws {Error} `this` must be a struct instance\n\t* @returns {JSON} serialized `struct` instance\n\t*/\n\tsetReadOnly( Struct.prototype, 'toJSON', function toJSON() {\n\t\tif ( !( this instanceof Struct ) ) {\n\t\t\tthrow new Error( 'invalid invocation. `this` is not a struct instance.' );\n\t\t}\n\t\treturn struct2json( this, FIELDS );\n\t});\n\n\treturn Struct;\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isObject from '@stdlib/assert-is-object';\nimport format from '@stdlib/string-format';\nimport FIELD_PROPERTIES from './field_properties.js';\nimport isUnionType from './is_union_type.js';\nimport normalizeField from './normalize_field.js';\nimport normalizeUnion from './normalize_union.js';\n\n\n// MAIN //\n\n/**\n* Normalizes a list of field objects.\n*\n* @private\n* @param {Array} fields - input fields\n* @returns {(Array|Error)} normalized field objects or an error\n*/\nfunction normalize( fields ) {\n\tvar out;\n\tvar tmp;\n\tvar o;\n\tvar i;\n\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tif ( !isObject( o ) ) {\n\t\t\treturn new TypeError( format( 'invalid argument. First argument must be an array of objects. Value: `%s`. Index: `%d`.', o, i ) );\n\t\t}\n\t\t// Check for a union type which is a collection of nested field objects which all have the same byte length...\n\t\tif ( isUnionType( o ) ) {\n\t\t\ttmp = normalizeUnion( o );\n\t\t\tif ( tmp === null ) {\n\t\t\t\treturn new TypeError( format( 'invalid argument. Union types must be an array of objects. Value: `%s`. Index: `%d`.', JSON.stringify( o ), i ) );\n\t\t\t}\n\t\t\tif ( tmp instanceof Error ) {\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t} else {\n\t\t\ttmp = normalizeField( o, FIELD_PROPERTIES );\n\t\t\tif ( tmp instanceof Error ) {\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t}\n\t\tout.push( tmp );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default normalize;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport format from '@stdlib/string-format';\nimport isUnionType from './is_union_type.js';\n\n\n// MAIN //\n\n/**\n* Resolves a list of field names.\n*\n* @private\n* @param {Array} fields - list of field objects\n* @returns {(Array|Error)} list of field names or an error\n*/\nfunction fieldNames( fields ) {\n\tvar hash;\n\tvar out;\n\tvar o1;\n\tvar o2;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\thash = {};\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to1 = fields[ i ];\n\t\tk = o1.name;\n\t\tif ( isUnionType( o1 ) ) {\n\t\t\tfor ( j = 0; j < o1.fields.length; j++ ) {\n\t\t\t\to2 = o1.fields[ j ];\n\t\t\t\tk = o2.name;\n\t\t\t\tif ( hash[ k ] === true ) {\n\t\t\t\t\treturn new TypeError( format( 'invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t\t\t}\n\t\t\t\thash[ k ] = true;\n\t\t\t\tout.push( k );\n\t\t\t}\n\t\t} else if ( hash[ k ] === true ) {\n\t\t\treturn new TypeError( format( 'invalid argument. First argument must be an array of objects having unique field names. Value: `%s`.', JSON.stringify( fields ) ) );\n\t\t} else {\n\t\t\thash[ k ] = true;\n\t\t\tout.push( k );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fieldNames;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isUnionType from './is_union_type.js';\n\n\n// MAIN //\n\n/**\n* Flattens a list of field objects.\n*\n* @private\n* @param {Array} fields - list of field objects\n* @returns {Array} new list\n*/\nfunction flatten( fields ) {\n\tvar out;\n\tvar o;\n\tvar i;\n\tvar j;\n\n\tout = [];\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tif ( isUnionType( o ) ) {\n\t\t\tfor ( j = 0; j < o.fields.length; j++ ) {\n\t\t\t\tout.push( o.fields[ j ] );\n\t\t\t}\n\t\t} else {\n\t\t\tout.push( o );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default flatten;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a list of partition indices.\n*\n* ## Notes\n*\n* - This function partitions field objects according to whether a field object represents a unique \"view\" over an underlying byte buffer. Field objects within a union belong to the same partition.\n*\n* @private\n* @param {Array} fields - list of normalized field objects\n* @returns {NonNegativeIntegerArray} list of indices\n*/\nfunction partitions( fields ) {\n\tvar out;\n\tvar N;\n\tvar o;\n\tvar i;\n\tvar j;\n\n\tN = fields.length;\n\n\tout = [];\n\tj = 0;\n\tfor ( i = 0; i < N-1; i++ ) {\n\t\to = fields[ i ];\n\n\t\t// Check for the start of a union...\n\t\tif ( o.byteOffset === fields[ i+1 ].byteOffset ) {\n\t\t\tout.push( j );\n\t\t\tcontinue;\n\t\t}\n\t\tout.push( j );\n\t\tj += 1;\n\t}\n\t// Set the partition for the last field object:\n\tout.push( j );\n\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default partitions;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable id-length */\n\n'use strict';\n\n// MODULES //\n\nimport setNonEnumerableReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport setNonEnumerableReadWriteAccessor from '@stdlib/utils-define-nonenumerable-read-write-accessor';\nimport setReadOnlyAccessor from '@stdlib/utils-define-read-only-accessor';\nimport setReadWriteAccessor from '@stdlib/utils-define-read-write-accessor';\nimport getter from './getter.js';\nimport setter from './setter.js';\n\n\n// MAIN //\n\n/**\n* Assigns methods for accessing field values to a provided prototype.\n*\n* @private\n* @param {Object} p - prototype\n* @param {Array} fields - field objects\n* @returns {Object} object containing accessors for each field\n*/\nfunction createPrototypeAccessors( p, fields ) {\n\tvar get;\n\tvar set;\n\tvar out;\n\tvar o;\n\tvar i;\n\n\tout = {};\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tget = getter( o );\n\t\tset = setter( o );\n\t\tif ( o.enumerable ) {\n\t\t\tif ( o.writable ) {\n\t\t\t\tsetReadWriteAccessor( p, o.name, get, set );\n\t\t\t} else {\n\t\t\t\tsetReadOnlyAccessor( p, o.name, get );\n\t\t\t}\n\t\t} else if ( o.writable ) {\n\t\t\tsetNonEnumerableReadWriteAccessor( p, o.name, get, set );\n\t\t} else {\n\t\t\tsetNonEnumerableReadOnlyAccessor( p, o.name, get );\n\t\t}\n\t\tout[ o.name ] = [ get, set ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default createPrototypeAccessors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isCollection from '@stdlib/assert-is-collection';\nimport isComplexLike from '@stdlib/assert-is-complex-like';\nimport isFunction from '@stdlib/assert-is-function';\nimport typedarray2json from '@stdlib/array-to-json';\nimport isStructInstance from './is_struct_instance.js';\n\n\n// MAIN //\n\n/**\n* Serializes a `struct` instance to JSON.\n*\n* @private\n* @param {Struct} struct - struct instance\n* @param {Array} fields - list of normalized fields\n* @returns {Object} JSON representation\n*/\nfunction toJSON( struct, fields ) {\n\tvar out;\n\tvar o;\n\tvar v;\n\tvar i;\n\n\tout = {};\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\to = fields[ i ];\n\t\tv = struct[ o.name ];\n\t\tif ( isCollection( v ) ) {\n\t\t\tv = typedarray2json( v );\n\t\t} else if ( isStructInstance( v ) ) {\n\t\t\tv = v.toJSON();\n\t\t} else if ( isComplexLike( v ) && isFunction( v.toJSON ) ) {\n\t\t\tv = v.toJSON();\n\t\t}\n\t\tout[ o.name ] = v;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default toJSON;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport Uint8Array from '@stdlib/array-uint8';\nimport { ndarray as gcopy } from '@stdlib/blas-base-gcopy';\n\n\n// MAIN //\n\n/**\n* Fills an output ArrayBuffer with array values.\n*\n* @private\n* @param {Function} Struct - struct constructor\n* @param {ArrayBuffer} buf - output data buffer\n* @param {Collection} arr - input array\n* @throws {TypeError} an input array must contain struct instances\n* @throws {TypeError} each element of an input array must be a struct instance having the expected layout\n* @returns {ArrayBuffer} output data buffer\n*/\nfunction fromArray( Struct, buf, arr ) {\n\tvar sbytes;\n\tvar bbytes;\n\tvar offset;\n\tvar layout;\n\tvar sview;\n\tvar opts;\n\tvar len;\n\tvar get;\n\tvar flg;\n\tvar nb;\n\tvar v;\n\tvar i;\n\n\topts = {\n\t\t'format': 'layout'\n\t};\n\n\tlen = arr.length;\n\tif ( arr.get && arr.set ) {\n\t\tget = accessorGetter( 'default' );\n\t} else {\n\t\tget = getter( 'default' );\n\t}\n\tlayout = Struct.layout;\n\tnb = Struct.byteLength;\n\n\t// FIXME: add optimization for when `buf` is a StructArray having the same layout, as can just copy bytes\n\n\tbbytes = new Uint8Array( buf );\n\toffset = 0;\n\tfor ( i = 0; i < len; i++ ) {\n\t\tv = get( arr, i );\n\t\ttry {\n\t\t\tsview = Struct.viewOf( v ); // note: this should throw if `v` is not a struct\n\t\t\tflg = true;\n\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\ttry {\n\t\t\t\t// Attempt to convert the input value to a struct instance:\n\t\t\t\tv = new Struct( v ); // note: this should throw if `v` is not an object with valid fields\n\t\t\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tsview = Struct.viewOf( v );\n\t\t\tflg = false;\n\t\t}\n\t\tif ( flg && v.toString( opts ) !== layout ) {\n\t\t\treturn null;\n\t\t}\n\t\tsbytes = new Uint8Array( sview.buffer, sview.byteOffset, sview.byteLength ); // eslint-disable-line max-len\n\t\tgcopy( nb, sbytes, 1, 0, bbytes, 1, offset );\n\t\toffset += nb;\n\t}\n\treturn buf;\n}\n\n\n// EXPORTS //\n\nexport default fromArray;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-restricted-syntax, no-invalid-this, max-len, max-lines-per-function */\n\n'use strict';\n\n// MODULES //\n\nimport isStructConstructorLike from '@stdlib/assert-is-struct-constructor-like';\nimport { isPrimitive as isNonNegativeInteger } from '@stdlib/assert-is-nonnegative-integer';\nimport { isPrimitive as isInteger } from '@stdlib/assert-is-integer';\nimport isArrayBuffer from '@stdlib/assert-is-arraybuffer';\nimport isCollection from '@stdlib/assert-is-collection';\nimport isFunction from '@stdlib/assert-is-function';\nimport isObject from '@stdlib/assert-is-object';\nimport isPrototypeOf from '@stdlib/assert-is-prototype-of'; // eslint-disable-line stdlib/no-redeclare\nimport hasIteratorSymbolSupport from '@stdlib/assert-has-iterator-symbol-support';\nimport hasProp from '@stdlib/assert-has-property';\nimport contains from '@stdlib/array-base-assert-contains';\nimport setReadOnly from '@stdlib/utils-define-nonenumerable-read-only-property';\nimport setReadOnlyAccessor from '@stdlib/utils-define-nonenumerable-read-only-accessor';\nimport ITERATOR_SYMBOL from '@stdlib/symbol-iterator';\nimport ArrayBuffer from '@stdlib/array-buffer';\nimport Uint8Array from '@stdlib/array-uint8';\nimport getter from '@stdlib/array-base-getter';\nimport accessorGetter from '@stdlib/array-base-accessor-getter';\nimport { ndarray as gcopy } from '@stdlib/blas-base-gcopy';\nimport structFactory from '@stdlib/dstructs-struct';\nimport format from '@stdlib/string-format';\nimport fromArray from './from_array.js';\nimport fromIterator from './from_iterator.js';\n\n\n// VARIABLES //\n\nvar HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();\nvar CTOR_NAME = 'StructArray';\n\n\n// MAIN //\n\n/**\n* Returns a constructor for creating arrays having a fixed-width composite data type.\n*\n* @param {(Function|Array)} arg - struct constructor or struct schema\n* @throws {TypeError} first argument must be either a struct constructor or struct schema\n* @returns {Function} constructor\n*\n* @example\n* import Complex128 from '@stdlib/complex-float64-ctor';\n* import structFactory from '@stdlib/dstructs-struct';\n*\n* var schema1 = [\n* {\n* 'name': 're',\n* 'type': 'float64'\n* },\n* {\n* 'name': 'im',\n* 'type': 'float64'\n* }\n* ];\n*\n* // Create a struct constructor for storing real and imaginary components:\n* var Components = structFactory( schema1 );\n*\n* var schema2 = [\n* {\n* 'type': 'union',\n* 'fields': [\n* {\n* 'name': 'value',\n* 'type': 'complex128'\n* },\n* {\n* 'name': 'components',\n* 'type': Components\n* }\n* ]\n* }\n* ];\n*\n* // Create a struct constructor for storing a double-precision complex number:\n* var Complex128Struct = structFactory( schema2 );\n*\n* // Create an array constructor for storing complex numbers:\n* var Complex128Array = factory( Complex128Struct );\n*\n* // Create a new array:\n* var x = new Complex128Array( 10 );\n* // returns \n*\n* // Retrieve the first element:\n* var v1 = x.get( 0 );\n*\n* // Resolve the complex number stored within the first element:\n* var z1 = v1.value;\n* // returns [ 0.0, 0.0 ]\n*\n* // Resolve the individual real and imaginary components:\n* var z2 = v1.components;\n*\n* var re = z2.re;\n* // returns 0.0\n*\n* var im = z2.im;\n* // returns 0.0\n*\n* // Create a new complex number struct:\n* var z3 = new Complex128Struct({\n* 'value': new Complex128( 3.0, 5.0 )\n* });\n*\n* // Update the first element of the array:\n* x.set( z3, 0 );\n*\n* // As `v1` is a view on same memory as the first element, resolve the complex number stored within the element:\n* var z4 = v1.value;\n* // returns [ 3.0, 5.0 ]\n*/\nfunction factory( arg ) { // eslint-disable-line stdlib/jsdoc-require-throws-tags\n\tvar BYTES_PER_ELEMENT;\n\tvar LAYOUT;\n\tvar FIELDS;\n\tvar Struct;\n\n\t// FIXME: add option support for strict input object validation (e.g., throw whenever non-struct properties are included on an object passed to `set`)\n\n\tif ( isCollection( arg ) ) {\n\t\tStruct = structFactory( arg ); // NOTE: delegate to `structFactory` to perform input validation\n\t} else if ( isStructConstructorLike( arg ) ) {\n\t\tStruct = arg;\n\t} else {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either a struct constructor or struct schema. Value: `%s`.', arg ) );\n\t}\n\tBYTES_PER_ELEMENT = Struct.byteLength;\n\tLAYOUT = Struct.layout; // TODO: consider whether to lazily materialize the struct layout, as this could potentially be a long string (hence increased memory consumption) depending on the complexity of the struct\n\tFIELDS = Struct.fields;\n\n\t/**\n\t* Constructor which returns an array having a fixed-width composite data type.\n\t*\n\t* @private\n\t* @constructor\n\t* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n\t* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n\t* @param {NonNegativeInteger} [length] - view length\n\t* @throws {TypeError} must provide a valid first argument\n\t* @throws {TypeError} second argument must be a nonnegative integer\n\t* @throws {TypeError} third argument must be a nonnegative integer\n\t* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n\t* @throws {RangeError} second argument must be a multiple of struct byte length\n\t* @throws {RangeError} second argument must not exceeds the ArrayBuffer bounds\n\t* @throws {TypeError} view length must be a positive multiple of struct byte length\n\t* @throws {TypeError} an input array must contain valid elements\n\t* @returns {StructArray} struct array instance\n\t*/\n\tfunction StructArray( arg, byteOffset, length ) {\n\t\tvar nargs;\n\t\tvar buf;\n\t\tvar len;\n\t\tvar tmp;\n\n\t\tnargs = arguments.length;\n\t\tif ( !( this instanceof StructArray) ) {\n\t\t\tif ( nargs === 0 ) {\n\t\t\t\treturn new StructArray();\n\t\t\t}\n\t\t\tif ( nargs === 1 ) {\n\t\t\t\treturn new StructArray( arg );\n\t\t\t}\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\treturn new StructArray( arg, byteOffset );\n\t\t\t}\n\t\t\treturn new StructArray( arg, byteOffset, length );\n\t\t}\n\n\t\t// Case: new StructArray()\n\t\tif ( nargs === 0 ) {\n\t\t\tbuf = new ArrayBuffer( 0 );\n\t\t\tlen = 0;\n\t\t}\n\t\t// Case: new StructArray( arg )\n\t\telse if ( nargs === 1 ) {\n\t\t\t// Case: new StructArray( length )\n\t\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\t\tbuf = new ArrayBuffer( arg*BYTES_PER_ELEMENT );\n\t\t\t\tlen = arg;\n\t\t\t}\n\t\t\t// Case: new StructArray( collection )\n\t\t\telse if ( isCollection( arg ) ) {\n\t\t\t\tlen = arg.length;\n\t\t\t\tbuf = fromArray( Struct, new ArrayBuffer( len*BYTES_PER_ELEMENT ), arg );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of a provided input array must be a valid object or a struct instance having the same layout as elements in the desired output array.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( ArrayBuffer )\n\t\t\telse if ( isArrayBuffer( arg ) ) {\n\t\t\t\tbuf = arg;\n\t\t\t\tlen = buf.byteLength / BYTES_PER_ELEMENT;\n\t\t\t\tif ( !isInteger( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( iterable )\n\t\t\telse if ( isObject( arg ) ) {\n\t\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. First argument must be a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t\t}\n\t\t\t\ttmp = fromIterator( buf );\n\t\t\t\tlen = tmp.length;\n\t\t\t\tbuf = fromArray( Struct, new ArrayBuffer( len*BYTES_PER_ELEMENT ), tmp );\n\t\t\t\tif ( buf === null ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Each element of a provided input iterable must be either a valid object or a struct instance having the same layout as elements in the desired output array.' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( ???? )\n\t\t\telse {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t}\n\t\t// Case: new StructArray( ArrayBuffer, byteOffset[, length] )\n\t\telse {\n\t\t\tbuf = arguments[ 0 ];\n\t\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t\t}\n\t\t\tif ( !isInteger( byteOffset/BYTES_PER_ELEMENT ) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Second argument must be a multiple of %u. Value: `%u`.', BYTES_PER_ELEMENT, byteOffset ) );\n\t\t\t}\n\t\t\tif ( byteOffset >= buf.byteLength ) {\n\t\t\t\tthrow new RangeError( format( 'invalid argument. Second argument exceeds the bounds of the ArrayBuffer. Value: `%s`.', byteOffset ) );\n\t\t\t}\n\t\t\t// Case: new StructArray( ArrayBuffer, byteOffset )\n\t\t\tif ( nargs === 2 ) {\n\t\t\t\tlen = ( buf.byteLength - byteOffset ) / BYTES_PER_ELEMENT;\n\t\t\t\tif ( !isInteger( len ) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid argument. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.', BYTES_PER_ELEMENT, buf.byteLength-byteOffset ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Case: new StructArray( ArrayBuffer, byteOffset, length )\n\t\t\telse {\n\t\t\t\tlen = length;\n\t\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t\t}\n\t\t\t\tif ( (len*BYTES_PER_ELEMENT) > (buf.byteLength-byteOffset) ) {\n\t\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len*BYTES_PER_ELEMENT ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsetReadOnly( this, '_buffer', buf );\n\t\tsetReadOnly( this, '_byteOffset', byteOffset || 0 );\n\t\tsetReadOnly( this, '_byteLength', len*BYTES_PER_ELEMENT );\n\t\tsetReadOnly( this, '_length', len );\n\t\treturn this;\n\t}\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof StructArray\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( StructArray, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n\t/**\n\t* Constructor name.\n\t*\n\t* @private\n\t* @name name\n\t* @memberof StructArray\n\t* @readonly\n\t* @type {string}\n\t*/\n\tsetReadOnly( StructArray, 'name', CTOR_NAME );\n\n\t/**\n\t* Element constructor.\n\t*\n\t* @private\n\t* @name struct\n\t* @memberof StructArray\n\t* @readonly\n\t* @type {Function}\n\t*/\n\tsetReadOnly( StructArray, 'struct', Struct );\n\n\t/**\n\t* Pointer to the underlying data buffer.\n\t*\n\t* @private\n\t* @name buffer\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {ArrayBuffer}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'buffer', function get() {\n\t\treturn this._buffer;\n\t});\n\n\t/**\n\t* Size (in bytes) of the array.\n\t*\n\t* @private\n\t* @name byteLength\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'byteLength', function get() {\n\t\treturn this._byteLength;\n\t});\n\n\t/**\n\t* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n\t*\n\t* @private\n\t* @name byteOffset\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'byteOffset', function get() {\n\t\treturn this._byteOffset;\n\t});\n\n\t/**\n\t* Size (in bytes) of each array element.\n\t*\n\t* @private\n\t* @name BYTES_PER_ELEMENT\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {PositiveInteger}\n\t*/\n\tsetReadOnly( StructArray.prototype, 'BYTES_PER_ELEMENT', StructArray.BYTES_PER_ELEMENT );\n\n\t/**\n\t* Returns an array element.\n\t*\n\t* @private\n\t* @name get\n\t* @memberof StructArray.prototype\n\t* @type {Function}\n\t* @param {NonNegativeInteger} idx - element index\n\t* @throws {TypeError} `this` must be a struct array instance\n\t* @throws {TypeError} must provide a nonnegative integer\n\t* @returns {(*|void)} array element\n\t*/\n\tsetReadOnly( StructArray.prototype, 'get', function get( idx ) {\n\t\tif ( !isStructArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not a %s.', CTOR_NAME ) );\n\t\t}\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\treturn;\n\t\t}\n\t\treturn new Struct( this._buffer, this._byteOffset+( idx*BYTES_PER_ELEMENT ), BYTES_PER_ELEMENT );\n\t});\n\n\t/**\n\t* Number of array elements.\n\t*\n\t* @private\n\t* @name length\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {NonNegativeInteger}\n\t*/\n\tsetReadOnlyAccessor( StructArray.prototype, 'length', function get() {\n\t\treturn this._length;\n\t});\n\n\t/**\n\t* Sets an array element.\n\t*\n\t* ## Notes\n\t*\n\t* - When provided a struct array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n\t*\n\t* In the other overlapping scenario,\n\t*\n\t* ```text\n\t* buf: ---------------------\n\t* src: ---------------------\n\t* ```\n\t*\n\t* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n\t*\n\t* @private\n\t* @name set\n\t* @memberof StructArray.prototype\n\t* @type {Function}\n\t* @param {(Collection|StructArray|Struct|Object)} value - value(s)\n\t* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n\t* @throws {TypeError} `this` must be a struct array instance\n\t* @throws {TypeError} index argument must be a nonnegative integer\n\t* @throws {RangeError} index argument is out-of-bounds\n\t* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n\t* @throws {TypeError} must provide a valid object or a struct instance having the same layout as elements in the target array\n\t* @returns {void}\n\t*/\n\tsetReadOnly( StructArray.prototype, 'set', function set( value ) {\n\t\tvar bbytes;\n\t\tvar sbytes;\n\t\tvar sbuf;\n\t\tvar opts;\n\t\tvar idx;\n\t\tvar buf;\n\t\tvar tmp;\n\t\tvar get;\n\t\tvar nb;\n\t\tvar N;\n\t\tvar s;\n\t\tvar f;\n\t\tvar i;\n\t\tvar j;\n\t\tif ( !isStructArray( this ) ) {\n\t\t\tthrow new TypeError( format( 'invalid invocation. `this` is not a %s.', CTOR_NAME ) );\n\t\t}\n\t\tbuf = this._buffer;\n\t\tif ( arguments.length > 1 ) {\n\t\t\tidx = arguments[ 1 ];\n\t\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t\t}\n\t\t} else {\n\t\t\tidx = 0;\n\t\t}\n\t\topts = {\n\t\t\t'format': 'layout'\n\t\t};\n\t\tnb = Struct.byteLength;\n\n\t\tif ( isCollection( value ) && !contains( FIELDS, 'length' ) ) { // note: when one of the fields is 'length', we always assume that a provided value with a 'length' property is a struct and/or data object as there doesn't seem to be a surefire way to distinguish such an object from a regular array-like object (including accessor arrays)\n\t\t\tN = value.length;\n\t\t\tif ( idx+N > this._length ) {\n\t\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t\t}\n\t\t\tsbuf = value;\n\t\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\t// Check for overlapping memory...\n\t\t\tj = this._byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\t\tif (\n\t\t\t\tsbuf.buffer === buf &&\n\t\t\t\t(\n\t\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// FIXME: add optimization when `value` is a StructArray sharing the same buffer and having the same layout; in which case, we can simply copy `src` bytes to a temporary array and then copy those bytes into the target array, without needing to intermediate struct instance materialization\n\n\t\t\t\t// We need to copy source values...\n\t\t\t\ttmp = [];\n\t\t\t\tfor ( i = 0; i < N; i++ ) {\n\t\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t\t}\n\t\t\t\tsbuf = tmp;\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\t\tthis.set( get( sbuf, i ), idx ); // note: this likely isn't the most performant approach, but it avoids having to replicate branching logic for handling struct instances vs data objects\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( idx >= this._length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t\t}\n\t\tif ( !isObject( value ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide either a valid object or a struct instance. Value: `%s`.', value ) );\n\t\t}\n\t\t// Check for a struct instance having a matching layout...\n\t\tif ( value.toString( opts ) === LAYOUT ) {\n\t\t\t// Explicitly copy the bytes of the input struct instance to the corresponding array element...\n\t\t\tsbuf = Struct.viewOf( value );\n\t\t\tsbytes = new Uint8Array( sbuf.buffer, sbuf.byteOffset, nb );\n\t\t\tbbytes = new Uint8Array( buf, this._byteOffset+( idx*BYTES_PER_ELEMENT ), nb );\n\t\t\tgcopy( nb, sbytes, 1, 0, bbytes, 1, 0 );\n\t\t\treturn;\n\t\t}\n\t\t// Create a struct instance view for the target element:\n\t\ts = new Struct( buf, this._byteOffset+( idx*BYTES_PER_ELEMENT ), nb );\n\n\t\t// Assign field values from the input object (accounting for both own and inherited properties)...\n\t\tfor ( i = 0; i < FIELDS.length; i++ ) {\n\t\t\tf = FIELDS[ i ];\n\t\t\tif ( hasProp( value, f ) ) {\n\t\t\t\ts[ f ] = value[ f ];\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t* Element constructor.\n\t*\n\t* @private\n\t* @name struct\n\t* @memberof StructArray.prototype\n\t* @readonly\n\t* @type {Function}\n\t*/\n\tsetReadOnly( StructArray.prototype, 'struct', Struct );\n\n\treturn StructArray;\n\n\t/**\n\t* Returns a boolean indicating if a value is a struct array.\n\t*\n\t* @private\n\t* @param {*} value - value to test\n\t* @returns {boolean} boolean indicating if a value is a struct array\n\t*/\n\tfunction isStructArray( value ) {\n\t\treturn (\n\t\t\ttypeof value === 'object' &&\n\t\t\tvalue !== null &&\n\t\t\t(\n\t\t\t\tvalue.constructor.name === CTOR_NAME ||\n\t\t\t\tisPrototypeOf( value, StructArray.prototype )\n\t\t\t) &&\n\t\t\tvalue.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT\n\t\t);\n\t}\n}\n\n\n// EXPORTS //\n\nexport default factory;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @returns {Array} output array\n*/\nfunction fromIterator( it ) {\n\tvar out;\n\tvar v;\n\n\tout = [];\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tout.push( v.value );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIterator;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar main = ( typeof Buffer === 'function' ) ? Buffer : null; // eslint-disable-line stdlib/require-globals\n\n\n// EXPORTS //\n\nexport default main;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar ctor = require( 'buffer' ).Buffer;\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Buffer constructor.\n*\n* @module @stdlib/buffer-ctor\n*\n* @example\n* import ctor from '@stdlib/buffer-ctor';\n*\n* var b = new ctor( [ 1, 2, 3, 4 ] );\n* // returns \n*/\n\n// MODULES //\n\nimport hasNodeBufferSupport from '@stdlib/assert-has-node-buffer-support';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar ctor;\nif ( hasNodeBufferSupport() ) {\n\tctor = main;\n} else {\n\tctor = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default ctor;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isBuffer from '@stdlib/assert-is-buffer';\nimport GlobalBuffer from './buffer.js';\n\n\n// MAIN //\n\n/**\n* Tests for native `Buffer` support.\n*\n* @returns {boolean} boolean indicating if an environment has `Buffer` support\n*\n* @example\n* var bool = hasNodeBufferSupport();\n* // returns \n*/\nfunction hasNodeBufferSupport() {\n\tvar bool;\n\tvar b;\n\n\tif ( typeof GlobalBuffer !== 'function' ) {\n\t\treturn false;\n\t}\n\t// Test basic support...\n\ttry {\n\t\tif ( typeof GlobalBuffer.from === 'function' ) {\n\t\t\tb = GlobalBuffer.from( [ 1, 2, 3, 4 ] );\n\t\t} else {\n\t\t\tb = new GlobalBuffer( [ 1, 2, 3, 4 ] ); // Note: this is deprecated behavior starting in Node v6 (see https://nodejs.org/api/buffer.html#buffer_new_buffer_array)\n\t\t}\n\t\tbool = (\n\t\t\tisBuffer( b ) &&\n\t\t\tb[ 0 ] === 1 &&\n\t\t\tb[ 1 ] === 2 &&\n\t\t\tb[ 2 ] === 3 &&\n\t\t\tb[ 3 ] === 4\n\t\t);\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\tbool = false;\n\t}\n\treturn bool;\n}\n\n\n// EXPORTS //\n\nexport default hasNodeBufferSupport;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// TODO: write (browser) polyfill\n\n// MAIN //\n\n/**\n* Buffer constructor.\n*\n* @throws {Error} not implemented\n*/\nfunction polyfill() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// EXPORTS //\n\nexport default polyfill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport Buffer from '@stdlib/buffer-ctor';\nimport Float64Array from '@stdlib/array-float64';\nimport Float32Array from '@stdlib/array-float32';\nimport Int16Array from '@stdlib/array-int16';\nimport Int32Array from '@stdlib/array-int32';\nimport Int8Array from '@stdlib/array-int8';\nimport Uint16Array from '@stdlib/array-uint16';\nimport Uint32Array from '@stdlib/array-uint32';\nimport Uint8Array from '@stdlib/array-uint8';\nimport Uint8ClampedArray from '@stdlib/array-uint8c';\nimport Complex64Array from '@stdlib/array-complex64';\nimport Complex128Array from '@stdlib/array-complex128';\nimport BooleanArray from '@stdlib/array-bool';\n\n\n// FUNCTIONS //\n\n/**\n* Throws an error.\n*\n* @private\n* @throws {Error} not implemented\n*/\nfunction notImplemented() {\n\tthrow new Error( 'not implemented' );\n}\n\n\n// MAIN //\n\n// Mapping from data types to underlying buffer constructors...\nvar ctors = { // eslint-disable-line vars-on-top\n\t'binary': Buffer,\n\t'float64': Float64Array,\n\t'float32': Float32Array,\n\t'float16': notImplemented, // FIXME: replace with Float16Array constructor once implemented\n\t'generic': Array, // TODO: replace with `stdlib` pkg\n\t'int16': Int16Array,\n\t'int32': Int32Array,\n\t'int8': Int8Array,\n\t'uint16': Uint16Array,\n\t'uint32': Uint32Array,\n\t'uint8': Uint8Array,\n\t'uint8c': Uint8ClampedArray,\n\t'complex32': notImplemented, // FIXME: replace with Complex32Array constructor once implemented\n\t'complex64': Complex64Array,\n\t'complex128': Complex128Array,\n\t'bool': BooleanArray\n};\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport isStructDataType from '@stdlib/ndarray-base-assert-is-struct-data-type';\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\nimport structFactory from '@stdlib/array-struct-factory';\nimport table from './ctors.js';\n\n\n// VARIABLES //\n\n// Initialize a cache to storing memoized struct array constructors:\nvar CACHE = {}; // TODO: consider adding/using `@stdlib/array/memoized-struct-factory`; should we need to memoize struct array constructors elsewhere, we should centralize that logic, rather than have multiple caches.\n\n\n// MAIN //\n\n/**\n* Returns an ndarray data buffer constructor.\n*\n* @param {*} dtype - data type\n* @returns {(Function|null)} data buffer constructor or null\n*\n* @example\n* var ctor = ctors( 'float64' );\n* // returns \n*\n* @example\n* var ctor = ctors( 'float' );\n* // returns null\n*/\nfunction ctors( dtype ) {\n\tvar struct;\n\tvar ctor;\n\tvar key;\n\n\t// Case: string || dtype_instance_with_string\n\tif ( !isFunction( dtype ) ) {\n\t\tkey = resolveStr( dtype );\n\t\tctor = table[ key ] || null;\n\t\tif ( ctor ) {\n\t\t\treturn ctor;\n\t\t}\n\t}\n\t// Case: struct_ctor || dtype_instance_with_struct_ctor\n\tif ( isStructDataType( dtype ) ) {\n\t\tif ( key ) {\n\t\t\t// Data type instance (note: we assume that `key === struct.layout`):\n\t\t\tstruct = dtype.value;\n\t\t} else {\n\t\t\t// Struct constructor:\n\t\t\tstruct = dtype;\n\t\t\tkey = struct.layout;\n\t\t}\n\t\tctor = CACHE[ key ];\n\t\tif ( ctor ) {\n\t\t\treturn ctor;\n\t\t}\n\t\tctor = structFactory( struct );\n\t\tCACHE[ key ] = ctor;\n\t\treturn ctor;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nexport default ctors;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Allocate a buffer having a specified number of bytes.\n*\n* @module @stdlib/buffer-alloc-unsafe\n*\n* @example\n* import allocUnsafe from '@stdlib/buffer-alloc-unsafe';\n*\n* var buf = allocUnsafe( 10 );\n* // returns \n*/\n\n// MODULES //\n\nimport hasAllocUnsafe from './has_alloc_unsafe.js';\nimport main from './main.js';\nimport polyfill from './polyfill.js';\n\n\n// MAIN //\n\nvar allocUnsafe;\nif ( hasAllocUnsafe ) {\n\tallocUnsafe = main;\n} else {\n\tallocUnsafe = polyfill;\n}\n\n\n// EXPORTS //\n\nexport default allocUnsafe;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isFunction from '@stdlib/assert-is-function';\nimport Buffer from '@stdlib/buffer-ctor';\n\n\n// MAIN //\n\nvar bool = isFunction( Buffer.allocUnsafe );\n\n\n// EXPORTS //\n\nexport default bool;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\nimport format from '@stdlib/string-format';\nimport Buffer from '@stdlib/buffer-ctor';\n\n\n// MAIN //\n\n/**\n* Allocates a buffer having a specified number of bytes.\n*\n* ## Notes\n*\n* - The underlying memory of returned `Buffer` instances is not initialized. Memory contents are unknown and may contain sensitive data.\n* - When the size is less than half the pool size (specified on the `Buffer` constructor), memory is allocated from the `Buffer` pool for faster allocation of new `Buffer` instances.\n*\n* @param {NonNegativeInteger} size - number of bytes to allocate\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* var buf = allocUnsafe( 10 );\n* // returns \n*/\nfunction allocUnsafe( size ) {\n\tif ( !isNonNegativeInteger( size ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', size ) );\n\t}\n\treturn Buffer.allocUnsafe( size );\n}\n\n\n// EXPORTS //\n\nexport default allocUnsafe;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport isNonNegativeInteger from '@stdlib/assert-is-nonnegative-integer';\nimport format from '@stdlib/string-format';\nimport Buffer from '@stdlib/buffer-ctor';\n\n\n// MAIN //\n\n/**\n* Allocates a buffer having a specified number of bytes.\n*\n* ## Notes\n*\n* - The underlying memory of returned `Buffer` instances is not initialized. Memory contents are unknown and may contain sensitive data.\n* - When the size is less than half the pool size (specified on the `Buffer` constructor), memory is allocated from the `Buffer` pool for faster allocation of new `Buffer` instances.\n*\n* @param {NonNegativeInteger} size - number of bytes to allocate\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {Buffer} new `Buffer` instance\n*\n* @example\n* var buf = allocUnsafe( 10 );\n* // returns \n*/\nfunction allocUnsafe( size ) {\n\tif ( !isNonNegativeInteger( size ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', size ) );\n\t}\n\treturn new Buffer( size );\n}\n\n\n// EXPORTS //\n\nexport default allocUnsafe;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport resolveStr from '@stdlib/ndarray-base-dtype-resolve-str';\nimport bufferCtors from '@stdlib/ndarray-base-buffer-ctors';\nimport allocUnsafe from '@stdlib/buffer-alloc-unsafe';\nimport zeros from '@stdlib/array-base-zeros';\nimport fill from '@stdlib/array-base-fill';\n\n\n// FUNCTIONS //\n\n/**\n* Returns a zero-filled binary buffer.\n*\n* @private\n* @param {NonNegativeInteger} size - buffer size\n* @returns {Buffer} zero-filled binary buffer\n*/\nfunction binary( size ) {\n\treturn fill( allocUnsafe( size ), 0, 0, size );\n}\n\n/**\n* Returns a typed array.\n*\n* @private\n* @param {*} dtype - data type\n* @param {NonNegativeInteger} size - buffer size\n* @returns {(TypedArray|null)} typed array\n*/\nfunction typedarray( dtype, size ) {\n\tvar ctor = bufferCtors( dtype );\n\tif ( ctor ) {\n\t\treturn new ctor( size );\n\t}\n\treturn null;\n}\n\n\n// MAIN //\n\n/**\n* Returns a contiguous linear ndarray data buffer.\n*\n* @param {*} dtype - data type\n* @param {NonNegativeInteger} size - buffer size\n* @returns {(Array|TypedArray|Buffer|null)} data buffer\n*\n* @example\n* var buf = buffer( 'float64', 3 );\n* // returns [ 0.0, 0.0, 0.0 ]\n*/\nfunction buffer( dtype, size ) {\n\tvar dt = resolveStr( dtype );\n\tif ( dt === 'generic' ) {\n\t\treturn zeros( size );\n\t}\n\tif ( dt === 'binary' ) {\n\t\treturn binary( size );\n\t}\n\treturn typedarray( dtype, size );\n}\n\n\n// EXPORTS //\n\nexport default buffer;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2025 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport arraylike2object from '@stdlib/array-base-arraylike2object';\n\n\n// FUNCTIONS //\n\n/**\n* Tests whether an object has a specified method.\n*\n* @private\n* @param {Object} obj - input object\n* @param {string} method - method name\n* @returns {boolean} boolean indicating whether an object has a specified method\n*\n* @example\n* var bool = hasMethod( [], 'fill' );\n* // e.g., returns true\n*\n* @example\n* var bool = hasMethod( [], 'beep' );\n* // returns false\n*/\nfunction hasMethod( obj, method ) {\n\treturn ( typeof obj[ method ] === 'function' );\n}\n\n/**\n* Fills all elements within a portion of an indexed array with a specified value.\n*\n* @private\n* @param {Collection} x - input array\n* @param {*} value - fill value\n* @param {integer} start - starting index (inclusive)\n* @param {integer} end - ending index (exclusive)\n* @returns {Array} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = indexed( x, 5, 1, 3 );\n* // returns [ 1, 5, 5, 4 ]\n*/\nfunction indexed( x, value, start, end ) {\n\tvar i;\n\tfor ( i = start; i < end; i++ ) {\n\t\tx[ i ] = value;\n\t}\n\treturn x;\n}\n\n/**\n* Fills all elements within a portion of an accessor array with a specified value.\n*\n* @private\n* @param {Object} x - input array object\n* @param {*} value - fill value\n* @param {integer} start - starting index (inclusive)\n* @param {integer} end - ending index (exclusive)\n* @returns {AccessorArray} modified input array\n*\n* @example\n* import toAccessorArray from '@stdlib/array-base-to-accessor-array';\n* import arraylike2object from '@stdlib/array-base-arraylike2object';\n*\n* var x = toAccessorArray( [ 1, 2, 3, 4 ] );\n* var obj = arraylike2object( x );\n*\n* var out = accessors( obj, 5, 1, 3 );\n* // returns \n*\n* var v = x.get( 0 );\n* // returns 1\n*\n* v = x.get( 1 );\n* // returns 5\n*\n* v = x.get( 2 );\n* // returns 5\n*\n* v = x.get( 3 );\n* // returns 4\n*/\nfunction accessors( x, value, start, end ) {\n\tvar data;\n\tvar set;\n\tvar i;\n\n\tdata = x.data;\n\tset = x.accessors[ 1 ];\n\tfor ( i = start; i < end; i++ ) {\n\t\tset( data, i, value );\n\t}\n\treturn data;\n}\n\n\n// MAIN //\n\n/**\n* Fills all elements within a portion of an array with a specified value.\n*\n* @param {Collection} x - input array\n* @param {*} value - fill value\n* @param {integer} start - starting index (inclusive)\n* @param {integer} end - ending index (exclusive)\n* @returns {Collection} output array\n*\n* @example\n* var x = [ 1, 2, 3, 4 ];\n*\n* var out = fill( x, 5, 1, 3 );\n* // returns [ 1, 5, 5, 4 ]\n*\n* var bool = ( out === x );\n* // returns true\n*\n* @example\n* import Int32Array from '@stdlib/array-int32';\n*\n* var x = new Int32Array( [ 1, 2, 3, 4 ] );\n*\n* var out = fill( x, 5, 1, 3 );\n* // returns [ 1, 5, 5, 4 ]\n*\n* var bool = ( out === x );\n* // returns true\n*/\nfunction fill( x, value, start, end ) {\n\tvar obj;\n\tif ( hasMethod( x, 'fill' ) ) {\n\t\treturn x.fill( value, start, end );\n\t}\n\tif ( start < 0 ) {\n\t\tstart += x.length;\n\t\tif ( start < 0 ) {\n\t\t\tstart = 0;\n\t\t}\n\t}\n\tif ( end < 0 ) {\n\t\tend += x.length; // if `end` is still negative, that is fine, as `x` will be returned un-mutated\n\t} else if ( end > x.length ) {\n\t\tend = x.length;\n\t}\n\tobj = arraylike2object( x );\n\tif ( obj.accessorProtocol ) {\n\t\treturn accessors( obj, value, start, end );\n\t}\n\treturn indexed( x, value, start, end );\n}\n\n\n// EXPORTS //\n\nexport default fill;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport buffer from '@stdlib/ndarray-base-buffer';\nimport zeros from '@stdlib/array-base-zeros';\n\n\n// MAIN //\n\n/**\n* Returns an empty n-dimensional ndarray.\n*\n* @private\n* @param {Function} ctor - ndarray constructor\n* @param {string} dtype - array data type\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {string} order - layout order\n* @param {boolean} readonly - boolean indicating whether a returned array should be read-only\n* @returns {ndarray} empty ndarray\n*/\nfunction empty( ctor, dtype, shape, order, readonly ) {\n\tvar strides;\n\tvar ndims;\n\n\tndims = shape.length;\n\tif ( ndims === 0 ) {\n\t\tstrides = [ 0 ];\n\t} else {\n\t\tstrides = zeros( ndims );\n\t}\n\treturn new ctor( dtype, buffer( dtype, 0 ), shape, strides, 0, order, {\n\t\t'readonly': readonly\n\t});\n}\n\n\n// EXPORTS //\n\nexport default empty;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport normalizeMultiSlice from '@stdlib/slice-base-normalize-multi-slice';\nimport nonreducedDimensions from '@stdlib/slice-base-nonreduced-dimensions';\nimport sliceShape from '@stdlib/slice-base-shape';\nimport take from '@stdlib/array-base-take-indexed';\nimport zeros from '@stdlib/array-base-zeros';\nimport numel from '@stdlib/ndarray-base-numel';\nimport getDType from '@stdlib/ndarray-base-dtype';\nimport getShape from '@stdlib/ndarray-base-shape';\nimport getStrides from '@stdlib/ndarray-base-strides';\nimport getOffset from '@stdlib/ndarray-base-offset';\nimport getOrder from '@stdlib/ndarray-base-order';\nimport getData from '@stdlib/ndarray-base-data-buffer';\nimport format from '@stdlib/string-format';\nimport sliceStart from './slice_start.js';\nimport slice2strides from './slice_strides.js';\nimport empty from './empty.js';\n\n\n// MAIN //\n\n/**\n* Returns a view of an input ndarray.\n*\n* @param {ndarray} x - input array\n* @param {MultiSlice} s - multi-slice object\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @param {boolean} writable - boolean indicating whether a returned array should be writable\n* @throws {RangeError} number of slice dimensions must match the number of array dimensions\n* @throws {RangeError} slice exceeds array bounds\n* @returns {ndarray} ndarray view\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n* import ndarray from '@stdlib/ndarray-ctor';\n* import ndarray2array from '@stdlib/ndarray-to-array';\n*\n* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n* var shape = [ 3, 2 ];\n* var strides = [ 2, 1 ];\n* var offset = 0;\n*\n* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var sh = x.shape;\n* // returns [ 3, 2 ]\n*\n* var arr = ndarray2array( x );\n* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*\n* var s = new MultiSlice( new Slice( null, null, -2 ), new Slice( null, null, -1 ) );\n* // returns \n*\n* var y = slice( x, s, false, false );\n* // returns \n*\n* sh = y.shape;\n* // returns [ 2, 2 ]\n*\n* arr = ndarray2array( y );\n* // returns [ [ 6.0, 5.0 ], [ 2.0, 1.0 ] ]\n*/\nfunction slice( x, s, strict, writable ) {\n\tvar strides;\n\tvar offset;\n\tvar dtype;\n\tvar shape;\n\tvar order;\n\tvar sdims;\n\tvar ndims;\n\tvar ctor;\n\tvar sh;\n\tvar ns;\n\n\t// Retrieve array meta data:\n\tdtype = getDType( x );\n\tshape = getShape( x, true );\n\tstrides = getStrides( x, true );\n\toffset = getOffset( x );\n\torder = getOrder( x );\n\tndims = shape.length;\n\n\t// Ensure that the number of array dimensions matches the number of slices:\n\tif ( s.ndims !== ndims ) {\n\t\tthrow new RangeError( format( 'invalid argument. Number of slice dimensions does not match the number of array dimensions. Array shape: (%s). Slice dimensions: %u.', shape.join( ',' ), s.ndims ) );\n\t}\n\t// Resolve the output array constructor:\n\tctor = x.constructor;\n\n\t// If provided a zero-dimensional input array, return a zero-dimensional array view...\n\tif ( ndims === 0 ) {\n\t\treturn new ctor( dtype, getData( x ), shape, strides, offset, order, {\n\t\t\t'readonly': !writable\n\t\t});\n\t}\n\t// Resolve the indices of the non-reduced dimensions:\n\tsdims = nonreducedDimensions( s );\n\n\t// Normalize the slice object based on the array shape:\n\tns = normalizeMultiSlice( s, shape, true );\n\n\t// Check whether the slice exceeds array bounds...\n\tif ( ns.code ) {\n\t\tif ( strict ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. Slice exceeds array bounds. Array shape: (%s).', shape.join( ',' ) ) );\n\t\t}\n\t\t// Normalize again, this time allowing for out-of-bounds indices:\n\t\tns = normalizeMultiSlice( s, shape, false );\n\n\t\t// Compute the slice shape:\n\t\tsh = sliceShape( ns );\n\n\t\t// If the non-reduced dimensions contain elements, this means that at least one reduced dimension exceeded array bounds; in which case, we generate a shape containing zeros:\n\t\tif ( numel( take( sh, sdims ) ) > 0 ) {\n\t\t\tsh = zeros( sh.length );\n\t\t}\n\t} else {\n\t\t// Compute the slice shape:\n\t\tsh = sliceShape( ns );\n\t}\n\t// If the slice does not contain any elements, return an empty array...\n\tif ( numel( sh ) === 0 ) {\n\t\treturn empty( ctor, dtype, take( sh, sdims ), order, !writable );\n\t}\n\t// Resolve the index offset of the first element indexed by the slice:\n\toffset = sliceStart( ns, strides, offset ); // TODO: @stdlib/ndarray/base/sind2bind\n\n\t// Remove reduced dimensions from the slice shape:\n\tsh = take( sh, sdims );\n\n\t// If all dimensions were reduced, return a zero-dimensional array...\n\tif ( sh.length === 0 ) {\n\t\treturn new ctor( dtype, getData( x ), [], [ 0 ], offset, order, {\n\t\t\t'readonly': !writable\n\t\t});\n\t}\n\t// Update strides according to slice steps:\n\tstrides = slice2strides( ns, strides, sdims ); // TODO: @stdlib/ndarray/base/slice2strides???\n\n\t// Return a slice view:\n\treturn new ctor( dtype, getData( x ), sh, strides, offset, order, {\n\t\t'readonly': !writable\n\t});\n}\n\n\n// EXPORTS //\n\nexport default slice;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the data type of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {string} data type\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var x = zeros( [ 3, 3, 3 ], {\n* 'dtype': 'float64'\n* });\n*\n* var dt = dtype( x );\n* // returns 'float64'\n*/\nfunction dtype( x ) {\n\treturn x.dtype;\n}\n\n\n// EXPORTS //\n\nexport default dtype;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport copyIndexed from '@stdlib/array-base-copy-indexed';\n\n\n// MAIN //\n\n/**\n* Returns the shape of a provided ndarray.\n*\n* @param {ndarrayLike} x - input ndarray\n* @param {boolean} copy - boolean indicating whether to explicitly copy the value assigned to the input ndarray's `shape` property\n* @returns {NonNegativeIntegerArray} shape\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var out = shape( zeros( [ 3, 3, 3 ] ), false );\n* // returns [ 3, 3, 3 ]\n*/\nfunction shape( x, copy ) {\n\tvar sh = x.shape;\n\tif ( copy ) {\n\t\treturn copyIndexed( sh );\n\t}\n\treturn sh;\n}\n\n\n// EXPORTS //\n\nexport default shape;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\nimport strides2offset from '@stdlib/ndarray-base-strides2offset';\n\n\n// MAIN //\n\n/**\n* Returns the index offset specifying the underlying buffer index of the first iterated ndarray element.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {NonNegativeInteger} index offset\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var n = offset( zeros( [ 3, 3, 3 ] ) );\n* // returns 0\n*/\nfunction offset( x ) {\n\tvar st;\n\tvar sh;\n\tvar o;\n\n\to = x.offset;\n\tif ( isNumber( o ) ) {\n\t\treturn o;\n\t}\n\tsh = x.shape;\n\tif ( sh.length === 0 ) {\n\t\treturn 0;\n\t}\n\tst = x.strides;\n\tif ( typeof st !== 'object' || st === null ) {\n\t\treturn 0;\n\t}\n\treturn strides2offset( sh, st );\n}\n\n\n// EXPORTS //\n\nexport default offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns the index offset which specifies the location of the first indexed value in a multidimensional array based on a stride array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @param {IntegerArray} strides - stride array\n* @returns {NonNegativeInteger} offset - offset\n*\n* @example\n* var shape = [ 2, 3, 10 ];\n* var strides = [ 30, -10, 1 ];\n*\n* var offset = strides2offset( shape, strides );\n* // returns 20\n*/\nfunction strides2offset( shape, strides ) {\n\tvar offset;\n\tvar ndims;\n\tvar i;\n\n\tndims = shape.length;\n\toffset = 0;\n\tfor ( i = 0; i < ndims; i++ ) {\n\t\tif ( strides[ i ] < 0 ) {\n\t\t\t// Note that, since the stride is negative, this operation increments, not decrements, the offset...\n\t\t\toffset -= strides[ i ] * ( shape[ i ]-1 );\n\t\t}\n\t}\n\treturn offset;\n}\n\n\n// EXPORTS //\n\nexport default strides2offset;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a list of non-reduced dimensions in an un-normalized multi-slice.\n*\n* @param {MultiSlice} slice - input slice\n* @returns {NonNegativeIntegerArray} list of non-reduced dimensions\n*\n* @example\n* import MultiSlice from '@stdlib/slice-multi';\n* import Slice from '@stdlib/slice-ctor';\n*\n* var s = new MultiSlice( 1, null, 2, void 0, new Slice( 0, 10, 1 ) );\n* // returns \n*\n* var indices = nonreducedDimensions( s );\n* // returns [ 1, 3, 4 ]\n*/\nfunction nonreducedDimensions( slice ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\n\tdata = slice.data;\n\tout = [];\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tif ( typeof data[ i ] !== 'number' ) {\n\t\t\tout.push( i );\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default nonreducedDimensions;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Resolves the index offset of the first element indexed by a normalized multi-slice.\n*\n* @private\n* @param {MultiSlice} slice - normalized multi-slice object\n* @param {IntegerArray} strides - array strides\n* @param {NonNegativeInteger} offset - array index offset\n* @returns {NonNegativeInteger} index offset of the first element indexed by a normalized multi-slice object\n*/\nfunction sliceStart( slice, strides, offset ) {\n\tvar data;\n\tvar idx;\n\tvar i;\n\n\tdata = slice.data;\n\tidx = offset;\n\tfor ( i = 0; i < data.length; i++ ) {\n\t\tidx += strides[ i ] * data[ i ].start;\n\t}\n\treturn idx;\n}\n\n\n// EXPORTS //\n\nexport default sliceStart;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Resolves slice strides for a provided normalized multi-slice object.\n*\n* @private\n* @param {MultiSlice} slice - normalized multi-slice object\n* @param {IntegerArray} strides - array strides\n* @param {NonNegativeIntegerArray} rdims - indices of non-reduced dimensions\n* @returns {IntegerArray} slice strides\n*\n* @example\n* import Slice from '@stdlib/slice-ctor';\n* import MultiSlice from '@stdlib/slice-multi';\n*\n* var s = new MultiSlice( new Slice( 2, 3, 1 ), new Slice( 10, null, -2 ) );\n* // returns \n*\n* var strides = slice2strides( s, [ 8, 2 ], [ 1 ] );\n* // returns [ -4 ]\n*/\nfunction slice2strides( slice, strides, rdims ) {\n\tvar data;\n\tvar out;\n\tvar i;\n\tvar j;\n\n\tdata = slice.data;\n\tout = [];\n\tfor ( i = 0; i < rdims.length; i++ ) {\n\t\tj = rdims[ i ];\n\t\tout.push( strides[j] * data[j].step );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default slice2strides;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Formats an error message for production.\n*\n* @param {string} code - error code\n* @param {*} ...args - error message arguments\n* @returns {string} formatted error message\n*\n* @example\n* var msg = fmtprodmsg( '3', 'wrong_type' );\n* // returns 'https://stdlib.io/e/3?&arg[]=wrong_type'\n*/\nfunction fmtprodmsg() {\n\tvar a = arguments;\n\tvar c = a[ 0 ];\n\tvar u = 'https://stdlib.io/e/'+c+'?';\n\tvar i;\n\tfor ( i = 1; i < a.length; i++ ) {\n\t\tu += '&arg[]=' + encodeURIComponent( a[ i ] );\n\t}\n\treturn u;\n}\n\n\n// EXPORTS //\n\nexport default fmtprodmsg;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport args2multislice from '@stdlib/slice-base-args2multislice';\nimport Slice from '@stdlib/slice-ctor';\nimport ndims from '@stdlib/ndarray-base-ndims';\nimport slice from '@stdlib/ndarray-base-slice';\nimport normalizeIndex from '@stdlib/ndarray-base-normalize-index';\nimport nulls from '@stdlib/array-base-nulls';\nimport format from '@stdlib/error-tools-fmtprodmsg';\n\n\n// MAIN //\n\n/**\n* Returns a shifted view of an input ndarray along a specified dimension.\n*\n* @param {ndarray} x - input array\n* @param {integer} dim - index of dimension to slice\n* @param {integer} start - starting index (inclusive)\n* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking\n* @param {boolean} writable - boolean indicating whether a returned array should be writable\n* @throws {TypeError} first argument must be an ndarray having one or more dimensions\n* @throws {RangeError} dimension index exceeds the number of dimensions\n* @throws {RangeError} slice exceeds array bounds\n* @returns {ndarray} ndarray view\n*\n* @example\n* import ndarray from '@stdlib/ndarray-ctor';\n* import ndarray2array from '@stdlib/ndarray-to-array';\n*\n* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];\n* var shape = [ 3, 2 ];\n* var strides = [ 2, 1 ];\n* var offset = 0;\n*\n* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );\n* // returns \n*\n* var sh = x.shape;\n* // returns [ 3, 2 ]\n*\n* var arr = ndarray2array( x );\n* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*\n* var y = sliceDimensionFrom( x, 0, 1, false, false );\n* // returns \n*\n* sh = y.shape;\n* // returns [ 2, 2 ]\n*\n* arr = ndarray2array( y );\n* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]\n*/\nfunction sliceDimensionFrom( x, dim, start, strict, writable ) {\n\tvar args;\n\tvar N;\n\tvar d;\n\n\t// Retrieve array meta data:\n\tN = ndims( x );\n\n\t// Check whether we were provided a zero-dimensional array...\n\tif ( N === 0 ) {\n\t\tthrow new TypeError( format( '1lDF7', N ) );\n\t}\n\t// Normalize the dimension index:\n\td = normalizeIndex( dim, N-1 );\n\tif ( d === -1 ) {\n\t\tthrow new RangeError( format( '1lDF8', N, dim ) );\n\t}\n\t// Define a list of slice arguments:\n\targs = nulls( N );\n\targs[ d ] = new Slice( start, null );\n\n\t// Return a new array view:\n\treturn slice( x, args2multislice( args ), strict, writable );\n}\n\n\n// EXPORTS //\n\nexport default sliceDimensionFrom;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Normalizes an index to the interval `[0,max]`.\n*\n* @param {integer} idx - index\n* @param {NonNegativeInteger} max - maximum index\n* @returns {integer} index\n*\n* @example\n* var idx = normalizeIndex( -2, 10 );\n* // returns 9\n*\n* idx = normalizeIndex( 15, 10 );\n* // returns -1\n*\n* idx = normalizeIndex( 5, 10 );\n* // returns 5\n*/\nfunction normalizeIndex( idx, max ) {\n\tif ( idx < 0 ) {\n\t\tidx += max + 1;\n\t\tif ( idx < 0 ) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn idx;\n\t}\n\tif ( idx > max ) {\n\t\treturn -1;\n\t}\n\treturn idx;\n}\n\n\n// EXPORTS //\n\nexport default normalizeIndex;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport { isPrimitive as isNumber } from '@stdlib/assert-is-number';\n\n\n// MAIN //\n\n/**\n* Returns the number of ndarray dimensions.\n*\n* @param {ndarrayLike} x - input ndarray\n* @returns {NonNegativeInteger} number of dimensions\n*\n* @example\n* import zeros from '@stdlib/ndarray-zeros';\n*\n* var n = ndims( zeros( [ 3, 3, 3 ] ) );\n* // returns 3\n*/\nfunction ndims( x ) {\n\tvar n = x.ndims; // Note: intentionally cache in case `ndims` is lazily resolved via accessor\n\tif ( isNumber( n ) ) {\n\t\treturn n;\n\t}\n\treturn x.shape.length;\n}\n\n\n// EXPORTS //\n\nexport default ndims;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport filled from '@stdlib/array-base-filled';\n\n\n// MAIN //\n\n/**\n* Returns a \"generic\" array filled with null values.\n*\n* @param {NonNegativeInteger} len - array length\n* @returns {Array} output array\n*\n* @example\n* var out = nulls( 3 );\n* // returns [ null, null, null ]\n*/\nfunction nulls( len ) {\n\treturn filled( null, len );\n}\n\n\n// EXPORTS //\n\nexport default nulls;\n"],"names":["main","Object","defineProperty","isNumber","value","zeros","n","i","out","zeroPad","str","width","right","negative","pad","length","startsWithMinus","substr","lowercase","String","prototype","toLowerCase","uppercase","toUpperCase","formatInteger","token","base","specifier","arg","parseInt","isFinite","Error","toString","precision","padRight","sign","alternate","call","charAt","abs","Math","replace","RE_EXP_POS_DIGITS","RE_EXP_NEG_DIGITS","RE_ONLY_DIGITS","RE_DIGITS_BEFORE_EXP","RE_TRAILING_PERIOD_ZERO","RE_PERIOD_ZERO_EXP","RE_ZERO_BEFORE_EXP","formatDouble","f","digits","toExponential","toFixed","toPrecision","spaces","fromCharCode","isArray","Array","isnan","initialize","flags","mapping","formatInterpolate","tokens","hasPeriod","flag","num","pos","j","TypeError","padZeros","indexOf","arguments","maxWidth","parseFloat","substring","RE","parse","match","formatTokenize","content","prev","exec","slice","lastIndex","push","format","args","tokenize","interpolate","apply","objectProtoype","toStr","defineGetter","__defineGetter__","defineSetter","__defineSetter__","lookupGetter","__lookupGetter__","lookupSetter","__lookupSetter__","err","hasDefinePropertySupport","builtin","obj","prop","descriptor","hasValue","hasGet","hasSet","__proto__","get","set","defineProperty$1","setNonEnumerableReadOnly","configurable","enumerable","writable","setNonEnumerableReadOnlyAccessor","getter","FLG","Symbol","hasToStringTagSupport","toStringTag","has","hasOwnProperty","hasOwnProp","property","Sym","toStrTag","nativeClass","hasToStringTag","v","isOwn","tag","main$f","Number","test","isPrimitive","isObject","setReadOnly","FLOAT64_PINF","POSITIVE_INFINITY","FLOAT64_NINF","NEGATIVE_INFINITY","floor","isInteger","x","PINF","NINF","isInt","valueOf","isNull","isUndefined","isValid","Slice","nargs","start","stop","step","this","RangeError","_start","_stop","_step","reFunctionName","type","data","RE_FUNCTION_NAME","REGEXP","main$e","arrayfcn","predicate","len","isObjectLike","isBuffer","_isBuffer","constructor","constructorName","name","ctor","isSlice","MultiSlice","proxy","create","_data","args2multislice","normalize","strict","max","code","int2slice","normalizeSlice","normalizeMultiSlice","shape","s","arrayfun","join","toJSON","ceil","sliceLength","inc","x1","x2","sliceShape","take","indices","filled","arr","numel","ndims","copy","isString","isColumnMajorString","shape2strides","order","isColumnMajor","columnmajor","rowmajor","ROW_MAJOR","COLUMN_MAJOR","st","o","strides","column","row","s1","s2","strides2order","isPositiveInteger","isBoolean","Bool","Boolean","self","window","global","globalThis","getGlobal","codegen","Function","GlobalThis","Self","Win","Global","root","nodeList","document","childNodes","typedarray","Int8Array","ctorName","isFunction","typeOf","isStructConstructorLike","alignment","byteLength","byteLengthOf","byteOffsetOf","bufferOf","isStruct","viewOf","keys","bool","isArguments","bool$b","detect","hasArgumentsClass","isNan","isEnumerableProperty","propertyIsEnumerable","hasStringEnumBug","isEnum","UINT32_MAX","isArguments$1","MAX_LENGTH","MAX_TYPED_ARRAY_LENGTH","isCollection","searchElement","fromIndex","isConstructorPrototype","w","hasAutomationEqualityBug","k","win","EXCLUDED_KEYS","check","HAS_BUILTIN","skipConstructor","skipPrototype","isFcn","p","HAS_ENUM_PROTO_BUG","HAS_NON_ENUM_PROPS_BUG","HAS_WINDOW","error","NON_ENUMERABLE","main$c","getProto","Obj","getPrototypeOf","proto","getProto$1","objectPrototype","isPlainObject","isPrototypeOf","key","ownProps","hash","opts","val","allowDupes","duplicates","objectKeys","objectInverse","int8","uint8","uint8c","int16","uint16","int32","uint32","int64","uint64","float16","float32","float64","complex32","complex64","complex128","binary","generic","notype","userdefined_type","enum2str","dtype","ENUM","str2enum","resolve","t","layout","hasProp","TYPE","isAccessorArray","GETTERS","idx","default","ctor2dtypes","Float32Array","Float64Array","Int16Array","Int32Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","Complex64Array","Complex128Array","BooleanArray","hasFloat64Array","hasFloat64ArraySupport","GlobalFloat64Array","NaN","Float64Array$1","hasFloat32Array","GlobalFloat32Array","hasFloat32ArraySupport","Float32Array$1","hasUint32Array","GlobalUint32Array","hasUint32ArraySupport","Uint32Array$1","hasInt32Array","INT32_MAX","INT32_MIN","GlobalInt32Array","hasInt32ArraySupport","Int32Array$1","hasUint16Array","UINT16_MAX","GlobalUint16Array","hasUint16ArraySupport","Uint16Array$1","hasInt16Array","INT16_MAX","INT16_MIN","GlobalInt16Array","hasInt16ArraySupport","Int16Array$1","hasUint8Array","UINT8_MAX","GlobalUint8Array","hasUint8ArraySupport","Uint8Array$1","hasUint8ClampedArray","GlobalUint8ClampedArray","hasUint8ClampedArraySupport","Uint8ClampedArray$1","hasInt8Array","INT8_MAX","INT8_MIN","GlobalInt8Array","hasInt8ArraySupport","Int8Array$1","isNonNegativeInteger","MAX_ARRAY_LENGTH","isArrayLikeObject","hasArrayBuffer","ArrayBuffer","isArrayBuffer","isPrimitiveArray","isObjectArray","isStringArray","Complex128","real","imag","setEnumerableReadOnly","re","im","fround","FLOAT32_VIEW","float64ToFloat32$1","Complex64","float64ToFloat32","isComplexLike","isEven","BYTES_PER_ELEMENT","isComplex64Array","isComplex128Array","hasIteratorSymbolSupport","iterator","IteratorSymbol","z","reinterpret","offset","buffer","byteOffset","fromIterator","it","next","done","realf","imagf","HAS_ITERATOR_SYMBOL","isComplexArray","_length","_buffer","isComplexArrayConstructor","getComplex64","buf","fromArray","reinterpret64","reinterpret128","ITERATOR_SYMBOL","src","thisArg","clbk","tmp","flg","accessorGetter","fromIteratorMap","target","copyWithin","iter","entries","end","fcn","separator","sep","outbuf","reducer","initialValue","acc","N","sbuf","outlen","compareFcn","sort","begin","locales","options","loc","toLocaleString","values","index","getComplex128","isBooleanArray","isBooleanArrayConstructor","a","b","CTORS","DTYPES","NTYPES","ctor2dtype","contains","dt","factory","search","newval","RE_SUFFIX","TABLE","isDataTypeString","kind","all","dtypes","bytesPerElement","DataType","char","description","byteOrder","isDataType","bfloat16","float128","int128","int256","uint128","uint256","dtype2desc","dtype2char","enum","resolveEnum","dtype2alignment","isStructDataType","isDataTypeObject","_alignment","_byteLength","_byteOrder","_char","_description","_enum","_value","_type","isProtoOf","view","GlobalArrayBuffer","isView","hasArrayBufferSupport","ArrayBuffer$1","SETTERS","setter","arraylike2object","accessorProtocol","accessors","accessorSetter","gcopy","strideX","offsetX","y","strideY","offsetY","xbuf","ybuf","ix","iy","M","ox","oy","m","min","ndarray","hasDataView","DataView","isDataView","GlobalDataView","getFloat64","setFloat64","hasDataViewSupport","DataView$1","PRIVATE_BUFFER","CTOR_NAME","setNonEnumerableReadWriteAccessor","setReadOnlyAccessor","setReadWriteAccessor","uint16view","DATA_VIEW_METHODS","ctors","IS_LITTLE_ENDIAN","table","DEFAULT_CTOR","CMPLX_TO_REAL","getComplex","method","complex","defaults","numeric","floating_point","real_floating_point","complex_floating_point","integer","signed_integer","unsigned_integer","boolean","integer_index","boolean_index","mask_index","DEFAULTS","HASH","DEFAULT_DTYPE","reinterpretBoolean","isStructType","getStructArray","getTypedArray","getBigInt","getBoolean","getStruct","isRealFloatingPointDataType","isSignedIntegerDataType","isBigInt","BigInt","wrap","isSymbol","constantFunction","polyfill","ntypes","dt1","dt2","SAFE_CASTS","generateFullTable","generateTable","safeCasts","CASTS","casts","SAME_KIND_CASTS","sameKindCasts","isAllowedCast","from","to","casting","resolveStr","isSafeCast","isMostlySafeCast","isSameKindCast","FLOAT32_SMALLEST_SUBNORMAL","FLOAT32_MAX_SAFE_INTEGER","FLOAT32_MIN_SAFE_INTEGER","minFloatDataType","minDataType","boolean2number","bigint2number","setNumber","minSignedIntegerDataType","complexDType","castingMode","number2boolean","complex2boolean","setBoolean","bigint2boolean","BigInteger","setBigInt","boolean2bigint","isStructInstance","isComplexFloatingPointDataType","isBooleanDataType","isRealDataType","stride2offset","stride","gfill","alpha","assign","xobj","yobj","xdata","ydata","xget","yset","io","internal","map","hasMethod","complex2number","views","dest","nb","setStructArray","isComplexDataType","reinterpretComplex","setTypedArray","setComplex","setStruct","FIELD_PROPERTIES","isUnionType","fields","isUndefinedOrNull","gjoin","strided","isValidBoolean","ALIGNMENTS","MANDATORY_FIELD_NAMES","VALIDATORS","padding","hasProperties","JSON","stringify","normalizeUnion","dflg","normalizeField","resolveAlignment","resolveGetter","fieldIndex","names","setPadding","replacer","p1","layoutFormat","FORMATS","isFormat","Struct","fmt0","fmt1","fmt2","bfmt","ufmt","fmt","ib","c0","c1","c2","w1","linearFormat","foo","isFunctionNameSupported","TypedArray","Dummy","fcnName","hasHasInstanceSymbolSupport","hasInstance","HasInstanceSymbol","hasSupport","instanceOf","typeName","typedarray2json","NAMES","isTypedArray","isComplexTypedArray","FIELD_NAMES","BYTE_LENGTH","PARTITIONS","ALIGNMENT","ACCESSORS","FIELDS","o1","fieldNames","cache","byteOffsets","flatten","partitions","createPrototypeAccessors","struct2string","struct","struct2json","bbytes","sview","LAYOUT","structFactory","StructArray","_byteOffset","isStructArray","Buffer","require$$0","GlobalBuffer","hasNodeBufferSupport","Buffer$1","notImplemented","CACHE","allocUnsafe$1","allocUnsafe","size","fill","indexed","bufferCtors","empty","readonly","sdims","sh","ns","getDType","copyIndexed","getShape","ord","getStrides","strides2offset","getOffset","getOrder","getData","nonreducedDimensions","sliceStart","rdims","slice2strides","fmtprodmsg","u","encodeURIComponent","dim","d"],"mappings":";4RAsBA,IAAIA,EAA0C,mBAA1BC,OAAOC,eAAkCD,OAAOC,eAAiB,KCiCrF,IAAIA,EAAiBD,OAAOC,eCjB5B,SAASC,EAAUC,GAClB,MAA0B,iBAAVA,CACjB,CCAA,SAASC,EAAOC,GACf,IACIC,EADAC,EAAM,GAEV,IAAMD,EAAI,EAAGA,EAAID,EAAGC,IACnBC,GAAO,IAER,OAAOA,CACR,CAcA,SAASC,EAASC,EAAKC,EAAOC,GAC7B,IAAIC,GAAW,EACXC,EAAMH,EAAQD,EAAIK,OACtB,OAAKD,EAAM,IAnCZ,SAA0BJ,GACzB,MAAoB,MAAbA,EAAK,EACb,CAoCMM,CAAiBN,KACrBG,GAAW,EACXH,EAAMA,EAAIO,OAAQ,IAEnBP,EAAM,EACLA,EAAML,EAAOS,GACbT,EAAOS,GAAQJ,EACXG,IACJH,EAAM,IAAMA,IAVLA,CAaT,CCpDA,IAAIQ,EAAYC,OAAOC,UAAUC,YAC7BC,EAAYH,OAAOC,UAAUG,YAajC,SAASC,EAAeC,GACvB,IAAIC,EACAlB,EACAD,EAEJ,OAASkB,EAAME,WACf,IAAK,IAEJD,EAAO,EACP,MACD,IAAK,IAEJA,EAAO,EACP,MACD,IAAK,IACL,IAAK,IAEJA,EAAO,GACP,MAID,QAECA,EAAO,GAKR,GAFAlB,EAAMiB,EAAMG,IACZrB,EAAIsB,SAAUrB,EAAK,KACbsB,SAAUvB,GAAM,CACrB,IAAMJ,EAAUK,GACf,MAAM,IAAIuB,MAAO,2BAA6BvB,GAE/CD,EAAI,CACJ,CAkCD,OAjCKA,EAAI,IAA2B,MAApBkB,EAAME,WAA8B,KAATD,KAC1CnB,EAAI,WAAa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AAI9I,EAAI8I,EAAE+D,MACV,OAAKhN,EAAUG,GACPA,EAED8I,EAAE+C,MAAMpL,MAChB,CFkCKoM,CAAO/D,IAIV,MAAM,IAAI9E,UAAWiB,GAAQ,QAASkY,IAIvC,GChD6B3R,ED+CJ2R,EAAE,GACf,KADZ+T,GC/CwB/b,ED+CJ8b,GC9CT,GACV9b,GAAO3J,EAAM,GACF,GACF,EAEF2J,EAEHA,EAAM3J,GACF,EAEF2J,GDsCN,MAAM,IAAIvL,WAAY3E,GAAQ,QAASkY,EAAG8T,IAO3C,OAJA/rB,EGrDOwH,GAAQ,KHqDDyQ,IACR+T,GAAM,IAAI5nB,GAAOE,EAAO,MAGvB1E,GAAOgE,EAAGuC,GAAiBnG,GAAQqG,EAAQvE,EACnD","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,466,467,468]} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index b3f97b2..0000000 --- a/lib/index.js +++ /dev/null @@ -1,62 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 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'; - -/** -* Return a shifted view of an input ndarray along a specified dimension. -* -* @module @stdlib/ndarray-base-slice-dimension-from -* -* @example -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* var sliceDimensionFrom = require( '@stdlib/ndarray-base-slice-dimension-from' ); -* -* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 54bb1c2..0000000 --- a/lib/main.js +++ /dev/null @@ -1,102 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 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 args2multislice = require( '@stdlib/slice-base-args2multislice' ); -var Slice = require( '@stdlib/slice-ctor' ); -var ndims = require( '@stdlib/ndarray-base-ndims' ); -var slice = require( '@stdlib/ndarray-base-slice' ); -var normalizeIndex = require( '@stdlib/ndarray-base-normalize-index' ); -var nulls = require( '@stdlib/array-base-nulls' ); -var format = require( '@stdlib/string-format' ); - - -// MAIN // - -/** -* Returns a shifted view of an input ndarray along a specified dimension. -* -* @param {ndarray} x - input array -* @param {integer} dim - index of dimension to slice -* @param {integer} start - starting index (inclusive) -* @param {boolean} strict - boolean indicating whether to enforce strict bounds checking -* @param {boolean} writable - boolean indicating whether a returned array should be writable -* @throws {TypeError} first argument must be an ndarray having one or more dimensions -* @throws {RangeError} dimension index exceeds the number of dimensions -* @throws {RangeError} slice exceeds array bounds -* @returns {ndarray} ndarray view -* -* @example -* var ndarray = require( '@stdlib/ndarray-ctor' ); -* var ndarray2array = require( '@stdlib/ndarray-to-array' ); -* -* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ]; -* var shape = [ 3, 2 ]; -* var strides = [ 2, 1 ]; -* var offset = 0; -* -* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' ); -* // returns -* -* var sh = x.shape; -* // returns [ 3, 2 ] -* -* var arr = ndarray2array( x ); -* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -* -* var y = sliceDimensionFrom( x, 0, 1, false, false ); -* // returns -* -* sh = y.shape; -* // returns [ 2, 2 ] -* -* arr = ndarray2array( y ); -* // returns [ [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] -*/ -function sliceDimensionFrom( x, dim, start, strict, writable ) { - var args; - var N; - var d; - - // Retrieve array meta data: - N = ndims( x ); - - // Check whether we were provided a zero-dimensional array... - if ( N === 0 ) { - throw new TypeError( format( 'invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.', N ) ); - } - // Normalize the dimension index: - d = normalizeIndex( dim, N-1 ); - if ( d === -1 ) { - throw new RangeError( format( 'invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.', N, dim ) ); - } - // Define a list of slice arguments: - args = nulls( N ); - args[ d ] = new Slice( start, null ); - - // Return a new array view: - return slice( x, args2multislice( args ), strict, writable ); -} - - -// EXPORTS // - -module.exports = sliceDimensionFrom; diff --git a/package.json b/package.json index b6747ca..af1e85c 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,7 @@ "version": "0.2.4", "description": "Return a shifted view of an input ndarray along a specific dimension.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "main": "./index.js", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,50 +12,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-nulls": "^0.1.1", - "@stdlib/ndarray-base-ndims": "^0.2.3", - "@stdlib/ndarray-base-normalize-index": "^0.2.3", - "@stdlib/ndarray-base-slice": "^0.2.3", - "@stdlib/slice-base-args2multislice": "^0.2.3", - "@stdlib/slice-ctor": "^0.2.3", - "@stdlib/string-format": "^0.2.3", - "@stdlib/types": "^0.4.3", - "@stdlib/error-tools-fmtprodmsg": "^0.2.3" - }, - "devDependencies": { - "@stdlib/array-base-zero-to": "^0.2.2", - "@stdlib/array-typed": "^0.3.2", - "@stdlib/assert-is-ndarray-like": "^0.2.3", - "@stdlib/ndarray-array": "^0.2.3", - "@stdlib/ndarray-base-assert-is-read-only": "^0.2.3", - "@stdlib/ndarray-base-ctor": "^0.3.1", - "@stdlib/ndarray-base-empty": "^0.3.2", - "@stdlib/ndarray-base-numel": "^0.2.3", - "@stdlib/ndarray-ctor": "^0.3.1", - "@stdlib/ndarray-empty": "^0.3.1", - "@stdlib/ndarray-to-array": "^0.2.2", - "@stdlib/ndarray-zeros": "^0.3.1", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.3" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", diff --git a/stats_browser.html b/stats_browser.html new file mode 100644 index 0000000..ccdac15 --- /dev/null +++ b/stats_browser.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/stats_node.html b/stats_node.html new file mode 100644 index 0000000..20e6eb2 --- /dev/null +++ b/stats_node.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 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 tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index dd19802..0000000 --- a/test/test.js +++ /dev/null @@ -1,621 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 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 tape = require( 'tape' ); -var isndarrayLike = require( '@stdlib/assert-is-ndarray-like' ); -var isReadOnly = require( '@stdlib/ndarray-base-assert-is-read-only' ); -var zeroTo = require( '@stdlib/array-base-zero-to' ); -var typedarray = require( '@stdlib/array-typed' ); -var zeros = require( '@stdlib/ndarray-zeros' ); -var numel = require( '@stdlib/ndarray-base-numel' ); -var ndarray2array = require( '@stdlib/ndarray-to-array' ); -var baseCtor = require( '@stdlib/ndarray-base-ctor' ); -var ctor = require( '@stdlib/ndarray-ctor' ); -var sliceDimensionFrom = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof sliceDimensionFrom, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function throws an error if provided a zero-dimensional array (strict=false)', function test( t ) { - var values; - var i; - - values = [ - zeros( [] ) - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error' ); - } - t.end(); - - function badValue( x ) { - return function badValue() { - sliceDimensionFrom( x, 0, 0, false, false ); - }; - } -}); - -tape( 'the function throws an error if provided a zero-dimensional array (strict=true)', function test( t ) { - var values; - var i; - - values = [ - zeros( [] ) - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error' ); - } - t.end(); - - function badValue( x ) { - return function badValue() { - sliceDimensionFrom( x, 0, 0, true, false ); - }; - } -}); - -tape( 'the function throws an error if the dimension index exceeds the number of dimensions (strict=false)', function test( t ) { - var values; - var i; - - values = [ - zeros( [ 1 ] ), - zeros( [ 1, 1 ] ), - zeros( [ 1, 1, 1 ] ), - zeros( [ 1, 1, 1, 1 ] ) - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ], 10 ), RangeError, 'throws an error when provided ' + values[ i ].shape.join( 'x' ) ); - t.throws( badValue( values[ i ], -10 ), RangeError, 'throws an error when provided ' + values[ i ].shape.join( 'x' ) ); - } - t.end(); - - function badValue( x, dim ) { - return function badValue() { - sliceDimensionFrom( x, dim, 0, false, false ); - }; - } -}); - -tape( 'the function throws an error if the dimension index exceeds the number of dimensions (strict=true)', function test( t ) { - var values; - var i; - - values = [ - zeros( [ 1 ] ), - zeros( [ 1, 1 ] ), - zeros( [ 1, 1, 1 ] ), - zeros( [ 1, 1, 1, 1 ] ) - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ], 10 ), RangeError, 'throws an error when provided ' + values[ i ].shape.join( 'x' ) ); - t.throws( badValue( values[ i ], -10 ), RangeError, 'throws an error when provided ' + values[ i ].shape.join( 'x' ) ); - } - t.end(); - - function badValue( x, dim ) { - return function badValue() { - sliceDimensionFrom( x, dim, 0, true, false ); - }; - } -}); - -tape( 'in strict mode, the function throws an error when a starting index exceeds array bounds', function test( t ) { - var values; - var start; - var i; - - values = [ - zeros( [ 1 ] ), - zeros( [ 1, 1 ] ), - zeros( [ 1, 1, 1 ] ), - zeros( [ 1, 1, 1, 1 ] ) - ]; - - start = [ - 10, - 20, - 20, - 20 - ]; - for ( i = 0; i < values.length; i++ ) { - t.throws( badValues( values[ i ], start[ i ] ), RangeError, 'throws an error when provided ' + start[ i ].toString() ); - } - t.end(); - - function badValues( x, s ) { - return function badValues() { - sliceDimensionFrom( x, 0, s, true, false ); - }; - } -}); - -tape( 'in non-strict mode, the function returns an empty array when a starting index exceeds array bounds', function test( t ) { - var actual; - var values; - var start; - var i; - - /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */ - values = [ - zeros( [ 1 ], { 'dtype': 'float64' } ), - zeros( [ 1, 1 ], { 'dtype': 'float32' } ), - zeros( [ 1, 1, 1 ], { 'dtype': 'int32' } ), - zeros( [ 1, 1, 1, 1 ], { 'dtype': 'uint32' } ), - zeros( [ 1, 1, 1, 1, 1 ], { 'dtype': 'complex128' } ) - ]; - - /* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */ - - start = [ - 10, - 20, - 20, - 20, - 10 - ]; - for ( i = 0; i < values.length; i++ ) { - actual = sliceDimensionFrom( values[ i ], 0, start[ i ], false, false ); - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( numel( actual.shape ), 0, 'returns expected value' ); - t.strictEqual( actual.dtype, values[ i ].dtype, 'returns expected value' ); - } - t.end(); -}); - -tape( 'in non-strict mode, the function returns an empty array when a starting index is the one more than the last index along a dimension', function test( t ) { - var actual; - var values; - var start; - var dim; - var i; - - /* eslint-disable object-curly-newline, stdlib/line-closing-bracket-spacing */ - - values = [ - zeros( [ 1 ], { 'dtype': 'float64' } ), - zeros( [ 1, 1 ], { 'dtype': 'float32' } ), - zeros( [ 1, 1, 1 ], { 'dtype': 'int32' } ), - zeros( [ 1, 1, 1, 1 ], { 'dtype': 'uint32' } ), - zeros( [ 1, 1, 1, 1, 1 ], { 'dtype': 'complex128' } ) - ]; - - /* eslint-enable object-curly-newline, stdlib/line-closing-bracket-spacing */ - - dim = [ - 0, - 1, - 0, - 1, - 4 - ]; - - start = [ - 1, - 1, - 1, - 1, - 1 - ]; - for ( i = 0; i < values.length; i++ ) { - actual = sliceDimensionFrom( values[ i ], dim[ i ], start[ i ], false, false ); // eslint-disable-line max-len - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( numel( actual.shape ), 0, 'returns expected value' ); - t.strictEqual( actual.dtype, values[ i ].dtype, 'returns expected value' ); - } - t.end(); -}); - -tape( 'the function returns a shifted view of a provided input array (ndims=1)', function test( t ) { - var expected; - var actual; - var buf; - var ord; - var sh; - var st; - var o; - var x; - var i; - - buf = typedarray( zeroTo( 30 ), 'float64' ); - sh = [ 6 ]; - st = [ 2 ]; - o = 4; - ord = 'row-major'; - - x = new ctor( 'float64', buf, sh, st, o, ord ); - - actual = sliceDimensionFrom( x, 0, 0, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 1, 'returns expected value' ); - t.strictEqual( actual.length, 6, 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ 4, 6, 8, 10, 12, 14 ]; - for ( i = 0; i < expected.length; i++ ) { - t.strictEqual( actual.iget( i ), expected[ i ], 'returns expected value' ); - } - - actual = sliceDimensionFrom( x, 0, 2, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 1, 'returns expected value' ); - t.strictEqual( actual.length, 4, 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ 8, 10, 12, 14 ]; - for ( i = 0; i < expected.length; i++ ) { - t.strictEqual( actual.iget( i ), expected[ i ], 'returns expected value' ); - } - - actual = sliceDimensionFrom( x, 0, -4, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 1, 'returns expected value' ); - t.strictEqual( actual.length, 4, 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ 8, 10, 12, 14 ]; - for ( i = 0; i < expected.length; i++ ) { - t.strictEqual( actual.iget( i ), expected[ i ], 'returns expected value' ); - } - t.end(); -}); - -tape( 'the function returns a shifted view of a provided input array (ndims=2)', function test( t ) { - var expected; - var actual; - var buf; - var ord; - var sh; - var st; - var o; - var x; - - buf = typedarray( zeroTo( 30 ), 'float64' ); - sh = [ 4, 3 ]; - st = [ 6, 2 ]; - o = 4; - ord = 'row-major'; - - x = new ctor( 'float64', buf, sh, st, o, ord ); - - actual = sliceDimensionFrom( x, 0, 0, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 2, 'returns expected value' ); - t.deepEqual( actual.shape, [ 4, 3 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ 4, 6, 8 ], - [ 10, 12, 14 ], - [ 16, 18, 20 ], - [ 22, 24, 26 ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 1, 0, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 2, 'returns expected value' ); - t.deepEqual( actual.shape, [ 4, 3 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ 4, 6, 8 ], - [ 10, 12, 14 ], - [ 16, 18, 20 ], - [ 22, 24, 26 ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 0, 2, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 2, 'returns expected value' ); - t.deepEqual( actual.shape, [ 2, 3 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ 16, 18, 20 ], - [ 22, 24, 26 ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 0, -2, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 2, 'returns expected value' ); - t.deepEqual( actual.shape, [ 2, 3 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ 16, 18, 20 ], - [ 22, 24, 26 ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 1, 1, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 2, 'returns expected value' ); - t.deepEqual( actual.shape, [ 4, 2 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ 6, 8 ], - [ 12, 14 ], - [ 18, 20 ], - [ 24, 26 ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 1, -2, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 2, 'returns expected value' ); - t.deepEqual( actual.shape, [ 4, 2 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ 6, 8 ], - [ 12, 14 ], - [ 18, 20 ], - [ 24, 26 ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - t.end(); -}); - -tape( 'the function returns a shifted view of a provided input array (ndims=3)', function test( t ) { - var expected; - var actual; - var buf; - var ord; - var sh; - var st; - var o; - var x; - - buf = typedarray( zeroTo( 100 ), 'float64' ); - sh = [ 2, 4, 3 ]; - st = [ 24, 6, 2 ]; - o = 10; - ord = 'row-major'; - - x = new ctor( 'float64', buf, sh, st, o, ord ); - - actual = sliceDimensionFrom( x, 0, 0, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 3, 'returns expected value' ); - t.deepEqual( actual.shape, [ 2, 4, 3 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ - [ 10, 12, 14 ], - [ 16, 18, 20 ], - [ 22, 24, 26 ], - [ 28, 30, 32 ] - ], - [ - [ 34, 36, 38 ], - [ 40, 42, 44 ], - [ 46, 48, 50 ], - [ 52, 54, 56 ] - ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 0, 1, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 3, 'returns expected value' ); - t.deepEqual( actual.shape, [ 1, 4, 3 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ - [ 34, 36, 38 ], - [ 40, 42, 44 ], - [ 46, 48, 50 ], - [ 52, 54, 56 ] - ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 1, 1, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 3, 'returns expected value' ); - t.deepEqual( actual.shape, [ 2, 3, 3 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ - [ 16, 18, 20 ], - [ 22, 24, 26 ], - [ 28, 30, 32 ] - ], - [ - [ 40, 42, 44 ], - [ 46, 48, 50 ], - [ 52, 54, 56 ] - ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 2, 2, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 3, 'returns expected value' ); - t.deepEqual( actual.shape, [ 2, 4, 1 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ - [ 14 ], - [ 20 ], - [ 26 ], - [ 32 ] - ], - [ - [ 38 ], - [ 44 ], - [ 50 ], - [ 56 ] - ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = sliceDimensionFrom( x, 2, -1, true, false ); - - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( actual.ndims, 3, 'returns expected value' ); - t.deepEqual( actual.shape, [ 2, 4, 1 ], 'returns expected value' ); - t.strictEqual( actual.dtype, x.dtype, 'returns expected value' ); - t.strictEqual( actual.data, x.data, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - expected = [ - [ - [ 14 ], - [ 20 ], - [ 26 ], - [ 32 ] - ], - [ - [ 38 ], - [ 44 ], - [ 50 ], - [ 56 ] - ] - ]; - actual = ndarray2array( actual ); - t.deepEqual( actual, expected, 'returns expected value' ); - t.end(); -}); - -tape( 'if a provided ndarray has a constructor supporting read-only instances, the function returns a read-only instance', function test( t ) { - var actual; - var buf; - var ord; - var sh; - var st; - var o; - var x; - - buf = typedarray( zeroTo( 30 ), 'float64' ); - sh = [ 6 ]; - st = [ 2 ]; - o = 4; - ord = 'row-major'; - - x = new ctor( 'float64', buf, sh, st, o, ord ); - - actual = sliceDimensionFrom( x, 0, 0, true, false ); - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), true, 'returns expected value' ); - - x = new baseCtor( 'float64', buf, sh, st, o, ord ); - - actual = sliceDimensionFrom( x, 0, 0, true, false ); - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), false, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function supports returning writable views', function test( t ) { - var actual; - var buf; - var ord; - var sh; - var st; - var o; - var x; - - buf = typedarray( zeroTo( 30 ), 'float64' ); - sh = [ 6 ]; - st = [ 2 ]; - o = 4; - ord = 'row-major'; - - x = new ctor( 'float64', buf, sh, st, o, ord ); - - actual = sliceDimensionFrom( x, 0, 0, true, true ); - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), false, 'returns expected value' ); - - x = new baseCtor( 'float64', buf, sh, st, o, ord ); - - actual = sliceDimensionFrom( x, 0, 0, true, true ); - t.strictEqual( isndarrayLike( actual ), true, 'returns expected value' ); - t.strictEqual( isReadOnly( actual ), false, 'returns expected value' ); - - t.end(); -});