tofscope 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. {tofscope-0.1.1 → tofscope-0.1.2}/LICENSE +1 -1
  2. {tofscope-0.1.1/src/tofscope.egg-info → tofscope-0.1.2}/PKG-INFO +14 -9
  3. {tofscope-0.1.1 → tofscope-0.1.2}/README.md +13 -8
  4. {tofscope-0.1.1 → tofscope-0.1.2}/pyproject.toml +4 -1
  5. tofscope-0.1.2/src/tofscope/__init__.py +1 -0
  6. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/analyses.py +29 -2
  7. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/explore.py +1 -1
  8. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/cli.py +24 -13
  9. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/signals.py +1 -1
  10. tofscope-0.1.1/src/tofscope/static/assets/VtkScene-q-o3MPFv.js → tofscope-0.1.2/src/tofscope/static/assets/VtkScene-BMAtiZcm.js +1 -1
  11. tofscope-0.1.1/src/tofscope/static/assets/index-djLJCKw_.js → tofscope-0.1.2/src/tofscope/static/assets/index-D15XNFrC.js +2 -2
  12. tofscope-0.1.1/src/tofscope/static/assets/index-CeV0NVRS.css → tofscope-0.1.2/src/tofscope/static/assets/index-Dx1YS1Fe.css +1 -1
  13. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/static/index.html +2 -2
  14. tofscope-0.1.2/src/tofscope/static/manifest.json +13 -0
  15. {tofscope-0.1.1 → tofscope-0.1.2/src/tofscope.egg-info}/PKG-INFO +14 -9
  16. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope.egg-info/SOURCES.txt +3 -3
  17. tofscope-0.1.1/src/tofscope/__init__.py +0 -1
  18. tofscope-0.1.1/src/tofscope/static/manifest.json +0 -13
  19. {tofscope-0.1.1 → tofscope-0.1.2}/MANIFEST.in +0 -0
  20. {tofscope-0.1.1 → tofscope-0.1.2}/setup.cfg +0 -0
  21. {tofscope-0.1.1 → tofscope-0.1.2}/setup.py +0 -0
  22. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/api/__init__.py +0 -0
  23. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/api/app.py +0 -0
  24. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/api/auth.py +0 -0
  25. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/api/schemas.py +0 -0
  26. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/__init__.py +0 -0
  27. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/cache.py +0 -0
  28. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/commands.py +0 -0
  29. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/identification.py +0 -0
  30. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/identification_models.py +0 -0
  31. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/jobs.py +0 -0
  32. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/lifecycle.py +0 -0
  33. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/models.py +0 -0
  34. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/preparations.py +0 -0
  35. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/resources.py +0 -0
  36. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/saves.py +0 -0
  37. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/signals.py +0 -0
  38. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/application/spatial.py +0 -0
  39. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/config.py +0 -0
  40. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/presentation/__init__.py +0 -0
  41. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/presentation/coordinates.py +0 -0
  42. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/presentation/data.py +0 -0
  43. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/presentation/explore.py +0 -0
  44. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/presentation/exports.py +0 -0
  45. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/presentation/isotopes.py +0 -0
  46. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/presentation/volumes.py +0 -0
  47. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/resources/__init__.py +0 -0
  48. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/resources/reference/README.md +0 -0
  49. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/resources/reference/isotopes.json +0 -0
  50. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/__init__.py +0 -0
  51. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/abundance.py +0 -0
  52. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/depth_calibration.py +0 -0
  53. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/integration.py +0 -0
  54. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/isotopes.py +0 -0
  55. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/raw_peaks.py +0 -0
  56. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/science/volume_layers.py +0 -0
  57. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/static/assets/datasophos-wordmark.png +0 -0
  58. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/static/assets/favicon.svg +0 -0
  59. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/static/licenses/matplotlib.txt +0 -0
  60. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/__init__.py +0 -0
  61. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/acquisitions.py +0 -0
  62. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/analysis_document.py +0 -0
  63. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/bounded_events.py +0 -0
  64. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/compact_copy.py +0 -0
  65. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/dataset_io.py +0 -0
  66. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/explorer.py +0 -0
  67. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/file_browser.py +0 -0
  68. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/identification_document.py +0 -0
  69. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/integration_store.py +0 -0
  70. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/native_saved_copy.py +0 -0
  71. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/raw_preparation.py +0 -0
  72. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/saved_files.py +0 -0
  73. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope/storage/vendor_export.py +0 -0
  74. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope.egg-info/dependency_links.txt +0 -0
  75. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope.egg-info/entry_points.txt +0 -0
  76. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope.egg-info/requires.txt +0 -0
  77. {tofscope-0.1.1 → tofscope-0.1.2}/src/tofscope.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Josh Taillon
3
+ Copyright (c) 2026 Josh Taillon, datasophos LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tofscope
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Multi-analysis ToF-SIMS exploration and calibrated 3D visualization
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.11
@@ -21,10 +21,13 @@ Dynamic: license-file
21
21
  # ToFScope
22
22
 
23
23
  [![PyPI version](https://img.shields.io/pypi/v/tofscope)](https://pypi.org/project/tofscope/)
24
+ [![Documentation](https://img.shields.io/badge/docs-read-blue)](https://datasophos.github.io/ToFScope/)
24
25
 
25
26
  ToFScope is a browser-based application for exploring time-of-flight secondary ion mass spectrometry (ToF-SIMS) data. It allows you to analyze ion images, mass spectra, and depth profiles together so you can inspect an acquisition, compare signals, and save your analysis for later.
26
27
 
27
- ToFScope runs locally as a Python application and opens in your browser. It reads [TOFWERK TOFexplorer](#trademark-disclaimer) HDF5 (`.h5`) acquisitions, and provides interactive tools for exploring their mass spectra, ion images, and depth profiles in two and three dimensions.
28
+ ToFScope runs locally as a Python application and opens in your browser. It reads TOFWERK TOFexplorer[^trademark] HDF5 (`.h5`) acquisitions, and provides interactive tools for exploring their mass spectra, ion images, and depth profiles in two and three dimensions.
29
+
30
+ **[Read the ToFScope documentation](https://datasophos.github.io/ToFScope/)** for installation, user guides, deployment, and developer information. Start with [Install and launch](https://datasophos.github.io/ToFScope/docs/getting-started/installation.html) or [Your first analysis](https://datasophos.github.io/ToFScope/docs/getting-started/first-analysis.html).
28
31
 
29
32
  ![ToFScope Explore showing an ion map, mass spectrum, front projection, and depth profile from a real acquisition](https://raw.githubusercontent.com/datasophos/ToFScope/main/docs/assets/tofscope-explore.png)
30
33
 
@@ -58,7 +61,7 @@ tofscope --data-root /path/to/acquisitions --output-root /path/to/saved-analyses
58
61
 
59
62
  Replace the example paths with your folders. The output folder must be writable and have enough space for a full copy of an acquisition. ToFScope starts a local service and opens the app in your browser. Select a file to begin; keep the terminal open while you work and press **Ctrl-C** there to stop the app.
60
63
 
61
- For a step-by-step installation, including folder setup and troubleshooting, see the [macOS setup guide](https://github.com/datasophos/ToFScope/blob/main/docs/macos-tofscope.md). For configuration, hosted use, and containers, see [deployment](https://github.com/datasophos/ToFScope/blob/main/docs/deployment.md).
64
+ For step-by-step installation, folder setup, and troubleshooting, see [Install and launch](https://datasophos.github.io/ToFScope/docs/getting-started/installation.html). See the [configuration reference](https://datasophos.github.io/ToFScope/docs/technical-documentation/configuration.html) for settings, and [deployment](https://datasophos.github.io/ToFScope/docs/technical-documentation/deployment.html) for hosted use and containers.
62
65
 
63
66
  ## Your first analysis
64
67
 
@@ -69,12 +72,12 @@ For a step-by-step installation, including folder setup and troubleshooting, see
69
72
 
70
73
  Saving leaves the source acquisition unchanged. Unsaved tabs and in-progress calculations do not survive a restart. Some raw files require preparation into a new copy before exploration; ToFScope previews that step and asks for confirmation.
71
74
 
72
- The [user guide](https://github.com/datasophos/ToFScope/blob/main/docs/user-guide.md) covers signals, calibration, exports, isotope identification, saving, and 3D controls in more detail.
75
+ The [user guide](https://datasophos.github.io/ToFScope/docs/getting-started/index.html) covers signals, calibration, exports, isotope identification, saving, and 3D controls in more detail.
73
76
 
74
77
  ## Current limitations
75
78
 
76
79
  ToFScope is under active development and is in an alpha state. The application may change substantially prior to a stable 1.0.0 release.
77
- See the [user guide](https://github.com/datasophos/ToFScope/blob/main/docs/user-guide.md) and [project roadmap](https://github.com/datasophos/ToFScope/blob/main/TODO.md) for details.
80
+ See the [user guide](https://datasophos.github.io/ToFScope/docs/getting-started/index.html) for details.
78
81
  If you have ideas of features to add, or notice any bugs, please open an [issue](https://github.com/datasophos/ToFScope/issues)!
79
82
 
80
83
  ## Developing ToFScope
@@ -86,7 +89,11 @@ uv sync --frozen
86
89
  uv run tofscope --data-root /path/to/acquisitions --output-root /path/to/saved-analyses
87
90
  ```
88
91
 
89
- For frontend and Python checks, build instructions, and distribution validation, see the [developer commands](https://github.com/datasophos/ToFScope/blob/main/docs/user-guide.md#building-and-testing). Scientific and implementation evidence is available in [docs/validation](https://github.com/datasophos/ToFScope/tree/main/docs/validation/).
92
+ For frontend and Python checks, build instructions, and distribution validation, see the [developer commands](https://datasophos.github.io/ToFScope/docs/technical-documentation/building-and-testing.html).
93
+
94
+ For a diagram-led overview of the application, see [ToFScope architecture](https://datasophos.github.io/ToFScope/docs/technical-documentation/architecture.html).
95
+
96
+ To build or preview the documentation site, see [maintaining the documentation](https://datasophos.github.io/ToFScope/docs/technical-documentation/documentation.html).
90
97
 
91
98
  ## License
92
99
 
@@ -94,6 +101,4 @@ ToFScope is available under the [MIT License](https://github.com/datasophos/ToFS
94
101
 
95
102
  ---
96
103
 
97
- ### Trademark disclaimer
98
-
99
- TOFWERK and TOFexplorer are names owned by [TOFWERK AG](https://www.tofwerk.com/). They are used here solely to identify the products and file formats supported by ToFScope. ToFScope is an independent project and is not affiliated with, endorsed by, or sponsored by TOFWERK AG.
104
+ [^trademark]: TOFWERK and TOFexplorer are names owned by [TOFWERK AG](https://www.tofwerk.com/). They are used here solely to identify the products and file formats supported by ToFScope. ToFScope is an independent project and is not affiliated with, endorsed by, or sponsored by TOFWERK AG.
@@ -5,10 +5,13 @@
5
5
  # ToFScope
6
6
 
7
7
  [![PyPI version](https://img.shields.io/pypi/v/tofscope)](https://pypi.org/project/tofscope/)
8
+ [![Documentation](https://img.shields.io/badge/docs-read-blue)](https://datasophos.github.io/ToFScope/)
8
9
 
9
10
  ToFScope is a browser-based application for exploring time-of-flight secondary ion mass spectrometry (ToF-SIMS) data. It allows you to analyze ion images, mass spectra, and depth profiles together so you can inspect an acquisition, compare signals, and save your analysis for later.
10
11
 
11
- ToFScope runs locally as a Python application and opens in your browser. It reads [TOFWERK TOFexplorer](#trademark-disclaimer) HDF5 (`.h5`) acquisitions, and provides interactive tools for exploring their mass spectra, ion images, and depth profiles in two and three dimensions.
12
+ ToFScope runs locally as a Python application and opens in your browser. It reads TOFWERK TOFexplorer[^trademark] HDF5 (`.h5`) acquisitions, and provides interactive tools for exploring their mass spectra, ion images, and depth profiles in two and three dimensions.
13
+
14
+ **[Read the ToFScope documentation](https://datasophos.github.io/ToFScope/)** for installation, user guides, deployment, and developer information. Start with [Install and launch](https://datasophos.github.io/ToFScope/docs/getting-started/installation.html) or [Your first analysis](https://datasophos.github.io/ToFScope/docs/getting-started/first-analysis.html).
12
15
 
13
16
  ![ToFScope Explore showing an ion map, mass spectrum, front projection, and depth profile from a real acquisition](https://raw.githubusercontent.com/datasophos/ToFScope/main/docs/assets/tofscope-explore.png)
14
17
 
@@ -42,7 +45,7 @@ tofscope --data-root /path/to/acquisitions --output-root /path/to/saved-analyses
42
45
 
43
46
  Replace the example paths with your folders. The output folder must be writable and have enough space for a full copy of an acquisition. ToFScope starts a local service and opens the app in your browser. Select a file to begin; keep the terminal open while you work and press **Ctrl-C** there to stop the app.
44
47
 
45
- For a step-by-step installation, including folder setup and troubleshooting, see the [macOS setup guide](https://github.com/datasophos/ToFScope/blob/main/docs/macos-tofscope.md). For configuration, hosted use, and containers, see [deployment](https://github.com/datasophos/ToFScope/blob/main/docs/deployment.md).
48
+ For step-by-step installation, folder setup, and troubleshooting, see [Install and launch](https://datasophos.github.io/ToFScope/docs/getting-started/installation.html). See the [configuration reference](https://datasophos.github.io/ToFScope/docs/technical-documentation/configuration.html) for settings, and [deployment](https://datasophos.github.io/ToFScope/docs/technical-documentation/deployment.html) for hosted use and containers.
46
49
 
47
50
  ## Your first analysis
48
51
 
@@ -53,12 +56,12 @@ For a step-by-step installation, including folder setup and troubleshooting, see
53
56
 
54
57
  Saving leaves the source acquisition unchanged. Unsaved tabs and in-progress calculations do not survive a restart. Some raw files require preparation into a new copy before exploration; ToFScope previews that step and asks for confirmation.
55
58
 
56
- The [user guide](https://github.com/datasophos/ToFScope/blob/main/docs/user-guide.md) covers signals, calibration, exports, isotope identification, saving, and 3D controls in more detail.
59
+ The [user guide](https://datasophos.github.io/ToFScope/docs/getting-started/index.html) covers signals, calibration, exports, isotope identification, saving, and 3D controls in more detail.
57
60
 
58
61
  ## Current limitations
59
62
 
60
63
  ToFScope is under active development and is in an alpha state. The application may change substantially prior to a stable 1.0.0 release.
61
- See the [user guide](https://github.com/datasophos/ToFScope/blob/main/docs/user-guide.md) and [project roadmap](https://github.com/datasophos/ToFScope/blob/main/TODO.md) for details.
64
+ See the [user guide](https://datasophos.github.io/ToFScope/docs/getting-started/index.html) for details.
62
65
  If you have ideas of features to add, or notice any bugs, please open an [issue](https://github.com/datasophos/ToFScope/issues)!
63
66
 
64
67
  ## Developing ToFScope
@@ -70,7 +73,11 @@ uv sync --frozen
70
73
  uv run tofscope --data-root /path/to/acquisitions --output-root /path/to/saved-analyses
71
74
  ```
72
75
 
73
- For frontend and Python checks, build instructions, and distribution validation, see the [developer commands](https://github.com/datasophos/ToFScope/blob/main/docs/user-guide.md#building-and-testing). Scientific and implementation evidence is available in [docs/validation](https://github.com/datasophos/ToFScope/tree/main/docs/validation/).
76
+ For frontend and Python checks, build instructions, and distribution validation, see the [developer commands](https://datasophos.github.io/ToFScope/docs/technical-documentation/building-and-testing.html).
77
+
78
+ For a diagram-led overview of the application, see [ToFScope architecture](https://datasophos.github.io/ToFScope/docs/technical-documentation/architecture.html).
79
+
80
+ To build or preview the documentation site, see [maintaining the documentation](https://datasophos.github.io/ToFScope/docs/technical-documentation/documentation.html).
74
81
 
75
82
  ## License
76
83
 
@@ -78,6 +85,4 @@ ToFScope is available under the [MIT License](https://github.com/datasophos/ToFS
78
85
 
79
86
  ---
80
87
 
81
- ### Trademark disclaimer
82
-
83
- TOFWERK and TOFexplorer are names owned by [TOFWERK AG](https://www.tofwerk.com/). They are used here solely to identify the products and file formats supported by ToFScope. ToFScope is an independent project and is not affiliated with, endorsed by, or sponsored by TOFWERK AG.
88
+ [^trademark]: TOFWERK and TOFexplorer are names owned by [TOFWERK AG](https://www.tofwerk.com/). They are used here solely to identify the products and file formats supported by ToFScope. ToFScope is an independent project and is not affiliated with, endorsed by, or sponsored by TOFWERK AG.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tofscope"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Multi-analysis ToF-SIMS exploration and calibrated 3D visualization"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -21,6 +21,9 @@ dev = [
21
21
  "playwright>=1.50",
22
22
  "rosettasciio==0.15.0",
23
23
  ]
24
+ docs = [
25
+ "great-docs==0.17.0",
26
+ ]
24
27
 
25
28
  [tool.setuptools.packages.find]
26
29
  where = ["src"]
@@ -0,0 +1 @@
1
+ __version__ = "0.1.2"
@@ -2,6 +2,8 @@ from collections import OrderedDict
2
2
  from dataclasses import dataclass, field, replace
3
3
  from threading import RLock
4
4
  from uuid import uuid4
5
+
6
+ import numpy as np
5
7
  from tofscope.storage.acquisitions import SourceChanged
6
8
  from tofscope.application.models import (
7
9
  AnalysisSnapshot,
@@ -13,6 +15,31 @@ from tofscope.application.commands import AllDepth
13
15
  from tofscope.science.signals import SignalRecipe
14
16
 
15
17
 
18
+ DEFAULT_MIN_MZ = 20.0
19
+
20
+
21
+ def strongest_spectral_peak(peaks, mass_axis, spectrum):
22
+ """Estimate stored-channel intensity from its inclusive spectrum window.
23
+
24
+ The sum spectrum is a fast proxy; it need not match stored ion-map totals.
25
+ Peaks below m/z 20 are excluded unless no peak meets that threshold.
26
+ Nonfinite spectrum samples are ignored, and ties retain peak-table order.
27
+ """
28
+ axis = np.asarray(mass_axis, dtype=np.float64)
29
+ finite = np.isfinite(spectrum)
30
+ eligible = [peak for peak in peaks if peak["mass"] >= DEFAULT_MIN_MZ] or peaks
31
+ best = eligible[0]
32
+ best_score = float("-inf")
33
+ for peak in eligible:
34
+ included = finite & (axis >= peak["low"]) & (axis <= peak["high"])
35
+ if not included.any():
36
+ continue
37
+ score = np.sum(spectrum, where=included, dtype=np.float64)
38
+ if score > best_score:
39
+ best, best_score = peak, score
40
+ return best
41
+
42
+
16
43
  class CapacityError(ValueError):
17
44
  pass
18
45
 
@@ -90,10 +117,10 @@ class AnalysisService:
90
117
  def initial(self, owner, dataset, aid=None, revision=0):
91
118
  with self.repository.metadata(owner, dataset, aid) as m:
92
119
  nz, ny, nx, _ = m.shape
93
- default = min(m.peaks, key=lambda p: abs(p["mass"] - 27))
120
+ default = strongest_spectral_peak(m.peaks, m.mass_axis, m.sum_spectrum)
94
121
  frames = (0, nz - 1)
95
122
  recipe = SignalRecipe(
96
- label=f"{default['label']} · {default['mass']:g} Th",
123
+ label=f"{default['label']} · m/z {default['mass']:g}",
97
124
  source="stored",
98
125
  stored_index=default["index"],
99
126
  intervals=((default["low"], default["high"]),),
@@ -20,7 +20,7 @@ class ExploreService:
20
20
  raise ValueError("Coverage outside acquisition.")
21
21
  p = s.peaks[index]
22
22
  return SignalRecipe(
23
- label=f"{p.label} · {p.mass:g} Th",
23
+ label=f"{p.label} · m/z {p.mass:g}",
24
24
  source="stored",
25
25
  stored_index=index,
26
26
  intervals=((p.low, p.high),),
@@ -1,12 +1,9 @@
1
1
  """One Python service/port, loopback by default; Node is build-time only."""
2
2
 
3
3
  import argparse
4
- from dataclasses import asdict
5
4
  import hashlib
6
- from importlib.resources import files
7
5
  import json
8
6
  import os
9
- from pathlib import Path
10
7
  import secrets
11
8
  import socket
12
9
  import sys
@@ -14,7 +11,12 @@ import threading
14
11
  import time
15
12
  import urllib.request
16
13
  import webbrowser
14
+ from dataclasses import asdict
15
+ from importlib.resources import files
16
+ from pathlib import Path
17
+
17
18
  import uvicorn
19
+
18
20
  from tofscope import __version__
19
21
  from tofscope.api.app import create_app
20
22
  from tofscope.config import load_settings
@@ -56,6 +58,9 @@ def run_service(settings, browser=False):
56
58
  socket.AF_INET6 if ":" in settings.host else socket.AF_INET, socket.SOCK_STREAM
57
59
  )
58
60
  try:
61
+ if os.name != "nt":
62
+ # Rebind promptly after closed connections leave the port in TIME_WAIT.
63
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
59
64
  sock.bind((settings.host, settings.port))
60
65
  sock.listen(128)
61
66
  except OSError:
@@ -106,8 +111,11 @@ def main(argv=None):
106
111
  p.add_argument("--port", type=int)
107
112
  p.add_argument("--mode", choices=["local", "proxy"])
108
113
  p.add_argument("--no-browser", action="store_true")
114
+ p.add_argument("--json", action="store_true", help="Print the doctor report as JSON")
109
115
  p.add_argument("--version", action="version", version=__version__)
110
116
  a = p.parse_args(argv)
117
+ if a.json and a.command != "doctor":
118
+ p.error("--json is only available with doctor")
111
119
  try:
112
120
  settings = load_settings(
113
121
  a.config,
@@ -126,16 +134,19 @@ def main(argv=None):
126
134
  )
127
135
  if a.command == "doctor":
128
136
  assets = asset_status()
129
- public = asdict(settings)
130
- public.update(
131
- version=__version__,
132
- asset_version=assets["version"],
133
- scope="Explore-only",
134
- writes_available=False,
135
- save_copies_available=True,
136
- notes="Managed array budget excludes Python/HDF5/browser allocator overhead; one API process.",
137
- )
138
- print(json.dumps(public, default=str, indent=2))
137
+ if a.json:
138
+ public = asdict(settings)
139
+ public.update(
140
+ version=__version__,
141
+ asset_version=assets["version"],
142
+ scope="Explore-only",
143
+ writes_available=False,
144
+ save_copies_available=True,
145
+ notes="Managed array budget excludes Python/HDF5/browser allocator overhead; one API process.",
146
+ )
147
+ print(json.dumps(public, default=str, indent=2))
148
+ else:
149
+ print("Everything looks good: configuration loaded and frontend assets verified.")
139
150
  return 0
140
151
  if a.command == "open":
141
152
  credential = json.loads((settings.runtime_dir / "launch.json").read_text())
@@ -17,7 +17,7 @@ def _integer(value):
17
17
 
18
18
 
19
19
  def interval_label(intervals):
20
- return ' ∪ '.join(f'{low:.4f}–{high:.4f}' for low,high in intervals)+' Th'
20
+ return 'm/z ' + ' ∪ '.join(f'{low:.4f}–{high:.4f}' for low,high in intervals)
21
21
 
22
22
 
23
23
  @dataclass(frozen=True)
@@ -1,4 +1,4 @@
1
- import{v as Un,c as mv,r as Pr,a as Ov,e as Sl,j as Lt,b as wv,d as Rv,t as Mv,f as Ev}from"./index-djLJCKw_.js";function Yo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Dv(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var a=!1;try{a=this instanceof n}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var su=Object.defineProperty,Vv=(t,e)=>{let r={};for(var n in t)su(r,n,{get:t[n],enumerable:!0});return su(r,Symbol.toStringTag,{value:"Module"}),r},xl={vtkObject:()=>null};function $t(t){if(t==null||t.isA)return t;if(!t.vtkClass)return globalThis.console&&globalThis.console.error&&globalThis.console.error("Invalid VTK object"),null;const e=xl[t.vtkClass];if(!e)return globalThis.console&&globalThis.console.error&&globalThis.console.error(`No vtk class found for Object of type ${t.vtkClass}`),null;const r={...t};Object.keys(r).forEach(a=>{r[a]&&typeof r[a]=="object"&&r[a].vtkClass&&(r[a]=$t(r[a]))});const n=e(r);return n&&n.modified&&n.modified(),n}function Bv(t,e){xl[t]=e}$t.register=Bv;var Vs=class extends Array{push(){for(let t=0;t<arguments.length;t++)this.includes(arguments[t])||super.push(arguments[t]);return this.length}},Bs,ou;function Lv(){return ou||(ou=1,Bs=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=n;a--!==0;){var s=i[a];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}),Bs}var Uv=Lv();const Zo=Yo(Uv);var at=Vv({EVENT_ABORT:()=>nc,TYPED_ARRAYS:()=>qe,VOID:()=>Cl,_capitalize:()=>be,algo:()=>rc,capitalize:()=>us,chain:()=>dr,debounce:()=>Fl,default:()=>R,event:()=>ac,formatBytesToProperUnit:()=>Dl,formatNumbersWithThousandSeparator:()=>Vl,get:()=>Ye,getArray:()=>Hn,isVtkObject:()=>ic,keystore:()=>sc,measurePromiseExecution:()=>Ll,moveToProtected:()=>Da,newInstance:()=>ge,newTypedArray:()=>cs,newTypedArrayFrom:()=>Qo,normalizeWheel:()=>Gl,obj:()=>Se,proxy:()=>Nl,proxyPropertyMapping:()=>_l,proxyPropertyState:()=>kl,requiredParam:()=>yl,set:()=>fs,setArray:()=>ec,setGet:()=>Me,setGetArray:()=>tc,setImmediateVTK:()=>Jo,setLoggerFunction:()=>Ol,throttle:()=>bl,traverseInstanceTree:()=>Ui,uncapitalize:()=>El,vtkDebugMacro:()=>Li,vtkErrorMacro:()=>ue,vtkInfoMacro:()=>Rl,vtkLogMacro:()=>wl,vtkOnceErrorMacro:()=>Ml,vtkWarningMacro:()=>os}),xo=0,yl=t=>{throw new Error(`Named parameter '${t}' is missing`)},Cl=Symbol("void");function Fv(){return xo}var ml={};function tn(){}["log","debug","info","warn","error","time","timeEnd","group","groupEnd"].forEach(t=>{ml[t]=tn});var Na=globalThis.console&&globalThis.console.hasOwnProperty("log")?globalThis.console:ml,br={debug:tn,error:Na.error||tn,info:Na.info||tn,log:Na.log||tn,warn:Na.warn||tn};function Ol(t,e){br[t]&&(br[t]=e||tn)}function wl(...t){br.log(...t)}function Rl(...t){br.info(...t)}function Li(...t){br.debug(...t)}function ue(...t){br.error(...t)}function os(...t){br.warn(...t)}var cu={};function Ml(t){cu[t]||(br.error(t),cu[t]=!0)}var qe=Object.create(null);qe.Float32Array=Float32Array;qe.Float64Array=Float64Array;qe.Uint8Array=Uint8Array;qe.Int8Array=Int8Array;qe.Uint16Array=Uint16Array;qe.Int16Array=Int16Array;qe.Uint32Array=Uint32Array;qe.Int32Array=Int32Array;qe.Uint8ClampedArray=Uint8ClampedArray;try{qe.BigInt64Array=BigInt64Array,qe.BigUint64Array=BigUint64Array}catch{}function cs(t,...e){return new(qe[t]||Float64Array)(...e)}function Qo(t,...e){return(qe[t]||Float64Array).from(...e)}function us(t){return t.charAt(0).toUpperCase()+t.slice(1)}function be(t){return us(t[0]==="_"?t.slice(1):t)}function El(t){return t.charAt(0).toLowerCase()+t.slice(1)}function Dl(t,e=2,r=1e3){const n=["TB","GB","MB","KB"];let a=Number(t),i="B";for(;a>r;)a/=r,i=n.pop();return`${a.toFixed(e)} ${i}`}function Vl(t,e=" "){const r=[];let n=t;for(;n>1e3;)r.push(`000${n%1e3}`.slice(-3)),n=Math.floor(n/1e3);return n>0&&r.push(n),r.reverse(),r.join(e)}function Bl(t){Object.keys(t).forEach(e=>{Array.isArray(t[e])&&(t[e]=[].concat(t[e]))})}function bv(t){return Object.values(qe).some(e=>t instanceof e)}function Nv(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return!1}function _v(t,e){return Object.keys(t).find(r=>t[r]===e)}function Jo(t){setTimeout(t,0)}function Ll(t,e){const r=performance.now();t.finally(()=>{e(performance.now()-r)})}function Se(t={},e={}){Bl(e);const r=[];if(Number.isInteger(e.mtime)||(e.mtime=++xo),!("classHierarchy"in e))e.classHierarchy=new Vs("vtkObject");else if(!(e.classHierarchy instanceof Vs)){const i=new Vs;for(let s=0;s<e.classHierarchy.length;s++)i.push(e.classHierarchy[s]);e.classHierarchy=i}function n(i){r[i]=null}function a(i){function s(){n(i)}return Object.freeze({unsubscribe:s})}return t.isDeleted=()=>!!e.deleted,t.modified=i=>{if(e.deleted){ue("instance deleted - cannot call any method");return}i&&i<t.getMTime()||(e.mtime=++xo,r.forEach(s=>s&&s(t)))},t.onModified=i=>{if(e.deleted)return ue("instance deleted - cannot call any method"),null;const s=r.length;return r.push(i),a(s)},t.getMTime=()=>e.mtime,t.isA=i=>{let s=e.classHierarchy.length;for(;s--;)if(e.classHierarchy[s]===i)return!0;return!1},t.getClassName=(i=0)=>e.classHierarchy[e.classHierarchy.length-1-i],t.set=(i={},s=!1,o=!1)=>{let c=!1;return Object.keys(i).forEach(u=>{const l=o?null:t[`set${us(u)}`];l&&Array.isArray(i[u])&&l.length>1?c=l(...i[u])||c:l?c=l(i[u])||c:(["mtime"].indexOf(u)===-1&&!s&&os(`Warning: Set value to model directly ${u}, ${i[u]}`),c=e[u]!==i[u]||c,e[u]=i[u])}),c},t.get=(...i)=>{if(!i.length)return e;const s={};return i.forEach(o=>{s[o]=e[o]}),s},t.getReferenceByName=i=>e[i],t.delete=()=>{Object.keys(e).forEach(i=>delete e[i]),r.forEach((i,s)=>n(s)),e.deleted=!0},t.getState=({preserveTypedArrays:i=!1}={})=>{if(e.deleted)return null;const s={preserveTypedArrays:i},o={...e,vtkClass:t.getClassName()};Object.keys(o).forEach(u=>{o[u]===null||o[u]===void 0||u[0]==="_"?delete o[u]:o[u].isA?o[u]=o[u].getState(s):Array.isArray(o[u])?o[u]=o[u].map(l=>l&&l.isA?l.getState(s):l):bv(o[u])&&(i||(o[u]=Array.from(o[u])))});const c={};return Object.keys(o).sort().forEach(u=>{c[u]=o[u]}),c.mtime&&delete c.mtime,c},t.shallowCopy=(i,s=!1)=>{if(i.getClassName()!==t.getClassName())throw new Error(`Cannot ShallowCopy ${i.getClassName()} into ${t.getClassName()}`);const o=i.get(),c=Object.keys(e).sort();Object.keys(o).sort().forEach(u=>{const l=c.indexOf(u);l===-1?s&&Li(`add ${u} in shallowCopy`):c.splice(l,1),e[u]=o[u]}),c.length&&s&&Li(`Untouched keys: ${c.join(", ")}`),t.modified()},t.toJSON=function(){return t.getState()},t}var kv={object(t,e,r){return function(){return{...e[r.name]}}}};function Ye(t,e,r){r.forEach(n=>{if(typeof n=="object"){const a=kv[n.type];a?t[`get${be(n.name)}`]=a(t,e,n):t[`get${be(n.name)}`]=()=>e[n.name]}else t[`get${be(n)}`]=()=>e[n]})}var Ul={enum(t,e,r){const n=`_on${be(r.name)}Changed`;return a=>{if(typeof a=="string"){if(r.enum[a]!==void 0)return e[r.name]!==r.enum[a]?(e[r.name]=r.enum[a],t.modified(),!0):!1;throw ue(`Set Enum with invalid argument ${r}, ${a}`),new RangeError("Set Enum with invalid string argument")}if(typeof a=="number"){if(e[r.name]!==a){if(Object.keys(r.enum).map(i=>r.enum[i]).indexOf(a)!==-1){const i=e[r.name];return e[r.name]=a,e[n]?.(t,e,a,i),t.modified(),!0}throw ue(`Set Enum outside numeric range ${r}, ${a}`),new RangeError("Set Enum outside numeric range")}return!1}throw ue(`Set Enum with invalid argument (String/Number) ${r}, ${a}`),new TypeError("Set Enum with invalid argument (String/Number)")}},object(t,e,r){r.params?.length===1&&os('Setter of type "object" with a single "param" field is not supported');const n=`_on${be(r.name)}Changed`;return(...a)=>{let i;if(a.length>1&&r.params?.length?i=r.params.reduce((s,o,c)=>Object.assign(s,{[o]:a[c]}),{}):i=a[0],!Zo(e[r.name],i)){const s=e[r.name];return e[r.name]=i,e[n]?.(t,e,i,s),t.modified(),!0}return!1}}};function uu(t){if(typeof t=="object"){const e=Ul[t.type];if(e)return(r,n)=>e(r,n,t);throw ue(`No setter for field ${t}`),new TypeError("No setter for field")}return function(r,n){const a=`_on${be(t)}Changed`;return function(s){if(n.deleted)return ue("instance deleted - cannot call any method"),!1;if(n[t]!==s){const o=n[t.name];return n[t]=s,n[a]?.(r,n,s,o),r.modified(),!0}return!1}}}function fs(t,e,r){r.forEach(n=>{typeof n=="object"?t[`set${be(n.name)}`]=uu(n)(t,e):t[`set${be(n)}`]=uu(n)(t,e)})}function Me(t,e,r){Ye(t,e,r),fs(t,e,r)}function Hn(t,e,r){r.forEach(n=>{t[`get${be(n)}`]=()=>e[n]?Array.from(e[n]):e[n],t[`get${be(n)}ByReference`]=()=>e[n]})}function ec(t,e,r,n,a=void 0){r.forEach(i=>{if(e[i]&&n&&e[i].length!==n)throw new RangeError(`Invalid initial number of values for array (${i})`);const s=`_on${be(i)}Changed`;t[`set${be(i)}`]=(...o)=>{if(e.deleted)return ue("instance deleted - cannot call any method"),!1;let c=o,u,l=!1;if(c.length===1&&(c[0]==null||c[0].length>=0)&&(c=c[0],l=!0),c==null)u=e[i]!==c;else{if(n&&c.length!==n)if(c.length<n&&a!==void 0)for(c=Array.from(c),l=!1;c.length<n;)c.push(a);else throw new RangeError(`Invalid number of values for array setter (${i})`);u=e[i]==null||e[i].length!==c.length;for(let g=0;!u&&g<c.length;++g)u=e[i][g]!==c[g];u&&l&&(c=Array.from(c))}if(u){const g=e[i.name];e[i]=c,e[s]?.(t,e,c,g),t.modified()}return u},t[`set${be(i)}From`]=o=>{const c=e[i];o.forEach((u,l)=>{c[l]=u})}})}function tc(t,e,r,n,a=void 0){Hn(t,e,r),ec(t,e,r,n,a)}function Da(t,e,r){for(let n=0;n<r.length;n++){const a=r[n];e[a]!==void 0&&(e[`_${a}`]=e[a],delete e[a])}}function rc(t,e,r,n){e.inputData?e.inputData=e.inputData.map($t):e.inputData=[],e.inputConnection?e.inputConnection=e.inputConnection.map($t):e.inputConnection=[],e.output?e.output=e.output.map($t):e.output=[],e.inputArrayToProcess?e.inputArrayToProcess=e.inputArrayToProcess.map($t):e.inputArrayToProcess=[],e.numberOfInputs=r;function a(p,d=0){if(e.deleted){ue("instance deleted - cannot call any method");return}if(d>=e.numberOfInputs){ue(`algorithm ${t.getClassName()} only has ${e.numberOfInputs} input ports. To add more input ports, use addInputData()`);return}(e.inputData[d]!==p||e.inputConnection[d])&&(e.inputData[d]=p,e.inputConnection[d]=null,t.modified&&t.modified())}function i(p=0){return e.inputConnection[p]&&(e.inputData[p]=e.inputConnection[p]()),e.inputData[p]}function s(p,d=0){if(e.deleted){ue("instance deleted - cannot call any method");return}if(d>=e.numberOfInputs){let h=`algorithm ${t.getClassName()} only has `;h+=`${e.numberOfInputs}`,h+=" input ports. To add more input ports, use addInputConnection()",ue(h);return}e.inputData[d]=null,e.inputConnection[d]=p}function o(p=0){return e.inputConnection[p]}function c(){let p=e.numberOfInputs;for(;p&&!e.inputData[p-1]&&!e.inputConnection[p-1];)p--;return p===e.numberOfInputs&&e.numberOfInputs++,p}function u(p){if(e.deleted){ue("instance deleted - cannot call any method");return}s(p,c())}function l(p){if(e.deleted){ue("instance deleted - cannot call any method");return}a(p,c())}function g(p=0){return e.deleted?(ue("instance deleted - cannot call any method"),null):(t.shouldUpdate()&&t.update(),e.output[p])}t.shouldUpdate=()=>{const p=t.getMTime();let d=1/0,h=n;for(;h--;){if(!e.output[h]||e.output[h].isDeleted())return!0;const v=e.output[h].getMTime();if(v<p)return!0;v<d&&(d=v)}for(h=e.numberOfInputs;h--;)if(e.inputConnection[h]?.filter.shouldUpdate()||t.getInputData(h)?.getMTime()>d)return!0;return!1};function f(p=0){const d=()=>g(p);return d.filter=t,d}if(e.numberOfInputs){let p=e.numberOfInputs;for(;p--;)e.inputData.push(null),e.inputConnection.push(null);t.setInputData=a,t.setInputConnection=s,t.addInputData=l,t.addInputConnection=u,t.getInputData=i,t.getInputConnection=o}n&&(t.getOutputData=g,t.getOutputPort=f),t.update=()=>{const p=[];if(e.numberOfInputs){let d=0;for(;d<e.numberOfInputs;)p[d]=t.getInputData(d),d++}t.requestData&&!t.isDeleted()&&t.shouldUpdate()&&t.requestData(p,e.output)},t.getNumberOfInputPorts=()=>e.numberOfInputs,t.getNumberOfOutputPorts=()=>n||e.output.length,t.getInputArrayToProcess=p=>{const d=e.inputArrayToProcess[p],h=e.inputData[p];return d&&h?h[`get${d.fieldAssociation}`]().getArray(d.arrayName):null},t.setInputArrayToProcess=(p,d,h,v="Scalars")=>{for(;e.inputArrayToProcess.length<p;)e.inputArrayToProcess.push(null);e.inputArrayToProcess[p]={arrayName:d,fieldAssociation:h,attributeType:v}}}var nc=Symbol("Event abort");function ac(t,e,r){const n=[],a=t.delete;let i=1;function s(u){for(let l=0;l<n.length;++l){const[g]=n[l];if(g===u){n.splice(l,1);return}}}function o(u){function l(){s(u)}return Object.freeze({unsubscribe:l})}function c(){if(e.deleted){ue("instance deleted - cannot call any method");return}const u=n.slice();for(let l=0;l<u.length;++l){const[,g,f]=u[l];if(g){if(f<0)setTimeout(()=>g.apply(t,arguments),1-f);else if(g.apply(t,arguments)===nc)break}}}t[`invoke${be(r)}`]=c,t[`on${be(r)}`]=(u,l=0)=>{if(!u.apply)return console.error(`Invalid callback for event ${r}`),null;if(e.deleted)return ue("instance deleted - cannot call any method"),null;const g=i++;return n.push([g,u,l]),n.sort((f,p)=>p[2]-f[2]),o(g)},t.delete=()=>{a(),n.forEach(([u])=>s(u))}}function ge(t,e){const r=(n={})=>{const a={},i={};return t(i,a,n),Object.freeze(i)};return e&&$t.register(e,r),r}function dr(...t){return(...e)=>t.filter(r=>!!r).map(r=>r(...e))}function ic(t){return t&&t.isA&&t.isA("vtkObject")}function Ui(t,e,r=[],n=[]){if(ic(t)){if(n.indexOf(t)>=0)return r;n.push(t);const a=e(t);a!==void 0&&r.push(a);const i=t.get();Object.keys(i).forEach(s=>{const o=i[s];Array.isArray(o)?o.forEach(c=>{Ui(c,e,r,n)}):Ui(o,e,r,n)})}return r}function Fl(t,e,r){let n;const a=(...i)=>{const s=this,o=()=>{n=null,r||t.apply(s,i)},c=r&&!n;clearTimeout(n),n=setTimeout(o,e),c&&t.apply(s,i)};return a.cancel=()=>clearTimeout(n),a}function bl(t,e){let r=!1,n=null;function a(){r=!1,n!==null&&(i(...n),n=null)}function i(...s){if(r){n=s;return}r=!0,t(...s),setTimeout(a,e)}return i}function sc(t,e,r={}){e.keystore=Object.assign(e.keystore||{},r),t.setKey=(n,a)=>{e.keystore[n]=a},t.getKey=n=>e.keystore[n],t.getAllKeys=()=>Object.keys(e.keystore),t.deleteKey=n=>delete e.keystore[n],t.clearKeystore=()=>t.getAllKeys().forEach(n=>delete e.keystore[n])}var Gv=1,_a="__root__";function Nl(t,e){sc(t,e);const r=t.delete;e.proxyId=`${Gv++}`,e.ui=JSON.parse(JSON.stringify(e.ui||[])),Ye(t,e,["proxyId","proxyGroup","proxyName"]),Me(t,e,["proxyManager"]);const n={},a={};function i(u,l){a[l]||(a[l]=[]);const g=a[l];for(let f=0;f<u.length;f++)g.push(u[f].name),n[u[f].name]=u[f],u[f].children&&u[f].children.length&&i(u[f].children,u[f].name)}i(e.ui,_a),t.updateUI=u=>{e.ui=JSON.parse(JSON.stringify(u||[])),Object.keys(n).forEach(l=>delete n[l]),Object.keys(a).forEach(l=>delete a[l]),i(e.ui,_a),t.modified()};function s(u=_a){return a[u]}t.updateProxyProperty=(u,l)=>{const g=n[u];g?Object.assign(g,l):n[u]={...l}},t.activate=()=>{if(e.proxyManager){const u=`setActive${be(t.getProxyGroup().slice(0,-1))}`;e.proxyManager[u]&&e.proxyManager[u](t)}},e.propertyLinkSubscribers={},t.registerPropertyLinkForGC=(u,l)=>{l in e.propertyLinkSubscribers||(e.propertyLinkSubscribers[l]=[]),e.propertyLinkSubscribers[l].push(u)},t.gcPropertyLinks=u=>{const l=e.propertyLinkSubscribers[u]||[];for(;l.length;)l.pop().unbind(t)},e.propertyLinkMap={},t.getPropertyLink=(u,l=!1)=>{if(e.propertyLinkMap[u])return e.propertyLinkMap[u];let g=null;const f=[];let p=0,d=!1;function h(S,m=!1){if(d)return null;const O=[];let V=null;for(p=f.length;p--;){const M=f[p];M.instance===S?V=M:O.push(M)}if(!V)return null;const C=V.instance[`get${be(V.propertyName)}`]();if(!Nv(C,g)||m){for(g=C,d=!0;O.length;){const M=O.pop();M.instance.set({[M.propertyName]:g})}d=!1}return e.propertyLinkMap[u].persistent&&(e.propertyLinkMap[u].value=C),C}function v(S,m){const O=[];for(p=f.length;p--;){const V=f[p];V.instance===S&&(V.propertyName===m||m===void 0)&&(V.subscription.unsubscribe(),O.push(p))}for(;O.length;)f.splice(O.pop(),1)}function x(S,m,O=!1){const V=S.onModified(h),C=f[0];return f.push({instance:S,propertyName:m,subscription:V}),O&&(e.propertyLinkMap[u].persistent&&e.propertyLinkMap[u].value!==void 0?S.set({[m]:e.propertyLinkMap[u].value}):C&&h(C.instance,!0)),{unsubscribe:()=>v(S,m)}}function y(){for(;f.length;)f.pop().subscription.unsubscribe()}const T={bind:x,unbind:v,unsubscribe:y,persistent:l};return e.propertyLinkMap[u]=T,T};function o(u=_a){const l=[],g=e.proxyId,f=s(u)||[];for(let p=0;p<f.length;p++){const d=f[p],h=t[`get${be(d)}`],v={id:g,name:d,value:h?h():void 0},x=o(d);x.length&&(v.children=x),l.push(v)}return l}t.listPropertyNames=()=>o().map(u=>u.name),t.getPropertyByName=u=>o().find(l=>l.name===u),t.getPropertyDomainByName=u=>(n[u]||{}).domain,t.getProxySection=()=>({id:e.proxyId,name:e.proxyGroup,ui:e.ui,properties:o()}),t.delete=()=>{const u=Object.keys(e.propertyLinkMap);let l=u.length;for(;l--;)e.propertyLinkMap[u[l]].unsubscribe();Object.keys(e.propertyLinkSubscribers).forEach(t.gcPropertyLinks),r()},t.getState=()=>null;function c(){if(e.links)for(let u=0;u<e.links.length;u++){const{link:l,property:g,persistent:f,updateOnBind:p,type:d}=e.links[u];if(d==="application"){const h=e.proxyManager.getPropertyLink(l,f);t.registerPropertyLinkForGC(h,"application"),h.bind(t,g,p)}}}Jo(c)}function _l(t,e,r){const n=t.delete,a=[],i=Object.keys(r);let s=i.length;for(;s--;){const o=i[s],{modelKey:c,property:u,modified:l=!0}=r[o],g=be(u),f=be(o);t[`get${f}`]=e[c][`get${g}`],t[`set${f}`]=e[c][`set${g}`],l&&a.push(e[c].onModified(t.modified))}t.delete=()=>{for(;a.length;)a.pop().unsubscribe();n()}}function kl(t,e,r={},n={}){e.this=t;function a(o){const c=Object.keys(o);let u=c.length;for(;u--;){const l=c[u];e[l].set(o[l])}}const i=Object.keys(n);let s=i.length;for(;s--;){const o=i[s];e[o]=n[o];const c=r[o];t[`set${be(o)}`]=u=>{if(u!==e[o]){e[o]=u;const l=c[u];a(l),t.modified()}}}i.length&&Ye(t,e,i)}var fu=10,lu=40,gu=800;function Gl(t){let e=0,r=0,n=0,a=0;return"detail"in t&&(r=t.detail),"wheelDelta"in t&&(r=-t.wheelDelta/120),"wheelDeltaY"in t&&(r=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=r,r=0),n=e*fu,a=r*fu,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||a)&&t.deltaMode&&(t.deltaMode===1?(n*=lu,a*=lu):(n*=gu,a*=gu)),n&&!e&&(e=n<1?-1:1),a&&!r&&(r=a<1?-1:1),{spinX:e,spinY:r||e,pixelX:n,pixelY:a||n}}var R={algo:rc,capitalize:us,chain:dr,debounce:Fl,enumToString:_v,event:ac,EVENT_ABORT:nc,formatBytesToProperUnit:Dl,formatNumbersWithThousandSeparator:Vl,get:Ye,getArray:Hn,getCurrentGlobalMTime:Fv,isVtkObject:ic,keystore:sc,measurePromiseExecution:Ll,moveToProtected:Da,newInstance:ge,newTypedArray:cs,newTypedArrayFrom:Qo,normalizeWheel:Gl,obj:Se,proxy:Nl,proxyPropertyMapping:_l,proxyPropertyState:kl,safeArrays:Bl,set:fs,setArray:ec,setGet:Me,setGetArray:tc,setImmediate:Jo,setLoggerFunction:Ol,throttle:bl,traverseInstanceTree:Ui,TYPED_ARRAYS:qe,uncapitalize:El,VOID:Cl,vtkDebugMacro:Li,vtkErrorMacro:ue,vtkInfoMacro:Rl,vtkLogMacro:wl,vtkOnceErrorMacro:Ml,vtkWarningMacro:os,objectSetterMap:Ul,requiredParam:yl},{vtkErrorMacro:$v}=R,Wv=["Build","Render"];function zv(t,e){e.classHierarchy.push("vtkViewNode");function r(a,i){const{children:s}=e;if(a.end===void 0){a.start=s.lastIndexOf(i),a.end=a.start+1;return}if(s[a.end]===i){a.end++;return}let o=s.indexOf(i,a.end+1);if(o<0&&(o=s.indexOf(i)),!(o>=a.start&&o<a.end)){if(a.end>=s.length){s.splice(o,1),s.push(i),a.start--;return}s[o]=s[a.end],s[a.end]=i,a.end++}}t.build=a=>{},t.render=a=>{},t.traverse=a=>{const i=t[a.getTraverseOperation()];if(i){i(a);return}t.apply(a,!0);for(let s=0;s<e.children.length;s++)e.children[s].traverse(a);t.apply(a,!1)},t.apply=(a,i)=>{const s=t[a.getOperation()];s&&s(i,a)},t.getViewNodeFor=(a,i=null)=>{if(i&&i.renderable===a)return i;if(e.renderable===a)return t;const s=e._renderableChildMap.get(a);if(s)return s;for(let o=0;o<e.children.length;++o){const c=e.children[o].getViewNodeFor(a);if(c)return c}},t.getFirstAncestorOfType=a=>e._parent?e._parent.isA(a)?e._parent:e._parent.getFirstAncestorOfType(a):null,t.getLastAncestorOfType=a=>{if(!e._parent)return null;const i=e._parent.getLastAncestorOfType(a);return i||(e._parent.isA(a)?e._parent:null)},t.addMissingNode=a=>{if(!a)return;const i=e._renderableChildMap.get(a);if(i!==void 0)return i.setVisited(!0),i;const s=t.createViewNode(a);if(s)return s.setParent(t),s.setVisited(!0),e._renderableChildMap.set(a,s),e.children.push(s),s},t.addMissingNodes=(a,i=!1)=>{if(!a||!a.length)return;const s={};for(let o=0;o<a.length;++o){const c=a[o],u=t.addMissingNode(c);i&&u!==void 0&&r(s,u)}},t.addMissingChildren=a=>{if(!(!a||!a.length))for(let i=0;i<a.length;++i){const s=a[i];if(e.children.indexOf(s)===-1){s.setParent(t),e.children.push(s);const o=s.getRenderable();o&&e._renderableChildMap.set(o,s)}s.setVisited(!0)}},t.removeNode=a=>{const i=e.children.findIndex(o=>o===a);if(i<0)return!1;const s=a.getRenderable();return s&&e._renderableChildMap.delete(s),a.delete(),e.children.splice(i,1),!0},t.prepareNodes=()=>{for(let a=0;a<e.children.length;++a)e.children[a].setVisited(!1)},t.setVisited=a=>{e.visited=a},t.removeUnusedNodes=()=>{let a=0;for(let i=0;i<e.children.length;++i){const s=e.children[i];if(s.getVisited())e.children[a++]=s,s.setVisited(!1);else{const o=s.getRenderable();o&&e._renderableChildMap.delete(o),s.delete()}}e.children.length=a},t.createViewNode=a=>{if(!e.myFactory)return $v("Cannot create view nodes without my own factory"),null;const i=e.myFactory.createNode(a);return i&&i.setRenderable(a),i};const n=t.delete;t.delete=()=>{for(let a=0;a<e.children.length;a++)e.children[a].delete();n()}}var Iv={renderable:null,myFactory:null,children:[],visited:!1};function pu(t,e,r={}){Object.assign(e,Iv,r),R.obj(t,e),R.event(t,e,"event"),e._renderableChildMap=new Map,R.get(t,e,["visited"]),R.setGet(t,e,["_parent","renderable","myFactory"]),R.getArray(t,e,["children"]),R.moveToProtected(t,e,["parent"]),zv(t,e)}var ve={newInstance:R.newInstance(pu,"vtkViewNode"),extend:pu,PASS_TYPES:Wv},{vtkWarningMacro:Pv}=R;function Hv(t){const e=[];let r=0,n=t.getClassName(r++);for(;n;)e.push(n),n=t.getClassName(r++);return e}function Av(t,e){const r=e.join(" → ");return[`No ${t} implementation found for ${e[0]}.`,`Class hierarchy: ${r}.`,`A rendering Profile is likely missing for ${e[0]}.`,"Try importing '@kitware/vtk.js/Rendering/Profiles/All' or 'vtk.js/Sources/Rendering/Profiles/All',","or import the specific rendering profile needed by this renderable if known.","See https://kitware.github.io/vtk-js/docs/concepts_profile.html for details."].join(`
1
+ import{v as Un,c as mv,r as Pr,a as Ov,e as Sl,j as Lt,b as wv,d as Rv,t as Mv,f as Ev}from"./index-D15XNFrC.js";function Yo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Dv(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var a=!1;try{a=this instanceof n}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var su=Object.defineProperty,Vv=(t,e)=>{let r={};for(var n in t)su(r,n,{get:t[n],enumerable:!0});return su(r,Symbol.toStringTag,{value:"Module"}),r},xl={vtkObject:()=>null};function $t(t){if(t==null||t.isA)return t;if(!t.vtkClass)return globalThis.console&&globalThis.console.error&&globalThis.console.error("Invalid VTK object"),null;const e=xl[t.vtkClass];if(!e)return globalThis.console&&globalThis.console.error&&globalThis.console.error(`No vtk class found for Object of type ${t.vtkClass}`),null;const r={...t};Object.keys(r).forEach(a=>{r[a]&&typeof r[a]=="object"&&r[a].vtkClass&&(r[a]=$t(r[a]))});const n=e(r);return n&&n.modified&&n.modified(),n}function Bv(t,e){xl[t]=e}$t.register=Bv;var Vs=class extends Array{push(){for(let t=0;t<arguments.length;t++)this.includes(arguments[t])||super.push(arguments[t]);return this.length}},Bs,ou;function Lv(){return ou||(ou=1,Bs=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=n;a--!==0;){var s=i[a];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}),Bs}var Uv=Lv();const Zo=Yo(Uv);var at=Vv({EVENT_ABORT:()=>nc,TYPED_ARRAYS:()=>qe,VOID:()=>Cl,_capitalize:()=>be,algo:()=>rc,capitalize:()=>us,chain:()=>dr,debounce:()=>Fl,default:()=>R,event:()=>ac,formatBytesToProperUnit:()=>Dl,formatNumbersWithThousandSeparator:()=>Vl,get:()=>Ye,getArray:()=>Hn,isVtkObject:()=>ic,keystore:()=>sc,measurePromiseExecution:()=>Ll,moveToProtected:()=>Da,newInstance:()=>ge,newTypedArray:()=>cs,newTypedArrayFrom:()=>Qo,normalizeWheel:()=>Gl,obj:()=>Se,proxy:()=>Nl,proxyPropertyMapping:()=>_l,proxyPropertyState:()=>kl,requiredParam:()=>yl,set:()=>fs,setArray:()=>ec,setGet:()=>Me,setGetArray:()=>tc,setImmediateVTK:()=>Jo,setLoggerFunction:()=>Ol,throttle:()=>bl,traverseInstanceTree:()=>Ui,uncapitalize:()=>El,vtkDebugMacro:()=>Li,vtkErrorMacro:()=>ue,vtkInfoMacro:()=>Rl,vtkLogMacro:()=>wl,vtkOnceErrorMacro:()=>Ml,vtkWarningMacro:()=>os}),xo=0,yl=t=>{throw new Error(`Named parameter '${t}' is missing`)},Cl=Symbol("void");function Fv(){return xo}var ml={};function tn(){}["log","debug","info","warn","error","time","timeEnd","group","groupEnd"].forEach(t=>{ml[t]=tn});var Na=globalThis.console&&globalThis.console.hasOwnProperty("log")?globalThis.console:ml,br={debug:tn,error:Na.error||tn,info:Na.info||tn,log:Na.log||tn,warn:Na.warn||tn};function Ol(t,e){br[t]&&(br[t]=e||tn)}function wl(...t){br.log(...t)}function Rl(...t){br.info(...t)}function Li(...t){br.debug(...t)}function ue(...t){br.error(...t)}function os(...t){br.warn(...t)}var cu={};function Ml(t){cu[t]||(br.error(t),cu[t]=!0)}var qe=Object.create(null);qe.Float32Array=Float32Array;qe.Float64Array=Float64Array;qe.Uint8Array=Uint8Array;qe.Int8Array=Int8Array;qe.Uint16Array=Uint16Array;qe.Int16Array=Int16Array;qe.Uint32Array=Uint32Array;qe.Int32Array=Int32Array;qe.Uint8ClampedArray=Uint8ClampedArray;try{qe.BigInt64Array=BigInt64Array,qe.BigUint64Array=BigUint64Array}catch{}function cs(t,...e){return new(qe[t]||Float64Array)(...e)}function Qo(t,...e){return(qe[t]||Float64Array).from(...e)}function us(t){return t.charAt(0).toUpperCase()+t.slice(1)}function be(t){return us(t[0]==="_"?t.slice(1):t)}function El(t){return t.charAt(0).toLowerCase()+t.slice(1)}function Dl(t,e=2,r=1e3){const n=["TB","GB","MB","KB"];let a=Number(t),i="B";for(;a>r;)a/=r,i=n.pop();return`${a.toFixed(e)} ${i}`}function Vl(t,e=" "){const r=[];let n=t;for(;n>1e3;)r.push(`000${n%1e3}`.slice(-3)),n=Math.floor(n/1e3);return n>0&&r.push(n),r.reverse(),r.join(e)}function Bl(t){Object.keys(t).forEach(e=>{Array.isArray(t[e])&&(t[e]=[].concat(t[e]))})}function bv(t){return Object.values(qe).some(e=>t instanceof e)}function Nv(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return!1}function _v(t,e){return Object.keys(t).find(r=>t[r]===e)}function Jo(t){setTimeout(t,0)}function Ll(t,e){const r=performance.now();t.finally(()=>{e(performance.now()-r)})}function Se(t={},e={}){Bl(e);const r=[];if(Number.isInteger(e.mtime)||(e.mtime=++xo),!("classHierarchy"in e))e.classHierarchy=new Vs("vtkObject");else if(!(e.classHierarchy instanceof Vs)){const i=new Vs;for(let s=0;s<e.classHierarchy.length;s++)i.push(e.classHierarchy[s]);e.classHierarchy=i}function n(i){r[i]=null}function a(i){function s(){n(i)}return Object.freeze({unsubscribe:s})}return t.isDeleted=()=>!!e.deleted,t.modified=i=>{if(e.deleted){ue("instance deleted - cannot call any method");return}i&&i<t.getMTime()||(e.mtime=++xo,r.forEach(s=>s&&s(t)))},t.onModified=i=>{if(e.deleted)return ue("instance deleted - cannot call any method"),null;const s=r.length;return r.push(i),a(s)},t.getMTime=()=>e.mtime,t.isA=i=>{let s=e.classHierarchy.length;for(;s--;)if(e.classHierarchy[s]===i)return!0;return!1},t.getClassName=(i=0)=>e.classHierarchy[e.classHierarchy.length-1-i],t.set=(i={},s=!1,o=!1)=>{let c=!1;return Object.keys(i).forEach(u=>{const l=o?null:t[`set${us(u)}`];l&&Array.isArray(i[u])&&l.length>1?c=l(...i[u])||c:l?c=l(i[u])||c:(["mtime"].indexOf(u)===-1&&!s&&os(`Warning: Set value to model directly ${u}, ${i[u]}`),c=e[u]!==i[u]||c,e[u]=i[u])}),c},t.get=(...i)=>{if(!i.length)return e;const s={};return i.forEach(o=>{s[o]=e[o]}),s},t.getReferenceByName=i=>e[i],t.delete=()=>{Object.keys(e).forEach(i=>delete e[i]),r.forEach((i,s)=>n(s)),e.deleted=!0},t.getState=({preserveTypedArrays:i=!1}={})=>{if(e.deleted)return null;const s={preserveTypedArrays:i},o={...e,vtkClass:t.getClassName()};Object.keys(o).forEach(u=>{o[u]===null||o[u]===void 0||u[0]==="_"?delete o[u]:o[u].isA?o[u]=o[u].getState(s):Array.isArray(o[u])?o[u]=o[u].map(l=>l&&l.isA?l.getState(s):l):bv(o[u])&&(i||(o[u]=Array.from(o[u])))});const c={};return Object.keys(o).sort().forEach(u=>{c[u]=o[u]}),c.mtime&&delete c.mtime,c},t.shallowCopy=(i,s=!1)=>{if(i.getClassName()!==t.getClassName())throw new Error(`Cannot ShallowCopy ${i.getClassName()} into ${t.getClassName()}`);const o=i.get(),c=Object.keys(e).sort();Object.keys(o).sort().forEach(u=>{const l=c.indexOf(u);l===-1?s&&Li(`add ${u} in shallowCopy`):c.splice(l,1),e[u]=o[u]}),c.length&&s&&Li(`Untouched keys: ${c.join(", ")}`),t.modified()},t.toJSON=function(){return t.getState()},t}var kv={object(t,e,r){return function(){return{...e[r.name]}}}};function Ye(t,e,r){r.forEach(n=>{if(typeof n=="object"){const a=kv[n.type];a?t[`get${be(n.name)}`]=a(t,e,n):t[`get${be(n.name)}`]=()=>e[n.name]}else t[`get${be(n)}`]=()=>e[n]})}var Ul={enum(t,e,r){const n=`_on${be(r.name)}Changed`;return a=>{if(typeof a=="string"){if(r.enum[a]!==void 0)return e[r.name]!==r.enum[a]?(e[r.name]=r.enum[a],t.modified(),!0):!1;throw ue(`Set Enum with invalid argument ${r}, ${a}`),new RangeError("Set Enum with invalid string argument")}if(typeof a=="number"){if(e[r.name]!==a){if(Object.keys(r.enum).map(i=>r.enum[i]).indexOf(a)!==-1){const i=e[r.name];return e[r.name]=a,e[n]?.(t,e,a,i),t.modified(),!0}throw ue(`Set Enum outside numeric range ${r}, ${a}`),new RangeError("Set Enum outside numeric range")}return!1}throw ue(`Set Enum with invalid argument (String/Number) ${r}, ${a}`),new TypeError("Set Enum with invalid argument (String/Number)")}},object(t,e,r){r.params?.length===1&&os('Setter of type "object" with a single "param" field is not supported');const n=`_on${be(r.name)}Changed`;return(...a)=>{let i;if(a.length>1&&r.params?.length?i=r.params.reduce((s,o,c)=>Object.assign(s,{[o]:a[c]}),{}):i=a[0],!Zo(e[r.name],i)){const s=e[r.name];return e[r.name]=i,e[n]?.(t,e,i,s),t.modified(),!0}return!1}}};function uu(t){if(typeof t=="object"){const e=Ul[t.type];if(e)return(r,n)=>e(r,n,t);throw ue(`No setter for field ${t}`),new TypeError("No setter for field")}return function(r,n){const a=`_on${be(t)}Changed`;return function(s){if(n.deleted)return ue("instance deleted - cannot call any method"),!1;if(n[t]!==s){const o=n[t.name];return n[t]=s,n[a]?.(r,n,s,o),r.modified(),!0}return!1}}}function fs(t,e,r){r.forEach(n=>{typeof n=="object"?t[`set${be(n.name)}`]=uu(n)(t,e):t[`set${be(n)}`]=uu(n)(t,e)})}function Me(t,e,r){Ye(t,e,r),fs(t,e,r)}function Hn(t,e,r){r.forEach(n=>{t[`get${be(n)}`]=()=>e[n]?Array.from(e[n]):e[n],t[`get${be(n)}ByReference`]=()=>e[n]})}function ec(t,e,r,n,a=void 0){r.forEach(i=>{if(e[i]&&n&&e[i].length!==n)throw new RangeError(`Invalid initial number of values for array (${i})`);const s=`_on${be(i)}Changed`;t[`set${be(i)}`]=(...o)=>{if(e.deleted)return ue("instance deleted - cannot call any method"),!1;let c=o,u,l=!1;if(c.length===1&&(c[0]==null||c[0].length>=0)&&(c=c[0],l=!0),c==null)u=e[i]!==c;else{if(n&&c.length!==n)if(c.length<n&&a!==void 0)for(c=Array.from(c),l=!1;c.length<n;)c.push(a);else throw new RangeError(`Invalid number of values for array setter (${i})`);u=e[i]==null||e[i].length!==c.length;for(let g=0;!u&&g<c.length;++g)u=e[i][g]!==c[g];u&&l&&(c=Array.from(c))}if(u){const g=e[i.name];e[i]=c,e[s]?.(t,e,c,g),t.modified()}return u},t[`set${be(i)}From`]=o=>{const c=e[i];o.forEach((u,l)=>{c[l]=u})}})}function tc(t,e,r,n,a=void 0){Hn(t,e,r),ec(t,e,r,n,a)}function Da(t,e,r){for(let n=0;n<r.length;n++){const a=r[n];e[a]!==void 0&&(e[`_${a}`]=e[a],delete e[a])}}function rc(t,e,r,n){e.inputData?e.inputData=e.inputData.map($t):e.inputData=[],e.inputConnection?e.inputConnection=e.inputConnection.map($t):e.inputConnection=[],e.output?e.output=e.output.map($t):e.output=[],e.inputArrayToProcess?e.inputArrayToProcess=e.inputArrayToProcess.map($t):e.inputArrayToProcess=[],e.numberOfInputs=r;function a(p,d=0){if(e.deleted){ue("instance deleted - cannot call any method");return}if(d>=e.numberOfInputs){ue(`algorithm ${t.getClassName()} only has ${e.numberOfInputs} input ports. To add more input ports, use addInputData()`);return}(e.inputData[d]!==p||e.inputConnection[d])&&(e.inputData[d]=p,e.inputConnection[d]=null,t.modified&&t.modified())}function i(p=0){return e.inputConnection[p]&&(e.inputData[p]=e.inputConnection[p]()),e.inputData[p]}function s(p,d=0){if(e.deleted){ue("instance deleted - cannot call any method");return}if(d>=e.numberOfInputs){let h=`algorithm ${t.getClassName()} only has `;h+=`${e.numberOfInputs}`,h+=" input ports. To add more input ports, use addInputConnection()",ue(h);return}e.inputData[d]=null,e.inputConnection[d]=p}function o(p=0){return e.inputConnection[p]}function c(){let p=e.numberOfInputs;for(;p&&!e.inputData[p-1]&&!e.inputConnection[p-1];)p--;return p===e.numberOfInputs&&e.numberOfInputs++,p}function u(p){if(e.deleted){ue("instance deleted - cannot call any method");return}s(p,c())}function l(p){if(e.deleted){ue("instance deleted - cannot call any method");return}a(p,c())}function g(p=0){return e.deleted?(ue("instance deleted - cannot call any method"),null):(t.shouldUpdate()&&t.update(),e.output[p])}t.shouldUpdate=()=>{const p=t.getMTime();let d=1/0,h=n;for(;h--;){if(!e.output[h]||e.output[h].isDeleted())return!0;const v=e.output[h].getMTime();if(v<p)return!0;v<d&&(d=v)}for(h=e.numberOfInputs;h--;)if(e.inputConnection[h]?.filter.shouldUpdate()||t.getInputData(h)?.getMTime()>d)return!0;return!1};function f(p=0){const d=()=>g(p);return d.filter=t,d}if(e.numberOfInputs){let p=e.numberOfInputs;for(;p--;)e.inputData.push(null),e.inputConnection.push(null);t.setInputData=a,t.setInputConnection=s,t.addInputData=l,t.addInputConnection=u,t.getInputData=i,t.getInputConnection=o}n&&(t.getOutputData=g,t.getOutputPort=f),t.update=()=>{const p=[];if(e.numberOfInputs){let d=0;for(;d<e.numberOfInputs;)p[d]=t.getInputData(d),d++}t.requestData&&!t.isDeleted()&&t.shouldUpdate()&&t.requestData(p,e.output)},t.getNumberOfInputPorts=()=>e.numberOfInputs,t.getNumberOfOutputPorts=()=>n||e.output.length,t.getInputArrayToProcess=p=>{const d=e.inputArrayToProcess[p],h=e.inputData[p];return d&&h?h[`get${d.fieldAssociation}`]().getArray(d.arrayName):null},t.setInputArrayToProcess=(p,d,h,v="Scalars")=>{for(;e.inputArrayToProcess.length<p;)e.inputArrayToProcess.push(null);e.inputArrayToProcess[p]={arrayName:d,fieldAssociation:h,attributeType:v}}}var nc=Symbol("Event abort");function ac(t,e,r){const n=[],a=t.delete;let i=1;function s(u){for(let l=0;l<n.length;++l){const[g]=n[l];if(g===u){n.splice(l,1);return}}}function o(u){function l(){s(u)}return Object.freeze({unsubscribe:l})}function c(){if(e.deleted){ue("instance deleted - cannot call any method");return}const u=n.slice();for(let l=0;l<u.length;++l){const[,g,f]=u[l];if(g){if(f<0)setTimeout(()=>g.apply(t,arguments),1-f);else if(g.apply(t,arguments)===nc)break}}}t[`invoke${be(r)}`]=c,t[`on${be(r)}`]=(u,l=0)=>{if(!u.apply)return console.error(`Invalid callback for event ${r}`),null;if(e.deleted)return ue("instance deleted - cannot call any method"),null;const g=i++;return n.push([g,u,l]),n.sort((f,p)=>p[2]-f[2]),o(g)},t.delete=()=>{a(),n.forEach(([u])=>s(u))}}function ge(t,e){const r=(n={})=>{const a={},i={};return t(i,a,n),Object.freeze(i)};return e&&$t.register(e,r),r}function dr(...t){return(...e)=>t.filter(r=>!!r).map(r=>r(...e))}function ic(t){return t&&t.isA&&t.isA("vtkObject")}function Ui(t,e,r=[],n=[]){if(ic(t)){if(n.indexOf(t)>=0)return r;n.push(t);const a=e(t);a!==void 0&&r.push(a);const i=t.get();Object.keys(i).forEach(s=>{const o=i[s];Array.isArray(o)?o.forEach(c=>{Ui(c,e,r,n)}):Ui(o,e,r,n)})}return r}function Fl(t,e,r){let n;const a=(...i)=>{const s=this,o=()=>{n=null,r||t.apply(s,i)},c=r&&!n;clearTimeout(n),n=setTimeout(o,e),c&&t.apply(s,i)};return a.cancel=()=>clearTimeout(n),a}function bl(t,e){let r=!1,n=null;function a(){r=!1,n!==null&&(i(...n),n=null)}function i(...s){if(r){n=s;return}r=!0,t(...s),setTimeout(a,e)}return i}function sc(t,e,r={}){e.keystore=Object.assign(e.keystore||{},r),t.setKey=(n,a)=>{e.keystore[n]=a},t.getKey=n=>e.keystore[n],t.getAllKeys=()=>Object.keys(e.keystore),t.deleteKey=n=>delete e.keystore[n],t.clearKeystore=()=>t.getAllKeys().forEach(n=>delete e.keystore[n])}var Gv=1,_a="__root__";function Nl(t,e){sc(t,e);const r=t.delete;e.proxyId=`${Gv++}`,e.ui=JSON.parse(JSON.stringify(e.ui||[])),Ye(t,e,["proxyId","proxyGroup","proxyName"]),Me(t,e,["proxyManager"]);const n={},a={};function i(u,l){a[l]||(a[l]=[]);const g=a[l];for(let f=0;f<u.length;f++)g.push(u[f].name),n[u[f].name]=u[f],u[f].children&&u[f].children.length&&i(u[f].children,u[f].name)}i(e.ui,_a),t.updateUI=u=>{e.ui=JSON.parse(JSON.stringify(u||[])),Object.keys(n).forEach(l=>delete n[l]),Object.keys(a).forEach(l=>delete a[l]),i(e.ui,_a),t.modified()};function s(u=_a){return a[u]}t.updateProxyProperty=(u,l)=>{const g=n[u];g?Object.assign(g,l):n[u]={...l}},t.activate=()=>{if(e.proxyManager){const u=`setActive${be(t.getProxyGroup().slice(0,-1))}`;e.proxyManager[u]&&e.proxyManager[u](t)}},e.propertyLinkSubscribers={},t.registerPropertyLinkForGC=(u,l)=>{l in e.propertyLinkSubscribers||(e.propertyLinkSubscribers[l]=[]),e.propertyLinkSubscribers[l].push(u)},t.gcPropertyLinks=u=>{const l=e.propertyLinkSubscribers[u]||[];for(;l.length;)l.pop().unbind(t)},e.propertyLinkMap={},t.getPropertyLink=(u,l=!1)=>{if(e.propertyLinkMap[u])return e.propertyLinkMap[u];let g=null;const f=[];let p=0,d=!1;function h(S,m=!1){if(d)return null;const O=[];let V=null;for(p=f.length;p--;){const M=f[p];M.instance===S?V=M:O.push(M)}if(!V)return null;const C=V.instance[`get${be(V.propertyName)}`]();if(!Nv(C,g)||m){for(g=C,d=!0;O.length;){const M=O.pop();M.instance.set({[M.propertyName]:g})}d=!1}return e.propertyLinkMap[u].persistent&&(e.propertyLinkMap[u].value=C),C}function v(S,m){const O=[];for(p=f.length;p--;){const V=f[p];V.instance===S&&(V.propertyName===m||m===void 0)&&(V.subscription.unsubscribe(),O.push(p))}for(;O.length;)f.splice(O.pop(),1)}function x(S,m,O=!1){const V=S.onModified(h),C=f[0];return f.push({instance:S,propertyName:m,subscription:V}),O&&(e.propertyLinkMap[u].persistent&&e.propertyLinkMap[u].value!==void 0?S.set({[m]:e.propertyLinkMap[u].value}):C&&h(C.instance,!0)),{unsubscribe:()=>v(S,m)}}function y(){for(;f.length;)f.pop().subscription.unsubscribe()}const T={bind:x,unbind:v,unsubscribe:y,persistent:l};return e.propertyLinkMap[u]=T,T};function o(u=_a){const l=[],g=e.proxyId,f=s(u)||[];for(let p=0;p<f.length;p++){const d=f[p],h=t[`get${be(d)}`],v={id:g,name:d,value:h?h():void 0},x=o(d);x.length&&(v.children=x),l.push(v)}return l}t.listPropertyNames=()=>o().map(u=>u.name),t.getPropertyByName=u=>o().find(l=>l.name===u),t.getPropertyDomainByName=u=>(n[u]||{}).domain,t.getProxySection=()=>({id:e.proxyId,name:e.proxyGroup,ui:e.ui,properties:o()}),t.delete=()=>{const u=Object.keys(e.propertyLinkMap);let l=u.length;for(;l--;)e.propertyLinkMap[u[l]].unsubscribe();Object.keys(e.propertyLinkSubscribers).forEach(t.gcPropertyLinks),r()},t.getState=()=>null;function c(){if(e.links)for(let u=0;u<e.links.length;u++){const{link:l,property:g,persistent:f,updateOnBind:p,type:d}=e.links[u];if(d==="application"){const h=e.proxyManager.getPropertyLink(l,f);t.registerPropertyLinkForGC(h,"application"),h.bind(t,g,p)}}}Jo(c)}function _l(t,e,r){const n=t.delete,a=[],i=Object.keys(r);let s=i.length;for(;s--;){const o=i[s],{modelKey:c,property:u,modified:l=!0}=r[o],g=be(u),f=be(o);t[`get${f}`]=e[c][`get${g}`],t[`set${f}`]=e[c][`set${g}`],l&&a.push(e[c].onModified(t.modified))}t.delete=()=>{for(;a.length;)a.pop().unsubscribe();n()}}function kl(t,e,r={},n={}){e.this=t;function a(o){const c=Object.keys(o);let u=c.length;for(;u--;){const l=c[u];e[l].set(o[l])}}const i=Object.keys(n);let s=i.length;for(;s--;){const o=i[s];e[o]=n[o];const c=r[o];t[`set${be(o)}`]=u=>{if(u!==e[o]){e[o]=u;const l=c[u];a(l),t.modified()}}}i.length&&Ye(t,e,i)}var fu=10,lu=40,gu=800;function Gl(t){let e=0,r=0,n=0,a=0;return"detail"in t&&(r=t.detail),"wheelDelta"in t&&(r=-t.wheelDelta/120),"wheelDeltaY"in t&&(r=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=r,r=0),n=e*fu,a=r*fu,"deltaY"in t&&(a=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||a)&&t.deltaMode&&(t.deltaMode===1?(n*=lu,a*=lu):(n*=gu,a*=gu)),n&&!e&&(e=n<1?-1:1),a&&!r&&(r=a<1?-1:1),{spinX:e,spinY:r||e,pixelX:n,pixelY:a||n}}var R={algo:rc,capitalize:us,chain:dr,debounce:Fl,enumToString:_v,event:ac,EVENT_ABORT:nc,formatBytesToProperUnit:Dl,formatNumbersWithThousandSeparator:Vl,get:Ye,getArray:Hn,getCurrentGlobalMTime:Fv,isVtkObject:ic,keystore:sc,measurePromiseExecution:Ll,moveToProtected:Da,newInstance:ge,newTypedArray:cs,newTypedArrayFrom:Qo,normalizeWheel:Gl,obj:Se,proxy:Nl,proxyPropertyMapping:_l,proxyPropertyState:kl,safeArrays:Bl,set:fs,setArray:ec,setGet:Me,setGetArray:tc,setImmediate:Jo,setLoggerFunction:Ol,throttle:bl,traverseInstanceTree:Ui,TYPED_ARRAYS:qe,uncapitalize:El,VOID:Cl,vtkDebugMacro:Li,vtkErrorMacro:ue,vtkInfoMacro:Rl,vtkLogMacro:wl,vtkOnceErrorMacro:Ml,vtkWarningMacro:os,objectSetterMap:Ul,requiredParam:yl},{vtkErrorMacro:$v}=R,Wv=["Build","Render"];function zv(t,e){e.classHierarchy.push("vtkViewNode");function r(a,i){const{children:s}=e;if(a.end===void 0){a.start=s.lastIndexOf(i),a.end=a.start+1;return}if(s[a.end]===i){a.end++;return}let o=s.indexOf(i,a.end+1);if(o<0&&(o=s.indexOf(i)),!(o>=a.start&&o<a.end)){if(a.end>=s.length){s.splice(o,1),s.push(i),a.start--;return}s[o]=s[a.end],s[a.end]=i,a.end++}}t.build=a=>{},t.render=a=>{},t.traverse=a=>{const i=t[a.getTraverseOperation()];if(i){i(a);return}t.apply(a,!0);for(let s=0;s<e.children.length;s++)e.children[s].traverse(a);t.apply(a,!1)},t.apply=(a,i)=>{const s=t[a.getOperation()];s&&s(i,a)},t.getViewNodeFor=(a,i=null)=>{if(i&&i.renderable===a)return i;if(e.renderable===a)return t;const s=e._renderableChildMap.get(a);if(s)return s;for(let o=0;o<e.children.length;++o){const c=e.children[o].getViewNodeFor(a);if(c)return c}},t.getFirstAncestorOfType=a=>e._parent?e._parent.isA(a)?e._parent:e._parent.getFirstAncestorOfType(a):null,t.getLastAncestorOfType=a=>{if(!e._parent)return null;const i=e._parent.getLastAncestorOfType(a);return i||(e._parent.isA(a)?e._parent:null)},t.addMissingNode=a=>{if(!a)return;const i=e._renderableChildMap.get(a);if(i!==void 0)return i.setVisited(!0),i;const s=t.createViewNode(a);if(s)return s.setParent(t),s.setVisited(!0),e._renderableChildMap.set(a,s),e.children.push(s),s},t.addMissingNodes=(a,i=!1)=>{if(!a||!a.length)return;const s={};for(let o=0;o<a.length;++o){const c=a[o],u=t.addMissingNode(c);i&&u!==void 0&&r(s,u)}},t.addMissingChildren=a=>{if(!(!a||!a.length))for(let i=0;i<a.length;++i){const s=a[i];if(e.children.indexOf(s)===-1){s.setParent(t),e.children.push(s);const o=s.getRenderable();o&&e._renderableChildMap.set(o,s)}s.setVisited(!0)}},t.removeNode=a=>{const i=e.children.findIndex(o=>o===a);if(i<0)return!1;const s=a.getRenderable();return s&&e._renderableChildMap.delete(s),a.delete(),e.children.splice(i,1),!0},t.prepareNodes=()=>{for(let a=0;a<e.children.length;++a)e.children[a].setVisited(!1)},t.setVisited=a=>{e.visited=a},t.removeUnusedNodes=()=>{let a=0;for(let i=0;i<e.children.length;++i){const s=e.children[i];if(s.getVisited())e.children[a++]=s,s.setVisited(!1);else{const o=s.getRenderable();o&&e._renderableChildMap.delete(o),s.delete()}}e.children.length=a},t.createViewNode=a=>{if(!e.myFactory)return $v("Cannot create view nodes without my own factory"),null;const i=e.myFactory.createNode(a);return i&&i.setRenderable(a),i};const n=t.delete;t.delete=()=>{for(let a=0;a<e.children.length;a++)e.children[a].delete();n()}}var Iv={renderable:null,myFactory:null,children:[],visited:!1};function pu(t,e,r={}){Object.assign(e,Iv,r),R.obj(t,e),R.event(t,e,"event"),e._renderableChildMap=new Map,R.get(t,e,["visited"]),R.setGet(t,e,["_parent","renderable","myFactory"]),R.getArray(t,e,["children"]),R.moveToProtected(t,e,["parent"]),zv(t,e)}var ve={newInstance:R.newInstance(pu,"vtkViewNode"),extend:pu,PASS_TYPES:Wv},{vtkWarningMacro:Pv}=R;function Hv(t){const e=[];let r=0,n=t.getClassName(r++);for(;n;)e.push(n),n=t.getClassName(r++);return e}function Av(t,e){const r=e.join(" → ");return[`No ${t} implementation found for ${e[0]}.`,`Class hierarchy: ${r}.`,`A rendering Profile is likely missing for ${e[0]}.`,"Try importing '@kitware/vtk.js/Rendering/Profiles/All' or 'vtk.js/Sources/Rendering/Profiles/All',","or import the specific rendering profile needed by this renderable if known.","See https://kitware.github.io/vtk-js/docs/concepts_profile.html for details."].join(`
2
2
  `)}function jv(t){return t.includes("vtkAbstractWidget")||t.includes("vtkWidgetRepresentation")}function Kv(t,e){e.overrides||(e.overrides={}),e.classHierarchy.push("vtkViewNodeFactory"),t.createNode=r=>{if(r.isDeleted())return null;const n=Hv(r);let a=0,i=n[a++],s=!1;const o=Object.keys(e.overrides);for(;i&&!s;)o.indexOf(i)!==-1?s=!0:i=r.getClassName(a++);if(!s)return jv(n)||Pv(Av(t.getClassName(),n)),null;const c=e.overrides[i]();return c.setMyFactory(t),c}}var Xv={};function $l(t,e,r={}){Object.assign(e,Xv,r),R.obj(t,e),Kv(t,e)}var qv=R.newInstance($l,"vtkViewNodeFactory"),Wl={newInstance:qv,extend:$l},zl=Object.create(null);function ze(t,e){zl[t]=e}function Yv(t,e){e.classHierarchy.push("vtkOpenGLViewNodeFactory")}var Zv={};function Il(t,e,r={}){Object.assign(e,Zv,r),e.overrides=zl,Wl.extend(t,e,r),Yv(t,e)}var Qv=R.newInstance(Il,"vtkOpenGLViewNodeFactory"),Jv={newInstance:Qv,extend:Il},le=1e-6,He=typeof Float32Array<"u"?Float32Array:Array,ed=Math.PI/180;function td(t){return t*ed}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function wt(){var t=new He(9);return He!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function rd(t){var e=new He(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function nd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ad(t,e,r,n,a,i,s,o,c){var u=new He(9);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=a,u[5]=i,u[6]=s,u[7]=o,u[8]=c,u}function oc(t,e,r,n,a,i,s,o,c,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s,t[6]=o,t[7]=c,t[8]=u,t}function ht(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ta(t,e){if(t===e){var r=e[1],n=e[2],a=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=a}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function pr(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],g=l*s-o*u,f=-l*i+o*c,p=u*i-s*c,d=r*g+n*f+a*p;return d?(d=1/d,t[0]=g*d,t[1]=(-l*n+a*u)*d,t[2]=(o*n-a*s)*d,t[3]=f*d,t[4]=(l*r-a*c)*d,t[5]=(-o*r+a*i)*d,t[6]=p*d,t[7]=(-u*r+n*c)*d,t[8]=(s*r-n*i)*d,t):null}function id(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8];return t[0]=s*l-o*u,t[1]=a*u-n*l,t[2]=n*o-a*s,t[3]=o*c-i*l,t[4]=r*l-a*c,t[5]=a*i-r*o,t[6]=i*u-s*c,t[7]=n*c-r*u,t[8]=r*s-n*i,t}function yo(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],s=t[5],o=t[6],c=t[7],u=t[8];return e*(u*i-s*c)+r*(-u*a+s*o)+n*(c*a-i*o)}function rn(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],c=e[5],u=e[6],l=e[7],g=e[8],f=r[0],p=r[1],d=r[2],h=r[3],v=r[4],x=r[5],y=r[6],T=r[7],S=r[8];return t[0]=f*n+p*s+d*u,t[1]=f*a+p*o+d*l,t[2]=f*i+p*c+d*g,t[3]=h*n+v*s+x*u,t[4]=h*a+v*o+x*l,t[5]=h*i+v*c+x*g,t[6]=y*n+T*s+S*u,t[7]=y*a+T*o+S*l,t[8]=y*i+T*c+S*g,t}function sd(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],c=e[5],u=e[6],l=e[7],g=e[8],f=r[0],p=r[1];return t[0]=n,t[1]=a,t[2]=i,t[3]=s,t[4]=o,t[5]=c,t[6]=f*n+p*s+u,t[7]=f*a+p*o+l,t[8]=f*i+p*c+g,t}function od(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],c=e[5],u=e[6],l=e[7],g=e[8],f=Math.sin(r),p=Math.cos(r);return t[0]=p*n+f*s,t[1]=p*a+f*o,t[2]=p*i+f*c,t[3]=p*s-f*n,t[4]=p*o-f*a,t[5]=p*c-f*i,t[6]=u,t[7]=l,t[8]=g,t}function cd(t,e,r){var n=r[0],a=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=a*e[3],t[4]=a*e[4],t[5]=a*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ud(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function fd(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function ld(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function gd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function pd(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=r+r,o=n+n,c=a+a,u=r*s,l=n*s,g=n*o,f=a*s,p=a*o,d=a*c,h=i*s,v=i*o,x=i*c;return t[0]=1-g-d,t[3]=l-x,t[6]=f+v,t[1]=l+x,t[4]=1-u-d,t[7]=p-h,t[2]=f-v,t[5]=p+h,t[8]=1-u-g,t}function hd(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],g=e[9],f=e[10],p=e[11],d=e[12],h=e[13],v=e[14],x=e[15],y=r*o-n*s,T=r*c-a*s,S=r*u-i*s,m=n*c-a*o,O=n*u-i*o,V=a*u-i*c,C=l*h-g*d,M=l*v-f*d,w=l*x-p*d,E=g*v-f*h,D=g*x-p*h,U=f*x-p*v,B=y*U-T*D+S*E+m*w-O*M+V*C;return B?(B=1/B,t[0]=(o*U-c*D+u*E)*B,t[1]=(c*w-s*U-u*M)*B,t[2]=(s*D-o*w+u*C)*B,t[3]=(a*D-n*U-i*E)*B,t[4]=(r*U-a*w+i*M)*B,t[5]=(n*w-r*D-i*C)*B,t[6]=(h*V-v*O+x*m)*B,t[7]=(v*S-d*V-x*T)*B,t[8]=(d*O-h*S+x*y)*B,t):null}function vd(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function dd(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Td(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Sd(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function Pl(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function xd(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function yd(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function Cd(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function md(t,e){var r=t[0],n=t[1],a=t[2],i=t[3],s=t[4],o=t[5],c=t[6],u=t[7],l=t[8],g=e[0],f=e[1],p=e[2],d=e[3],h=e[4],v=e[5],x=e[6],y=e[7],T=e[8];return Math.abs(r-g)<=le*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(n-f)<=le*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=le*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(i-d)<=le*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(s-h)<=le*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-v)<=le*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(c-x)<=le*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(u-y)<=le*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(l-T)<=le*Math.max(1,Math.abs(l),Math.abs(T))}var Od=rn,wd=Pl;const Rd=Object.freeze(Object.defineProperty({__proto__:null,add:Sd,adjoint:id,clone:rd,copy:nd,create:wt,determinant:yo,equals:md,exactEquals:Cd,frob:Td,fromMat2d:gd,fromMat4:Jt,fromQuat:pd,fromRotation:fd,fromScaling:ld,fromTranslation:ud,fromValues:ad,identity:ht,invert:pr,mul:Od,multiply:rn,multiplyScalar:xd,multiplyScalarAndAdd:yd,normalFromMat4:hd,projection:vd,rotate:od,scale:cd,set:oc,str:dd,sub:wd,subtract:Pl,translate:sd,transpose:Ta},Symbol.toStringTag,{value:"Module"}));function Ke(){var t=new He(16);return He!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Md(t){var e=new He(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Ue(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ed(t,e,r,n,a,i,s,o,c,u,l,g,f,p,d,h){var v=new He(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=a,v[5]=i,v[6]=s,v[7]=o,v[8]=c,v[9]=u,v[10]=l,v[11]=g,v[12]=f,v[13]=p,v[14]=d,v[15]=h,v}function Dd(t,e,r,n,a,i,s,o,c,u,l,g,f,p,d,h,v){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s,t[6]=o,t[7]=c,t[8]=u,t[9]=l,t[10]=g,t[11]=f,t[12]=p,t[13]=d,t[14]=h,t[15]=v,t}function j(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ne(t,e){if(t===e){var r=e[1],n=e[2],a=e[3],i=e[6],s=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=a,t[13]=s,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function me(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],g=e[9],f=e[10],p=e[11],d=e[12],h=e[13],v=e[14],x=e[15],y=r*o-n*s,T=r*c-a*s,S=r*u-i*s,m=n*c-a*o,O=n*u-i*o,V=a*u-i*c,C=l*h-g*d,M=l*v-f*d,w=l*x-p*d,E=g*v-f*h,D=g*x-p*h,U=f*x-p*v,B=y*U-T*D+S*E+m*w-O*M+V*C;return B?(B=1/B,t[0]=(o*U-c*D+u*E)*B,t[1]=(a*D-n*U-i*E)*B,t[2]=(h*V-v*O+x*m)*B,t[3]=(f*O-g*V-p*m)*B,t[4]=(c*w-s*U-u*M)*B,t[5]=(r*U-a*w+i*M)*B,t[6]=(v*S-d*V-x*T)*B,t[7]=(l*V-f*S+p*T)*B,t[8]=(s*D-o*w+u*C)*B,t[9]=(n*w-r*D-i*C)*B,t[10]=(d*O-h*S+x*y)*B,t[11]=(g*S-l*O-p*y)*B,t[12]=(o*M-s*E-c*C)*B,t[13]=(r*E-n*M+a*C)*B,t[14]=(h*T-d*m-v*y)*B,t[15]=(l*m-g*T+f*y)*B,t):null}function Vd(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=e[4],o=e[5],c=e[6],u=e[7],l=e[8],g=e[9],f=e[10],p=e[11],d=e[12],h=e[13],v=e[14],x=e[15];return t[0]=o*(f*x-p*v)-g*(c*x-u*v)+h*(c*p-u*f),t[1]=-(n*(f*x-p*v)-g*(a*x-i*v)+h*(a*p-i*f)),t[2]=n*(c*x-u*v)-o*(a*x-i*v)+h*(a*u-i*c),t[3]=-(n*(c*p-u*f)-o*(a*p-i*f)+g*(a*u-i*c)),t[4]=-(s*(f*x-p*v)-l*(c*x-u*v)+d*(c*p-u*f)),t[5]=r*(f*x-p*v)-l*(a*x-i*v)+d*(a*p-i*f),t[6]=-(r*(c*x-u*v)-s*(a*x-i*v)+d*(a*u-i*c)),t[7]=r*(c*p-u*f)-s*(a*p-i*f)+l*(a*u-i*c),t[8]=s*(g*x-p*h)-l*(o*x-u*h)+d*(o*p-u*g),t[9]=-(r*(g*x-p*h)-l*(n*x-i*h)+d*(n*p-i*g)),t[10]=r*(o*x-u*h)-s*(n*x-i*h)+d*(n*u-i*o),t[11]=-(r*(o*p-u*g)-s*(n*p-i*g)+l*(n*u-i*o)),t[12]=-(s*(g*v-f*h)-l*(o*v-c*h)+d*(o*f-c*g)),t[13]=r*(g*v-f*h)-l*(n*v-a*h)+d*(n*f-a*g),t[14]=-(r*(o*v-c*h)-s*(n*v-a*h)+d*(n*c-a*o)),t[15]=r*(o*f-c*g)-s*(n*f-a*g)+l*(n*c-a*o),t}function Bd(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],s=t[5],o=t[6],c=t[7],u=t[8],l=t[9],g=t[10],f=t[11],p=t[12],d=t[13],h=t[14],v=t[15],x=e*s-r*i,y=e*o-n*i,T=e*c-a*i,S=r*o-n*s,m=r*c-a*s,O=n*c-a*o,V=u*d-l*p,C=u*h-g*p,M=u*v-f*p,w=l*h-g*d,E=l*v-f*d,D=g*v-f*h;return x*D-y*E+T*w+S*M-m*C+O*V}function q(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],c=e[5],u=e[6],l=e[7],g=e[8],f=e[9],p=e[10],d=e[11],h=e[12],v=e[13],x=e[14],y=e[15],T=r[0],S=r[1],m=r[2],O=r[3];return t[0]=T*n+S*o+m*g+O*h,t[1]=T*a+S*c+m*f+O*v,t[2]=T*i+S*u+m*p+O*x,t[3]=T*s+S*l+m*d+O*y,T=r[4],S=r[5],m=r[6],O=r[7],t[4]=T*n+S*o+m*g+O*h,t[5]=T*a+S*c+m*f+O*v,t[6]=T*i+S*u+m*p+O*x,t[7]=T*s+S*l+m*d+O*y,T=r[8],S=r[9],m=r[10],O=r[11],t[8]=T*n+S*o+m*g+O*h,t[9]=T*a+S*c+m*f+O*v,t[10]=T*i+S*u+m*p+O*x,t[11]=T*s+S*l+m*d+O*y,T=r[12],S=r[13],m=r[14],O=r[15],t[12]=T*n+S*o+m*g+O*h,t[13]=T*a+S*c+m*f+O*v,t[14]=T*i+S*u+m*p+O*x,t[15]=T*s+S*l+m*d+O*y,t}function Te(t,e,r){var n=r[0],a=r[1],i=r[2],s,o,c,u,l,g,f,p,d,h,v,x;return e===t?(t[12]=e[0]*n+e[4]*a+e[8]*i+e[12],t[13]=e[1]*n+e[5]*a+e[9]*i+e[13],t[14]=e[2]*n+e[6]*a+e[10]*i+e[14],t[15]=e[3]*n+e[7]*a+e[11]*i+e[15]):(s=e[0],o=e[1],c=e[2],u=e[3],l=e[4],g=e[5],f=e[6],p=e[7],d=e[8],h=e[9],v=e[10],x=e[11],t[0]=s,t[1]=o,t[2]=c,t[3]=u,t[4]=l,t[5]=g,t[6]=f,t[7]=p,t[8]=d,t[9]=h,t[10]=v,t[11]=x,t[12]=s*n+l*a+d*i+e[12],t[13]=o*n+g*a+h*i+e[13],t[14]=c*n+f*a+v*i+e[14],t[15]=u*n+p*a+x*i+e[15]),t}function Mt(t,e,r){var n=r[0],a=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ut(t,e,r,n){var a=n[0],i=n[1],s=n[2],o=Math.hypot(a,i,s),c,u,l,g,f,p,d,h,v,x,y,T,S,m,O,V,C,M,w,E,D,U,B,L;return o<le?null:(o=1/o,a*=o,i*=o,s*=o,c=Math.sin(r),u=Math.cos(r),l=1-u,g=e[0],f=e[1],p=e[2],d=e[3],h=e[4],v=e[5],x=e[6],y=e[7],T=e[8],S=e[9],m=e[10],O=e[11],V=a*a*l+u,C=i*a*l+s*c,M=s*a*l-i*c,w=a*i*l-s*c,E=i*i*l+u,D=s*i*l+a*c,U=a*s*l+i*c,B=i*s*l-a*c,L=s*s*l+u,t[0]=g*V+h*C+T*M,t[1]=f*V+v*C+S*M,t[2]=p*V+x*C+m*M,t[3]=d*V+y*C+O*M,t[4]=g*w+h*E+T*D,t[5]=f*w+v*E+S*D,t[6]=p*w+x*E+m*D,t[7]=d*w+y*E+O*D,t[8]=g*U+h*B+T*L,t[9]=f*U+v*B+S*L,t[10]=p*U+x*B+m*L,t[11]=d*U+y*B+O*L,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function cc(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],s=e[5],o=e[6],c=e[7],u=e[8],l=e[9],g=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*a+u*n,t[5]=s*a+l*n,t[6]=o*a+g*n,t[7]=c*a+f*n,t[8]=u*a-i*n,t[9]=l*a-s*n,t[10]=g*a-o*n,t[11]=f*a-c*n,t}function uc(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],s=e[1],o=e[2],c=e[3],u=e[8],l=e[9],g=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*a-u*n,t[1]=s*a-l*n,t[2]=o*a-g*n,t[3]=c*a-f*n,t[8]=i*n+u*a,t[9]=s*n+l*a,t[10]=o*n+g*a,t[11]=c*n+f*a,t}function fc(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],s=e[1],o=e[2],c=e[3],u=e[4],l=e[5],g=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*a+u*n,t[1]=s*a+l*n,t[2]=o*a+g*n,t[3]=c*a+f*n,t[4]=u*a-i*n,t[5]=l*a-s*n,t[6]=g*a-o*n,t[7]=f*a-c*n,t}function Nr(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function ls(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Hl(t,e,r){var n=r[0],a=r[1],i=r[2],s=Math.hypot(n,a,i),o,c,u;return s<le?null:(s=1/s,n*=s,a*=s,i*=s,o=Math.sin(e),c=Math.cos(e),u=1-c,t[0]=n*n*u+c,t[1]=a*n*u+i*o,t[2]=i*n*u-a*o,t[3]=0,t[4]=n*a*u-i*o,t[5]=a*a*u+c,t[6]=i*a*u+n*o,t[7]=0,t[8]=n*i*u+a*o,t[9]=a*i*u-n*o,t[10]=i*i*u+c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Ld(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ud(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Fd(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Al(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=n+n,c=a+a,u=i+i,l=n*o,g=n*c,f=n*u,p=a*c,d=a*u,h=i*u,v=s*o,x=s*c,y=s*u;return t[0]=1-(p+h),t[1]=g+y,t[2]=f-x,t[3]=0,t[4]=g-y,t[5]=1-(l+h),t[6]=d+v,t[7]=0,t[8]=f+x,t[9]=d-v,t[10]=1-(l+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function bd(t,e){var r=new He(3),n=-e[0],a=-e[1],i=-e[2],s=e[3],o=e[4],c=e[5],u=e[6],l=e[7],g=n*n+a*a+i*i+s*s;return g>0?(r[0]=(o*s+l*n+c*i-u*a)*2/g,r[1]=(c*s+l*a+u*n-o*i)*2/g,r[2]=(u*s+l*i+o*a-c*n)*2/g):(r[0]=(o*s+l*n+c*i-u*a)*2,r[1]=(c*s+l*a+u*n-o*i)*2,r[2]=(u*s+l*i+o*a-c*n)*2),Al(t,e,r),t}function Nd(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jl(t,e){var r=e[0],n=e[1],a=e[2],i=e[4],s=e[5],o=e[6],c=e[8],u=e[9],l=e[10];return t[0]=Math.hypot(r,n,a),t[1]=Math.hypot(i,s,o),t[2]=Math.hypot(c,u,l),t}function Co(t,e){var r=new He(3);jl(r,e);var n=1/r[0],a=1/r[1],i=1/r[2],s=e[0]*n,o=e[1]*a,c=e[2]*i,u=e[4]*n,l=e[5]*a,g=e[6]*i,f=e[8]*n,p=e[9]*a,d=e[10]*i,h=s+l+d,v=0;return h>0?(v=Math.sqrt(h+1)*2,t[3]=.25*v,t[0]=(g-p)/v,t[1]=(f-c)/v,t[2]=(o-u)/v):s>l&&s>d?(v=Math.sqrt(1+s-l-d)*2,t[3]=(g-p)/v,t[0]=.25*v,t[1]=(o+u)/v,t[2]=(f+c)/v):l>d?(v=Math.sqrt(1+l-s-d)*2,t[3]=(f-c)/v,t[0]=(o+u)/v,t[1]=.25*v,t[2]=(g+p)/v):(v=Math.sqrt(1+d-s-l)*2,t[3]=(o-u)/v,t[0]=(f+c)/v,t[1]=(g+p)/v,t[2]=.25*v),t}function lc(t,e,r,n){var a=e[0],i=e[1],s=e[2],o=e[3],c=a+a,u=i+i,l=s+s,g=a*c,f=a*u,p=a*l,d=i*u,h=i*l,v=s*l,x=o*c,y=o*u,T=o*l,S=n[0],m=n[1],O=n[2];return t[0]=(1-(d+v))*S,t[1]=(f+T)*S,t[2]=(p-y)*S,t[3]=0,t[4]=(f-T)*m,t[5]=(1-(g+v))*m,t[6]=(h+x)*m,t[7]=0,t[8]=(p+y)*O,t[9]=(h-x)*O,t[10]=(1-(g+d))*O,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function _d(t,e,r,n,a){var i=e[0],s=e[1],o=e[2],c=e[3],u=i+i,l=s+s,g=o+o,f=i*u,p=i*l,d=i*g,h=s*l,v=s*g,x=o*g,y=c*u,T=c*l,S=c*g,m=n[0],O=n[1],V=n[2],C=a[0],M=a[1],w=a[2],E=(1-(h+x))*m,D=(p+S)*m,U=(d-T)*m,B=(p-S)*O,L=(1-(f+x))*O,F=(v+y)*O,_=(d+T)*V,b=(v-y)*V,N=(1-(f+h))*V;return t[0]=E,t[1]=D,t[2]=U,t[3]=0,t[4]=B,t[5]=L,t[6]=F,t[7]=0,t[8]=_,t[9]=b,t[10]=N,t[11]=0,t[12]=r[0]+C-(E*C+B*M+_*w),t[13]=r[1]+M-(D*C+L*M+b*w),t[14]=r[2]+w-(U*C+F*M+N*w),t[15]=1,t}function Fn(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=r+r,o=n+n,c=a+a,u=r*s,l=n*s,g=n*o,f=a*s,p=a*o,d=a*c,h=i*s,v=i*o,x=i*c;return t[0]=1-g-d,t[1]=l+x,t[2]=f-v,t[3]=0,t[4]=l-x,t[5]=1-u-d,t[6]=p+h,t[7]=0,t[8]=f+v,t[9]=p-h,t[10]=1-u-g,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function kd(t,e,r,n,a,i,s){var o=1/(r-e),c=1/(a-n),u=1/(i-s);return t[0]=i*2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*o,t[9]=(a+n)*c,t[10]=(s+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*i*2*u,t[15]=0,t}function Kl(t,e,r,n,a){var i=1/Math.tan(e/2),s;return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,a!=null&&a!==1/0?(s=1/(n-a),t[10]=(a+n)*s,t[14]=2*a*n*s):(t[10]=-1,t[14]=-2*n),t}var Gd=Kl;function $d(t,e,r,n,a){var i=1/Math.tan(e/2),s;return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,a!=null&&a!==1/0?(s=1/(n-a),t[10]=a*s,t[14]=a*n*s):(t[10]=-1,t[14]=-n),t}function Wd(t,e,r,n){var a=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),c=2/(s+o),u=2/(a+i);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((s-o)*c*.5),t[9]=(a-i)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Xl(t,e,r,n,a,i,s){var o=1/(e-r),c=1/(n-a),u=1/(i-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*o,t[13]=(a+n)*c,t[14]=(s+i)*u,t[15]=1,t}var ql=Xl;function zd(t,e,r,n,a,i,s){var o=1/(e-r),c=1/(n-a),u=1/(i-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+r)*o,t[13]=(a+n)*c,t[14]=i*u,t[15]=1,t}function Yl(t,e,r,n){var a,i,s,o,c,u,l,g,f,p,d=e[0],h=e[1],v=e[2],x=n[0],y=n[1],T=n[2],S=r[0],m=r[1],O=r[2];return Math.abs(d-S)<le&&Math.abs(h-m)<le&&Math.abs(v-O)<le?j(t):(l=d-S,g=h-m,f=v-O,p=1/Math.hypot(l,g,f),l*=p,g*=p,f*=p,a=y*f-T*g,i=T*l-x*f,s=x*g-y*l,p=Math.hypot(a,i,s),p?(p=1/p,a*=p,i*=p,s*=p):(a=0,i=0,s=0),o=g*s-f*i,c=f*a-l*s,u=l*i-g*a,p=Math.hypot(o,c,u),p?(p=1/p,o*=p,c*=p,u*=p):(o=0,c=0,u=0),t[0]=a,t[1]=o,t[2]=l,t[3]=0,t[4]=i,t[5]=c,t[6]=g,t[7]=0,t[8]=s,t[9]=u,t[10]=f,t[11]=0,t[12]=-(a*d+i*h+s*v),t[13]=-(o*d+c*h+u*v),t[14]=-(l*d+g*h+f*v),t[15]=1,t)}function Id(t,e,r,n){var a=e[0],i=e[1],s=e[2],o=n[0],c=n[1],u=n[2],l=a-r[0],g=i-r[1],f=s-r[2],p=l*l+g*g+f*f;p>0&&(p=1/Math.sqrt(p),l*=p,g*=p,f*=p);var d=c*f-u*g,h=u*l-o*f,v=o*g-c*l;return p=d*d+h*h+v*v,p>0&&(p=1/Math.sqrt(p),d*=p,h*=p,v*=p),t[0]=d,t[1]=h,t[2]=v,t[3]=0,t[4]=g*v-f*h,t[5]=f*d-l*v,t[6]=l*h-g*d,t[7]=0,t[8]=l,t[9]=g,t[10]=f,t[11]=0,t[12]=a,t[13]=i,t[14]=s,t[15]=1,t}function Pd(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Hd(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ad(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Zl(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function jd(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function Kd(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function Xd(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function qd(t,e){var r=t[0],n=t[1],a=t[2],i=t[3],s=t[4],o=t[5],c=t[6],u=t[7],l=t[8],g=t[9],f=t[10],p=t[11],d=t[12],h=t[13],v=t[14],x=t[15],y=e[0],T=e[1],S=e[2],m=e[3],O=e[4],V=e[5],C=e[6],M=e[7],w=e[8],E=e[9],D=e[10],U=e[11],B=e[12],L=e[13],F=e[14],_=e[15];return Math.abs(r-y)<=le*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-T)<=le*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(a-S)<=le*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(i-m)<=le*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-O)<=le*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(o-V)<=le*Math.max(1,Math.abs(o),Math.abs(V))&&Math.abs(c-C)<=le*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(u-M)<=le*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(l-w)<=le*Math.max(1,Math.abs(l),Math.abs(w))&&Math.abs(g-E)<=le*Math.max(1,Math.abs(g),Math.abs(E))&&Math.abs(f-D)<=le*Math.max(1,Math.abs(f),Math.abs(D))&&Math.abs(p-U)<=le*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(d-B)<=le*Math.max(1,Math.abs(d),Math.abs(B))&&Math.abs(h-L)<=le*Math.max(1,Math.abs(h),Math.abs(L))&&Math.abs(v-F)<=le*Math.max(1,Math.abs(v),Math.abs(F))&&Math.abs(x-_)<=le*Math.max(1,Math.abs(x),Math.abs(_))}var Fi=q,Yd=Zl;const Sa=Object.freeze(Object.defineProperty({__proto__:null,add:Ad,adjoint:Vd,clone:Md,copy:Ue,create:Ke,determinant:Bd,equals:qd,exactEquals:Xd,frob:Hd,fromQuat:Fn,fromQuat2:bd,fromRotation:Hl,fromRotationTranslation:Al,fromRotationTranslationScale:lc,fromRotationTranslationScaleOrigin:_d,fromScaling:ls,fromTranslation:Nr,fromValues:Ed,fromXRotation:Ld,fromYRotation:Ud,fromZRotation:Fd,frustum:kd,getRotation:Co,getScaling:jl,getTranslation:Nd,identity:j,invert:me,lookAt:Yl,mul:Fi,multiply:q,multiplyScalar:jd,multiplyScalarAndAdd:Kd,ortho:ql,orthoNO:Xl,orthoZO:zd,perspective:Gd,perspectiveFromFieldOfView:Wd,perspectiveNO:Kl,perspectiveZO:$d,rotate:Ut,rotateX:cc,rotateY:uc,rotateZ:fc,scale:Mt,set:Dd,str:Pd,sub:Yd,subtract:Zl,targetTo:Id,translate:Te,transpose:ne},Symbol.toStringTag,{value:"Module"}));function gs(){var t=new He(3);return He!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function bi(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function xa(t,e,r){var n=new He(3);return n[0]=t,n[1]=e,n[2]=r,n}function Zd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Zt(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function ra(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function Ur(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function Qd(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function qt(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function Ql(t,e){var r=e[0]-t[0],n=e[1]-t[1],a=e[2]-t[2];return Math.hypot(r,n,a)}function Ni(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function gr(t,e){var r=e[0],n=e[1],a=e[2],i=r*r+n*n+a*a;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function ps(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bn(t,e,r){var n=e[0],a=e[1],i=e[2],s=r[0],o=r[1],c=r[2];return t[0]=a*c-i*o,t[1]=i*s-n*c,t[2]=n*o-a*s,t}function ie(t,e,r){var n=e[0],a=e[1],i=e[2],s=r[3]*n+r[7]*a+r[11]*i+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*a+r[8]*i+r[12])/s,t[1]=(r[1]*n+r[5]*a+r[9]*i+r[13])/s,t[2]=(r[2]*n+r[6]*a+r[10]*i+r[14])/s,t}function Gn(t,e,r){var n=e[0],a=e[1],i=e[2];return t[0]=n*r[0]+a*r[3]+i*r[6],t[1]=n*r[1]+a*r[4]+i*r[7],t[2]=n*r[2]+a*r[5]+i*r[8],t}function Jd(t){return t[0]=0,t[1]=0,t[2]=0,t}function hu(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function vu(t,e){var r=t[0],n=t[1],a=t[2],i=e[0],s=e[1],o=e[2];return Math.abs(r-i)<=le*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(n-s)<=le*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(a-o)<=le*Math.max(1,Math.abs(a),Math.abs(o))}var mo=Ur,eT=Ql,Jl=bi;(function(){var t=gs();return function(e,r,n,a,i,s){var o,c;for(r||(r=3),n||(n=0),a?c=Math.min(a*r+n,e.length):c=e.length,o=n;o<c;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],i(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2];return e}})();function tT(){var t=new He(4);return He!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function rT(t,e,r,n){var a=new He(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a}function du(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function nT(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],s=r*r+n*n+a*a+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=a*s,t[3]=i*s,t}function Qt(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3];return t[0]=r[0]*n+r[4]*a+r[8]*i+r[12]*s,t[1]=r[1]*n+r[5]*a+r[9]*i+r[13]*s,t[2]=r[2]*n+r[6]*a+r[10]*i+r[14]*s,t[3]=r[3]*n+r[7]*a+r[11]*i+r[15]*s,t}(function(){var t=tT();return function(e,r,n,a,i,s){var o,c;for(r||(r=4),n||(n=0),a?c=Math.min(a*r+n,e.length):c=e.length,o=n;o<c;o+=r)t[0]=e[o],t[1]=e[o+1],t[2]=e[o+2],t[3]=e[o+3],i(t,t,s),e[o]=t[0],e[o+1]=t[1],e[o+2]=t[2],e[o+3]=t[3];return e}})();function _r(){var t=new He(4);return He!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function hs(t,e,r){r=r*.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function aT(t,e){var r=Math.acos(e[3])*2,n=Math.sin(r/2);return n>le?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function Tu(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=r[0],c=r[1],u=r[2],l=r[3];return t[0]=n*l+s*o+a*u-i*c,t[1]=a*l+s*c+i*o-n*u,t[2]=i*l+s*u+n*c-a*o,t[3]=s*l-n*o-a*c-i*u,t}function ga(t,e,r,n){var a=e[0],i=e[1],s=e[2],o=e[3],c=r[0],u=r[1],l=r[2],g=r[3],f,p,d,h,v;return p=a*c+i*u+s*l+o*g,p<0&&(p=-p,c=-c,u=-u,l=-l,g=-g),1-p>le?(f=Math.acos(p),d=Math.sin(f),h=Math.sin((1-n)*f)/d,v=Math.sin(n*f)/d):(h=1-n,v=n),t[0]=h*a+v*c,t[1]=h*i+v*u,t[2]=h*s+v*l,t[3]=h*o+v*g,t}function iT(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function sT(t,e){var r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var a=0;e[4]>e[0]&&(a=1),e[8]>e[a*3+a]&&(a=2);var i=(a+1)%3,s=(a+2)%3;n=Math.sqrt(e[a*3+a]-e[i*3+i]-e[s*3+s]+1),t[a]=.5*n,n=.5/n,t[3]=(e[i*3+s]-e[s*3+i])*n,t[i]=(e[i*3+a]+e[a*3+i])*n,t[s]=(e[s*3+a]+e[a*3+s])*n}return t}var Oo=rT,gc=nT;(function(){var t=gs(),e=xa(1,0,0),r=xa(0,1,0);return function(n,a,i){var s=ps(a,i);return s<-.999999?(bn(t,e,a),Jl(t)<1e-6&&bn(t,r,a),gr(t,t),hs(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(bn(t,a,i),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,gc(n,n))}})();(function(){var t=_r(),e=_r();return function(r,n,a,i,s,o){return ga(t,n,s,o),ga(e,a,i,o),ga(r,t,e,2*o*(1-o)),r}})();(function(){var t=wt();return function(e,r,n,a){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=a[0],t[4]=a[1],t[7]=a[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],gc(e,sT(e,t))}})();function oT(t,e){e.classHierarchy.push("vtkOpenGLCamera"),t.buildPass=r=>{r&&(e._openGLRenderer=t.getFirstAncestorOfType("vtkOpenGLRenderer"),e._openGLRenderWindow=e._openGLRenderer.getParent(),e.context=e._openGLRenderWindow.getContext())},t.opaquePass=r=>{if(r){const n=e._openGLRenderer.getTiledSizeAndOrigin();e.context.viewport(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize),e.context.scissor(n.lowerLeftU,n.lowerLeftV,n.usize,n.vsize)}},t.translucentPass=t.opaquePass,t.zBufferPass=t.opaquePass,t.opaqueZBufferPass=t.opaquePass,t.volumePass=t.opaquePass,t.getKeyMatrices=r=>{if(r!==e.lastRenderer||e._openGLRenderWindow.getMTime()>e.keyMatrixTime.getMTime()||t.getMTime()>e.keyMatrixTime.getMTime()||r.getMTime()>e.keyMatrixTime.getMTime()||e.renderable.getMTime()>e.keyMatrixTime.getMTime()){e.renderable.getViewMatrix(e.keyMatrices.wcvc),Jt(e.keyMatrices.normalMatrix,e.keyMatrices.wcvc),pr(e.keyMatrices.normalMatrix,e.keyMatrices.normalMatrix),ne(e.keyMatrices.wcvc,e.keyMatrices.wcvc);const n=e._openGLRenderer.getAspectRatio();Ue(e.keyMatrices.vcpc,e.renderable.getProjectionMatrix(n,-1,1)),ne(e.keyMatrices.vcpc,e.keyMatrices.vcpc),q(e.keyMatrices.wcpc,e.keyMatrices.vcpc,e.keyMatrices.wcvc),e.keyMatrixTime.modified(),e.lastRenderer=r}return e.keyMatrices}}var cT={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};function uT(t,e,r={}){Object.assign(e,cT,r),ve.extend(t,e,r),e.keyMatrixTime={},Se(e.keyMatrixTime),e.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},Me(t,e,["context","keyMatrixTime"]),oT(t,e)}var fT=ge(uT);ze("vtkCamera",fT);var lT={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ae={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",UNSIGNED_CHAR_CLAMPED:"Uint8ClampedArray",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"},gT=ae.FLOAT,eg={DefaultDataType:gT,DataTypeByteSize:lT,VtkDataTypes:ae},vs=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],pT=[1,0,0,0,1,0,0,0,1],ds=1e-6,vi={exports:{}},hT=vi.exports,Su;function vT(){return Su||(Su=1,(function(t){(function(e,r,n){function a(c){var u=this,l=o();u.next=function(){var g=2091639*u.s0+u.c*23283064365386963e-26;return u.s0=u.s1,u.s1=u.s2,u.s2=g-(u.c=g|0)},u.c=1,u.s0=l(" "),u.s1=l(" "),u.s2=l(" "),u.s0-=l(c),u.s0<0&&(u.s0+=1),u.s1-=l(c),u.s1<0&&(u.s1+=1),u.s2-=l(c),u.s2<0&&(u.s2+=1),l=null}function i(c,u){return u.c=c.c,u.s0=c.s0,u.s1=c.s1,u.s2=c.s2,u}function s(c,u){var l=new a(c),g=u&&u.state,f=l.next;return f.int32=function(){return l.next()*4294967296|0},f.double=function(){return f()+(f()*2097152|0)*11102230246251565e-32},f.quick=f,g&&(typeof g=="object"&&i(g,l),f.state=function(){return i(l,{})}),f}function o(){var c=4022871197,u=function(l){l=String(l);for(var g=0;g<l.length;g++){c+=l.charCodeAt(g);var f=.02519603282416938*c;c=f>>>0,f-=c,f*=c,c=f>>>0,f-=c,c+=f*4294967296}return(c>>>0)*23283064365386963e-26};return u}r&&r.exports?r.exports=s:this.alea=s})(hT,t)})(vi)),vi.exports}var di={exports:{}},dT=di.exports,xu;function TT(){return xu||(xu=1,(function(t){(function(e,r,n){function a(o){var c=this,u="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var g=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^g^g>>>8},o===(o|0)?c.x=o:u+=o;for(var l=0;l<u.length+64;l++)c.x^=u.charCodeAt(l)|0,c.next()}function i(o,c){return c.x=o.x,c.y=o.y,c.z=o.z,c.w=o.w,c}function s(o,c){var u=new a(o),l=c&&c.state,g=function(){return(u.next()>>>0)/4294967296};return g.double=function(){do var f=u.next()>>>11,p=(u.next()>>>0)/4294967296,d=(f+p)/(1<<21);while(d===0);return d},g.int32=u.next,g.quick=g,l&&(typeof l=="object"&&i(l,u),g.state=function(){return i(u,{})}),g}r&&r.exports?r.exports=s:this.xor128=s})(dT,t)})(di)),di.exports}var Ti={exports:{}},ST=Ti.exports,yu;function xT(){return yu||(yu=1,(function(t){(function(e,r,n){function a(o){var c=this,u="";c.next=function(){var g=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(g^g<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,o===(o|0)?c.x=o:u+=o;for(var l=0;l<u.length+64;l++)c.x^=u.charCodeAt(l)|0,l==u.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function i(o,c){return c.x=o.x,c.y=o.y,c.z=o.z,c.w=o.w,c.v=o.v,c.d=o.d,c}function s(o,c){var u=new a(o),l=c&&c.state,g=function(){return(u.next()>>>0)/4294967296};return g.double=function(){do var f=u.next()>>>11,p=(u.next()>>>0)/4294967296,d=(f+p)/(1<<21);while(d===0);return d},g.int32=u.next,g.quick=g,l&&(typeof l=="object"&&i(l,u),g.state=function(){return i(u,{})}),g}r&&r.exports?r.exports=s:this.xorwow=s})(ST,t)})(Ti)),Ti.exports}var Si={exports:{}},yT=Si.exports,Cu;function CT(){return Cu||(Cu=1,(function(t){(function(e,r,n){function a(o){var c=this;c.next=function(){var l=c.x,g=c.i,f,p;return f=l[g],f^=f>>>7,p=f^f<<24,f=l[g+1&7],p^=f^f>>>10,f=l[g+3&7],p^=f^f>>>3,f=l[g+4&7],p^=f^f<<7,f=l[g+7&7],f=f^f<<13,p^=f^f<<9,l[g]=p,c.i=g+1&7,p};function u(l,g){var f,p=[];if(g===(g|0))p[0]=g;else for(g=""+g,f=0;f<g.length;++f)p[f&7]=p[f&7]<<15^g.charCodeAt(f)+p[f+1&7]<<13;for(;p.length<8;)p.push(0);for(f=0;f<8&&p[f]===0;++f);for(f==8?p[7]=-1:p[f],l.x=p,l.i=0,f=256;f>0;--f)l.next()}u(c,o)}function i(o,c){return c.x=o.x.slice(),c.i=o.i,c}function s(o,c){o==null&&(o=+new Date);var u=new a(o),l=c&&c.state,g=function(){return(u.next()>>>0)/4294967296};return g.double=function(){do var f=u.next()>>>11,p=(u.next()>>>0)/4294967296,d=(f+p)/(1<<21);while(d===0);return d},g.int32=u.next,g.quick=g,l&&(l.x&&i(l,u),g.state=function(){return i(u,{})}),g}r&&r.exports?r.exports=s:this.xorshift7=s})(yT,t)})(Si)),Si.exports}var xi={exports:{}},mT=xi.exports,mu;function OT(){return mu||(mu=1,(function(t){(function(e,r,n){function a(o){var c=this;c.next=function(){var l=c.w,g=c.X,f=c.i,p,d;return c.w=l=l+1640531527|0,d=g[f+34&127],p=g[f=f+1&127],d^=d<<13,p^=p<<17,d^=d>>>15,p^=p>>>12,d=g[f]=d^p,c.i=f,d+(l^l>>>16)|0};function u(l,g){var f,p,d,h,v,x=[],y=128;for(g===(g|0)?(p=g,g=null):(g=g+"\0",p=0,y=Math.max(y,g.length)),d=0,h=-32;h<y;++h)g&&(p^=g.charCodeAt((h+32)%g.length)),h===0&&(v=p),p^=p<<10,p^=p>>>15,p^=p<<4,p^=p>>>13,h>=0&&(v=v+1640531527|0,f=x[h&127]^=p+v,d=f==0?d+1:0);for(d>=128&&(x[(g&&g.length||0)&127]=-1),d=127,h=512;h>0;--h)p=x[d+34&127],f=x[d=d+1&127],p^=p<<13,f^=f<<17,p^=p>>>15,f^=f>>>12,x[d]=p^f;l.w=v,l.X=x,l.i=d}u(c,o)}function i(o,c){return c.i=o.i,c.w=o.w,c.X=o.X.slice(),c}function s(o,c){o==null&&(o=+new Date);var u=new a(o),l=c&&c.state,g=function(){return(u.next()>>>0)/4294967296};return g.double=function(){do var f=u.next()>>>11,p=(u.next()>>>0)/4294967296,d=(f+p)/(1<<21);while(d===0);return d},g.int32=u.next,g.quick=g,l&&(l.X&&i(l,u),g.state=function(){return i(u,{})}),g}r&&r.exports?r.exports=s:this.xor4096=s})(mT,t)})(xi)),xi.exports}var yi={exports:{}},wT=yi.exports,Ou;function RT(){return Ou||(Ou=1,(function(t){(function(e,r,n){function a(o){var c=this,u="";c.next=function(){var g=c.b,f=c.c,p=c.d,d=c.a;return g=g<<25^g>>>7^f,f=f-p|0,p=p<<24^p>>>8^d,d=d-g|0,c.b=g=g<<20^g>>>12^f,c.c=f=f-p|0,c.d=p<<16^f>>>16^d,c.a=d-g|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,o===Math.floor(o)?(c.a=o/4294967296|0,c.b=o|0):u+=o;for(var l=0;l<u.length+20;l++)c.b^=u.charCodeAt(l)|0,c.next()}function i(o,c){return c.a=o.a,c.b=o.b,c.c=o.c,c.d=o.d,c}function s(o,c){var u=new a(o),l=c&&c.state,g=function(){return(u.next()>>>0)/4294967296};return g.double=function(){do var f=u.next()>>>11,p=(u.next()>>>0)/4294967296,d=(f+p)/(1<<21);while(d===0);return d},g.int32=u.next,g.quick=g,l&&(typeof l=="object"&&i(l,u),g.state=function(){return i(u,{})}),g}r&&r.exports?r.exports=s:this.tychei=s})(wT,t)})(yi)),yi.exports}var Ci={exports:{}};const MT={},ET=Object.freeze(Object.defineProperty({__proto__:null,default:MT},Symbol.toStringTag,{value:"Module"})),DT=Dv(ET);var VT=Ci.exports,wu;function BT(){return wu||(wu=1,(function(t){(function(e,r,n){var a=256,i=6,s=52,o="random",c=n.pow(a,i),u=n.pow(2,s),l=u*2,g=a-1,f;function p(S,m,O){var V=[];m=m==!0?{entropy:!0}:m||{};var C=x(v(m.entropy?[S,T(r)]:S??y(),3),V),M=new d(V),w=function(){for(var E=M.g(i),D=c,U=0;E<u;)E=(E+U)*a,D*=a,U=M.g(1);for(;E>=l;)E/=2,D/=2,U>>>=1;return(E+U)/D};return w.int32=function(){return M.g(4)|0},w.quick=function(){return M.g(4)/4294967296},w.double=w,x(T(M.S),r),(m.pass||O||function(E,D,U,B){return B&&(B.S&&h(B,M),E.state=function(){return h(M,{})}),U?(n[o]=E,D):E})(w,C,"global"in m?m.global:this==n,m.state)}function d(S){var m,O=S.length,V=this,C=0,M=V.i=V.j=0,w=V.S=[];for(O||(S=[O++]);C<a;)w[C]=C++;for(C=0;C<a;C++)w[C]=w[M=g&M+S[C%O]+(m=w[C])],w[M]=m;(V.g=function(E){for(var D,U=0,B=V.i,L=V.j,F=V.S;E--;)D=F[B=g&B+1],U=U*a+F[g&(F[B]=F[L=g&L+D])+(F[L]=D)];return V.i=B,V.j=L,U})(a)}function h(S,m){return m.i=S.i,m.j=S.j,m.S=S.S.slice(),m}function v(S,m){var O=[],V=typeof S,C;if(m&&V=="object")for(C in S)try{O.push(v(S[C],m-1))}catch{}return O.length?O:V=="string"?S:S+"\0"}function x(S,m){for(var O=S+"",V,C=0;C<O.length;)m[g&C]=g&(V^=m[g&C]*19)+O.charCodeAt(C++);return T(m)}function y(){try{var S;return f&&(S=f.randomBytes)?S=S(a):(S=new Uint8Array(a),(e.crypto||e.msCrypto).getRandomValues(S)),T(S)}catch{var m=e.navigator,O=m&&m.plugins;return[+new Date,e,O,e.screen,T(r)]}}function T(S){return String.fromCharCode.apply(0,S)}if(x(n.random(),r),t.exports){t.exports=p;try{f=DT}catch{}}else n["seed"+o]=p})(typeof self<"u"?self:VT,[],Math)})(Ci)),Ci.exports}var Ls,Ru;function LT(){if(Ru)return Ls;Ru=1;var t=vT(),e=TT(),r=xT(),n=CT(),a=OT(),i=RT(),s=BT();return s.alea=t,s.xor128=e,s.xorwow=r,s.xorshift7=n,s.xor4096=a,s.tychei=i,Ls=s,Ls}var UT=LT();const FT=Yo(UT);var{vtkErrorMacro:tg,vtkWarningMacro:fn}=R,rg=0,Mu=20;function Va(t){return()=>tg(`vtkMath::${t} - NOT IMPLEMENTED`)}function pa(t,e,r,n){let a;for(let i=0;i<e;i++)a=t[r*e+i],t[r*e+i]=t[n*e+i],t[n*e+i]=a}function na(t,e,r,n){let a;for(let i=0;i<e;i++)a=t[i*e+r],t[i*e+r]=t[i*e+n],t[i*e+n]=a}function ye(t=3){const e=Array(t);for(let r=0;r<t;++r)e[r]=0;return e}var bT=()=>Math.PI;function NT(t,e){return e>1023?t*2**1023*2**(e-1023):e<-1074?t*2**-1074*2**(e+1074):t*2**e}function Fe(t){return t/180*Math.PI}function $n(t){return t*180/Math.PI}var{round:aa,floor:pc,ceil:_T,min:kT,max:GT}=Math;function $T(t,e=0,r=1){let n=1/0;for(let a=e,i=t.length;a<i;a+=r)t[a]<n&&(n=t[a]);return n}function WT(t,e=0,r=1){let n=-1/0;for(let a=e,i=t.length;a<i;a+=r)n<t[a]&&(n=t[a]);return n}function zT(t,e=0,r=1){let n=1/0,a=-1/0;for(let i=e,s=t.length;i<s;i+=r)t[i]<n&&(n=t[i]),a<t[i]&&(a=t[i]);return[n,a]}var IT=Va("ceilLog2"),PT=Va("factorial");function kr(t){let e=1;for(;e<t;)e*=2;return e}function HT(t){return t===kr(t)}function AT(t,e){let r=1;for(let n=1;n<=e;++n)r*=(t-n+1)/n;return Math.floor(r)}function jT(t,e){if(t<e)return 0;const r=ye(e);for(let n=0;n<e;++n)r[n]=n;return r}function KT(t,e,r){let n=0;for(let a=e-1;a>=0;--a)if(r[a]<t-e+a){let i=r[a]+1;for(;a<e;)r[a++]=i++;n=1;break}return n}function XT(t){FT(`${t}`,{global:!0}),rg=t}function qT(){return rg}function YT(t=0,e=1){return t+(e-t)*Math.random()}var ZT=Va("gaussian");function Wn(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function We(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function ng(t,e){return t[0]*=e,t[1]*=e,t[2]*=e,t}function ag(t,e){return t[0]*=e,t[1]*=e,t}function wo(t,e,r,n){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n[2]=t[2]+e[2]*r,n}function QT(t,e,r,n){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n}function J(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function JT(t,e,r){r[0]=t[0]*e[0],r[1]=t[0]*e[1],r[2]=t[0]*e[2],r[3]=t[1]*e[0],r[4]=t[1]*e[1],r[5]=t[1]*e[2],r[6]=t[2]*e[0],r[7]=t[2]*e[1],r[8]=t[2]*e[2]}function rt(t,e,r){const n=t[1]*e[2]-t[2]*e[1],a=t[2]*e[0]-t[0]*e[2],i=t[0]*e[1]-t[1]*e[0];return r[0]=n,r[1]=a,r[2]=i,r}function Rt(t,e=3){switch(e){case 1:return Math.abs(t);case 2:return Math.sqrt(t[0]*t[0]+t[1]*t[1]);case 3:return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);default:{let r=0;for(let n=0;n<e;n++)r+=t[n]*t[n];return Math.sqrt(r)}}}function vt(t){const e=Rt(t);return e!==0&&(t[0]/=e,t[1]/=e,t[2]/=e),e}function eS(t){const e=Rt(t,3);return e!==0&&(t[0]/=e,t[1]/=e,t[2]/=e,t[3]/=e),e}function tS(t,e,r,n){const a=t[0]*t[0],i=t[1]*t[1],s=t[2]*t[2],o=Math.sqrt(a+i+s);let c,u,l;a>i&&a>s?(c=0,u=1,l=2):i>s?(c=1,u=2,l=0):(c=2,u=0,l=1);const g=t[c]/o,f=t[u]/o,p=t[l]/o,d=Math.sqrt(g*g+p*p);if(n!==0){const h=Math.sin(n),v=Math.cos(n);e&&(e[c]=(p*v-g*f*h)/d,e[u]=h*d,e[l]=(-(g*v)-f*p*h)/d),r&&(r[c]=(-(p*h)-g*f*v)/d,r[u]=v*d,r[l]=(g*h-f*p*v)/d)}else e&&(e[c]=p/d,e[u]=0,e[l]=-g/d),r&&(r[c]=-g*f/d,r[u]=d,r[l]=-f*p/d)}function rS(t,e,r){const n=J(e,e);if(n===0)return r[0]=0,r[1]=0,r[2]=0,!1;const a=J(t,e)/n;for(let i=0;i<3;i++)r[i]=e[i];return ng(r,a),!0}function Ro(t,e){return t[0]*e[0]+t[1]*e[1]}function nS(t,e,r){const n=Ro(e,e);if(n===0)return r[0]=0,r[1]=0,!1;const a=Ro(t,e)/n;for(let i=0;i<2;i++)r[i]=e[i];return ag(r,a),!0}function ct(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])+(t[2]-e[2])*(t[2]-e[2])}function aS(t,e){const r=[0,0,0];return rt(t,e,r),Math.atan2(Rt(r),J(t,e))}function iS(t,e,r){const n=Math.abs(t-r);return 1/Math.sqrt(2*Math.PI*e)*Math.exp(-(n**2)/(2*e))}function sS(t,e,r){const n=Math.abs(t-r);return Math.exp(-(n**2)/(2*e))}function oS(t,e,r){r[0]=t[0]*e[0],r[1]=t[0]*e[1],r[2]=t[1]*e[0],r[3]=t[1]*e[1]}function ig(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function sg(t){const e=ig(t);return e!==0&&(t[0]/=e,t[1]/=e),e}function Be(...t){return t.length===2?t[0][0]*t[1][1]-t[1][0]*t[0][1]:t.length===4?t[0]*t[3]-t[1]*t[2]:NaN}function cS(t,e){let r,n,a;const i=[0,0,0];for(let s=0;s<3;s++)a=Math.abs(t[s*3]),(n=Math.abs(t[s*3+1]))>a&&(a=n),(n=Math.abs(t[s*3+2]))>a&&(a=n),i[s]=1/a;a=i[0]*Math.abs(t[0]),r=0,(n=i[1]*Math.abs(t[3]))>=a&&(a=n,r=1),(n=i[2]*Math.abs(t[6]))>=a&&(r=2),r!==0&&(pa(t,3,r,0),i[r]=i[0]),e[0]=r,t[3]/=t[0],t[6]/=t[0],t[4]-=t[3]*t[1],t[7]-=t[6]*t[1],a=i[1]*Math.abs(t[4]),r=1,(n=i[2]*Math.abs(t[7]))>=a&&(r=2,pa(t,3,1,2),i[2]=i[1]),e[1]=r,t[7]/=t[4],t[5]-=t[3]*t[2],t[8]-=t[6]*t[2]+t[7]*t[5],e[2]=2}function uS(t,e,r){let n=r[e[0]];r[e[0]]=r[0],r[0]=n,n=r[e[1]],r[e[1]]=r[1],r[1]=n-t[3]*r[0],n=r[e[2]],r[e[2]]=r[2],r[2]=n-t[6]*r[0]-t[7]*r[1],r[2]/=t[8],r[1]=(r[1]-t[5]*r[2])/t[4],r[0]=(r[0]-t[1]*r[1]-t[2]*r[2])/t[0]}function fS(t,e,r){const n=t[0],a=t[1],i=t[2],s=t[3],o=t[4],c=t[5],u=t[6],l=t[7],g=t[8],f=+Be(o,l,c,g),p=-Be(s,u,c,g),d=+Be(s,u,o,l),h=-Be(a,l,i,g),v=+Be(n,u,i,g),x=-Be(n,u,a,l),y=+Be(a,o,i,c),T=-Be(n,s,i,c),S=+Be(n,s,a,o),m=n*f+a*p+i*d,O=f*e[0]+h*e[1]+y*e[2],V=p*e[0]+v*e[1]+T*e[2],C=d*e[0]+x*e[1]+S*e[2];r[0]=O/m,r[1]=V/m,r[2]=C/m}function lS(t,e,r){const n=t[0]*e[0]+t[1]*e[1]+t[2]*e[2],a=t[3]*e[0]+t[4]*e[1]+t[5]*e[2],i=t[6]*e[0]+t[7]*e[1]+t[8]*e[2];r[0]=n,r[1]=a,r[2]=i}function Mo(t,e,r){const n=[...t],a=[...e];for(let i=0;i<3;i++)r[i]=n[0]*a[i]+n[1]*a[i+3]+n[2]*a[i+6],r[i+3]=n[3]*a[i]+n[4]*a[i+3]+n[5]*a[i+6],r[i+6]=n[6]*a[i]+n[7]*a[i+3]+n[8]*a[i+6]}function gS(t,e,r,n,a,i,s){n!==a&&tg("Number of columns of A must match number of rows of B.");const o=[...t],c=[...e];for(let u=0;u<r;u++)for(let l=0;l<i;l++){s[u*i+l]=0;for(let g=0;g<n;g++)s[u*i+l]+=o[u*n+g]*c[l+i*g]}}function Nn(t,e){let r;r=t[3],e[3]=t[1],e[1]=r,r=t[6],e[6]=t[2],e[2]=r,r=t[7],e[7]=t[5],e[5]=r,e[0]=t[0],e[4]=t[4],e[8]=t[8]}function pS(t,e){const r=t[0],n=t[1],a=t[2],i=t[3],s=t[4],o=t[5],c=t[6],u=t[7],l=t[8],g=+Be(s,u,o,l),f=-Be(i,c,o,l),p=+Be(i,c,s,u),d=-Be(n,u,a,l),h=+Be(r,c,a,l),v=-Be(r,c,n,u),x=+Be(n,s,a,o),y=-Be(r,i,a,o),T=+Be(r,i,n,s),S=r*g+n*f+a*p;S===0&&fn("Matrix has 0 determinant"),e[0]=g/S,e[3]=f/S,e[6]=p/S,e[1]=d/S,e[4]=h/S,e[7]=v/S,e[2]=x/S,e[5]=y/S,e[8]=T/S}function Ts(t){return t[0]*t[4]*t[8]+t[3]*t[7]*t[2]+t[6]*t[1]*t[5]-t[0]*t[7]*t[5]-t[3]*t[1]*t[8]-t[6]*t[4]*t[2]}function hc(t,e,r=ds){if(t.length!==e.length)return!1;function n(a,i){return Math.abs(a-e[i])<=r}return t.every(n)}var zn=hc;function og(t){for(let e=0;e<3;e++)t[e*3]=t[e*3+1]=t[e*3+2]=0,t[e*3+e]=1}function cg(t,e){for(let r=0;r<t;r++){for(let n=0;n<t;n++)e[r*t+n]=0;e[r*t+r]=1}return e}function hS(t,e=ds){return zn(t,vs,e)}function vS(t,e=ds){return zn(t,pT,e)}function ug(t,e){const r=t[0]*t[0],n=t[0]*t[1],a=t[0]*t[2],i=t[0]*t[3],s=t[1]*t[1],o=t[2]*t[2],c=t[3]*t[3],u=t[1]*t[2],l=t[1]*t[3],g=t[2]*t[3],f=s+o+c;let p=1/(r+f);const d=(r-f)*p;p*=2,e[0]=s*p+d,e[3]=(u+i)*p,e[6]=(l-a)*p,e[1]=(u-i)*p,e[4]=o*p+d,e[7]=(g+n)*p,e[2]=(l+a)*p,e[5]=(g-n)*p,e[8]=c*p+d}function mi(t,e=0){if(!`${t}`.includes("e"))return+`${Math.round(`${t}e+${e}`)}e-${e}`;const r=`${t}`.split("e");let n="";return+r[1]+e>0&&(n="+"),+`${Math.round(`${+r[0]}e${n}${+r[1]+e}`)}e-${e}`}function Eo(t,e=[0,0,0],r=0){return e[0]=mi(t[0],r),e[1]=mi(t[1],r),e[2]=mi(t[2],r),e}function Ba(t,e,r,n){let a,i,s,o,c,u,l,g,f,p,d,h,v,x,y,T;const S=ye(e),m=ye(e),O=(C,M,w)=>{x=C[M],v=C[w],C[M]=x-h*(v+x*p),C[w]=v+h*(x-v*p)};for(cg(e,n),c=0;c<e;c++)S[c]=r[c]=t[c+c*e],m[c]=0;for(a=0;a<Mu;a++){for(d=0,c=0;c<e-1;c++)for(o=c+1;o<e;o++)d+=Math.abs(t[c*e+o]);if(d===0)break;for(a<3?l=.2*d/(e*e):l=0,c=0;c<e-1;c++)for(o=c+1;o<e;o++)if(x=100*Math.abs(t[c*e+o]),a>3&&Math.abs(r[c])+x===Math.abs(r[c])&&Math.abs(r[o])+x===Math.abs(r[o]))t[c*e+o]=0;else if(Math.abs(t[c*e+o])>l){for(v=r[o]-r[c],Math.abs(v)+x===Math.abs(v)?f=t[c*e+o]/v:(g=.5*v/t[c*e+o],f=1/(Math.abs(g)+Math.sqrt(1+g*g)),g<0&&(f=-f)),y=1/Math.sqrt(1+f*f),h=f*y,p=h/(1+y),v=f*t[c*e+o],m[c]-=v,m[o]+=v,r[c]-=v,r[o]+=v,t[c*e+o]=0,i=0;i<=c-1;i++)O(t,i*e+c,i*e+o);for(i=c+1;i<=o-1;i++)O(t,c*e+i,i*e+o);for(i=o+1;i<e;i++)O(t,c*e+i,o*e+i);for(i=0;i<e;i++)O(n,i*e+c,i*e+o)}for(c=0;c<e;c++)S[c]+=m[c],r[c]=S[c],m[c]=0}if(a>=Mu)return fn("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(i=0;i<e-1;i++){for(s=i,T=r[s],a=i+1;a<e;a++)(r[a]>=T||Math.abs(r[a]-T)<1e-12)&&(s=a,T=r[s]);s!==i&&(r[s]=r[i],r[i]=T,na(n,e,i,s))}const V=(e>>1)+(e&1);for(u=0,a=0;a<e*e;a++)n[a]>=0&&u++;if(u<V)for(a=0;a<e;a++)n[a*e+i]*=-1;return 1}function fg(t,e){const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];r[0]=t[0]+t[4]+t[8],r[5]=t[0]-t[4]-t[8],r[10]=-t[0]+t[4]-t[8],r[15]=-t[0]-t[4]+t[8],r[1]=r[4]=t[7]-t[5],r[2]=r[8]=t[2]-t[6],r[3]=r[12]=t[3]-t[1],r[6]=r[9]=t[3]+t[1],r[7]=r[13]=t[2]+t[6],r[11]=r[14]=t[7]+t[5];const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=[0,0,0,0];Ba([...r],4,a,n),e[0]=n[0],e[1]=n[4],e[2]=n[8],e[3]=n[12]}function dS(t,e,r){const n=t[0]*e[0],a=t[0]*e[1],i=t[0]*e[2],s=t[0]*e[3],o=t[1]*e[0],c=t[1]*e[1],u=t[1]*e[2],l=t[1]*e[3],g=t[2]*e[0],f=t[2]*e[1],p=t[2]*e[2],d=t[2]*e[3],h=t[3]*e[0],v=t[3]*e[1],x=t[3]*e[2],y=t[3]*e[3];r[0]=n-c-p-y,r[1]=a+o+d-x,r[2]=i-l+g+v,r[3]=s+u-f+h}function lg(t,e){for(let f=0;f<9;f++)e[f]=t[f];const r=ye(3),n=ye(3);let a;for(let f=0;f<3;f++){const p=Math.abs(e[f*3]),d=Math.abs(e[f*3+1]),h=Math.abs(e[f*3+2]);a=d>p?d:p,a=h>a?h:a,r[f]=1,a!==0&&(r[f]/=a)}const i=Math.abs(e[0])*r[0],s=Math.abs(e[3])*r[1],o=Math.abs(e[6])*r[2];n[0]=0,a=i,s>=a&&(a=s,n[0]=1),o>=a&&(n[0]=2),n[0]!==0&&(na(e,3,n[0],0),r[n[0]]=r[0]);const c=Math.abs(e[4])*r[1],u=Math.abs(e[7])*r[2];n[1]=1,a=c,u>=a&&(n[1]=2,na(e,3,1,2)),n[2]=2;let l=0;if(Ts(e)<0){l=1;for(let f=0;f<9;f++)e[f]=-e[f]}const g=ye(4);if(fg(e,g),ug(g,e),l)for(let f=0;f<9;f++)e[f]=-e[f];n[1]!==1&&na(e,3,n[1],1),n[0]!==0&&na(e,3,n[0],0)}function gg(t,e,r){let n,a,i,s,o,c;if(Ba([...t],3,e,r),e[0]===e[1]&&e[0]===e[2]){og(r);return}for(Nn(r,r),n=0;n<3;n++)if(e[(n+1)%3]===e[(n+2)%3]){for(c=Math.abs(r[n*3]),s=0,a=1;a<3;a++)c<(o=Math.abs(r[n*3+a]))&&(c=o,s=a);s!==n&&(o=e[s],e[s]=e[n],e[n]=o,pa(r,3,n,s)),r[s*3+s]<0&&(r[s*3]=-r[s*3],r[s*3+1]=-r[s*3+1],r[s*3+2]=-r[s*3+2]),a=(s+1)%3,i=(s+2)%3,r[a*3]=0,r[a*3+1]=0,r[a*3+2]=0,r[a*3+a]=1;const u=rt([r[s*3],r[s*3+1],r[s*3+2]],[r[a*3],r[a*3+1],r[a*3+2]],[]);vt(u);const l=rt(u,[r[s*3],r[s*3+1],r[s*3+2]],[]);for(let g=0;g<3;g++)r[i*3+g]=u[g],r[a*3+g]=l[g];Nn(r,r);return}for(c=Math.abs(r[0]),s=0,n=1;n<3;n++)c<(o=Math.abs(r[n*3]))&&(c=o,s=n);if(s!==0){const u=e[s];e[s]=e[0],e[0]=u,pa(r,3,s,0)}if(Math.abs(r[4])<Math.abs(r[7])){const u=e[2];e[2]=e[1],e[1]=u,pa(r,3,1,2)}for(n=0;n<2;n++)r[n*3+n]<0&&(r[n*3]=-r[n*3],r[n*3+1]=-r[n*3+1],r[n*3+2]=-r[n*3+2]);Ts(r)<0&&(r[6]=-r[6],r[7]=-r[7],r[8]=-r[8]),Nn(r,r)}function TS(t,e,r,n){let a;const i=[...t],s=Ts(i);if(s<0)for(a=0;a<9;a++)i[a]=-i[a];lg(i,e),Nn(i,i),Mo(i,e,n),gg(n,r,n),Mo(e,n,e),Nn(n,n),s<0&&(r[0]=-r[0],r[1]=-r[1],r[2]=-r[2])}function vc(t,e,r){let n,a,i,s,o=0,c,u,l;const g=ye(r);for(n=0;n<r;n++){for(s=0,a=0;a<r;a++)(l=Math.abs(t[n*r+a]))>s&&(s=l);if(s===0)return fn("Unable to factor linear system"),0;g[n]=1/s}for(a=0;a<r;a++){for(n=0;n<a;n++){for(c=t[n*r+a],i=0;i<n;i++)c-=t[n*r+i]*t[i*r+a];t[n*r+a]=c}for(s=0,n=a;n<r;n++){for(c=t[n*r+a],i=0;i<a;i++)c-=t[n*r+i]*t[i*r+a];t[n*r+a]=c,(u=g[n]*Math.abs(c))>=s&&(s=u,o=n)}if(a!==o){for(i=0;i<r;i++)u=t[o*r+i],t[o*r+i]=t[a*r+i],t[a*r+i]=u;g[o]=g[a]}if(e[a]=o,Math.abs(t[a*r+a])<=1e-12)return fn("Unable to factor linear system"),0;if(a!==r-1)for(u=1/t[a*r+a],n=a+1;n<r;n++)t[n*r+a]*=u}return 1}function dc(t,e,r,n){let a,i,s,o,c;for(s=-1,a=0;a<n;a++){if(o=e[a],c=r[o],r[o]=r[a],s>=0)for(i=s;i<=a-1;i++)c-=t[a*n+i]*r[i];else c!==0&&(s=a);r[a]=c}for(a=n-1;a>=0;a--){for(c=r[a],i=a+1;i<n;i++)c-=t[a*n+i]*r[i];r[a]=c/t[a*n+a]}}function pg(t,e,r){if(r===2){const a=ye(2),i=Be(t[0],t[1],t[2],t[3]);return i===0?0:(a[0]=(t[3]*e[0]-t[1]*e[1])/i,a[1]=(-(t[2]*e[0])+t[0]*e[1])/i,e[0]=a[0],e[1]=a[1],1)}if(r===1)return t[0]===0?0:(e[0]/=t[0],1);const n=ye(r);return vc(t,n,r)===0?0:(dc(t,n,e,r),1)}function Tc(t,e,r,n=null,a=null){const i=n||ye(r),s=a||ye(r);if(vc(t,i,r)===0)return null;for(let o=0;o<r;o++){for(let c=0;c<r;c++)s[c]=0;s[o]=1,dc(t,i,s,r);for(let c=0;c<r;c++)e[c*r+o]=s[c]}return e}function SS(t,e){let r=+Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let a=0;a<e;a++)for(let i=a;i<e;i++)Math.abs(t[a*e+i])>n&&(n=Math.abs(t[a*e+i]));for(let a=0;a<e;a++)Math.abs(t[a*e+a])<r&&(r=Math.abs(t[a*e+a]));return r===0?Number.MAX_VALUE:n/r}function xS(t,e,r){return Ba(t,3,e,r)}function Do(t,e,r,n){if(t<r)return fn("Insufficient number of samples. Underdetermined."),0;let a,i,s;const o=ye(r*r),c=ye(r),u=ye(r*r);for(s=0;s<t;s++)for(a=0;a<r;a++)for(i=a;i<r;i++)o[a*r+i]+=e[s*r+a]*e[s*r+i];for(a=0;a<r;a++)for(i=0;i<a;i++)o[a*r+i]=o[i*r+a];for(Ba(o,r,c,u),a=0;a<r;a++)n[a]=u[a*r+r-1];return 1}function yS(t,e,r,n,a,i,s=!0){if(t<r||t<a)return fn("Insufficient number of samples. Underdetermined."),0;const o=ye(a);let c=1,u,l=0,g,f,p,d=0;if(s){for(f=0;f<a;f++)o[f]=1;for(g=0;g<t;g++)for(f=0;f<a;f++)Math.abs(n[g*a+f])>1e-12&&(c=0,o[f]=0);if(c&&a===1)return fn("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),Do(t,e,r,i);if(c)d=1;else for(f=0;f<a;f++)o[f]&&(d=1)}d&&(u=ye(r),l=Do(t,e,r,u));const h=ye(r*r),v=ye(r*r),x=ye(r*a);for(p=0;p<t;p++)for(g=0;g<r;g++){for(f=g;f<r;f++)h[g*r+f]+=e[p*r+g]*e[p*r+f];for(f=0;f<a;f++)x[g*a+f]+=e[p*r+g]*n[p*a+f]}for(g=0;g<r;g++)for(f=0;f<g;f++)h[g*r+f]=h[f*r+g];const y=Tc(h,v,r);if(y)for(g=0;g<r;g++)for(f=0;f<a;f++)for(i[g*a+f]=0,p=0;p<r;p++)i[g*a+f]+=v[g*r+p]*x[p*a+f];if(d){for(f=0;f<a;f++)if(o[f])for(g=0;g<r;g++)i[g*a+f]=u[g*a]}return d?l&&y:y}function CS(t,e=[0,.5,1]){switch(t.length){case 3:return e[0]=parseInt(t[0],16)*17/255,e[1]=parseInt(t[1],16)*17/255,e[2]=parseInt(t[2],16)*17/255,e;case 4:return e[0]=parseInt(t[1],16)*17/255,e[1]=parseInt(t[2],16)*17/255,e[2]=parseInt(t[3],16)*17/255,e;case 6:return e[0]=parseInt(t.substr(0,2),16)/255,e[1]=parseInt(t.substr(2,2),16)/255,e[2]=parseInt(t.substr(4,2),16)/255,e;case 7:return e[0]=parseInt(t.substr(1,2),16)/255,e[1]=parseInt(t.substr(3,2),16)/255,e[2]=parseInt(t.substr(5,2),16)/255,e;case 9:return e[0]=parseInt(t.substr(1,2),16)/255,e[1]=parseInt(t.substr(3,2),16)/255,e[2]=parseInt(t.substr(5,2),16)/255,e[3]=parseInt(t.substr(7,2),16)/255,e;default:return e}}function ia(t,e){let r,n;const[a,i,s]=t,o=1/3,c=1/6,u=2/3;let l=a,g=a;i>l?l=i:i<g&&(g=i),s>l?l=s:s<g&&(g=s);const f=l;f>0?n=(l-g)/l:n=0,n>0?(a===l?r=c*(i-s)/(l-g):i===l?r=o+c*(s-a)/(l-g):r=u+c*(a-i)/(l-g),r<0&&(r+=1)):r=0,e[0]=r,e[1]=n,e[2]=f}function nn(t,e){const[r,n,a]=t,i=1/3,s=1/6,o=2/3,c=5/6;let u,l,g;r>s&&r<=i?(l=1,u=(i-r)/s,g=0):r>i&&r<=.5?(l=1,g=(r-i)/s,u=0):r>.5&&r<=o?(g=1,l=(o-r)/s,u=0):r>o&&r<=c?(g=1,u=(r-o)/s,l=0):r>c&&r<=1?(u=1,g=(1-r)/s,l=0):(u=1,l=r/s,g=0),u=n*u+(1-n),l=n*l+(1-n),g=n*g+(1-n),u*=a,l*=a,g*=a,e[0]=u,e[1]=l,e[2]=g}function hg(t,e){const[r,n,a]=t;let i=(r+16)/116,s=n/500+i,o=i-a/200;i**3>.008856?i**=3:i=(i-16/116)/7.787,s**3>.008856?s**=3:s=(s-16/116)/7.787,o**3>.008856?o**=3:o=(o-16/116)/7.787;const c=.9505,u=1,l=1.089;e[0]=c*s,e[1]=u*i,e[2]=l*o}function vg(t,e){const[r,n,a]=t,i=.9505,s=1,o=1.089;let c=r/i,u=n/s,l=a/o;c>.008856?c**=1/3:c=7.787*c+16/116,u>.008856?u**=1/3:u=7.787*u+16/116,l>.008856?l**=1/3:l=7.787*l+16/116,e[0]=116*u-16,e[1]=500*(c-u),e[2]=200*(u-l)}function dg(t,e){const[r,n,a]=t;let i=r*3.2406+n*-1.5372+a*-.4986,s=r*-.9689+n*1.8758+a*.0415,o=r*.0557+n*-.204+a*1.057;i>.0031308?i=1.055*i**(1/2.4)-.055:i*=12.92,s>.0031308?s=1.055*s**(1/2.4)-.055:s*=12.92,o>.0031308?o=1.055*o**(1/2.4)-.055:o*=12.92;let c=i;c<s&&(c=s),c<o&&(c=o),c>1&&(i/=c,s/=c,o/=c),i<0&&(i=0),s<0&&(s=0),o<0&&(o=0),e[0]=i,e[1]=s,e[2]=o}function Tg(t,e){let[r,n,a]=t;r>.04045?r=((r+.055)/1.055)**2.4:r/=12.92,n>.04045?n=((n+.055)/1.055)**2.4:n/=12.92,a>.04045?a=((a+.055)/1.055)**2.4:a/=12.92,e[0]=r*.4124+n*.3576+a*.1805,e[1]=r*.2126+n*.7152+a*.0722,e[2]=r*.0193+n*.1192+a*.9505}function on(t,e){const r=[0,0,0];Tg(t,r),vg(r,e)}function _i(t,e){const r=[0,0,0];hg(t,r),dg(r,e)}function Sc(t){return t[0]=1,t[1]=-1,t[2]=1,t[3]=-1,t[4]=1,t[5]=-1,t}function Oi(t){return!(t[1]-t[0]<0)}function mS(t,e,r){return r[0]=Math.min(t[0],e[0]),r[1]=Math.max(t[0],e[0]),r[2]=Math.min(t[1],e[1]),r[3]=Math.max(t[1],e[1]),r[4]=Math.min(t[2],e[2]),r[5]=Math.max(t[2],e[2]),r}function Fr(t,e,r){return t<e?e:t>r?r:t}function Vo(t,e,r,n=[0,0,0]){return n[0]=Fr(t[0],e[0],r[0]),n[1]=Fr(t[1],e[1],r[1]),n[2]=Fr(t[2],e[2],r[2]),n}function OS(t,e){let r=0;return e[0]!==e[1]&&(t<e[0]?r=e[0]:t>e[1]?r=e[1]:r=t,r=(r-e[0])/(e[1]-e[0])),r}var wS=Va("GetScalarTypeFittingRange"),RS=Va("GetAdjustedScalarRange");function MS(t,e){if(!t||!e)return 0;for(let r=0;r<6;r+=2)if(t[r]<e[r]||t[r]>e[r+1]||t[r+1]<e[r]||t[r+1]>e[r+1])return 0;return 1}function ES(t,e,r){if(!t||!e)return 0;for(let n=0;n<6;n+=2)if(t[n]+r[n/2]<e[n]||t[n]-r[n/2]>e[n+1]||t[n+1]+r[n/2]<e[n]||t[n+1]-r[n/2]>e[n+1])return 0;return 1}function DS(t,e,r){if(!t||!e||!r)return 0;for(let n=0;n<3;n++)if(t[n]+r[n]<e[2*n]||t[n]-r[n]>e[2*n+1])return 0;return 1}function VS(t,e,r,n){const a=ye(3),i=ye(3),s=ye(3),o=ye(3),c=ye(3),u=ye(3);for(let S=0;S<3;++S)a[S]=t[S]-e[S],i[S]=e[S]-r[S],s[S]=r[S]-t[S],o[S]=-a[S],c[S]=-i[S],u[S]=-s[S];const l=Rt(o),g=Rt(c),f=Rt(s),p=ye(3);rt(a,i,p);const d=Rt(p),h=l*g*f/(2*d),v=2*d*d,x=g*g*J(a,u)/v,y=f*f*J(o,i)/v,T=l*l*J(s,c)/v;for(let S=0;S<3;++S)n[S]=x*t[S]+y*e[S]+T*r[S];return h}var BS=1/0,LS=-1/0,Sg=t=>!Number.isFinite(t),{isFinite:US,isNaN:Bo}=Number,ki=Bo;function xg(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function FS(t){let e=-1,r=-1;for(let n=0;n<t.length;n++){const a=Math.abs(t[n]);a>e&&(r=n,e=a)}return r}function bS(t){let e=1/0,r=-1;for(let n=0;n<t.length;n++){const a=Math.abs(t[n]);a<e&&(r=n,e=a)}return r}function NS(t,e=3){const r=new Array(e),n=new Array(e);for(let i=0;i<e;++i)r[i]=i,n[i]=i;for(let i=e-1;i>0;i--){let s=-1/0,o=0,c=0;for(let u=0;u<=i;++u){const l=r[u];for(let g=0;g<=i;++g){const f=n[g],p=Math.abs(t[l+e*f]);p>s&&(s=p,o=u,c=g)}}[r[i],r[o]]=[r[o],r[i]],[n[i],n[c]]=[n[c],n[i]]}const a=new Array(e*e).fill(0);for(let i=0;i<e;++i){const s=r[i]+e*n[i];a[s]=t[s]<0?-1:1}return a}function yg(t){const e=Math.floor(t*255);return e>15?e.toString(16):`0${e.toString(16)}`}function _S(t,e="#"){return`${e}${t.map(yg).join("")}`}function ka(t){return Math.round(t*255)}function kS(t){return t.length===3?`rgb(${t.map(ka).join(", ")})`:`rgba(${ka(t[0]||0)}, ${ka(t[1]||0)}, ${ka(t[2]||0)}, ${t[3]||0})`}var xe={Pi:bT,ldexp:NT,radiansFromDegrees:Fe,degreesFromRadians:$n,round:aa,floor:pc,ceil:_T,ceilLog2:IT,min:kT,max:GT,arrayMin:$T,arrayMax:WT,arrayRange:zT,isPowerOfTwo:HT,nearestPowerOfTwo:kr,factorial:PT,binomial:AT,beginCombination:jT,nextCombination:KT,randomSeed:XT,getSeed:qT,random:YT,gaussian:ZT,add:Wn,subtract:We,multiplyScalar:ng,multiplyScalar2D:ag,multiplyAccumulate:wo,multiplyAccumulate2D:QT,dot:J,outer:JT,cross:rt,norm:Rt,normalize:vt,perpendiculars:tS,projectVector:rS,projectVector2D:nS,distance2BetweenPoints:ct,angleBetweenVectors:aS,gaussianAmplitude:iS,gaussianWeight:sS,dot2D:Ro,outer2D:oS,norm2D:ig,normalize2D:sg,determinant2x2:Be,LUFactor3x3:cS,LUSolve3x3:uS,linearSolve3x3:fS,multiply3x3_vect3:lS,multiply3x3_mat3:Mo,multiplyMatrix:gS,transpose3x3:Nn,invert3x3:pS,identity3x3:og,identity:cg,isIdentity:hS,isIdentity3x3:vS,determinant3x3:Ts,quaternionToMatrix3x3:ug,areEquals:hc,areMatricesEqual:zn,roundNumber:mi,roundVector:Eo,matrix3x3ToQuaternion:fg,multiplyQuaternion:dS,orthogonalize3x3:lg,diagonalize3x3:gg,singularValueDecomposition3x3:TS,solveLinearSystem:pg,invertMatrix:Tc,luFactorLinearSystem:vc,luSolveLinearSystem:dc,estimateMatrixCondition:SS,jacobi:xS,jacobiN:Ba,solveHomogeneousLeastSquares:Do,solveLeastSquares:yS,hex2float:CS,rgb2hsv:ia,hsv2rgb:nn,lab2xyz:hg,xyz2lab:vg,xyz2rgb:dg,rgb2xyz:Tg,rgb2lab:on,lab2rgb:_i,uninitializeBounds:Sc,areBoundsInitialized:Oi,computeBoundsFromPoints:mS,clampValue:Fr,clampVector:Vo,clampAndNormalizeValue:OS,getScalarTypeFittingRange:wS,getAdjustedScalarRange:RS,extentIsWithinOtherExtent:MS,boundsIsWithinOtherBounds:ES,pointIsWithinBounds:DS,solve3PointCircle:VS,inf:BS,negInf:LS,isInf:Sg,isNan:Bo,isNaN:Bo,isFinite:US,createUninitializedBounds:xg,getMajorAxisIndex:FS,getMinorAxisIndex:bS,getSparseOrthogonalMatrix:NS,floatToHex2:yg,floatRGB2HexCode:_S,float2CssRGBA:kS},{vtkWarningMacro:GS}=R,{DefaultDataType:$S}=eg;function Lo(t,e,r){const n=t.length;let a=Number.MAX_VALUE,i=-Number.MAX_VALUE,s,o;for(o=e;o<n;o+=r)if(!Number.isNaN(t[o])){a=t[o],i=a;break}for(;o<n;o+=r)s=t[o],s<a?a=s:s>i&&(i=s);return{min:a,max:i}}function WS(){let t=Number.MAX_VALUE,e=-Number.MAX_VALUE,r=0,n=0;return{add(a){t>a&&(t=a),e<a&&(e=a),r++,n+=a},get(){return{min:t,max:e,count:r,sum:n,mean:n/r}},getRange(){return{min:t,max:e}}}}function Cg(t,e=0,r=1){if(e<0&&r>1){const n=t.length/r,a=new Float64Array(n);for(let i=0,s=0;i<n;++i){for(let o=s+r;s<o;++s)a[i]+=t[s]*t[s];a[i]**=.5}return Lo(a,0,1)}return Lo(t,e<0?0:e,r)}function Eu(t,e=0){const r=t||[];for(;r.length<=e;)r.push(null);return r}function xc(t){return Object.prototype.toString.call(t).slice(8,-1)}function zS(t){const e=t.getNumberOfComponents();let r=0;const n=new Array(e);for(let a=0;a<t.getNumberOfTuples();++a){t.getTuple(a,n);const i=xe.norm(n,e);i>r&&(r=i)}return r}var IS={computeRange:Cg,createRangeHelper:WS,fastComputeRange:Lo,getDataType:xc,getMaxNorm:zS};function PS(t,e){e.classHierarchy.push("vtkDataArray");function r(n){const a=t.getNumberOfComponents(),i=e.values.length/(a>0?a:1);if(n!==i&&n>i){const s=e.values;e.values=R.newTypedArray(e.dataType,(n+i)*a),e.values.set(s)}}t.dataChange=()=>{e.ranges=null,t.modified()},t.allocate=n=>{!Number.isInteger(n)||n<0||r(t.getNumberOfTuples()+n)},t.resize=n=>{if(!Number.isInteger(n)||n<0)return!1;r(n);const a=n*t.getNumberOfComponents();return e.size!==a?(e.size=a,t.dataChange(),!0):!1},t.initialize=()=>(t.resize(0),t),t.getElementComponentSize=()=>e.values.BYTES_PER_ELEMENT,t.getComponent=(n,a=0)=>e.values[n*e.numberOfComponents+a],t.setComponent=(n,a,i)=>{const s=n*e.numberOfComponents+a;Object.is(i,e.values[s])||(e.values[s]=i,t.dataChange())},t.getValue=n=>e.values[n],t.setValue=(n,a)=>{Object.is(a,e.values[n])||(e.values[n]=a,t.dataChange())},t.getData=()=>e.size===e.values.length?e.values:e.values.subarray(0,e.size),t.getRange=(n=-1)=>{let a=n;a<0&&(a=e.numberOfComponents===1?0:e.numberOfComponents);let i=null;return e.ranges||(e.ranges=Eu(e.ranges,e.numberOfComponents)),i=e.ranges[a],i?(e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple):(i=Cg(t.getData(),n,e.numberOfComponents),e.ranges[a]=i,e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple)},t.setRange=(n,a)=>{e.ranges||(e.ranges=Eu(e.ranges,e.numberOfComponents));const i={min:n.min,max:n.max};return e.ranges[a]=i,e.rangeTuple[0]=i.min,e.rangeTuple[1]=i.max,e.rangeTuple},t.getRanges=(n=!0)=>{if(!n)return structuredClone(e.ranges);const a=[];for(let i=0;i<e.numberOfComponents;i++){const[s,o]=t.getRange(i),c={min:s,max:o};a.push(c)}if(e.numberOfComponents>1){const[i,s]=t.getRange(-1),o={min:i,max:s};a.push(o)}return a},t.setTuple=(n,a)=>{const i=n*e.numberOfComponents;let s=!1;for(let o=0;o<e.numberOfComponents;o++){const c=i+o,u=e.values[c];e.values[c]=a[o],Object.is(e.values[c],u)||(s=!0)}return s&&t.dataChange(),s},t.setTuples=(n,a)=>{let i=n*e.numberOfComponents;const s=Math.min(a.length,e.size-i);let o=!1;for(let c=0;c<s;){const u=e.values[i];e.values[i]=a[c],Object.is(e.values[i],u)||(o=!0),i++,c++}return o&&t.dataChange(),o},t.insertTuple=(n,a)=>{if(!Number.isInteger(n)||n<0)throw new RangeError("idx must be a nonnegative integer");const i=e.size<=n*e.numberOfComponents;i&&(r(n+1),e.size=(n+1)*e.numberOfComponents);const s=t.setTuple(n,a);return i&&!s&&t.dataChange(),n},t.insertTuples=(n,a)=>{if(!Number.isInteger(n)||n<0)throw new RangeError("idx must be a nonnegative integer");if(a.length%e.numberOfComponents!==0)throw new RangeError("tuples.length must be a multiple of numberOfComponents");const i=n+a.length/e.numberOfComponents,s=e.size<i*e.numberOfComponents;s&&(r(i),e.size=i*e.numberOfComponents);const o=t.setTuples(n,a);return s&&!o&&t.dataChange(),i},t.insertNextTuple=n=>{const a=e.size/e.numberOfComponents;return t.insertTuple(a,n)},t.insertNextTuples=n=>{const a=e.size/e.numberOfComponents;return t.insertTuples(a,n)},t.findTuple=(n,a=ds)=>{for(let i=0;i<e.size;i+=e.numberOfComponents)if(Math.abs(n[0]-e.values[i])<=a){let s=!0;for(let o=1;o<e.numberOfComponents;++o)if(Math.abs(n[o]-e.values[i+o])>a){s=!1;break}if(s)return i/e.numberOfComponents}return-1},t.getTuple=(n,a=[])=>{const i=e.numberOfComponents||1,s=n*i;switch(i){case 4:a[3]=e.values[s+3];case 3:a[2]=e.values[s+2];case 2:a[1]=e.values[s+1];case 1:a[0]=e.values[s];break;default:for(let o=i-1;o>=0;--o)a[o]=e.values[s+o]}return a},t.getTuples=(n,a)=>{const i=(n??0)*e.numberOfComponents,s=(a??t.getNumberOfTuples())*e.numberOfComponents,o=t.getData().subarray(i,s);return o.length>0?o:null},t.getTupleLocation=(n=1)=>n*e.numberOfComponents,t.getNumberOfComponents=()=>e.numberOfComponents,t.getNumberOfValues=()=>e.size,t.getNumberOfTuples=()=>e.size/e.numberOfComponents,t.getDataType=()=>e.dataType,t.setNumberOfComponents=n=>!Number.isInteger(n)||n<=0||e.size%n!==0?(GS("numberOfComponents must be a positive integer that divides the array size"),!1):e.numberOfComponents!==n?(e.numberOfComponents=n,t.dataChange(),!0):!1,t.newClone=()=>Og({empty:!0,name:e.name,dataType:e.dataType,numberOfComponents:e.numberOfComponents,ranges:structuredClone(e.ranges)}),t.getName=()=>(e.name||(t.modified(),e.name=`vtkDataArray${t.getMTime()}`),e.name),t.setData=(n,a)=>{if(!ArrayBuffer.isView(n)||n instanceof DataView)throw new TypeError("Array must be a TypedArray");const i=a??e.numberOfComponents;e.values=n,e.size=n.length,e.dataType=xc(n),e.numberOfComponents=1,Number.isInteger(i)&&i>0&&e.size%i===0&&(e.numberOfComponents=i),t.dataChange()},t.getState=({preserveTypedArrays:n=!1}={})=>{if(e.deleted)return null;const a={...e,vtkClass:t.getClassName()};n||(a.values=Array.from(a.values)),delete a.buffer,Object.keys(a).forEach(s=>{a[s]||delete a[s]});const i={};return Object.keys(a).sort().forEach(s=>{i[s]=a[s]}),i.mtime&&delete i.mtime,i},t.deepCopy=n=>{const a=t.getDataType(),i=e.values;t.shallowCopy(n);const s=structuredClone(n.getRanges(!1));i?.length>=n.getNumberOfValues()&&a===n.getDataType()?(i.set(n.getData()),e.values=i):e.values=n.getData().slice(),e.ranges=s,e.rangeTuple=[0,0],t.modified()},t.interpolateTuple=(n,a,i,s,o,c)=>{const u=e.numberOfComponents||1;if(u!==a.getNumberOfComponents()||u!==s.getNumberOfComponents())throw new RangeError("numberOfComponents must match");const l=a.getTuple(i),g=s.getTuple(o),f=[];switch(f.length=u,u){case 4:f[3]=l[3]+(g[3]-l[3])*c;case 3:f[2]=l[2]+(g[2]-l[2])*c;case 2:f[1]=l[1]+(g[1]-l[1])*c;case 1:f[0]=l[0]+(g[0]-l[0])*c;break;default:for(let p=0;p<u;p++)f[p]=l[p]+(g[p]-l[p])*c}return t.insertTuple(n,f)}}var HS={name:"",numberOfComponents:1,dataType:$S,rangeTuple:[0,0]};function mg(t,e,r={}){if(Object.assign(e,HS,r),Array.isArray(r.values)&&r.dataType===void 0&&console.warn("vtkDataArray.newInstance: no dataType provided, converting to Float32Array"),!e.empty&&!e.values&&!e.size)throw new TypeError("Cannot create vtkDataArray object without: size > 0, values");if(e.values?Array.isArray(e.values)&&(e.values=R.newTypedArrayFrom(e.dataType,e.values)):e.values=R.newTypedArray(e.dataType,e.size),e.values&&(e.size=e.size??e.values.length,e.dataType=xc(e.values)),R.obj(t,e),R.set(t,e,["name"]),!Number.isInteger(e.numberOfComponents)||e.numberOfComponents<=0||e.size%e.numberOfComponents!==0)throw new RangeError("numberOfComponents must be a positive integer that divides model.size");PS(t,e)}var Og=R.newInstance(mg,"vtkDataArray"),re={newInstance:Og,extend:mg,...IS,...eg},{isVtkObject:AS}=R;function wg(t){const e=[];for(let r=0;r<t.length;r+=t[r]+1)e.push(t[r]);return e}function Rg(t){let e=0;for(let r=0;r<t.length;)r+=t[r]+1,e++;return e}var jS={extractCellSizes:wg,getNumberOfCells:Rg};function KS(t,e){e.classHierarchy.push("vtkCellArray");const r={...t};t.getNumberOfCells=n=>(e.numberOfCells!==void 0&&!n||(e.cellSizes?e.numberOfCells=e.cellSizes.length:e.numberOfCells=Rg(t.getData())),e.numberOfCells),t.getCellSizes=n=>(e.cellSizes!==void 0&&!n||(e.cellSizes=wg(t.getData())),e.cellSizes),t.resize=n=>{const a=t.getNumberOfTuples();r.resize(n);const i=t.getNumberOfTuples();i<a&&(i===0?(e.numberOfCells=0,e.cellSizes=[]):(e.numberOfCells=void 0,e.cellSizes=void 0))},t.setData=n=>{r.setData(n,1),e.numberOfCells=void 0,e.cellSizes=void 0},t.getCell=n=>{let a=n;const i=e.values[a++];return e.values.subarray(a,a+i)},t.insertNextCell=n=>{let a;AS(n)?a=n.getPointsIds():a=n;const i=t.getNumberOfCells(),s=a.length,o=new Array(s+1);o[0]=s;for(let c=0;c<s;++c)o[c+1]=a[c];return t.insertNextTuples(o),++e.numberOfCells,e.cellSizes!=null&&e.cellSizes.push(a.length),i},t.getMaxCellSize=()=>t.getCellSizes().reduce((n,a)=>Math.max(n,a),0)}function XS(t){return{empty:!0,numberOfComponents:1,dataType:ae.UNSIGNED_INT,...t}}function Mg(t,e,r={}){re.extend(t,e,XS(r)),KS(t,e)}var qS=R.newInstance(Mg,"vtkCellArray"),Wt={newInstance:qS,extend:Mg,...jS},Eg={FLAT:0,GOURAUD:1,PHONG:2,PBR:3},Xe={POINTS:0,WIREFRAME:1,SURFACE:2},YS=Eg,Dg={Shading:Eg,Representation:Xe,Interpolation:YS},dt={Off:0,PolygonOffset:1},Uo=dt.PolygonOffset,Gi=dt.Off,ZS=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function QS(){return Uo}function JS(t){const e=Uo===t;return Uo=t,e}function ex(){return Gi}function Ss(t=0){const e=Gi===t;return Gi=t,e}function tx(){return Ss(dt.Off)}function rx(){return Ss(dt.Off)}function nx(){return Ss(dt.PolygonOffset)}function ax(){return ZS[Gi]}var Fo={Resolve:dt,getResolveCoincidentTopologyAsString:ax,getResolveCoincidentTopologyPolygonOffsetFaces:QS,getResolveCoincidentTopology:ex,setResolveCoincidentTopology:Ss,setResolveCoincidentTopologyPolygonOffsetFaces:JS,setResolveCoincidentTopologyToDefault:tx,setResolveCoincidentTopologyToOff:rx,setResolveCoincidentTopologyToPolygonOffset:nx};function Vg(t,e,r){r.forEach(n=>{t[`get${n.method}`]=()=>e[n.key],t[`set${n.method}`]=R.objectSetterMap.object(t,e,{name:n.key,params:["factor","offset"]})})}var yc=["Polygon","Line","Point"],ix={Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},sx=()=>{},an={modified:sx};Vg(an,ix,yc.map(t=>({key:t,method:`ResolveCoincidentTopology${t}OffsetParameters`})));function ox(t,e){e.resolveCoincidentTopology===void 0&&(e.resolveCoincidentTopology=!1),R.setGet(t,e,["resolveCoincidentTopology"]),e.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(Fo).forEach(r=>{t[r]=Fo[r]}),Object.keys(an).filter(r=>r!=="modified").forEach(r=>{t[r]=an[r]}),Vg(t,e.topologyOffset,yc.map(r=>({key:r,method:`RelativeCoincidentTopology${r}OffsetParameters`}))),t.getCoincidentTopologyPolygonOffsetParameters=()=>{const r=an.getResolveCoincidentTopologyPolygonOffsetParameters(),n=t.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:r.factor+n.factor,offset:r.offset+n.offset}},t.getCoincidentTopologyLineOffsetParameters=()=>{const r=an.getResolveCoincidentTopologyLineOffsetParameters(),n=t.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:r.factor+n.factor,offset:r.offset+n.offset}},t.getCoincidentTopologyPointOffsetParameter=()=>{const r=an.getResolveCoincidentTopologyPointOffsetParameters(),n=t.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:r.factor+n.factor,offset:r.offset+n.offset}}}var Cc={implementCoincidentTopologyMethods:ox,staticOffsetAPI:an,otherStaticMethods:Fo,CATEGORIES:yc,Resolve:dt},cx={NONE:-1,I:0,J:1,K:2,X:3,Y:4,Z:5},Bg={SlicingMode:cx},er={NEAREST:0},ya={CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},X={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5},Lg={Wrap:ya,Filter:X},Ug=new Float32Array(1),ux=new Int32Array(Ug.buffer);function fx(t){Ug[0]=t;const e=ux[0];let r=e>>16&32768,n=e>>12&2047;const a=e>>23&255;return a<103?r:a>142?(r|=31744,r|=(a===255?0:1)&&e&8388607,r):a<113?(n|=2048,r|=(n>>114-a)+(n>>113-a&1),r):(r|=a-112<<10|n>>1,r+=n&1,r)}function lx(t){const e=(t&32768)>>15,r=(t&31744)>>10,n=t&1023;return r===0?(e?-1:1)*2**-14*(n/2**10):r===31?n?NaN:(e?-1:1)*(1/0):(e?-1:1)*2**(r-15)*(1+n/2**10)}var Vn={fromHalf:lx,toHalf:fx};function gx(){try{const n=new Int16Array([0,32767]),a=[1,1],i=document.createElement("canvas");i.width=4,i.height=4;const s=i.getContext("webgl2");if(!s)return!1;const o=s.getExtension("EXT_texture_norm16");if(!o)return!1;const c=`#version 300 es
3
3
  void main() {
4
4
  gl_PointSize = ${4 .toFixed(1)};